/* ============================================================
   MODAL GALERIE — iframe, fond neutre, barre drag fine
   ============================================================ */

/* Overlay — laisse la chronologie interactive derrière */
.gallery-overlay {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: none;
    pointer-events: none;
}
.gallery-overlay.active { display: block; }

/* ── Fenêtre modale ───────────────────────────────────────── */
.gallery-modal {
    pointer-events: all;
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    width: min(650px, 92vw);
    height: min(500px, 86vh);
    background: #f0e8d8;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(120, 100, 80, 0.5);
    border-radius: 0;
    display: flex;
    flex-direction: column;
    z-index: 500;
    overflow: hidden;
    opacity: 0;
    scale: 0.95;
    transition: opacity 0.2s ease, scale 0.2s ease;
    box-shadow: 0 28px 72px rgba(80, 60, 40, 0.32);
}
.gallery-overlay.active .gallery-modal,
.gallery-modal.is-visible {
    opacity: 1;
    scale: 1;
}

/* ── Barre de drag ────────────────────────────────────────── */
.gallery-drag-strip {
    flex-shrink: 0;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px 0 12px;
    cursor: grab;
    user-select: none;
    background: #ddd0b8;
    border-bottom: 1px solid rgba(120, 100, 80, 0.28);
    transition: background 0.15s;
}
.gallery-drag-strip:hover { background: #d4c4ac; }
.gallery-drag-strip:active { cursor: grabbing; }

.gallery-drag-label {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 0.58rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(80, 60, 40, 0.55);
    pointer-events: none;
}

/* ── Grip (grille de points) ──────────────────────────────── */
.gallery-grip {
    display: block;
    width: 22px;
    height: 14px;
    background-image: radial-gradient(circle, rgba(80,60,40,0.5) 1.5px, transparent 1.5px);
    background-size: 7px 7px;
    background-repeat: repeat;
    flex-shrink: 0;
}

/* ── Bouton fermer ────────────────────────────────────────── */
.gallery-close {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    border-radius: 0;
    cursor: pointer;
    color: rgba(80, 60, 40, 0.45);
    font-size: 1.1rem;
    line-height: 1;
    padding: 0;
    transition: color 0.2s ease;
    flex-shrink: 0;
}
.gallery-close:hover {
    color: rgba(80, 60, 40, 1);
}

/* ── Iframe du contenu ────────────────────────────────────── */
.gallery-iframe {
    flex: 1;
    width: 100%;
    min-height: 0;
    border: none;
    background: transparent;
    display: block;
}

/* ── Poignée de redimensionnement ─────────────────────────── */
.gallery-resize-handle {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 28px;
    height: 28px;
    cursor: se-resize;
    background: linear-gradient(
        135deg,
        transparent 30%, rgba(120,100,80,0.45) 30%,
        rgba(120,100,80,0.45) 40%, transparent 40%,
        transparent 52%, rgba(120,100,80,0.45) 52%,
        rgba(120,100,80,0.45) 62%, transparent 62%,
        transparent 74%, rgba(120,100,80,0.45) 74%,
        rgba(120,100,80,0.45) 84%, transparent 84%
    );
    opacity: 0.6;
    transition: opacity 0.2s ease;
    z-index: 600;
}
.gallery-resize-handle:hover { opacity: 1; }

/* ── Lightbox plein écran (tl-lightbox) — partagée toutes pages ── */
.tl-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: rgba(14,11,8,0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
}
.tl-lightbox.is-open { opacity: 1; pointer-events: all; }
.tl-lightbox-img {
    max-width: 88vw;
    max-height: 84vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 12px 48px rgba(0,0,0,0.55);
    display: block;
    transform-origin: center center;
    transition: transform 0.15s ease;
    will-change: transform;
}
.tl-lightbox-caption {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(240,236,228,0.7);
    font-size: 0.75rem;
    font-style: italic;
    letter-spacing: 0.08em;
    text-align: center;
    pointer-events: none;
    white-space: nowrap;
}
.tl-lightbox-close {
    position: absolute;
    top: 1.4rem;
    right: 1.4rem;
    width: 34px; height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.18);
    background: rgba(0,0,0,0.35);
    color: #fff;
    font-size: 1.1rem;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: background 0.18s;
}
.tl-lightbox-close:hover { background: rgba(255,255,255,0.12); }
.tl-lightbox.no-shadow .tl-lightbox-img { box-shadow: none; }
.tl-lb-zoom {
    position: absolute;
    top: 1.4rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(10,8,6,0.6);
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 20px;
    padding: 0.3rem 0.85rem;
    backdrop-filter: blur(6px);
}
.tl-lb-zoom-btn {
    border: none;
    background: transparent;
    color: rgba(255,255,255,0.75);
    font-size: 1.2rem;
    line-height: 1;
    width: 26px; height: 26px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s;
}
.tl-lb-zoom-btn:hover { color: #fff; }
.tl-lb-zoom-lvl {
    font-size: 0.65rem;
    letter-spacing: 0.06em;
    color: rgba(255,255,255,0.55);
    min-width: 36px;
    text-align: center;
}
