/* Team Info Button & Dialog Styles */
.team-info-btn {
    position: fixed;
    bottom: 22px;
    left: 22px;
    z-index: 1200;
    background: var(--color-secondary, #ddb07a);
    color: var(--color-primary, #b84a2e);
    border: none;
    border-radius: 50%;
    box-shadow: 0 8px 24px rgba(10,10,10,0.18);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.18s, box-shadow 0.18s;
}
.team-info-btn:hover {
    background: var(--color-secondary, #ddb07a);
    box-shadow: 0 12px 32px rgba(10,10,10,0.28);
}

.team-info-dialog {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
}
.team-info-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10,10,10,0.45);
    z-index: 0;
}
.team-info-content {
    position: relative;
    background: #fff;
    color: #222;
    padding: 28px 22px 22px 22px;
    border-radius: 18px;
    box-shadow: 0 16px 48px rgba(10,10,10,0.22);
    margin: 0 0 38px 38px;
    max-width: 320px;
    min-width: 220px;
    z-index: 1;
    font-family: var(--font-body);
    animation: teamInfoPopIn 0.22s cubic-bezier(.2,.8,.25,1);
}
@keyframes teamInfoPopIn {
    from { transform: translateY(40px) scale(0.92); opacity: 0; }
    to { transform: none; opacity: 1; }
}
.team-info-header h3 {
    font-size: 1.18rem;
    font-weight: 700;
    color: var(--color-primary, #b84a2e);
    margin-bottom: 8px;
}
.team-info-header h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-secondary, #ddb07a);
    margin-bottom: 8px;
}
.team-info-list {
    margin-bottom: 12px;
    padding-left: 0;
    list-style: none;
}
.team-info-list li {
    font-size: 0.98rem;
    color: #444;
    margin-bottom: 3px;
}
.close-team-info {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #fff;
    color: #888;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(10,10,10,0.10);
    cursor: pointer;
    transition: color 0.18s;
}
.close-team-info:hover {
    color: #b84a2e;
}
/* ===== CSS RESET & BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Color Palette - Inspired by Kalinga textiles and mountains */
    --color-primary: #B84A2E; /* warmer terracotta */
    --color-secondary: #ff8c00; /* warm golden brown */
    --color-dark: #0f0e0d; /* deep warm black */
    --color-light: #F3EEE9; /* warm light */
    --color-gray: #B9AFA6; /* softer gray */
    --color-overlay: rgba(10, 10, 10, 0.85); /* Modal overlay */
    --color-gold: #B8860B; /* Gold accent for highlights */
    
    /* Typography */
    --font-heading: 'Cormorant Garamond', serif;
    --font-body: 'Inter', sans-serif;
    
    /* Spacing */
    --space-xs: 8px;
    --space-sm: 16px;
    --space-md: 24px;
    --space-lg: 32px;
    --space-xl: 48px;
    --space-xxl: 64px;
    
    /* Z-Index */
    --z-modal: 1000;
    /* Shadows */
    --shadow-xs: 0 6px 14px rgba(10,10,10,0.10);
    --shadow-sm: 0 12px 30px rgba(10,10,10,0.12);
    --shadow-md: 0 24px 64px rgba(10,10,10,0.16);
    --shadow-lg: 0 40px 120px rgba(10,10,10,0.20);
}

/* ===== BODY & HTML ===== */
html, body {
    height: 100%;
    font-family: var(--font-body);
    background: url('images/background.webp'), linear-gradient(135deg, var(--color-dark) 0%, #111 100%);
    background-size: cover; /* Scale the image to cover the entire container */
    background-position: center center; /* Center the image horizontally and vertically */
    background-repeat: no-repeat; /* Prevent the image from repeating */
    background-attachment: fixed; /* Keep the background image fixed during scrolling */
    color: var(--color-light);
    line-height: 1.6;
    overflow: hidden; /* lock the screen: no vertical scrolling */
}

/* ===== HEADER ===== */
.header {
    text-align: center;
    padding: var(--space-xxl) var(--space-md);
    background: rgba(31, 29, 27, 0.8);
    backdrop-filter: blur(10px);
    margin-bottom: var(--space-xxl);
}

/* ===== HERO & UNIQUE LAYOUT ===== */
.hero{
    position:relative;
    padding: calc(var(--space-xxl) + 20px) 0;
    margin-bottom: var(--space-lg);
    overflow:visible;
    background: linear-gradient(180deg, rgba(18,18,17,0.6), rgba(12,12,11,0.2));
    border-bottom: 1px solid rgba(212,162,109,0.04);
}
.hero-inner{ max-width:1200px; margin:0 auto; padding:0 var(--space-md); text-align:left }
.hero .main-title{ font-size: clamp(2.6rem, 6vw, 4.6rem); color: var(--color-secondary); letter-spacing:-0.02em }
.hero .subtitle{ color:var(--color-light); margin-top:10px; max-width:760px }
.hero-cta{ margin-top:18px; display:flex; gap:12px }
.btn-primary{ background:var(--color-primary); color:#fff; padding:12px 16px; border-radius:10px; text-decoration:none; box-shadow: 0 8px 18px rgba(161,51,34,0.12) }
.btn-ghost{ background:transparent; color:var(--color-light); border:1px solid rgba(255,255,255,0.04); padding:10px 14px; border-radius:10px }
.hero-pattern{ position:absolute; right:-60px; top:20px; width:520px; height:520px; background:radial-gradient(circle at 30% 20%, rgba(212,162,109,0.06), transparent 20%), repeating-linear-gradient(45deg, rgba(165,51,34,0.06) 0 8px, transparent 8px 16px); transform: rotate(18deg); border-radius:260px; filter:blur(6px); opacity:0.95 }

/* Floating tour control */
.floating-tour{ position:fixed; right:20px; top:20px; z-index:1400; background:linear-gradient(180deg,var(--color-primary),#c43a1e); color:white; border:none; width:56px; height:56px; border-radius:50%; box-shadow:0 12px 30px rgba(10,10,10,0.6); font-size:18px; cursor:pointer }
.floating-tour:hover{ transform:translateY(-4px); }

/* page background mosaic texture */
/* Page background: layered museum-hall image + subtle texture
   - Place the attached image at: images/museum-hall.jpg (relative to this CSS file)
   - Image is centered and uses cover on large viewports; on small viewports attachment is not fixed for performance
   - A subtle dark overlay keeps card contrast readable
*/
body::before{
    content: '';
    position: fixed; inset: 0; z-index: -2;
    pointer-events: none;
    /* background layers: image first, then decorative textures */
    background-image: url('images/background.webp'), radial-gradient(circle at 12% 12%, rgba(221,176,122,0.02), transparent 10%), linear-gradient(135deg, rgba(184,74,46,0.01) 0%, rgba(10,10,10,0) 60%);
    background-position: center center, 12% 12%, 0 0;
    background-size: cover, auto, auto;
    background-repeat: no-repeat, no-repeat, no-repeat;
    opacity: 0.95; /* let the texture and overlay blend slightly */
}

/* A dark overlay for improved contrast and accessibility */
body::after{
    content: '';
    position: fixed; inset: 0; z-index: -1;
    background: linear-gradient(180deg, rgba(6,6,6,0.55), rgba(6,6,6,0.55));
    pointer-events: none;
}

/* Use fixed background on larger screens for a parallax-like feel; avoid on mobile for performance */
@media (min-width: 769px) {
    body::before { background-attachment: fixed }
}
@media (max-width: 768px) {
    body::before { background-attachment: scroll; background-size: cover }
}

/* Tilted/mosaic cards */
.exhibit-grid { perspective: 1200px }
.exhibit-card { transform-origin: center; transition: transform 220ms cubic-bezier(.2,.8,.25,1), box-shadow 180ms ease; border-radius:20px }
.exhibit-card:hover { /* no transform on hover; JS controls visuals */ box-shadow: 0 28px 70px rgba(10,10,10,0.45); }
.exhibit-card:nth-child(3n) { transform: rotate(-1deg) }
.exhibit-card:nth-child(4n) { transform: rotate(1.2deg) }
.image-container { border-radius:14px 14px 0 0; overflow:hidden }
.image-container img { transition: transform 220ms cubic-bezier(.2,.8,.25,1); filter: contrast(1.03) saturate(1.05) }
.exhibit-card:hover .image-container img { transform: none }

/* card frame ornament */
.exhibit-card::after{ content:''; position:absolute; inset:0; pointer-events:none; border-radius:16px; box-shadow: inset 0 0 0 3px rgba(212,162,109,0.025) }

/* ===== ABOUT SECTION ===== */
.about-section{ background:linear-gradient(180deg, rgba(255,255,255,0.02), transparent); padding:18px; border-radius:12px; margin-bottom:18px }
.about-inner h2{ font-family:var(--font-heading); color:var(--color-secondary); margin-bottom:8px }
.about-inner p{ color:var(--color-light) }

/* Filter chips */
.filter-chips { display:flex; gap:8px; margin-top:10px; flex-wrap:wrap; overflow-x:auto; overflow-y:hidden; padding-bottom:8px; scroll-behavior:smooth; scrollbar-width:thin; scrollbar-color:rgba(165,51,34,0.3) transparent }

.filter-chips::-webkit-scrollbar { height:4px }
.filter-chips::-webkit-scrollbar-track { background:transparent }
.filter-chips::-webkit-scrollbar-thumb { background:rgba(165,51,34,0.3); border-radius:2px }
.filter-chips::-webkit-scrollbar-thumb:hover { background:rgba(165,51,34,0.5) }

/* Hide "All" button on mobile */
.filter-chip:first-child { display:none }

/* Desktop: show "All" button */
@media (min-width: 769px) {
    .filter-chip:first-child { display:block }
    .filter-chips { flex-wrap:wrap }
}

/* Mobile: horizontal scroll for chips */
@media (max-width: 768px) {
    .filter-chips { flex-wrap:nowrap; width:100%; }
}

.filter-chip { padding:8px 14px; /* darker, non-transparent background for better contrast */ background: rgba(6,6,6,0.72); border-radius:999px; border:1px solid rgba(255,255,255,0.04); color:var(--color-light); cursor:pointer; font-size:0.98rem; font-weight:500; white-space:nowrap; flex-shrink:0 }
.filter-chip.active { background:linear-gradient(90deg, rgb(102, 20, 0), rgba(0, 36, 48, 0.662)); color:var(--color-secondary); font-weight:700 }

/* make the category buttons row center nicely in the controls */
.controls.floating-controls { display:flex; gap:12px; align-items:center; justify-content:center; padding: 6px 12px; width:100% }

@media (max-width: 768px) {
    .controls.floating-controls { justify-content:flex-start; overflow-x:auto; overflow-y:hidden; width:100vw; margin-left:calc(-50vw + 50%); padding-left:12px; padding-right:12px }
}

/* spotlight / tour highlight */
.exhibit-card.spotlight{ box-shadow: 0 30px 60px rgba(165,51,34,0.18); border-color: var(--color-gold) }


.main-title {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 600;
    color: var(--color-secondary);
    margin-bottom: var(--space-sm);
    letter-spacing: -0.02em;
}

.subtitle {
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    color: var(--color-gray);
    font-weight: 300;
    max-width: 600px;
    margin: 0 auto;
}

/* ===== MAIN GALLERY ===== */
.gallery-container {
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.fullscreen-stage { position: fixed; inset: 0; }

/* Layout for museum: sidebar + gallery */
.museum-layout {
    display: block; /* sidebar removed in fullscreen card-picker */
}

.category-sidebar {
    background: rgba(31,29,27,0.9);
    border-radius: 12px;
    padding: var(--space-lg);
    border: 1px solid rgba(212,162,109,0.08);
}

.sidebar-title {
    font-family: var(--font-heading);
    color: var(--color-secondary);
    margin-bottom: var(--space-sm);
}

.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Hide the background/category list to keep the deck clean. The DOM is left intact for accessibility, this only hides the visual list. */
.category-list { display: none; }

.category-item {
    border-radius: 8px;
}

.category-item.active {
    background: linear-gradient(90deg, rgba(165,51,34,0.12), rgba(212,162,109,0.06));
}

.cat-btn {
    width: 100%;
    text-align: left;
    padding: 10px 12px;
    border: none;
    background: transparent;
    color: var(--color-light);
    font-size: 0.95rem;
    cursor: pointer;
    border-radius: 6px;
}

.cat-btn:hover {
    background: rgba(212,162,109,0.06);
}

.gallery-area .controls {
    margin-bottom: var(--space-md);
}

#searchInput {
    width: 360px;
    max-width: calc(100vw - 48px);
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.02);
    color: var(--color-light);
    box-shadow: 0 8px 20px rgba(10,10,10,0.5);
}

.floating-controls{ position: absolute; top: 28px; left: 50%; transform: translateX(-50%); z-index:1100; display:flex; gap:12px; align-items:center }

.empty {
    color: var(--color-gray);
    text-align: center;
    padding: var(--space-lg);
}

.exhibit-grid {
    /* Deck stage: position relative so cards can be absolutely placed in a fan */
    position: relative;
    display: block;
    width: 100%;
    height: 64vh;
    min-height: 420px;
    max-height: 760px;
    margin: 0 auto;
}

/* ===== EXHIBIT CARDS ===== */
.exhibit-card { 
    background: linear-gradient(180deg, rgba(28,26,24,0.96), rgba(20,18,16,0.96));
    border-radius: 18px;
    overflow: visible;
    cursor: pointer;
    /* snappier transition for a more responsive feel */
    transition: transform 220ms cubic-bezier(.2,.8,.25,1), box-shadow 200ms ease, opacity 180ms ease;
    position: relative;
    border: 1px solid rgba(212, 162, 109, 0.04);
    width: 220px;
    min-height: 300px;
    display:flex;flex-direction:column;align-items:stretch;
    box-shadow: var(--shadow-sm);
}

.exhibit-card:hover {
    /* hover only increases shadow slightly */
    box-shadow: var(--shadow-md);
}

.exhibit-card.highlight,
.exhibit-card.deck-highlight,
.exhibit-card:focus {
    /* emphasize with softer layered shadows and a subtle glow */
    z-index: 9999 !important;
    box-shadow: var(--shadow-lg), 0 0 18px rgba(217,170,100,0.12) !important;
    outline: 2px solid rgba(217,170,100,0.14);
}

/* hovered state: only shadow, no positional transform */
.exhibit-card.hovered {
    box-shadow: var(--shadow-md);
}

.image-container {
    width: 100%;
    height: 160px;
    overflow: hidden;
    position: relative;
    border-radius: 12px 12px 0 0;
}

.image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 220ms cubic-bezier(.2,.8,.25,1);
}

.exhibit-card:hover .image-container img {
    /* keep image subtle; actual lift/scale handled in JS to avoid CSS-based centering */
    transform: none;
}

.card-content {
    padding: 16px;
    flex:1; display:flex; flex-direction:column; justify-content:flex-start; gap:6px
}

.card-content h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-secondary);
    margin-bottom: var(--space-sm);
}

.card-content p {
    color: var(--color-light);
    font-size: 1rem;
    opacity: 0.8;
}

.card-caption { color: var(--color-gray); font-size: 0.95rem; margin-top:6px }

/* More strip (carousel) */
.more-strip { position: absolute; left: 50%; transform: translateX(-50%); bottom: 18px; width: 92%; display:flex; gap:10px; align-items:center; justify-content:center; padding:10px 14px; background: rgba(124, 124, 124, 0.1); backdrop-filter: blur(6px); border-radius:14px; box-shadow: var(--shadow-sm); }
.more-thumb { width:56px; height:56px; border-radius:8px; overflow:hidden; border:1px solid rgba(255,255,255,0.04); cursor:pointer; flex: 0 0 auto; box-shadow: var(--shadow-xs); }
.more-thumb img{ width:100%; height:100%; object-fit:cover }
.more-controls{ display:flex; gap:8px; align-items:center }

/* Entrance animation */
@keyframes fanIn {
    from { opacity: 0; transform: translateY(80px) scale(0.9) rotate(-8deg) }
    to { opacity: 1; transform: translateY(0) scale(1) rotate(0deg) }
}

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-overlay);
    backdrop-filter: blur(5px);
    z-index: var(--z-modal);
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
}

.modal-overlay.active {
    display: flex;
}

.modal {
    max-width: 980px;
    width: 100%;
    max-height: 90vh;
    background: linear-gradient(180deg, rgba(12,12,11,0.98), rgba(18,18,17,0.98));
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(217,170,100,0.08);
    display: none;
    box-shadow: var(--shadow-lg);
}

.modal.active {
    display: block;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-xl);
    border-bottom: 1px solid var(--color-secondary);
    background: rgba(31, 29, 27, 0.9);
}

.modal-header h2 {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 600;
    color: var(--color-secondary);
    margin: 0;
}

.modal-close {
    width: 40px;
    height: 40px;
    background: var(--color-primary);
    border: none;
    border-radius: 50%;
    color: var(--color-light);
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    user-select: none;
}

.modal-close:hover {
    background: #c43a1e;
    transform: rotate(90deg);
}

.modal-content {
    padding: var(--space-xl);
    max-height: calc(90vh - 120px);
    overflow-y: auto;
    font-size: 1rem;
    line-height: 1.8;
    color: var(--color-light);
}

.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: var(--color-dark);
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--color-secondary);
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary);
}

.modal-content h3 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    color: var(--color-secondary);
    margin-top: var(--space-xl);
    margin-bottom: var(--space-md);
}

.modal-content h4 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    color: var(--color-light);
    margin-top: var(--space-lg);
    margin-bottom: var(--space-sm);
}

.modal-content p {
    margin-bottom: var(--space-md);
}

.modal-content ul {
    margin-left: var(--space-lg);
    margin-bottom: var(--space-md);
}

.modal-content li {
    margin-bottom: var(--space-xs);
    color: var(--color-gray);
}

.modal-content strong {
    color: var(--color-light);
    font-weight: 600;
}

.modal-content em {
    color: var(--color-secondary);
    font-style: italic;
}

.modal-content table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--space-md) 0;
}

.modal-content th,
.modal-content td {
    padding: var(--space-sm);
    border: 1px solid rgba(212, 162, 109, 0.3);
    text-align: left;
}

.modal-content th {
    background: rgba(212, 162, 109, 0.2);
    color: var(--color-secondary);
    font-weight: 600;
}

/* ===== INSTRUCTIONS ===== */
.instructions {
    text-align: center;
    padding: var(--space-xl);
    color: var(--color-gray);
    font-size: 1.1rem;
    background: rgba(31, 29, 27, 0.5);
    backdrop-filter: blur(10px);
    margin-top: var(--space-xxl);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .exhibit-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 18px;
        padding: 36px 18px;
    }
    .museum-layout { display:block }

    .header { padding: var(--space-lg) var(--space-md); }

    .modal-content { padding: var(--space-lg); font-size: 0.95rem; }
    .modal-header { padding: var(--space-lg); }
    .modal-header h2 { font-size: 1.5rem; }
    .card-content { padding: var(--space-md); }
    .image-container { height: 130px; }
}

@media (max-width: 480px) {
    .gallery-container {
        padding: 0 var(--space-sm);
    }
    
    .exhibit-grid {
        gap: var(--space-md);
    }
    
    .modal-overlay {
        padding: var(--space-sm);
    }
    
    .modal-content {
        padding: var(--space-md);
    }
}