/* ==========================================================================
   IMMERSIVE 3D PHOTOGRAPHY GALLERY (ORGANIC EMERALD & SAGE PALETTE)
   Harmonized with Warm Editorial Cream White, Gemini Yellow-Green & Forest Tones
   ========================================================================== */

:root {
    /* Palette matching launch_theme.css */
    --gallery-mesh-yellow: rgba(255, 230, 110, 0.45);
    --gallery-mesh-green: rgba(142, 230, 180, 0.45);
    --gallery-mesh-lime: rgba(186, 235, 120, 0.5);
    --gallery-forest-deep: #1e4528;
    --gallery-forest-primary: #346841;
    --gallery-forest-mid: #3e7b4f;
    --gallery-sage-pill: #e5ede5;
    --gallery-border-subtle: rgba(52, 104, 65, 0.12);
    --gallery-border-active: rgba(46, 83, 61, 0.35);
    --gallery-card-bg: #fcfaf6;
    --gallery-text-main: #1e4528;
    --gallery-text-muted: #4e6356;
}

/* Base Exhibition Viewport */
.gallery-3d-root {
    position: relative;
    width: 100%;
    min-height: 400px;
    height: 48vh;
    max-height: 520px;
    background: transparent;
    border-radius: 20px;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    cursor: grab;
    perspective: 1000px;
    -webkit-perspective: 1000px;
    box-shadow: none;
    border: none;
    touch-action: pan-y pinch-zoom;
    -webkit-overflow-scrolling: touch;
}

.gallery-3d-root:active {
    cursor: grabbing;
}

/* Atmospheric Ambient Lighting Orb (Disabled) */
.gallery-3d-ambient-light {
    display: none !important;
}

/* Soft Edge Fade instead of pitch-black vignette */
.gallery-3d-vignette {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 5;
    background: radial-gradient(circle at 50% 50%, transparent 60%, rgba(239, 236, 227, 0.45) 100%);
}

/* Minimal Editorial HUD Header */
.gallery-3d-hud {
    position: absolute;
    top: 24px;
    left: 28px;
    right: 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
    pointer-events: none;
}

.gallery-hud-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.gallery-hud-tag {
    font-family: 'Plus Jakarta Sans', monospace;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--gallery-forest-primary);
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid rgba(52, 104, 65, 0.15);
    box-shadow: 0 4px 12px rgba(52, 104, 65, 0.04);
}

.gallery-hud-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.4rem;
    font-weight: 600;
    font-style: italic;
    color: var(--gallery-forest-deep);
    letter-spacing: 0.5px;
}

.gallery-hud-hint {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.78rem;
    letter-spacing: 0.5px;
    color: var(--gallery-text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid rgba(52, 104, 65, 0.1);
}

.gallery-hud-hint kbd {
    background: #fff;
    border: 1px solid rgba(52, 104, 65, 0.16);
    border-radius: 6px;
    padding: 2px 7px;
    font-family: 'Plus Jakarta Sans', monospace;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--gallery-forest-deep);
    box-shadow: 0 2px 4px rgba(0,0,0,0.03);
}

/* 3D World Stage */
.gallery-3d-stage {
    position: absolute;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
    display: flex;
    align-items: center;
    justify-content: center;
    will-change: transform;
}

/* Individual 3D Photographic Card */
.gallery-card-3d {
    position: absolute;
    width: 220px;
    height: 310px;
    transform-style: preserve-3d;
    will-change: transform, opacity;
    cursor: pointer;
    border-radius: 14px;
    background: transparent;
    box-shadow: 0 12px 30px -8px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    padding: 0;
    transition: box-shadow 0.4s ease;
    contain: layout paint;
}

.gallery-card-3d:hover {
    box-shadow: 0 20px 45px -6px rgba(0, 0, 0, 0.55);
}

.gallery-card-media {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 14px;
    overflow: hidden;
    background: transparent;
}

.gallery-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), filter 0.4s ease;
    pointer-events: none;
}

.gallery-card-3d:hover .gallery-card-img {
    transform: scale(1.06);
}

/* Editorial Floating Meta on Card */
.gallery-card-meta { display: none !important; }

.gallery-card-3d:hover .gallery-card-meta { display: none !important; }

.gallery-card-index {
    font-family: 'Plus Jakarta Sans', monospace;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: #baeb78; /* Lime accent */
}

.gallery-card-caption {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.3rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Bottom Navigational Controller (Hidden on Desktop, Visible on Mobile & Small Tablets) */
.gallery-3d-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: none; /* Hidden on desktop */
    align-items: center;
    gap: 12px;
    z-index: 10;
    max-width: calc(100% - 32px);
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(52, 104, 65, 0.14);
    padding: 6px 14px;
    border-radius: 999px;
    box-shadow: 0 10px 28px rgba(22, 47, 33, 0.08);
}

.gallery-control-btn {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border-radius: 50%;
    border: none;
    background: var(--gallery-forest-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.25s ease;
}

.gallery-control-btn:hover {
    background: var(--gallery-forest-deep);
    transform: scale(1.08);
}

.gallery-progress-track {
    width: 120px;
    max-width: 32vw;
    flex-shrink: 1;
    min-width: 60px;
    height: 4px;
    background: rgba(52, 104, 65, 0.12);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.gallery-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 25%;
    background: linear-gradient(90deg, #346841 0%, #3e7b4f 50%, #8ee6b4 100%);
    border-radius: 4px;
    transition: width 0.2s ease-out;
}

/* ==========================================================================
   CINEMATIC FOCUS VIEW (WARM THEMED SCRIM MODAL)
   ========================================================================== */
.gallery-focus-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(52, 104, 65, 0.65);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1),
                visibility 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-focus-modal.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.gallery-focus-content {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    max-width: 1140px;
    width: 90vw;
    height: 82vh;
    background: #fdf5e6; /* Theme cream white background */
    border: 1px solid rgba(52, 104, 65, 0.16);
    border-radius: 28px;
    box-shadow: 0 40px 100px -20px rgba(52, 104, 65, 0.35);
    overflow: hidden;
    position: relative;
    transform: scale(0.92) translateY(20px);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-focus-modal.active .gallery-focus-content {
    transform: scale(1) translateY(0);
}

.gallery-focus-image-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    background: #eef2ed;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 24px;
}

.gallery-focus-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 16px;
    box-shadow: 0 16px 40px rgba(52, 104, 65, 0.15);
}

.gallery-focus-sidebar {
    padding: 48px 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: #fcfaf6;
    overflow-y: auto;
    border-left: 1px solid rgba(52, 104, 65, 0.08);
}

.gallery-focus-meta-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.gallery-focus-tag {
    font-family: 'Plus Jakarta Sans', monospace;
    font-size: 0.72rem;
    letter-spacing: 2px;
    color: var(--gallery-forest-primary);
    background: #e4eae4;
    padding: 4px 12px;
    border-radius: 999px;
    text-transform: uppercase;
    font-weight: 700;
}

.gallery-focus-year {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--gallery-text-muted);
}

.gallery-focus-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2.6rem;
    font-weight: 600;
    color: var(--gallery-forest-deep);
    line-height: 1.15;
    margin-bottom: 14px;
}

.gallery-focus-location {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--gallery-forest-mid);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 22px;
}

.gallery-focus-desc {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1rem;
    line-height: 1.7;
    color: #3c4f44;
    margin-bottom: 30px;
}

/* EXIF & Specs grid */
.gallery-focus-specs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 20px;
    border-radius: 16px;
    background: #f4f7f4;
    border: 1px solid rgba(52, 104, 65, 0.09);
    margin-bottom: 24px;
}

.focus-spec-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.focus-spec-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--gallery-text-muted);
    font-weight: 600;
}

.focus-spec-val {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--gallery-forest-deep);
    font-family: 'Plus Jakarta Sans', monospace;
}

.gallery-focus-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.gallery-focus-close-btn {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(52, 104, 65, 0.14);
    background: #fff;
    color: var(--gallery-forest-deep);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0,0,0,0.06);
    transition: all 0.25s ease;
    z-index: 20;
}

.gallery-focus-close-btn:hover {
    background: var(--gallery-forest-primary);
    color: #fff;
    transform: rotate(90deg);
}

/* Responsive Breakpoints */
@media (max-width: 992px) {
    .gallery-3d-root {
        height: 65vh;
        min-height: 520px;
    }
    
    .gallery-card-3d {
        width: 260px;
        height: 370px;
    }

    .gallery-focus-content {
        grid-template-columns: 1fr;
        height: 90vh;
        max-height: 90vh;
    }

    .gallery-focus-image-wrapper {
        height: 50%;
    }

    .gallery-focus-sidebar {
        height: 50%;
        padding: 24px 20px;
    }

    .gallery-focus-title {
        font-size: 1.8rem;
    }
}

@media (max-width: 768px) {
    .gallery-3d-root {
        height: 48vh;
        min-height: 380px;
        max-height: 420px;
    }

    .gallery-card-3d {
        width: 175px;
        height: 245px;
    }

    .gallery-3d-controls {
        display: flex; /* Maintained for mobile navigation buttons */
        bottom: 12px;
        padding: 5px 12px;
        gap: 10px;
        max-width: calc(100% - 24px);
    }

    .gallery-control-btn {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    .gallery-progress-track {
        width: 90px;
        max-width: 28vw;
    }

    /* Enable smooth swipe & touch interactions on mobile */
    .gallery-3d-stage,
    .gallery-card-3d,
    .gallery-card-media,
    .gallery-card-img {
        pointer-events: auto;
        cursor: grab;
        touch-action: pan-y pinch-zoom;
    }

    .gallery-card-3d {
        /* Optimize GPU composition for smooth 60fps/120fps touch drag */
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
        transform-style: flat; /* Flattens 3D hierarchy for super-fast mobile rasterization */
    }

    /* Remove text overlays & hints on mobile */
    .gallery-card-meta,
    .gallery-hud-hint {
        display: none !important;
    }

    /* Completely disable and hide focus modal & description on mobile */
    .gallery-focus-modal {
        display: none !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }
}

@media (max-width: 600px) {
    .gallery-3d-root {
        height: 44vh;
        min-height: 340px;
        max-height: 390px;
        border-radius: 18px;
    }

    .gallery-card-3d {
        width: 150px;
        height: 215px;
        border-radius: 10px;
    }

    .gallery-card-media {
        border-radius: 10px;
    }

    .gallery-3d-controls {
        bottom: 10px;
        padding: 4px 10px;
        gap: 8px;
        max-width: calc(100% - 20px);
    }

    .gallery-control-btn {
        width: 28px;
        height: 28px;
        font-size: 0.72rem;
    }

    .gallery-progress-track {
        width: 75px;
        max-width: 26vw;
        min-width: 44px;
    }

    .gallery-hud-hint {
        display: none;
    }
}


/* ==========================================================================
   GREEK KEY / MEANDER PATTERN SURROUND BORDER (#ffd014)
   ========================================================================== */

.photo-gallery-pattern-frame {
    position: relative;
    width: 100%;
    padding: 24px;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.42);
    border: 1px solid rgba(255, 208, 20, 0.35);
    box-shadow: 0 14px 40px rgba(52, 104, 65, 0.05);
    overflow: hidden;
    box-sizing: border-box;
}

/* Meander pattern ribbons */
.meander-border-strip {
    position: absolute;
    z-index: 10;
    pointer-events: none;
    background-color: transparent;
    background-image: url('assets/meander-pattern.svg');
    background-size: 20px 20px;
    background-repeat: repeat;
    opacity: 0.88;
}

.meander-border-top {
    top: 6px;
    left: 20px;
    right: 20px;
    height: 20px;
    background-repeat: repeat-x;
}

.meander-border-bottom {
    bottom: 6px;
    left: 20px;
    right: 20px;
    height: 20px;
    background-repeat: repeat-x;
}

.meander-border-left {
    top: 20px;
    bottom: 20px;
    left: 6px;
    width: 20px;
    background-repeat: repeat-y;
}

.meander-border-right {
    top: 20px;
    bottom: 20px;
    right: 6px;
    width: 20px;
    background-repeat: repeat-y;
}

/* Corner Accents */
.meander-corner {
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid #ffd014;
    z-index: 11;
    pointer-events: none;
}
.meander-corner-tl { top: 6px; left: 6px; border-right: none; border-bottom: none; border-top-left-radius: 8px; }
.meander-corner-tr { top: 6px; right: 6px; border-left: none; border-bottom: none; border-top-right-radius: 8px; }
.meander-corner-bl { bottom: 6px; left: 6px; border-right: none; border-top: none; border-bottom-left-radius: 8px; }
.meander-corner-br { bottom: 6px; right: 6px; border-left: none; border-top: none; border-bottom-right-radius: 8px; }

@media (max-width: 768px) {
    .photo-gallery-pattern-frame {
        padding: 16px;
        border-radius: 20px;
    }
    .meander-border-top, .meander-border-bottom { height: 16px; background-size: 16px 16px; }
    .meander-border-left, .meander-border-right { width: 16px; background-size: 16px 16px; }
}

/* ==========================================================================
   PHOTO SECTION BOTTOM REDIRECT WRAPPER
   ========================================================================== */
.photos-redirect-wrapper {
    display: flex;
    justify-content: flex-end;
    width: 100%;
    margin-top: 6px;
}

@media (max-width: 768px) {
    .photos-redirect-wrapper {
        justify-content: center;
        align-items: center;
        margin-top: 14px;
        width: 100%;
    }

    .photos-redirect-wrapper .editorial-redirect-link {
        margin: 0 auto;
    }
}


