/* ============================================================
   CSS GLOBAL du site — partagé par toutes les pages.
   Modifier ici change le style de tout le site.
   ============================================================ */

:root {
    --bg: #ffffff;
    --fg: #1a1a1a;
    --muted: #666;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --card: #f6f7f9;
    --border: #e5e7eb;
    --maxw: 820px;
    --radius: 12px;
    font-size: 17px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0e1116;
        --fg: #e6e6e6;
        --muted: #9aa4b2;
        --accent: #60a5fa;
        --accent-hover: #93c5fd;
        --card: #171b22;
        --border: #262b33;
    }
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.65;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 2rem 1.25rem 4rem; }

/* En-tête / navigation */
header.site { border-bottom: 1px solid var(--border); }
header.site .wrap { padding-top: 1.25rem; padding-bottom: 1.25rem; display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
header.site a.brand { font-weight: 700; font-size: 1.15rem; color: var(--fg); text-decoration: none; }
header.site nav a { color: var(--muted); text-decoration: none; margin-left: 1rem; }
header.site nav a:hover { color: var(--accent); }

h1 { font-size: 2rem; line-height: 1.2; margin: 0 0 .5rem; }
h2 { font-size: 1.35rem; margin: 2rem 0 .75rem; }
p.lead { color: var(--muted); font-size: 1.1rem; }

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

/* Grille de sections (page d'accueil) */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; margin-top: 1.5rem; }
.card {
    display: block; padding: 1.25rem; background: var(--card);
    border: 1px solid var(--border); border-radius: var(--radius);
    color: var(--fg); text-decoration: none; transition: border-color .15s, transform .15s;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
.card h3 { margin: 0 0 .35rem; font-size: 1.15rem; }
.card p { margin: 0; color: var(--muted); font-size: .95rem; }

/* Bouton (ex : lancer un quiz) */
.btn {
    display: inline-block; margin-top: .5rem; padding: .7rem 1.15rem;
    background: var(--accent); color: #fff; border-radius: 10px;
    font-weight: 600; text-decoration: none;
}
.btn:hover { background: var(--accent-hover); color: #fff; text-decoration: none; }

/* Médias d'une section */
figure { margin: 1.5rem 0; }
figure img, figure video { max-width: 100%; border-radius: var(--radius); border: 1px solid var(--border); }
figure figcaption { color: var(--muted); font-size: .9rem; margin-top: .4rem; }

footer.site { border-top: 1px solid var(--border); color: var(--muted); font-size: .9rem; }
footer.site .wrap { padding-top: 1.25rem; padding-bottom: 1.25rem; }

/* ============================================================
   Page d'accueil : hero + cartes enrichies
   ============================================================ */

/* Bandeau d'accueil */
.hero { background: var(--card); border-bottom: 1px solid var(--border); }
.hero { background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 10%, var(--bg)), var(--bg) 60%); }
.hero .wrap { padding-top: 3.5rem; padding-bottom: 2.75rem; }
.hero h1 { font-size: clamp(2rem, 6vw, 2.9rem); letter-spacing: -.02em; }
.hero p.lead { max-width: 42ch; }

/* Titre de groupe de cartes */
.section-label { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 2.5rem 0 .5rem; }

/* Pastille "Quiz interactif" */
.badge {
    display: inline-block; font-size: .68rem; font-weight: 700; letter-spacing: .04em;
    text-transform: uppercase; color: var(--accent); padding: .15rem .55rem; border-radius: 999px;
    background: color-mix(in srgb, var(--accent) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}

/* En-tête interne d'une carte (titre + flèche/badge) */
.card .card-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .4rem; }
.card .card-head h3 { margin: 0; }
.card .arrow { color: var(--muted); transition: transform .15s, color .15s; }
.card:hover .arrow { transform: translateX(4px); color: var(--accent); }

/* Accent des cartes menant à un quiz */
.card--quiz { border-left: 3px solid var(--accent); }
.card .card-foot { margin: .6rem 0 0; font-size: .82rem; color: var(--accent); font-weight: 600; }

/* Un peu plus d'air entre les cartes sur grands écrans */
@media (min-width: 640px) { .cards { gap: 1.15rem; } }
