/* MARKARIAN DYNASTY - MASTER STYLE SHEET v6.0 (RESCUE) */
:root {
    --bg-parchment: #FDFCF5;
    --bg-dark: #1A1A1A;
    --pomegranate: #9A2A2A;
    --charcoal: #2C2C2C;
    --gold: #C5A059;
    --font-header: 'Playfair Display', serif;
    --font-body: 'Lato', sans-serif;
}

body {
    margin: 0; padding: 0;
    font-family: var(--font-body);
    overflow-x: hidden;
    background-color: var(--bg-parchment);
}

/* --- NAVIGATION --- */
nav {
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 30px 50px;
    background: var(--bg-parchment); 
    border-bottom: 1px solid rgba(0,0,0,0.05);
    position: sticky; top: 0; z-index: 100;
}

.logo { 
    font-family: var(--font-header); 
    letter-spacing: 3px; 
    font-weight: 700; 
    color: var(--charcoal);
    font-size: 2.2rem;
    text-transform: uppercase;
    white-space: nowrap;
}

.nav-links { 
    display: flex; gap: 30px; 
    font-size: 1.1rem; font-weight: 600; 
    color: var(--charcoal); align-items: center;
}
.nav-links .armenian-text { font-size: 0.85em; vertical-align: middle; font-weight: 500; }

.nav-dedication-btn {
    background: none; border: none; color: var(--gold);
    cursor: pointer; font-family: inherit; font-size: 1rem;
    margin-right: 25px; letter-spacing: 1px;
    transition: 0.3s;
}
.nav-dedication-btn:hover { text-decoration: underline; color: #9A2A2A; }
.nav-extra-item {
    color: var(--charcoal); font-size: 0.95rem; 
    margin-left: 20px; cursor: pointer;
}

/* --- HOME PAGE GATEWAY --- */
.gateway-container { display: grid; grid-template-columns: 4fr 6fr; min-height: 90vh; }

.gateway-left {
    background-color: var(--bg-dark); color: var(--gold);
    position: relative; display: flex; flex-direction: column; justify-content: center;
    padding: 60px; overflow: hidden; border-right: 4px solid var(--gold);
}

.gateway-right {
    background-color: var(--bg-parchment); color: var(--charcoal);
    position: relative; display: flex; flex-direction: column; justify-content: center;
    padding: 60px;
}

/* Background Layers */
.visual-layer {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover; background-position: center; opacity: 0.4;
    background-image: url('../assets/images/tree-full.jpg');
    transition: transform 5s ease;
}
.gateway-left:hover .visual-layer { transform: scale(1.05); }

.visual-layer-portrait {
    position: absolute; top: 0; right: 0; width: 50%; height: 100%;
    background-size: cover; background-position: center; opacity: 0.9;
    background-image: url('../assets/images/markar-portrait.jpg');
    mask-image: linear-gradient(to left, black 50%, transparent 100%);
    -webkit-mask-image: linear-gradient(to left, black 50%, transparent 100%);
}

/* Typography */
.content-wrapper { position: relative; z-index: 2; max-width: 500px; }
.era-label { display: block; font-family: var(--font-header); font-style: italic; margin-bottom: 15px; }
.visible-date { font-size: 1.3rem; opacity: 1; font-weight: 400; letter-spacing: 1px; text-shadow: 0 2px 4px rgba(0,0,0,0.5); }
h1 { font-family: var(--font-header); font-size: 3.5rem; margin: 0; line-height: 1.1; }
.armenian-text { font-family: 'Noto Serif Armenian', serif; font-size: 1.8rem; margin: 10px 0 20px 0; font-weight: 400; }
p { font-size: 1.1rem; line-height: 1.6; margin-bottom: 30px; }

/* Buttons */
.btn { text-decoration: none; padding: 12px 30px; text-transform: uppercase; letter-spacing: 1px; display: inline-block; transition: 0.3s; border: 1px solid; font-size: 0.8rem; }
.btn-gold { color: var(--gold); border-color: var(--gold); }
.btn-gold:hover { background: var(--gold); color: var(--bg-dark); }
.btn-dark { color: var(--charcoal); border-color: var(--charcoal); }
.btn-dark:hover { background: var(--pomegranate); border-color: var(--pomegranate); color: white; }

/* Footer */
.archive-footer { display: flex; background: #e5e5e5; padding: 40px; gap: 20px; }
.archive-box { flex: 1; border-top: 2px solid var(--charcoal); padding-top: 10px; }


/* --- MUSEUM & TIMELINE --- */
.museum-container { display: flex; height: 100vh; overflow: hidden; }

.timeline-sidebar {
    width: 20%; background-color: var(--bg-dark); color: var(--gold);
    display: flex; flex-direction: column; justify-content: center;
    padding-left: 40px; border-right: 4px solid var(--gold); z-index: 10;
}
.timeline-year {
    margin: 20px 0; opacity: 0.3; transition: 0.3s;
    font-family: var(--font-header); list-style: none; cursor: pointer;
}
.timeline-year:hover { opacity: 0.7; }
.timeline-year.active { opacity: 1; font-size: 1.5rem; font-weight: bold; color: white; }
.timeline-year::before { content: '◇ '; color: var(--pomegranate); }

.gallery-scroll-area {
    width: 80%; height: 100vh;
    overflow-y: scroll; scroll-snap-type: y mandatory; scroll-behavior: smooth;
}
.museum-room {
    height: 100vh; width: 100%; scroll-snap-align: start;
    position: relative; display: flex; align-items: center; justify-content: center;
    background-color: #000; /* Black background to frame photos */
}

/* Room Overlays */
.room-overlay {
    background: rgba(0,0,0,0.6); padding: 60px; max-width: 600px;
    color: #F9F7F1; border-left: 5px solid var(--pomegranate); backdrop-filter: blur(5px);
}
.vibe-gold { border-left-color: var(--gold); }
.vibe-chaos { border-left-color: #8B0000; }
.vibe-sepia { border-left-color: #C19A6B; }


/* --- ANIMATION ENGINES (ALL CYCLES) --- */

.slideshow-container { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; overflow: hidden; }

/* SHARED SLIDE SETTINGS */
.slide {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    /* Ensures photos are NOT cut off */
    background-size: contain; 
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0; transform: scale(1);
}

/* ENGINE A: 6 Photos */
.cycle-6 .slide { animation: fadeZoom6 36s infinite; }
.cycle-6 .slide:nth-child(1) { animation-delay: 0s; }
.cycle-6 .slide:nth-child(2) { animation-delay: 6s; }
.cycle-6 .slide:nth-child(3) { animation-delay: 12s; }
.cycle-6 .slide:nth-child(4) { animation-delay: 18s; }
.cycle-6 .slide:nth-child(5) { animation-delay: 24s; }
.cycle-6 .slide:nth-child(6) { animation-delay: 30s; }
@keyframes fadeZoom6 {
    0% { opacity: 0; transform: scale(1); }
    5% { opacity: 1; } 16% { opacity: 1; } 22% { opacity: 0; transform: scale(1.15); } 100% { opacity: 0; }
}

/* ENGINE B: 4 Photos */
.cycle-4 .slide { animation: fadeZoom4 24s infinite; }
.cycle-4 .slide:nth-child(1) { animation-delay: 0s; }
.cycle-4 .slide:nth-child(2) { animation-delay: 6s; }
.cycle-4 .slide:nth-child(3) { animation-delay: 12s; }
.cycle-4 .slide:nth-child(4) { animation-delay: 18s; }
@keyframes fadeZoom4 {
    0% { opacity: 0; transform: scale(1); }
    5% { opacity: 1; } 25% { opacity: 1; } 30% { opacity: 0; transform: scale(1.15); } 100% { opacity: 0; }
}

/* ENGINE C: 10 Photos */
.cycle-10 .slide { animation: fadeZoom10 60s infinite; }
.cycle-10 .slide:nth-child(1) { animation-delay: 0s; }
.cycle-10 .slide:nth-child(2) { animation-delay: 6s; }
.cycle-10 .slide:nth-child(3) { animation-delay: 12s; }
.cycle-10 .slide:nth-child(4) { animation-delay: 18s; }
.cycle-10 .slide:nth-child(5) { animation-delay: 24s; }
.cycle-10 .slide:nth-child(6) { animation-delay: 30s; }
.cycle-10 .slide:nth-child(7) { animation-delay: 36s; }
.cycle-10 .slide:nth-child(8) { animation-delay: 42s; }
.cycle-10 .slide:nth-child(9) { animation-delay: 48s; }
.cycle-10 .slide:nth-child(10) { animation-delay: 54s; }
@keyframes fadeZoom10 {
    0% { opacity: 0; transform: scale(1); }
    1% { opacity: 1; } 10% { opacity: 1; } 12% { opacity: 0; transform: scale(1.15); } 100% { opacity: 0; }
}

/* ENGINE D: 11 Photos */
.cycle-11 .slide { animation: fadeZoom11 66s infinite; }
.cycle-11 .slide:nth-child(1) { animation-delay: 0s; }
.cycle-11 .slide:nth-child(2) { animation-delay: 6s; }
.cycle-11 .slide:nth-child(3) { animation-delay: 12s; }
.cycle-11 .slide:nth-child(4) { animation-delay: 18s; }
.cycle-11 .slide:nth-child(5) { animation-delay: 24s; }
.cycle-11 .slide:nth-child(6) { animation-delay: 30s; }
.cycle-11 .slide:nth-child(7) { animation-delay: 36s; }
.cycle-11 .slide:nth-child(8) { animation-delay: 42s; }
.cycle-11 .slide:nth-child(9) { animation-delay: 48s; }
.cycle-11 .slide:nth-child(10) { animation-delay: 54s; }
.cycle-11 .slide:nth-child(11) { animation-delay: 60s; }
@keyframes fadeZoom11 {
    0% { opacity: 0; transform: scale(1); }
    1% { opacity: 1; } 8% { opacity: 1; } 10% { opacity: 0; transform: scale(1.15); } 100% { opacity: 0; }
}


/* --- CHRONICLE READER --- */
.book-modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(26, 26, 26, 0.95); z-index: 2000;
    display: none; justify-content: center; align-items: center; opacity: 0; transition: opacity 0.5s ease;
}
.book-content {
    background: var(--bg-parchment); color: var(--charcoal);
    width: 60%; max-width: 800px; height: 85vh; padding: 60px;
    overflow-y: scroll; position: relative;
    box-shadow: 0 0 50px rgba(0,0,0,0.5); border: 1px solid var(--gold);
}
.book-content h2 { font-family: var(--font-header); color: var(--pomegranate); margin-top: 0; }
.book-content p { font-family: 'EB Garamond', serif; font-size: 1.25rem; line-height: 1.8; color: #1a1a1a; margin-bottom: 25px; }

.close-book-btn {
    position: absolute; top: 20px; right: 20px;
    font-size: 2rem; cursor: pointer; color: var(--pomegranate);
    background: none; border: none; font-weight: bold;
}
.close-book-btn:hover { transform: scale(1.1); }
.book-modal.open { display: flex; opacity: 1; }
.book-modal.open .book-content { transform: translateY(0); }

/* --- BILINGUAL --- */
body.lang-en .content-hy { display: none !important; }
body.lang-hy .content-en { display: none !important; }

.lang-switch {
    margin-bottom: 30px; cursor: pointer; font-family: var(--font-header);
    border: 1px solid var(--gold); padding: 8px 15px; display: inline-block;
    color: var(--gold); transition: 0.3s;
}
.lang-switch:hover { background: rgba(197, 160, 89, 0.1); }
.lang-switch span.active { opacity: 1; font-weight: bold; color: #fff; }
.lang-switch span { opacity: 0.4; margin: 0 5px; }
body.lang-hy h1, body.lang-hy h2, body.lang-hy p { font-family: 'Noto Serif Armenian', serif !important; }
body.lang-hy p { font-size: 1.1rem; line-height: 1.7; }

/* --- MOBILE --- */
@media (max-width: 768px) {
    .museum-container { flex-direction: column; }
    .timeline-sidebar { width: 100%; height: 60px; flex-direction: row; padding: 10px; overflow-x: auto; align-items: center; gap: 20px; }
    .timeline-year { margin: 0; font-size: 0.9rem; white-space: nowrap; }
    .gallery-scroll-area { width: 100%; height: calc(100vh - 60px); }
    .room-overlay { width: 85%; padding: 30px; }
    .book-content { width: 85%; padding: 30px; height: 80vh; }
}
