/* Photos réelles des exemplaires : visionneuse (js/modules/photos-reelles.js) et miniatures */

body.photos-reelles-ouverte {
    overflow: hidden;
}

.photos-reelles {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.photos-reelles[hidden] {
    display: none;
}

.photos-reelles-fond {
    position: absolute;
    inset: 0;
    background: rgba(28, 17, 10, 0.88);
}

.photos-reelles-cadre {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(960px, 100%);
    max-height: 100%;
    padding: 14px;
    border-radius: var(--radius-card, 1rem);
    background: var(--beige-clair);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.photos-reelles-entete {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.photos-reelles-titre {
    margin: 0;
    font-family: 'Grandstander', 'Nunito', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--brun-nuit);
}

.photos-reelles-legende {
    margin: 2px 0 0;
    font-size: 13px;
    color: var(--brun-cuir);
}

.photos-reelles-actions {
    display: flex;
    flex-shrink: 0;
    gap: 6px;
}

.photos-reelles-fermer,
.photos-reelles-loupe {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: var(--beige-fonce);
    color: var(--brun-nuit);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.photos-reelles-loupe svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
}

/* Photo zoomée : la loupe propose de revenir à la photo entière (signe moins) */
.photos-reelles.is-zoom .photos-reelles-loupe {
    background: var(--or);
}

.photos-reelles.is-zoom .photos-reelles-loupe-plus {
    display: none;
}

.photos-reelles-scene {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    flex: 1;
    border-radius: 10px;
    background: var(--brun-nuit);
    overflow: hidden;
    /* Glissement, pincement et double-tap gérés par photos-reelles.js */
    touch-action: none;
}

.photos-reelles-image {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 230px);
    object-fit: contain;
    user-select: none;
    cursor: zoom-in;
    transform-origin: center;
}

.photos-reelles-image.is-anime {
    transition: transform 0.2s ease;
}

.photos-reelles.is-zoom .photos-reelles-image {
    cursor: grab;
}

.photos-reelles.is-zoom .photos-reelles-image:active {
    cursor: grabbing;
}

.photos-reelles-fleche {
    position: absolute;
    z-index: 1;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: rgba(243, 234, 213, 0.9);
    color: var(--brun-nuit);
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
}

.photos-reelles-fleche--prec {
    left: 8px;
}

.photos-reelles-fleche--suiv {
    right: 8px;
}

.photos-reelles-fleche[hidden] {
    display: none;
}

.photos-reelles-compteur {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    color: var(--brun-cuir);
}

.photos-reelles-compteur:empty {
    display: none;
}

.photos-reelles-vignettes {
    display: flex;
    justify-content: safe center;
    gap: 6px;
    overflow-x: auto;
}

/* Galerie d'un article : séparation entre les photos de deux états */
.photos-reelles-vignettes button.is-debut-groupe {
    position: relative;
    margin-left: 12px;
}

.photos-reelles-vignettes button.is-debut-groupe::before {
    content: '';
    position: absolute;
    top: 8px;
    bottom: 8px;
    left: -11px;
    width: 2px;
    border-radius: 1px;
    background: var(--brun-cuir);
    opacity: 0.4;
}

.photos-reelles-vignettes:empty {
    display: none;
}

.photos-reelles-vignettes button {
    flex-shrink: 0;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 6px;
    background: none;
    opacity: 0.65;
    cursor: pointer;
}

.photos-reelles-vignettes button.is-active {
    border-color: var(--or);
    opacity: 1;
}

.photos-reelles-vignettes img {
    display: block;
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 4px;
}

/* Miniature sur la ligne d'un état (fiche article) */
.etat-photo-miniature {
    position: relative;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    margin-right: 8px;
    padding: 0;
    border: 2px solid var(--or);
    border-radius: 6px;
    background: var(--beige-clair);
    cursor: zoom-in;
    overflow: hidden;
}

.etat-photo-miniature img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.etat-photo-miniature span {
    position: absolute;
    right: 0;
    bottom: 0;
    padding: 0 4px;
    border-top-left-radius: 4px;
    background: var(--brun-nuit);
    color: var(--or-clair);
    font-size: 10px;
    font-weight: 700;
}

.etat-photo-miniature:hover,
.etat-photo-miniature:focus-visible {
    border-color: var(--rouille);
}

/* Galerie de la fiche article (partials/article-galerie.php, js/modules/article-galerie.js) : image de l'article puis
   photos réelles des états en vente, défilement horizontal aimanté (glissement du doigt sans script) */
.article-hero-visuels--galerie {
    flex-basis: 320px;
}

.article-galerie {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.article-galerie-scene {
    position: relative;
    /* Flèches au milieu du cadre carré des photos (50cqw) */
    container-type: inline-size;
}

.article-galerie-piste {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    border: 2px dashed var(--or-terne);
    border-radius: 10px;
    background: repeating-linear-gradient(135deg, rgba(0, 0, 0, 0.03) 0 10px, transparent 10px 20px), var(--beige-fonce);
}

.article-galerie-piste::-webkit-scrollbar {
    display: none;
}

.article-galerie-piste:focus-visible {
    outline: 2px solid var(--rouille);
    outline-offset: 2px;
}

.article-galerie-diapo {
    position: relative;
    flex: 0 0 100%;
    display: flex;
    flex-direction: column;
    margin: 0;
    scroll-snap-align: center;
    scroll-snap-stop: always;
}

.article-galerie-zoom {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    padding: 16px;
    overflow: hidden;
    cursor: zoom-in;
}

.article-galerie-diapo--reelle .article-galerie-zoom {
    padding: 0;
    background: var(--brun-nuit);
    border-radius: 8px 8px 0 0;
}

.article-galerie-zoom img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Photo réelle recadrée en carré (photo-cadree de components.css) */
.article-galerie-zoom img.photo-cadree,
.article-galerie-vignette img.photo-cadree {
    object-fit: cover;
}

.article-galerie-zoom img.photo-cadree--entiere,
.article-galerie-vignette img.photo-cadree--entiere {
    object-fit: contain;
}

/* État photographié, sur la photo */
.article-galerie-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--brun-nuit);
    color: var(--or-clair);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    pointer-events: none;
}

/* Texte de l'état (ou précision sur l'exemplaire), en légende sous la photo */
.article-galerie-texte {
    flex: 1;
    padding: 6px 10px;
    border-top: 2px solid var(--or);
    background: var(--beige-clair);
    border-radius: 0 0 8px 8px;
    font-size: 12.5px;
    font-style: italic;
    color: var(--brun-cuir);
    white-space: pre-line;
}

.article-galerie-fleche {
    position: absolute;
    top: 50cqw;
    transform: translateY(-50%);
    z-index: 2;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: rgba(243, 234, 213, 0.92);
    color: var(--brun-nuit);
    font-size: 26px;
    line-height: 1;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
    cursor: pointer;
}

.article-galerie-fleche--prec {
    left: 6px;
}

.article-galerie-fleche--suiv {
    right: 6px;
}

.article-galerie-fleche[hidden] {
    display: none;
}

.article-galerie-fleche:disabled {
    opacity: 0;
    pointer-events: none;
}

/* Pastilles des états : la première photo de chaque état */
.article-galerie-etats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.article-galerie-etat {
    padding: 3px 10px;
    border: 1px solid var(--or-terne);
    border-radius: 999px;
    background: var(--beige-clair);
    color: var(--brun-nuit);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
}

.article-galerie-etat small {
    font-weight: 400;
    color: var(--brun-cuir);
}

.article-galerie-etat.is-active {
    border-color: var(--brun-nuit);
    background: var(--brun-nuit);
    color: var(--or-clair);
}

.article-galerie-etat.is-active small {
    color: var(--or-clair);
}

.article-galerie-vignettes {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.article-galerie-vignette {
    flex: 0 0 auto;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 6px;
    background: var(--beige-fonce);
    overflow: hidden;
    opacity: 0.7;
    cursor: pointer;
}

.article-galerie-vignette img {
    display: block;
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 4px;
}

.article-galerie-vignette[data-etat=''] img {
    object-fit: contain;
}

.article-galerie-vignette.is-active {
    border-color: var(--or);
    opacity: 1;
}

@media (max-width: 991.98px) {
    .article-hero-visuels--galerie {
        flex-basis: auto;
    }

    .article-galerie {
        width: 100%;
        max-width: 440px;
        margin-inline: auto;
    }
}


