/* 
   Sailly-Lez-Lannoy - Heritage Digital Magazine 
   Design System "Haute Horlogerie & Musée"
*/

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

:root {
    --color-bg: #fdfbf7;
    --color-accent: #8c5e3c; /* Copper */
    --color-gold: #c5a059;
    --color-text: #3c3c3c;
    --color-muted: #8d8d8d;
    --color-white: #ffffff;
    --font-titles: "Playfair Display", serif;
    --font-body: "Roboto", sans-serif;
    --transition-smooth: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-fast: all 0.3s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background-color: var(--color-bg);
    font-family: var(--font-titles);
    color: var(--color-text);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* --- HEADER MUSEUM --- */
.museum-header {
    padding: 8rem 2rem 4rem;
    text-align: center;
    background: radial-gradient(circle at center, rgba(197, 160, 89, 0.05) 0%, transparent 70%);
}

.header-pretitle {
    display: block;
    text-transform: uppercase;
    font-family: var(--font-titles);
    font-size: 4rem; /* Match H1 */
    color: var(--color-accent); /* Match H1 */
    margin-bottom: 0;
    line-height: 1.1;
    font-weight: 700; /* Bold as requested */
}

.museum-header h1 {
    font-family: var(--font-titles);
    font-size: 4rem;
    color: var(--color-accent);
    margin-bottom: 1.5rem;
    font-weight: 400;
    line-height: 1.1;
}

.header-subtitle {
    font-style: italic;
    color: var(--color-muted);
    font-size: 1.1rem;
}

/* --- SECTIONS --- */
.museum-section {
    padding: 10rem 0;
}

.alternate-bg {
    background-color: #f7f3ed;
}

.section-title {
    font-family: var(--font-titles);
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 1rem;
    color: var(--color-accent);
}

.section-intro {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 4rem;
    color: var(--color-muted);
}

.subsection-title {
    font-family: var(--font-titles);
    font-size: 1.8rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--color-gold);
    display: inline-block;
    padding-bottom: 0.5rem;
}

/* --- HERO COMPARISON --- */
.hero-comparison-wrapper {
    margin-bottom: 4rem;
}

.slider-container {
    width: 100%;
    aspect-ratio: 21/9;
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    cursor: ew-resize;
    box-shadow: 0 30px 60px rgba(0,0,0,0.1);
}

@media (max-width: 768px) { .slider-container { aspect-ratio: 16/9; } }

.slider-image { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-size: cover; background-position: center; }
.slider-image.before { z-index: 2; width: 50%; border-right: 2px solid var(--color-white); }
.slider-handle { position: absolute; top: 0; left: 50%; width: 2px; height: 100%; background: var(--color-white); z-index: 3; }
.slider-handle::after {
    content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 44px; height: 44px; background: var(--color-white); border-radius: 50%;
    box-shadow: 0 0 15px rgba(0,0,0,0.2); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%238c5e3c'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M8 7l-5 5m0 0l5 5m-5-5h18m-5-5l5 5m0 0l-5 5' /%3E%3C/svg%3E");
    background-size: 24px; background-position: center; background-repeat: no-repeat;
}

.label {
    position: absolute; bottom: 20px; padding: 8px 15px; background: rgba(0,0,0,0.4);
    color: white; font-size: 0.9rem; border-radius: 4px; pointer-events: none;
    transition: opacity 0.3s ease; z-index: 4;
}
.label-before { left: 20px; }
.label-after { right: 20px; }

.hero-info { margin-top: 1.5rem; text-align: center; }
.hero-info h3 { font-size: 1.8rem; }

/* --- QUICK COMPARE GRID --- */
.quick-compare-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 6rem;
}

@media (max-width: 900px) { .quick-compare-grid { grid-template-columns: 1fr; } }

.quick-compare-card {
    cursor: pointer;
}

.qc-image-container {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.qc-image-container img {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    object-fit: cover;
    transition: opacity 0.8s ease;
}

.qc-before { z-index: 2; }
.quick-compare-card:hover .qc-before { opacity: 0; }

.qc-info h4 { font-size: 1.1rem; margin-bottom: 0; text-align: center; }

/* --- MAP --- */
.map-container-premium { margin-top: 4rem; }
#map { height: 500px; width: 100%; border-radius: 4px; border: 1px solid #e1dcc9; }

/* --- MUSEUM TIMELINE (Horizontal) --- */
.timeline-museum-outer {
    position: relative;
    padding-top: 300px; /* Large space for bubbles to pop up */
    padding-bottom: 5rem;
    margin-top: -250px;  /* Overlay the section title/intro dramatically */
    overflow-x: auto;
    margin-bottom: 4rem;
    scrollbar-width: none;
    cursor: grab;
    z-index: 100; /* Over everything */
}
.timeline-museum-outer::-webkit-scrollbar { display: none; }
.timeline-museum-outer:active { cursor: grabbing; }

.timeline-bg-year {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 25vw;
    font-weight: 900;
    color: var(--color-accent);
    opacity: 0.03;
    z-index: 1;
    pointer-events: none;
    font-family: var(--font-titles);
}

.timeline-museum-container {
    position: relative;
    z-index: 2;
    min-height: 200px;
    padding: 2rem 0;
}

.timeline-museum-container::after {
    content: ''; position: absolute; top: 50%; left: 0; width: 100%; height: 1px;
    background: linear-gradient(to right, rgba(140, 94, 60, 0) 0%, rgba(140, 94, 60, 0.4) 10%, rgba(140, 94, 60, 0.4) 90%, rgba(140, 94, 60, 0) 100%);
    z-index: 1;
}

.timeline-tick {
    position: absolute; top: 50%; width: 1px; height: 10px; background: rgba(140, 94, 60, 0.3);
    transform: translateY(-50%); z-index: 2;
}
.timeline-tick.major { height: 30px; background: rgba(140, 94, 60, 0.6); }

.timeline-label {
    position: absolute; bottom: -30px; left: 50%; transform: translateX(-50%);
    font-size: 0.75rem; color: var(--color-muted); font-weight: 500;
}

.timeline-point {
    position: absolute; top: 50%; width: 14px; height: 14px;
    background: var(--color-gold); border: 3px solid var(--color-bg);
    border-radius: 50%; z-index: 5; cursor: pointer;
    transform: translate(-50%, -50%) translateY(var(--v-offset));
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.timeline-point.type-reportage { background: var(--color-accent); }

.timeline-point:hover { transform: scale(1.5); z-index: 10; }

.timeline-bubble {
    position: absolute; left: 50%; transform: translateX(-50%) translateY(10px);
    width: 220px; background: white; border-radius: 8px; overflow: hidden;
    box-shadow: 0 15px 45px rgba(0,0,0,0.15); border: 1px solid rgba(140, 94, 60, 0.1);
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    z-index: 20;
}
.timeline-bubble.pos-top { bottom: 30px; }
.timeline-bubble.pos-bottom { top: 30px; }

.timeline-point:hover .timeline-bubble { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }

.timeline-bubble img { width: 100%; height: 120px; object-fit: cover; }
.bubble-content { padding: 12px; white-space: normal; }
.bubble-date { display: block; font-size: 0.7rem; color: var(--color-gold); font-weight: 600; margin-bottom: 4px; }
.bubble-content h4 { font-size: 1rem; margin-bottom: 0; color: var(--color-text); line-height: 1.2; font-family: var(--font-titles); }

/* --- JOURNAL DU VILLAGE --- */
.journal-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
    margin-top: 2rem;
}

@media (max-width: 1024px) { .journal-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .journal-grid { grid-template-columns: 1fr; } }

.journal-card {
    background: var(--color-white);
    transition: var(--transition-smooth);
}

.journal-card.is-important {
    grid-column: span 2;
}

@media (max-width: 600px) { .journal-card.is-important { grid-column: span 1; } }

.journal-card-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.is-important .journal-card-inner {
    flex-direction: row;
    gap: 2rem;
}

@media (max-width: 768px) { .is-important .journal-card-inner { flex-direction: column; } }

.journal-media {
    overflow: hidden;
    aspect-ratio: 16/10;
}

.is-important .journal-media {
    flex: 1;
    aspect-ratio: 1/1;
}

.journal-media img {
    width: 100%; height: 100%; object-fit: cover;
    transition: var(--transition-smooth);
}

.journal-card:hover .journal-media img { transform: scale(1.05); }

.journal-content {
    padding: 1.5rem 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.is-important .journal-content { flex: 1; padding: 0; }

.journal-meta {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1rem;
    display: flex;
    gap: 1rem;
    color: var(--color-gold);
}

.journal-card h4 {
    font-size: 1.5rem;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--color-text);
    font-family: var(--font-titles);
}

.is-important h4 { font-size: 2.2rem; }

.journal-excerpt {
    color: var(--color-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.journal-link {
    margin-top: auto;
    text-decoration: underline;
    font-weight: 500;
    color: var(--color-accent);
}

/* --- MUSEUM CAROUSEL --- */
.museum-carousel-wrapper {
    position: relative; width: 100vw; margin-left: calc(-50vw + 50%);
    overflow: hidden; padding: 2rem 0;
}
.museum-carousel {
    display: flex; width: max-content;
    animation: scroll-archive 60s linear infinite;
    will-change: transform;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
}
.museum-carousel:hover { animation-play-state: paused; }

.carousel-item {
    flex: 0 0 400px; margin-right: 3rem; position: relative;
    border-radius: 4px; overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: var(--transition-smooth);
}
@media (max-width: 768px) { .carousel-item { flex: 0 0 280px; margin-right: 1.5rem; } }

.carousel-item img {
    width: 100%; height: 280px; object-fit: cover;
    filter: sepia(20%) contrast(90%); transition: var(--transition-smooth);
}
.carousel-item:hover img { filter: sepia(0%) contrast(100%); transform: scale(1.05); }

.carousel-caption {
    position: absolute; bottom: 0; left: 0; width: 100%;
    padding: 1.5rem 1rem 0.8rem; background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 100%);
    color: white; font-size: 0.85rem; font-family: var(--font-titles);
    opacity: 0; transform: translateY(10px); transition: var(--transition-fast);
}
.carousel-item:hover .carousel-caption { opacity: 1; transform: translateY(0); }

@keyframes scroll-archive {
    0% { transform: translateX(0); }
    100% { transform: translateX(-16.6666%); } /* On scroll d'un set (1/6) */
}

/* --- NAV DOCK --- */
.nav-dock {
    position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
    background: rgba(253, 251, 247, 0.85); backdrop-filter: blur(20px);
    border: 1px solid rgba(140, 94, 60, 0.2); border-radius: 50px;
    padding: 12px 30px; display: flex; gap: 40px;
    box-shadow: 0 20px 50px rgba(140, 94, 60, 0.15); z-index: 1000;
}

.nav-item { display: flex; flex-direction: column; align-items: center; cursor: pointer; color: var(--color-muted); transition: var(--transition-fast); }
.nav-item svg { width: 22px; height: 22px; margin-bottom: 4px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.nav-item span { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 1px; font-weight: 600; }
.nav-item:hover, .nav-item.active { color: var(--color-accent); }

/* --- SEARCH --- */
#search-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(253, 251, 247, 0.98); z-index: 2000; display: none;
}
#search-modal { max-width: 800px; margin: 15vh auto; padding: 0 2rem; }
#search-input { 
    width: 100%; background: none; border: none; border-bottom: 2px solid var(--color-accent); 
    font-family: var(--font-titles); font-size: 3rem; outline: none; padding: 1rem 0; color: var(--color-accent); 
}
#search-results { margin-top: 3rem; }

/* --- FOOTER --- */
.museum-footer { padding: 6rem 0; border-top: 1px solid rgba(140, 94, 60, 0.1); text-align: center; color: var(--color-muted); font-size: 0.9rem; }
.admin-access { font-size: 0.7rem; opacity: 0.4; margin-top: 1rem; display: inline-block; }

/* --- MAP POPUP --- */
.map-popup h4 { margin-bottom: 5px; font-family: var(--font-titles); font-size: 1.2rem; }
.popup-date { font-size: 0.8rem; color: var(--color-gold); }
.popup-link { display: block; margin-top: 10px; color: var(--color-accent); font-weight: 600; }

/* --- EVENT DETAIL PAGE --- */
.event-hero {
    position: relative; width: 100%; height: 22vh;
    display: flex; align-items: flex-end; padding-bottom: 2rem;
    background-size: cover; background-position: center;
    color: var(--color-white);
}
.event-hero::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0.5) 100%);
}
.event-hero .container { position: relative; z-index: 2; }
.event-hero h1 { font-size: 2.5rem; color: var(--color-white); margin-bottom: 0; }

.btn-back-top {
    position: absolute; top: 20px; left: 20px; z-index: 100;
    color: var(--color-accent); font-weight: 600; font-size: 0.85rem;
    text-transform: uppercase; letter-spacing: 1px;
    background: rgba(253, 251, 247, 0.8); backdrop-filter: blur(10px);
    padding: 8px 15px; border-radius: 4px; border: 1px solid rgba(140, 94, 60, 0.2);
    transition: var(--transition-fast);
}
.btn-back-top:hover { background: var(--color-accent); color: white; transform: translateX(5px); }
.hero-with-back .btn-back-top { background: rgba(0,0,0,0.3); color: white; border-color: rgba(255,255,255,0.2); }

.event-detail-content { max-width: 900px; margin: 3rem auto; font-size: 1.1rem; line-height: 1.8; }
.journal-excerpt { font-size: 1.4rem; font-family: var(--font-titles); color: var(--color-accent); margin-bottom: 2rem; border-left: 3px solid var(--color-gold); padding-left: 2rem; }

.photo-gallery {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 3rem; margin-top: 3rem;
}
.gallery-card {
    background: white; border-radius: 4px; overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    transition: var(--transition-smooth);
}
.gallery-card:hover { transform: translateY(-10px); box-shadow: 0 20px 40px rgba(0,0,0,0.1); }

.gallery-photo {
    width: 100%; aspect-ratio: 3/2; object-fit: cover;
    display: block; cursor: zoom-in;
}
.gallery-caption {
    padding: 1.5rem; font-size: 0.9rem; color: var(--color-muted);
    border-top: 1px solid #f0f0f0; font-style: italic;
}
