/**
 * PALACE GALLERY
 * Shared styles: homepage entrance + /gallery immersive page
 * ============================================================ */

/* ═══════════════════════════════════════════════════════════
   0. NAV — "Palace Gallery" link with gold door icon
═══════════════════════════════════════════════════════════ */
.nav-link--gallery {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.nav-door-icon {
    height: 20px;
    width: auto;
    /* Drop the black PNG background — only the gold door shows */
    mix-blend-mode: screen;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════
   1a. HOMEPAGE — GALLERY CTA (door on charcoal → /gallery)
═══════════════════════════════════════════════════════════ */
.section-gallery-cta {
    background: var(--color-charcoal);
    padding: clamp(4.5rem, 10vw, 8rem) 1.5rem;
}
.gallery-cta {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    text-decoration: none;
    gap: 1.4rem;
}
.gallery-cta__label {
    font-family: var(--font-sans);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--color-gold);
}
.gallery-cta__door {
    height: 180px;
    width: auto;
    display: block;
    /* Screen blend drops the black PNG background on the dark charcoal bg */
    mix-blend-mode: screen;
    transition: filter 0.4s ease, transform 0.4s ease;
}
.gallery-cta:hover .gallery-cta__door,
.gallery-cta:focus-visible .gallery-cta__door {
    filter: drop-shadow(0 0 20px rgba(201,162,75,0.7));
    transform: scale(1.04);
}
.gallery-cta__text {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    color: var(--color-cream-70);
}
@media (max-width: 640px) {
    .gallery-cta__door { height: 130px; }
}

/* ═══════════════════════════════════════════════════════════
   1. HOMEPAGE — GALLERY ENTRANCE (palace-door image)
═══════════════════════════════════════════════════════════ */
.section-gallery-entrance {
    /* NOTE: dark overlay is baked into the background gradient (set inline in
       the template) rather than a ::before layer. A separate overlay would
       force a z-index on the inner wrapper, creating a stacking context that
       isolates the door's mix-blend-mode and brings the black box back. */
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: clamp(5rem, 12vw, 9rem) 1.5rem;
    overflow: hidden;
}
.gallery-entrance-inner {
    /* No z-index / no stacking context — lets the door blend onto the bg */
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.gallery-entrance-title {
    font-family: var(--font-serif);
    font-weight: 600;
    font-size: clamp(2rem, 6vw, 3.6rem);
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--color-gold);
    margin: 0;
    text-shadow: 0 2px 22px rgba(0,0,0,0.85), 0 0 40px rgba(201,162,75,0.22);
}
.gallery-entrance-sub {
    font-family: var(--font-sans);
    font-size: clamp(0.66rem, 1.8vw, 0.85rem);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: rgba(201,162,75,0.85);
    margin: 1rem 0 0;
}
/* Door image — clean, NO box; screen blend drops the black background */
.gallery-entrance-door {
    display: inline-block;
    margin: 2.6rem 0 0;
    padding: 0;
    border: none;
    box-shadow: none;
    background: transparent !important;
    mix-blend-mode: screen;
    line-height: 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.gallery-entrance-door__img {
    height: 220px;
    width: auto;
    background: transparent !important;
    border: none;
    box-shadow: none;
    mix-blend-mode: screen;
    filter: drop-shadow(0 0 20px #C9A24B);
    transition: transform 0.4s ease, filter 0.4s ease;
}
.gallery-entrance-door:hover .gallery-entrance-door__img,
.gallery-entrance-door:focus-visible .gallery-entrance-door__img {
    transform: scale(1.05);
    filter: drop-shadow(0 0 32px #E4C374);
}
.gallery-entrance-cue {
    font-family: var(--font-sans);
    font-size: 0.62rem;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: rgba(245,240,230,0.78);
    margin: 1.8rem 0 0;
    animation: cue-pulse 2.6s ease-in-out infinite;
}

/* ═══════════════════════════════════════════════════════════
   2. GALLERY PAGE — Immersive Colosseum (GSAP + CSS 3D)
═══════════════════════════════════════════════════════════ */

/* Hide site chrome for full immersion */
.is-gallery-page .site-header,
.is-gallery-page .site-footer { display: none !important; }

/* Scoped reset (gallery.css loads site-wide — never reset globally) */
#colosseum-gallery,
#colosseum-gallery *,
#colosseum-gallery *::before,
#colosseum-gallery *::after { box-sizing: border-box; }

#colosseum-gallery {
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: #0a0604;
    overflow: hidden;
    z-index: 100;
    font-family: 'Cormorant Garamond', 'Playfair Display', serif;
}

/* ── Scene ── */
#colosseum-scene {
    position: absolute;
    inset: 0;
    perspective: 1400px;
    perspective-origin: 50% 50%;
}
#colosseum-bg {
    position: absolute;
    inset: 0;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    transform: scale(1.5);            /* starts zoomed for fly-in */
    transform-origin: center center;
    filter: brightness(0.85);
}
#photo-stage {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
    will-change: transform;
}

/* ── Header ── */
#gallery-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 20px 40px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7), transparent);
    z-index: 200;
}
.gallery-title h1 { color: #C9A24B; font-size: 1.8rem; letter-spacing: 0.3em; font-weight: 400; margin: 0; }
.gallery-title p  { color: rgba(201,162,75,0.7); font-size: 0.7rem; letter-spacing: 0.2em; margin: 4px 0 0; }
#sound-toggle {
    background: none;
    border: 1px solid rgba(201,162,75,0.5);
    color: #C9A24B;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    cursor: pointer;
    white-space: nowrap;
    font-family: var(--font-sans);
}

/* ── Footer ── */
#gallery-footer {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 40px;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    z-index: 200;
}
#back-home, #autoplay-btn {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.3s;
    font-family: var(--font-sans);
}
#back-home:hover, #autoplay-btn:hover { color: #C9A24B; }
#gallery-logo { color: #C9A24B; font-size: 1.5rem; letter-spacing: 0.2em; }

/* ── Photographer credit (top-left, below the gallery title) ── */
#photo-credit {
    position: fixed;
    top: 85px;
    left: 32px;
    z-index: 200;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px;
    border-radius: 14px;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    font-family: var(--font-sans);
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    white-space: nowrap;
}
#photo-credit .credit-cam { line-height: 1; flex-shrink: 0; }
#photo-credit .credit-label { color: var(--color-cream); }
#photo-credit .credit-name {
    color: #C9A24B;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.25s ease, filter 0.25s ease;
}
#photo-credit .credit-name:hover { color: #E4C374; filter: brightness(1.15); }
#photo-credit .credit-ig { display: inline-flex; flex-shrink: 0; line-height: 0; transition: transform 0.25s ease; }
#photo-credit .credit-ig:hover { transform: scale(1.1); }
@media (max-width: 768px) {
    #photo-credit { top: 78px; left: 16px; font-size: 0.7rem; gap: 6px; padding: 5px 10px; }
}

/* ── Photo frames ── */
.colosseum-photo {
    position: absolute;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: box-shadow 0.3s;
    will-change: transform;
}
.colosseum-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(30%) contrast(1.05);
    display: block;
}
.colosseum-photo .frame {
    position: absolute;
    inset: -10px;
    border: 10px solid #8B6914;
    box-shadow:
        0 0 0 2px #C9A24B,
        0 0 0 4px #5C4010,
        0 0 40px rgba(201,162,75,0.5),
        inset 0 0 20px rgba(0,0,0,0.4);
    pointer-events: none;
}
.colosseum-photo:hover { z-index: 50; }
.colosseum-photo:hover .frame {
    box-shadow:
        0 0 0 2px #C9A24B,
        0 0 0 4px #5C4010,
        0 0 60px rgba(201,162,75,0.8),
        inset 0 0 20px rgba(0,0,0,0.3);
}

/* Featured centre photo — brighter + a gentle gold glow, sits above the ring */
.colosseum-photo.is-center { z-index: 20; }
.colosseum-photo.is-center img {
    filter: grayscale(15%) contrast(1.08) brightness(1.08);
}
.colosseum-photo.is-center .frame {
    box-shadow:
        0 0 0 2px #C9A24B,
        0 0 0 4px #5C4010,
        0 0 60px rgba(201,162,75,0.6),
        inset 0 0 20px rgba(0,0,0,0.4);
}

/* ── Lightbox ── */
#lightbox { position: fixed; inset: 0; z-index: 1000; }
#lightbox-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
#lightbox-content {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90vw;
    max-height: 90vh;
}
#lightbox-img {
    max-width: 85vw;
    max-height: 80vh;
    object-fit: contain;
    border: 3px solid rgba(201,162,75,0.5);
    box-shadow: 0 0 60px rgba(201,162,75,0.3);
    display: block;
}
#lb-prev, #lb-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(201,162,75,0.2);
    border: 1px solid #C9A24B;
    color: #C9A24B;
    font-size: 1.5rem;
    width: 50px; height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s;
}
#lb-prev:hover, #lb-next:hover { background: rgba(201,162,75,0.4); }
#lb-prev { left: -70px; }
#lb-next { right: -70px; }
#lb-close {
    position: absolute;
    top: -50px; right: 0;
    background: none;
    border: none;
    color: #C9A24B;
    font-size: 1.8rem;
    cursor: pointer;
}
#lb-counter {
    text-align: center;
    color: rgba(255,255,255,0.6);
    font-size: 0.8rem;
    margin-top: 12px;
    letter-spacing: 0.1em;
}
#lb-controls { display: flex; justify-content: center; gap: 16px; margin-top: 10px; }
#lb-controls button {
    background: rgba(201,162,75,0.15);
    border: 1px solid rgba(201,162,75,0.4);
    color: #C9A24B;
    width: 36px; height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
}

/* ── Mobile ── */
@media (max-width: 768px) {
    /* Only the title + sound toggle remain — keep them on one compact row */
    #gallery-header { gap: 12px; padding: 12px 16px; align-items: center; }
    .gallery-title h1 { font-size: 1.3rem; letter-spacing: 0.2em; }
    .gallery-title p { font-size: 0.5rem; }
    #sound-toggle { padding: 6px 12px; font-size: 0.6rem; }
    #gallery-footer { padding: 12px 16px; }
    #back-home, #autoplay-btn { font-size: 0.65rem; }
    #lb-prev { left: 6px; }
    #lb-next { right: 6px; }
    #lb-close { top: -42px; right: 6px; }
}
