/* Thème « magazine moderne » du site public */

:root {
    --ink: #111827;
    --muted: #6b7280;
    --accent: #1d4ed8;        /* bleu */
    --accent-dark: #1e3a8a;
    --bg: #f8f7f5;
    --card: #ffffff;
    --line: #e7e5e4;
    --radius: 12px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

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

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

.container { max-width: 1100px; margin: 0 auto; padding: 0 1.25rem; }

/* ---------- Header ---------- */

.site-header {
    background: var(--card);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 50;
}

.site-header .inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .9rem 0;
    flex-wrap: wrap;
}

.brand {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -.02em;
    color: var(--ink);
}
.site-header .brand { margin-left: .5rem; }

.nav-toggle { display: none; }
.brand:hover { text-decoration: none; }
.brand .dot { color: var(--accent); }

.main-nav {
    display: flex;
    gap: .25rem;
}

.nav-item { position: relative; }

.nav-item > a {
    display: inline-block;
    white-space: nowrap;
    color: var(--ink);
    font-size: .9rem;
    font-weight: 600;
    padding: .4rem .8rem;
    border-radius: 999px;
    transition: background .15s, color .15s;
}
.nav-item > a:hover,
.nav-item:focus-within > a {
    background: var(--accent);
    color: #fff;
    text-decoration: none;
}

.nav-item.has-children > a::after {
    content: ' ▾';
    font-size: .7em;
}

.dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 210px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 12px 30px rgb(0 0 0 / .12);
    padding: .4rem;
    z-index: 60;
}
.nav-item:hover .dropdown,
.nav-item:focus-within .dropdown {
    display: block;
}

.dropdown a {
    display: block;
    color: var(--ink);
    font-size: .88rem;
    font-weight: 500;
    padding: .45rem .75rem;
    border-radius: 6px;
    white-space: nowrap;
}
.dropdown a:hover {
    background: var(--bg);
    color: var(--accent);
    text-decoration: none;
}

/* Mobile : menu hamburger — panneau vertical avec sous-rubriques indentées */
@media (max-width: 800px) {
    .nav-toggle {
        display: block;
        background: none;
        border: 1px solid var(--line);
        border-radius: 8px;
        font-size: 1.25rem;
        line-height: 1;
        padding: .4rem .65rem;
        cursor: pointer;
        color: var(--ink);
    }

    .main-nav {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: .1rem;
        padding: .5rem 0 .25rem;
    }
    .main-nav.open {
        display: flex;
        /* Menu long : défilement interne (l'en-tête sticky ne défile pas avec la page) */
        max-height: calc(100vh - 90px);
        max-height: calc(100dvh - 90px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    .nav-item > a {
        display: block;
        padding: .5rem .8rem;
        border-radius: 8px;
    }
    .nav-item.has-children > a::after { content: ''; }

    .dropdown {
        display: block !important;
        position: static;
        min-width: 0;
        background: none;
        border: none;
        box-shadow: none;
        padding: 0 0 .35rem 1.4rem;
    }
    .dropdown a {
        padding: .4rem .75rem;
        color: var(--muted);
    }
}

/* ---------- Structure ---------- */

main { padding: 2.5rem 0 3rem; }

.section-title {
    font-size: 1.05rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--accent);
    margin: 0 0 1.25rem;
    display: flex;
    align-items: center;
    gap: .75rem;
}
.section-title::after {
    content: '';
    flex: 1;
    height: 2px;
    background: var(--line);
}

/* ---------- Diaporama d'accueil ---------- */

.slideshow {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 2.5rem;
    height: 420px;
}

.slideshow .slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity .7s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    padding: 2rem 3.5rem;
    pointer-events: none;
    box-sizing: border-box;
}
.slideshow .slide.active {
    opacity: 1;
    pointer-events: auto;
}

.slideshow .slide-content { max-width: 680px; }

/* Alignement du contenu par diapositive */
.slideshow .slide.align-left {
    justify-content: flex-start;
    text-align: left;
}
.slideshow .slide.align-left .slide-content p { margin-left: 0; }

.slideshow .slide.align-right {
    justify-content: flex-end;
    text-align: right;
}
.slideshow .slide.align-right .slide-content p { margin-right: 0; }

.slideshow .slide-content h2 {
    font-size: clamp(1.6rem, 4vw, 2.5rem);
    letter-spacing: -.02em;
    margin: 0 0 .75rem;
    text-shadow: 0 2px 12px rgb(0 0 0 / .4);
}

.slideshow .slide-content p {
    margin: 0 auto 1.25rem;
    opacity: .95;
    text-shadow: 0 1px 8px rgb(0 0 0 / .4);
}

.slideshow .slide-content .btn-primary {
    display: inline-block;
    background: #fff;
    color: var(--accent-dark);
    text-decoration: none;
}
.slideshow .slide-content .btn-primary:hover { background: var(--bg); }

.slide-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgb(0 0 0 / .35);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    font-size: 1.1rem;
    cursor: pointer;
    z-index: 2;
    transition: background .15s;
}
.slide-arrow:hover { background: rgb(0 0 0 / .6); }
.slide-arrow.prev { left: .75rem; }
.slide-arrow.next { right: .75rem; }

.slide-dots {
    position: absolute;
    bottom: .9rem;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: .5rem;
    z-index: 2;
}
.slide-dots button {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background: rgb(255 255 255 / .5);
    cursor: pointer;
    padding: 0;
    transition: background .15s, transform .15s;
}
.slide-dots button.active {
    background: #fff;
    transform: scale(1.25);
}

@media (max-width: 700px) {
    .slideshow { height: 320px; }
    .slideshow .slide { padding: 1.5rem 3rem; }
}

/* ---------- Bandeau d'accueil (hero paramétrable) ---------- */

.hero-banner {
    background: linear-gradient(135deg, var(--accent-dark), var(--accent));
    background-size: cover;
    background-position: center;
    border-radius: var(--radius);
    color: #fff;
    text-align: center;
    padding: 3.5rem 2rem;
    margin-bottom: 2.5rem;
}

.hero-banner h2 {
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    letter-spacing: -.02em;
    margin: 0 0 .75rem;
}

.hero-banner p {
    max-width: 620px;
    margin: 0 auto 1.25rem;
    opacity: .92;
}

.hero-banner .btn-primary {
    display: inline-block;
    background: #fff;
    color: var(--accent-dark);
    text-decoration: none;
}
.hero-banner .btn-primary:hover { background: var(--bg); }

/* ---------- Footer : colonnes ---------- */

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 2rem;
    margin-bottom: 1rem;
}
@media (max-width: 700px) {
    .footer-grid { grid-template-columns: 1fr; gap: 1rem; }
}

.footer-contact p { margin: .2rem 0; }

.footer-socials {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    align-content: flex-start;
}
.footer-socials a { opacity: .85; }
.footer-socials a:hover { opacity: 1; }

/* ---------- Hero (article à la une) ---------- */

.hero {
    display: grid;
    grid-template-columns: 3fr 2fr;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 2.5rem;
}

.hero .thumb { min-height: 320px; }

.hero .body {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero h2 {
    font-size: 1.75rem;
    line-height: 1.25;
    letter-spacing: -.01em;
    margin: .5rem 0 .75rem;
}
.hero h2 a { color: var(--ink); }

.hero p.excerpt { color: var(--muted); margin: 0 0 1rem; }

/* ---------- Grille de cartes ---------- */

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform .15s, box-shadow .15s;
}
.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgb(0 0 0 / .08);
}

.thumb {
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, var(--accent-dark), var(--accent));
    background-size: cover;
    background-position: center;
    display: block;
}

.card .body { padding: 1.1rem 1.25rem 1.35rem; display: flex; flex-direction: column; flex: 1; }

.card h3 {
    font-size: 1.1rem;
    line-height: 1.35;
    margin: .4rem 0 .5rem;
}
.card h3 a { color: var(--ink); }

.card p.excerpt {
    color: var(--muted);
    font-size: .92rem;
    margin: 0;
}

.kicker {
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--accent);
}
.kicker a { color: inherit; }

.meta { color: var(--muted); font-size: .85rem; }

/* ---------- Breadcrumbs ---------- */

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .4rem;
    font-size: .82rem;
    color: var(--muted);
    margin: 0 0 1.25rem;
}
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs .sep { opacity: .6; }
.breadcrumbs [aria-current] { color: var(--ink); font-weight: 600; }

/* ---------- Page article ---------- */

/* Pleine largeur du conteneur (alignée sur la barre de menu) */
.article-page { max-width: none; margin: 0; }

.article-page h1 {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    line-height: 1.2;
    letter-spacing: -.02em;
    margin: .5rem 0 .75rem;
}

.article-page .lead-image {
    border-radius: var(--radius);
    margin: 1.5rem 0;
    width: 100%;
    object-fit: cover;
}

.article-body {
    font-size: 1.08rem;
}
.article-body img {
    border-radius: var(--radius);
    margin: 1rem 0;
}
.article-body iframe { max-width: 100%; }

/* ---------- Tags ---------- */

.tags { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: .5rem; }
.tags a, .tags span {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: .2rem .85rem;
    font-size: .8rem;
    font-weight: 600;
    color: var(--muted);
}

/* ---------- Sous-rubriques ---------- */

.subcats { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 2rem; }
.subcats a {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: .35rem 1rem;
    font-size: .88rem;
    font-weight: 600;
    color: var(--ink);
    transition: background .15s, color .15s;
}
.subcats a:hover { background: var(--accent); color: #fff; text-decoration: none; }

/* ---------- Formulaires (contact) ---------- */

.contact-form { max-width: 560px; }

.form-field { margin-bottom: 1.1rem; }

.form-field label {
    display: block;
    font-weight: 600;
    font-size: .9rem;
    margin-bottom: .35rem;
}

.form-field input,
.form-field textarea {
    width: 100%;
    padding: .65rem .85rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
    background: var(--card);
    color: var(--ink);
}
.form-field input:focus,
.form-field textarea:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
    border-color: var(--accent);
}

.error-text {
    display: block;
    color: #dc2626;
    font-size: .82rem;
    margin-top: .3rem;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: .65rem 1.6rem;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
.btn-primary:hover { background: var(--accent-dark); }

.alert {
    border-radius: 8px;
    padding: .8rem 1rem;
    font-size: .95rem;
}
.alert-success { background: #dcfce7; color: #166534; }
.alert-error { background: #fee2e2; color: #991b1b; }

/* Honeypot : hors écran (les robots le remplissent, pas les humains) */
.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ---------- Emplacements publicitaires ---------- */

.ad-slot {
    margin: 1.5rem 0;
    text-align: center;
    overflow: hidden;
}

.card.ad-card {
    /* Surtout pas de flex ici : AdSense a besoin d'une largeur de bloc définie */
    display: block;
    padding: 1rem;
    min-height: 200px;
    overflow: hidden;
}
.card.ad-card ins,
.card.ad-card > div {
    display: block;
    width: 100%;
}

/* ---------- Cadres (blocs de contenu des pages) ---------- */

.cards-grid {
    margin: 2rem 0;
    grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 900px) {
    .cards-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .cards-grid { grid-template-columns: 1fr; }
}

.cards-grid .card .body h3 { margin-top: 0; }

.cards-grid .card-link { margin: .75rem 0 0; }
.cards-grid .card-link a { font-weight: 600; font-size: .92rem; }

/* ---------- Page 404 ---------- */

.error-page {
    text-align: center;
    padding: 3rem 1rem 4rem;
    max-width: 560px;
    margin: 0 auto;
}

.error-page .error-code {
    font-size: 6rem;
    font-weight: 800;
    line-height: 1;
    color: var(--accent);
    margin: 0 0 .5rem;
    letter-spacing: -.04em;
}

.error-page h1 { margin: 0 0 .75rem; }

.error-page .error-text-lead { color: var(--muted); }

.error-page .error-actions {
    display: flex;
    justify-content: center;
    gap: .75rem;
    flex-wrap: wrap;
    margin-top: 1.75rem;
}

.btn-secondary {
    display: inline-block;
    background: var(--card);
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: .65rem 1.6rem;
    font-weight: 600;
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

.error-page .btn-primary { text-decoration: none; }

/* ---------- Pagination ---------- */

.pager {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2.5rem;
}
.pager a {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: .5rem 1.25rem;
    font-weight: 600;
    font-size: .92rem;
}
.pager a:hover { background: var(--accent); color: #fff; text-decoration: none; }

/* ---------- Footer ---------- */

.site-footer {
    background: var(--ink);
    color: #d1d5db;
    padding: 2.5rem 0;
    margin-top: 3rem;
    font-size: .9rem;
}
.site-footer a { color: #fff; }
.site-footer .brand { color: #fff; font-size: 1.2rem; margin-left: 0; }
.site-footer .footer-links { margin-top: .5rem; }
.site-footer .footer-links a { margin-right: .25rem; opacity: .85; }
.site-footer .footer-links a:hover { opacity: 1; }

/* ---------- Responsive ---------- */

@media (max-width: 800px) {
    .hero { grid-template-columns: 1fr; }
    .hero .thumb { min-height: 220px; }
    .hero .body { padding: 1.5rem; }
}
