@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;1,400&family=Montserrat:wght@300;400;600&family=Dancing+Script:wght@700&display=swap');

/* Reset and Global Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: #151311; /* Deep Exhibition Charcoal-Ash */
    color: #e6dfd5; /* Warm parchment text */
    font-family: 'Montserrat', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    line-height: 1.8;
}

h1, h2, h3, h4 {
    font-family: 'Playfair Display', serif;
    letter-spacing: 1px;
    color: #fff;
}

/* NAVIGATION BAR (Unified design across dark pages) */
.nav-bar { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 1.5rem 5%; 
    background: rgba(21, 19, 17, 0.95); 
    position: sticky; 
    top: 0; 
    width: 100%; 
    z-index: 100; 
    border-bottom: 1px solid #231f1c;
}
.nav-bar ul { display: flex; list-style: none; gap: 2rem; }
.nav-bar a { 
    color: #df8040; /* Warm Copper accent */
    text-decoration: none; 
    font-size: 0.9rem; 
    font-weight: 600; 
    letter-spacing: 1px; 
    transition: 0.3s; 
}
.nav-bar a:hover, .nav-bar a.active { 
    color: #fff; 
    text-shadow: 0 0 10px #df8040; 
}

.logo { display: flex; align-items: center; gap: 15px; color: #df8040; }
.logo span { font-family: 'Dancing Script', cursive; font-size: 2.2rem; }

/* GLOW LINKS */
.glow-link { transition: all 0.3s ease; cursor: pointer; }
.glow-link:hover { color: #fff !important; text-shadow: 0 0 10px #df8040, 0 0 20px #df8040; }

/* HEADER */
.gallery-header {
    text-align: center;
    padding: 6rem 5% 3rem 5%;
    background: linear-gradient(180deg, #231f1c 0%, #151311 100%);
    border-bottom: 1px dashed #352e2a;
}
.gallery-header h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    color: #fff;
    text-shadow: 0 0 15px rgba(223, 128, 64, 0.3);
    margin-bottom: 0.8rem;
    letter-spacing: 3px;
    text-transform: uppercase;
}
.gallery-header .tagline {
    font-size: 1.1rem;
    color: #df8040;
    font-style: italic;
    font-weight: 300;
}

/* MAIN CONTAINER */
.gallery-container {
    max-width: 1200px;
    width: 90%;
    margin: 4rem auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

/* FILTERS */
.filter-bar {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    border-bottom: 1px solid #231f1c;
    padding-bottom: 2rem;
}
.filter-btn {
    background: none;
    border: 1px solid #352e2a;
    color: #a0958a;
    padding: 0.8rem 1.5rem;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 1px;
    cursor: pointer;
    border-radius: 2px;
    transition: 0.3s;
}
.filter-btn:hover {
    color: #fff;
    border-color: #df8040;
}
.filter-btn.active {
    background: #df8040;
    color: #12100e;
    border-color: #df8040;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(223, 128, 64, 0.25);
}

/* AUDIO LAYER */
.gallery-audio-player {
    background: #1c1815;
    border: 1px solid #2d2520;
    border-left: 4px solid #df8040;
    padding: 1.5rem 2rem;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}
.audio-hud {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.pulse-indicator {
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    color: #00ffcc;
    text-shadow: 0 0 5px #00ffcc;
    font-weight: bold;
}
.track-title {
    font-size: 1rem;
    font-weight: bold;
    color: #fff;
}
.audio-toggle-btn {
    background: none;
    border: 1px solid #df8040;
    color: #df8040;
    padding: 0.8rem 1.5rem;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85rem;
    font-weight: bold;
    letter-spacing: 1px;
    cursor: pointer;
    transition: 0.3s;
}
.audio-toggle-btn:hover, .audio-toggle-btn.playing {
    background: #df8040;
    color: #12100e;
    box-shadow: 0 0 15px rgba(223, 128, 64, 0.4);
}

/* BENTO GRID */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    grid-auto-rows: 220px;
    gap: 1.5rem;
}

.gallery-tile {
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid #231f1c;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    animation: fadeInTile 0.5s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}
@keyframes fadeInTile {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Bento Sizing Overrides */
.card-small { grid-row: span 1; }
.card-medium { grid-row: span 2; }
.card-large { grid-row: span 2; grid-column: span 2; }

@media (max-width: 768px) {
    .card-large { grid-column: span 1; }
}

.tile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}
.gallery-tile:hover .tile-img {
    transform: scale(1.05);
}

.tile-overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.95) 90%);
    padding: 2rem 1.5rem 1.5rem 1.5rem;
    opacity: 0;
    transition: opacity 0.4s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 0.3rem;
}
.gallery-tile:hover .tile-overlay {
    opacity: 1;
}

.tile-overlay h3 {
    font-size: 1.25rem;
    color: #fff;
    font-family: 'Playfair Display', serif;
}
.category-label {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.75rem;
    color: #df8040;
    letter-spacing: 1px;
    font-weight: 600;
}

/* LIGHTBOX EXHBIT OVERLAY */
.lightbox {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(10, 8, 7, 0.98);
    backdrop-filter: blur(10px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    animation: fadeInOverlay 0.4s ease;
}
.lightbox-close {
    position: absolute;
    top: 2rem; right: 3rem;
    background: #1c1815;
    border: 1px solid #352e2a;
    color: #df8040;
    padding: 0.8rem 1.5rem;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.8rem;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}
.lightbox-close:hover {
    background: #df8040;
    color: #12100e;
    box-shadow: 0 0 15px rgba(223, 128, 64, 0.4);
}

.lightbox-content {
    display: flex;
    flex-direction: column;
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    background: #12100e;
    border: 2px solid #231f1c;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0,0,0,0.9);
}
.lightbox-content img {
    width: 100%;
    max-height: 55vh;
    object-fit: contain;
    background: #000;
    border-bottom: 1px solid #231f1c;
}
.lightbox-caption {
    padding: 2.5rem;
    color: #e6dfd5;
}
.lightbox-caption h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    color: #fff;
    margin-bottom: 0.5rem;
}
.lightbox-divider {
    height: 1px;
    background: linear-gradient(90deg, #df8040, transparent);
    width: 100%;
    margin-bottom: 1.2rem;
}
.lightbox-caption p {
    font-size: 1rem;
    line-height: 1.8;
    color: #ccc;
}

/* FOOTER */
.gallery-footer {
    border-top: 1px solid #231f1c;
    padding: 2.5rem;
    text-align: center;
    font-size: 0.8rem;
    color: #60554c;
    background: #0d0c0b;
}

@media (max-width: 768px) {
    .lightbox-caption { padding: 1.5rem; }
    .lightbox-caption h2 { font-size: 1.4rem; }
}

/* Bulletproof CSS Keyframe Page Transitions - Solves Flashing & Black screen bugs */
@keyframes pageFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

body {
    animation: pageFadeIn 0.4s ease-out forwards;
}

body.fade-out {
    opacity: 0 !important;
    transition: opacity 0.3s ease-in-out !important;
    animation: none !important;
}

/* ==========================================================================
   UNIFIED FLUID TYPOGRAPHY SYSTEM (Release v41)
   ========================================================================== */
html {
    font-size: 16px; /* Desktop browser baseline */
}

:root {
    --h1-size: clamp(1.8rem, 4.5vw, 3rem);
    --h2-size: clamp(1.4rem, 3.5vw, 2.2rem);
    --h3-size: clamp(1.1rem, 2.5vw, 1.5rem);
}

/* Standard Responsive Text Scaling */
@media (max-width: 850px) {
    html {
        font-size: 14px !important; /* Globally down-scales all REM dimensions by 12.5% */
    }
    body {
        line-height: 1.6 !important;
    }
}
@media (max-width: 450px) {
    html {
        font-size: 13.2px !important; /* Scale down by 17% for tiny devices */
    }
}

/* ==========================================================================
   PREMIUM MOBILE NAVIGATION RE-DESIGN - EXHIBITION NOIR THEME (Release v41)
   ========================================================================== */
@media (max-width: 850px) {
    .nav-bar {
        flex-direction: column !important;
        gap: 1rem !important;
        padding: 1.2rem 4% !important;
        text-align: center !important;
        position: relative !important;
        width: 100% !important;
        box-sizing: border-box !important;
        background: #151311 !important;
        border-bottom: 1px solid #231f1c !important;
    }
    .nav-bar ul {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 0.4rem !important;
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        list-style: none !important;
    }
    .nav-bar li {
        width: 100% !important;
        margin: 0 !important;
    }
    .nav-bar a {
        font-size: 0.72rem !important;
        font-weight: 700 !important;
        padding: 0.65rem 0.2rem !important;
        text-align: center !important;
        border: 1px solid rgba(223, 128, 64, 0.15) !important;
        border-radius: 4px !important;
        background: rgba(223, 128, 64, 0.02) !important;
        display: block !important;
        width: 100% !important;
        box-sizing: border-box !important;
        letter-spacing: 0.5px !important;
        transition: 0.2s ease !important;
        white-space: nowrap !important;
        text-overflow: ellipsis !important;
        overflow: hidden !important;
        color: #df8040 !important;
    }
    .nav-bar a.active {
        color: #fff !important;
        border-color: #df8040 !important;
        background: rgba(223, 128, 64, 0.1) !important;
        text-shadow: 0 0 5px rgba(223, 128, 64, 0.5) !important;
    }
    .nav-bar a:hover {
        color: #fff !important;
        text-shadow: 0 0 10px #df8040 !important;
    }
}