/* ================================================================
   LA JOUEUSE DE TYMPANON — MUSÉE DU CNAM
   Design musée classique — présentation portfolio
   ================================================================ */

:root {
    --bg:          #f0e9dd;
    --surface:     #ffffff;
    --sidebar-bg:  #e8dfd0;
    --card-bg:     #faf6ef;
    --header-bg:   #2b1a0d;
    --footer-bg:   #231508;
    --accent:      #7a4a00;
    --accent-h:    #4e2e00;
    --gold:        #a87820;
    --gold-light:  #d4a84b;
    --border:      #cdbea4;
    --border-light:#e0d5c0;
    --text:        #1e1408;
    --text-muted:  #6b5238;
    --serif:       'Playfair Display', 'Georgia', serif;
    --sans:        'Red Hat Display', 'Arial', sans-serif;
    --radius:      4px;
    --shadow-card: 0 2px 8px rgba(60,30,10,0.10), 0 1px 2px rgba(60,30,10,0.06);
    --shadow-lift: 0 6px 20px rgba(60,30,10,0.13), 0 2px 4px rgba(60,30,10,0.07);
    --transition:  0.2s ease;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
}

/* ================================================================
   HEADER
   ================================================================ */
header {
    background-color: var(--header-bg);
    color: #f0e4d0;
    height: 78px;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 2px solid var(--gold);
    box-shadow: 0 2px 12px rgba(0,0,0,0.35);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    max-width: 1380px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
}

.logo {
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
}
.logo img {
    height: 52px;
    width: auto;
    border-radius: 3px;
    display: block;
}

.header-titles {
    text-align: center;
}
.header-surtitre {
    font-family: var(--sans);
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--gold-light);
    margin-bottom: 3px;
    opacity: 0.9;
}
header h1 {
    font-family: var(--serif);
    font-weight: 400;
    font-style: italic;
    font-size: clamp(1.05rem, 2.2vw, 1.5rem);
    letter-spacing: 0.03em;
    color: #f0e4d0;
    line-height: 1.2;
}

.recherche-header {
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
}
.recherche-header input {
    background: rgba(255,255,255,0.09);
    border: 1px solid rgba(168,120,32,0.45);
    border-radius: var(--radius);
    color: #f0e4d0;
    font-family: var(--sans);
    font-size: 0.8rem;
    outline: none;
    padding: 7px 13px 7px 32px;
    width: clamp(110px, 14vw, 180px);
    transition: background var(--transition), box-shadow var(--transition);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23c8a060' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 10px center;
}
.recherche-header input::placeholder { color: rgba(240,228,208,0.4); }
.recherche-header input:focus {
    background-color: rgba(255,255,255,0.15);
    box-shadow: 0 0 0 2px rgba(168,120,32,0.38);
}

/* ================================================================
   LAYOUT — 3 colonnes CSS Grid
   ================================================================ */
.container {
    display: grid;
    grid-template-columns: 258px 1fr 258px;
    grid-template-areas: "left main right";
    max-width: 1380px;
    margin: 0 auto;
    align-items: start;
    min-height: calc(100vh - 78px);
    counter-reset: section;
}

.sidebar-left  { grid-area: left;  }
main           { grid-area: main;  }
.sidebar-right { grid-area: right; }

/* ================================================================
   SIDEBARS
   ================================================================ */
.sidebar-left,
.sidebar-right {
    background-color: var(--sidebar-bg);
    padding: 30px 16px;
    display: flex;
    flex-direction: column;
    gap: 22px;
    min-height: 100%;
}
.sidebar-left  { border-right: 1px solid var(--border); }
.sidebar-right { border-left:  1px solid var(--border); }

/* ================================================================
   CONTENU PRINCIPAL
   ================================================================ */
main {
    background-color: var(--surface);
    padding: 48px 48px 56px;
    border-left:  1px solid var(--border);
    border-right: 1px solid var(--border);
    min-height: 100%;
}

main section {
    counter-increment: section;
    padding-bottom: 48px;
    margin-bottom: 48px;
    border-bottom: 1px solid var(--border-light);
}
main section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* --- H2 : numéro romain + titre centré --- */
main h2 {
    font-family: var(--serif);
    font-size: clamp(1.45rem, 2.4vw, 2rem);
    font-weight: 700;
    color: var(--text);
    text-align: center;
    margin-bottom: 32px;
    letter-spacing: 0.01em;
}
main h2::before {
    content: counter(section, upper-roman);
    display: block;
    font-family: var(--sans);
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 7px;
}
main h2::after {
    content: '';
    display: block;
    width: 36px;
    height: 2px;
    background: var(--gold);
    margin: 12px auto 0;
    border-radius: 1px;
}

/* --- H3 --- */
main h3 {
    font-family: var(--serif);
    font-size: clamp(0.98rem, 1.6vw, 1.12rem);
    font-style: italic;
    font-weight: 400;
    color: var(--accent);
    margin: 26px 0 11px;
    padding-left: 14px;
    border-left: 2px solid var(--gold-light);
}

/* --- Paragraphes --- */
main p {
    font-size: clamp(0.88rem, 1.3vw, 0.97rem);
    line-height: 1.88;
    color: #2a1c0e;
    margin-bottom: 14px;
}

/* Premier paragraphe de chaque section : légèrement mis en valeur */
main section > p:first-of-type {
    font-size: clamp(0.93rem, 1.4vw, 1.02rem);
    color: var(--text);
    line-height: 1.9;
}

main a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: rgba(122,74,0,0.3);
    transition: color var(--transition), text-decoration-color var(--transition);
}
main a:hover {
    color: var(--accent-h);
    text-decoration-color: var(--accent-h);
}

/* Mise en évidence de la recherche */
.search-highlight {
    background-color: #fde68a !important;
    border-radius: 2px;
    outline: 2px solid #f0c040;
    outline-offset: 1px;
}

/* ================================================================
   ENCADRÉS DES SIDEBARS
   ================================================================ */
.le-saviez-vous,
.zoom-automate,
.petit-quiz,
.lien-cnam {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-top: 3px solid var(--gold);
    border-radius: var(--radius);
    padding: 16px;
    font-size: 0.82rem;
    line-height: 1.65;
    color: var(--text-muted);
    box-shadow: var(--shadow-card);
    transition: box-shadow var(--transition);
}
.le-saviez-vous:hover,
.zoom-automate:hover,
.petit-quiz:hover,
.lien-cnam:hover {
    box-shadow: var(--shadow-lift);
}

/* Titres des cartes */
.le-saviez-vous h3,
.zoom-automate h4,
.petit-quiz h3,
.lien-cnam h3 {
    font-family: var(--serif);
    font-size: 0.88rem;
    font-weight: 700;
    font-style: normal;
    text-decoration: none;
    color: var(--accent);
    margin-bottom: 10px;
    padding-left: 0;
    border-left: none;
    letter-spacing: 0.02em;
}

.le-saviez-vous p {
    font-style: italic;
    font-size: 0.82rem;
}

.zoom-automate p {
    font-style: italic;
    font-size: 0.82rem;
    margin-bottom: 8px;
}
.zoom-automate img {
    width: 100%;
    display: block;
    border-radius: 3px;
    margin: 10px 0 8px;
    object-fit: cover;
    max-height: 134px;
    border: 1px solid var(--border);
}
.zoom-automate a {
    display: inline-block;
    font-size: 0.79rem;
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid rgba(122,74,0,0.3);
    padding-bottom: 1px;
    transition: color var(--transition), border-color var(--transition);
}
.zoom-automate a:hover {
    color: var(--accent-h);
    border-color: var(--accent-h);
}

/* --- Lien CNAM --- */
.lien-cnam h3 { margin-bottom: 12px; }

.lien-cnam a {
    display: block;
    text-decoration: none;
}
.lien-cnam img {
    width: 100%;
    max-height: 68px;
    object-fit: contain;
    border-radius: 3px;
    border: 1px solid var(--border-light);
    padding: 8px;
    background: #fff;
    transition: box-shadow var(--transition);
}
.lien-cnam a:hover img {
    box-shadow: 0 3px 10px rgba(122,74,0,0.2);
    transform: none;
}

/* --- Quiz --- */
.petit-quiz h3 { margin-bottom: 8px; }

.petit-quiz > p {
    font-style: italic;
    font-size: 0.82rem;
    margin-bottom: 12px;
    line-height: 1.5;
}

.quiz-buttons {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.petit-quiz button {
    width: 100%;
    padding: 9px 13px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    cursor: pointer;
    font-family: var(--sans);
    font-size: 0.82rem;
    text-align: left;
    transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.petit-quiz button:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.petit-quiz button.correct {
    background: #166534;
    border-color: #166534;
    color: #fff;
}
.petit-quiz button.wrong {
    background: #991b1b;
    border-color: #991b1b;
    color: #fff;
}

.quiz-result {
    margin-top: 10px;
    font-size: 0.8rem;
    font-style: italic;
    font-weight: 500;
    text-align: center;
    min-height: 1.2em;
}
.quiz-result.correct { color: #166534; }
.quiz-result.wrong   { color: #991b1b; }

/* --- Labels + Pubs portfolio --- */
.pub-label {
    font-family: var(--sans);
    font-size: 0.63rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 7px;
    opacity: 0.75;
}

.pub-fixe-gauche a,
.pub-fixe-droite a {
    display: block;
    text-decoration: none;
}
.pub-fixe-gauche img,
.pub-fixe-droite img {
    width: 100%;
    display: block;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-card);
    transition: box-shadow var(--transition), opacity var(--transition);
}
.pub-fixe-gauche a:hover img,
.pub-fixe-droite a:hover img {
    box-shadow: var(--shadow-lift);
    opacity: 0.92;
    transform: none;
}

/* Override global du hover a img */
a img { transition: opacity var(--transition); }
a img:hover { transform: none; cursor: pointer; }

/* ================================================================
   SLIDERS
   ================================================================ */
.slider {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 58%;
    margin: 28px 0;
    overflow: hidden;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background-color: #1a1008;
    box-shadow: var(--shadow-card);
}
.slider img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.9s ease-in-out;
}
.slider img.active { opacity: 1; }

.prev, .next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(43,26,13,0.72);
    border: 1px solid rgba(168,120,32,0.5);
    color: #e8d0a8;
    font-size: 1rem;
    cursor: pointer;
    transition: background var(--transition), color var(--transition), transform 0.15s;
}
.prev { left: 12px; }
.next { right: 12px; }
.prev:hover, .next:hover {
    background: rgba(43,26,13,0.95);
    color: var(--gold-light);
    transform: translateY(-50%) scale(1.08);
}

/* ================================================================
   VIDÉO
   ================================================================ */
.video-container {
    display: flex;
    justify-content: center;
    margin: 24px 0 4px;
}
.video-container iframe {
    width: 100%;
    max-width: 610px;
    aspect-ratio: 16 / 9;
    height: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
}

/* ================================================================
   FOOTER
   ================================================================ */
footer {
    background-color: var(--footer-bg);
    border-top: 2px solid var(--gold);
    padding: 24px 24px;
    text-align: center;
}
.footer-content {
    max-width: 1380px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.footer-credit {
    font-family: var(--serif);
    font-size: 0.92rem;
    font-style: italic;
    color: rgba(240,228,208,0.75);
}
.footer-credit strong {
    font-style: normal;
    font-weight: 600;
    color: var(--gold-light);
}
.footer-copy {
    font-family: var(--sans);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    color: rgba(240,228,208,0.38);
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 1100px) {
    .container {
        grid-template-columns: 230px 1fr 230px;
    }
    main { padding: 40px 36px 48px; }
}

@media (max-width: 900px) {
    .container {
        grid-template-columns: 1fr;
        grid-template-areas:
            "main"
            "left"
            "right";
    }
    main       { order: 1; border: none; }
    .sidebar-left  { order: 2; }
    .sidebar-right { order: 3; }

    .sidebar-left,
    .sidebar-right {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 16px;
        padding: 24px 16px;
        min-height: auto;
        border: none;
        border-top: 2px solid var(--border);
    }
    .sidebar-left > *,
    .sidebar-right > * {
        flex: 1 1 210px;
        max-width: 300px;
    }
}

@media (max-width: 640px) {
    header { height: auto; padding: 12px 16px; }

    .header-content {
        flex-direction: column;
        gap: 10px;
        position: static;
        padding: 0;
    }
    .logo, .recherche-header {
        position: static;
        transform: none;
    }
    .recherche-header input { width: 100%; max-width: 280px; }

    main { padding: 28px 18px 36px; }

    main section { padding-bottom: 36px; margin-bottom: 36px; }

    .sidebar-left > *,
    .sidebar-right > * {
        flex: 1 1 100%;
        max-width: 100%;
    }
}

@media (max-width: 400px) {
    main { padding: 20px 14px 28px; }
    .prev, .next { width: 34px; height: 34px; font-size: 0.85rem; }
}
