/* Identité reprise du thème d'origine (Frame) : en-tête sombre, accent rouge, Open Sans. */
@font-face {
    font-family: 'Open Sans';
    src: url("../fonts/open-sans-latin-wght-normal-7FyopfO.woff2") format('woff2');
    font-weight: 300 800;
    font-display: swap;
}

:root {
    --fond-entete: #2a282f;
    --fond-pied: #000;
    --accent: #e73c1d;
    --texte: #2a282f;
    --texte-attenue: #6f6c78;
    --texte-clair: #f5f5f5;
    --fond: #fff;
    --fond-carte: #f4f3f6;
    --largeur: 1170px;
    --hauteur-entete: 70px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: 'Open Sans', system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--texte);
    background: var(--fond);
}

::selection { background: var(--accent); color: #fff; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3 { line-height: 1.25; margin: 0 0 .6em; }
h1 { font-size: 1.9rem; font-weight: 700; }

/* —— En-tête et menu —— */
.entete {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0 2rem;
    min-height: var(--hauteur-entete);
    padding: 0 max(16px, calc((100% - var(--largeur)) / 2));
    background: var(--fond-entete);
}

.logo img { width: 197px; height: auto; }

.menu > ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0 25px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.menu > ul > li { position: relative; }

.menu > ul > li > a,
.menu summary {
    display: block;
    padding: 26px 0;
    font-size: 14px;
    line-height: 17px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--texte-clair);
    cursor: pointer;
    list-style: none;
}
.menu summary::-webkit-details-marker { display: none; }
.menu summary::after { content: ' ▾'; font-size: 11px; }

.menu > ul > li > a:hover,
.menu summary:hover,
.menu .courant > a,
.menu .courant summary { color: var(--accent); text-decoration: none; }

/* Sous-menus : panneau sous l'entrée, ouvert au clic (un seul à la fois). */
.menu details > ul {
    position: absolute;
    top: 100%;
    left: 50%;
    width: 220px;
    margin: 0 0 0 -110px;
    padding: 0;
    list-style: none;
    background: var(--accent);
    max-height: calc(100vh - var(--hauteur-entete));
    overflow-y: auto;
}
.menu > ul > li:last-child details > ul { left: auto; right: 0; margin: 0; }

.menu details li { border-top: 3px solid var(--fond-entete); }
.menu details li:first-child { border-top: none; }

.menu details a {
    display: block;
    padding: 10px 15px;
    font-size: 13px;
    line-height: 1.3;
    color: #fff;
}
.menu details a:hover,
.menu details a[aria-current='page'] { background: var(--fond-entete); text-decoration: none; }

/* Galerie : chaque rubrique, puis ses sous-catégories en retrait. */
.menu details ul ul { margin: 0; padding: 0; list-style: none; }
.menu details ul ul li { border-top: 1px solid rgb(0 0 0 / .15); }
.menu details ul ul a { padding-left: 28px; font-size: 12px; }
.menu [data-test='menu-rubrique-nom'] { font-weight: 700; text-transform: uppercase; }

@media (max-width: 899px) {
    .entete { position: static; padding-block: 12px; }
    .menu { width: 100%; }
    .menu > ul { gap: 0 18px; }
    .menu > ul > li > a, .menu summary { padding: 10px 0; }
    .menu > ul > li { position: static; }
    .menu details > ul { left: 16px; right: 16px; width: auto; margin: 0; }
}

/* —— Contenu —— */
.contenu {
    flex: 1;
    width: 100%;
    max-width: var(--largeur);
    margin: 0 auto;
    padding: 40px 16px 60px;
}

.contenu > p, .contenu article > p { max-width: 75ch; }

.grille {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    margin: 30px 0 0;
    padding: 0;
    list-style: none;
}
.grille a {
    display: block;
    height: 100%;
    color: var(--texte);
    background: var(--fond-carte);
    transition: background .2s;
}
.grille a:hover { background: var(--accent); color: #fff; text-decoration: none; }
.grille img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.grille h2 { margin: 0; padding: 12px 15px; font-size: 14px; font-weight: 600; }

[data-test='sous-categories'] ul {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}
[data-test='sous-categories'] a,
[data-test='tags'] a {
    display: inline-block;
    padding: 4px 12px;
    font-size: 13px;
    color: var(--texte);
    background: var(--fond-carte);
}
[data-test='sous-categories'] a:hover,
[data-test='sous-categories'] a[aria-current='page'],
[data-test='tags'] a:hover { background: var(--accent); color: #fff; text-decoration: none; }

[data-test='tags'] { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; list-style: none; }

article img { margin: 0 0 20px; }

form[role='search'] { display: flex; gap: 8px; max-width: 600px; }

input, textarea, select, button { font: inherit; }
input, textarea, select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #cdcbd3;
    border-radius: 0;
    background: #fff;
    color: var(--texte);
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: -1px; }
button {
    padding: 8px 20px;
    border: none;
    background: var(--fond-entete);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}
button:hover { background: var(--accent); }

[data-test='article'] { padding: 24px 0; border-bottom: 1px solid #e4e2e8; }
[data-test='article'] time { color: var(--texte-attenue); font-size: 13px; }

/* —— Accueil plein écran —— */
.plein-ecran .contenu { max-width: none; padding: 0; }
.plein-ecran .pied { display: none; }

.diaporama {
    position: relative;
    height: calc(100vh - var(--hauteur-entete));
    min-height: 320px;
    margin: 0;
    padding: 0;
    list-style: none;
    background: var(--fond-pied);
    overflow: hidden;
}
.diaporama li {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 1.2s ease;
}
.diaporama li.visible { opacity: 1; z-index: 1; }
.diaporama img { width: 100%; height: 100%; object-fit: cover; }
.diaporama a {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 18px max(16px, calc((100% - var(--largeur)) / 2));
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--texte-clair);
    background: rgb(42 40 47 / .9);
}
.diaporama a:hover { color: var(--accent); text-decoration: none; }

/* —— Pied de page —— */
.pied {
    padding: 20px 16px;
    text-align: center;
    font-size: 13px;
    color: #cdcbd3;
    background: var(--fond-pied);
}
.pied p { margin: 0; }
.pied a { color: #cdcbd3; }
