.galinf-gallery { position: relative; width: 100%; }
.galinf-runway  { position: relative; width: 100%; }

/* Contrôle « trier par » */
.galinf-controls {
    margin: 0 0 1rem;
    display: flex;
    justify-content: flex-end;
}
.galinf-sort-label {
    font-size: .9rem;
    color: #444;
}
.galinf-sort {
    margin-left: .4rem;
    padding: .25rem .5rem;
    font-size: .9rem;
}

.galinf-tile {
    position: absolute;
    top: 0; left: 0;
    overflow: hidden;
    background: #ececec;
    will-change: transform;
    border-radius: 2px;
    cursor: pointer;
}
.galinf-tile img {
    width: 100%; height: 100%;
    display: block;
    object-fit: cover;
    background: #ececec;
    opacity: 1;
    transition: opacity .25s ease;   /* nouvelle image : apparition en fondu */
}

/* Pendant le chargement (recyclage) : l'ancienne image est masquée
   INSTANTANÉMENT (transition: none) → on ne voit jamais une image déjà vue. */
.galinf-tile.galinf-loading img {
    opacity: 0;
    transition: none;
}

/* Spinner centré dans la case en cours de chargement. */
.galinf-tile.galinf-loading::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 22px; height: 22px;
    margin: -11px 0 0 -11px;
    border: 2px solid rgba(0, 0, 0, .15);
    border-top-color: rgba(0, 0, 0, .45);
    border-radius: 50%;
    animation: galinf-spin .7s linear infinite;
}
@keyframes galinf-spin { to { transform: rotate(360deg); } }

.galinf-sentinel { display: none; }

/* Barre de progression du bas de page (indicateur « il reste des images »). */
.galinf-status .galinf-bar {
    display: block;
    width: min(320px, 60%);
    height: 4px;
    margin: .5rem auto 0;
    background: rgba(127, 127, 127, .18);
    border-radius: 2px;
    overflow: hidden;
}
.galinf-status .galinf-bar-fill {
    display: block;
    height: 100%;
    background: #8a8a8a;
    border-radius: 2px;
    transition: width .3s ease;
}
/* Variante indéterminée (si le total n'est pas encore connu). */
.galinf-bar-indet {
    width: 30%;
    animation: galinf-indet 1.1s linear infinite;
}
@keyframes galinf-indet {
    from { transform: translateX(-110%); }
    to   { transform: translateX(440%); }
}

/* Indicateur discret de chargement (en flux, sous la galerie). */
.galinf-status {
    margin: 0;
    padding: 1rem 0;
    min-height: 1.2rem;
    text-align: center;
    font-size: .85rem;
    color: var(--galinf-muted, #999);
}
