/* Charte reprise de cirses.fr : vert d'eau, jaune, rouge brique ; titres Alpino, texte Atkinson Hyperlegible */
@font-face { font-family: Alpino; font-weight: 900; font-display: swap; src: url(fonts/Alpino-Black.woff2) format("woff2"); }
@font-face { font-family: AtkinsonHyperlegible; font-weight: 400; font-display: swap; src: url(fonts/AtkinsonHyperlegible-Regular.woff2) format("woff2"); }
@font-face { font-family: AtkinsonHyperlegible; font-weight: 700; font-display: swap; src: url(fonts/AtkinsonHyperlegible-Bold.woff2) format("woff2"); }

:root {
    --green-header: #a6cfbb;
    --green: #21a68b;
    --green-light: #c0e6d4;
    --yellow: #ffd800;
    --yellow-light: #ffeaa7;
    --red: #c12928;
    --red-dark: #780807;
    --violet: #a25ea2;
    --bg: #f4f3ef;
    --card: #fff;
    --ink: #000;
    --muted: #4d4d4d;
    --line: #d9d6cc;
    --radius: 16px;
    --ff-text: AtkinsonHyperlegible, system-ui, -apple-system, "Segoe UI", sans-serif;
    --ff-title: Alpino, AtkinsonHyperlegible, system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 1rem; }
body {
    margin: 0; background: var(--bg); color: var(--ink);
    font: 400 1.0625rem/1.6 var(--ff-text);
    display: flex; flex-direction: column; min-height: 100vh;
}
h1, h2, h3 { font-family: var(--ff-title); font-weight: 900; line-height: 1.2; }
h1 { font-size: clamp(1.7rem, 3vw, 2.3rem); margin: .6rem 0 .4rem; }
a { color: var(--red-dark); text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid #000; outline-offset: 2px; box-shadow: 0 0 0 6px var(--yellow); border-radius: 6px; }

.skip { position: absolute; left: -999px; top: 0; background: #fff; padding: .6rem 1rem; z-index: 100; border-radius: 0 0 8px 0; }
.skip:focus { left: 0; }

/* --- En-tête --- */
.topbar { background: var(--green-header); }
.topbar-inner { display: flex; align-items: center; gap: 1rem; max-width: 1280px; margin: 0 auto; padding: .7rem 1.25rem; }
.brand { display: flex; align-items: center; gap: .8rem; text-decoration: none; color: #000; }
.brand img { height: 48px; width: auto; display: block; }
.brand span { font-family: var(--ff-title); font-weight: 900; font-size: 1.1rem; padding-left: .8rem; border-left: 2px solid #000; line-height: 1.1; }
.search { flex: 1; max-width: 440px; margin: 0 0 0 auto; }
.search input { width: 100%; padding: .55rem 1.1rem; border-radius: 999px; border: 2px solid transparent; background: #fff; font: inherit; }
.userbox { display: flex; align-items: center; gap: .75rem; margin: 0; font-weight: 700; }
.userbox span { max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- Boutons --- */
.btn {
    display: inline-block; background: var(--red); color: #fff; border: 2px solid var(--red); border-radius: 999px;
    padding: .5rem 1.2rem; font: 700 1rem var(--ff-text); cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--red-dark); border-color: var(--red-dark); }
.btn-ghost { background: #fff; color: #000; border-color: #000; }
.btn-ghost:hover { background: var(--yellow); border-color: #000; }

/* --- Mise en page --- */
.shell { display: flex; align-items: flex-start; width: 100%; max-width: 1280px; margin: 0 auto; flex: 1; }
.sidebar { flex: 0 0 240px; padding: 1.5rem 0 1.5rem 1.25rem; display: flex; flex-direction: column; gap: .3rem; position: sticky; top: 0; }
.sidebar a { padding: .55rem .9rem; border-radius: 12px; color: #000; text-decoration: none; border-left: 4px solid transparent; }
.sidebar a:hover { background: var(--green-light); }
.sidebar a.active { background: var(--green-light); border-left-color: var(--green); font-weight: 700; }
.container { flex: 1; min-width: 0; padding: 1.25rem 1.25rem 3rem; }
.crumbs { display: flex; flex-wrap: wrap; gap: .4rem; color: var(--muted); font-size: .95rem; }
.crumbs a { color: var(--red-dark); }
.lead { color: var(--muted); }
.muted { color: var(--muted); }

.intro { background: var(--card); border-radius: var(--radius); border-top: 6px solid var(--green); padding: .4rem 1.5rem 1rem; margin: 1rem 0; }
.intro h2 { font-size: 1.25rem; margin: 1.1rem 0 .4rem; }
.section { font-size: .95rem; margin: 2rem 0 .6rem; padding-bottom: .25rem; border-bottom: 3px solid var(--yellow); display: inline-block; }

/* --- Cartes --- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; margin-top: .5rem; }
.card { display: block; background: var(--card); border: 3px solid transparent; border-radius: var(--radius); padding: 1.1rem 1.3rem; color: inherit; text-decoration: none; transition: border-color .15s, transform .15s; }
a.card:hover { border-color: var(--green); transform: translateY(-2px); }
.card h3 { margin: 0 0 .2rem; font-size: 1.1rem; }
.card p { margin: 0; color: var(--muted); }
.icon { margin-right: .25rem; }
.form { display: grid; gap: 1rem; max-width: 420px; }
.form label { display: grid; gap: .25rem; font-weight: 700; }
input { padding: .55rem .8rem; border: 2px solid #000; border-radius: 12px; font: inherit; background: #fff; }
.alert { background: var(--red-dark); color: #fff; border-radius: 12px; padding: .7rem 1rem; max-width: 420px; }
.notice { background: var(--yellow-light); border-radius: 12px; padding: .7rem 1rem; max-width: 520px; }

/* --- Fichiers --- */
.files { list-style: none; margin: 0; padding: 0; background: var(--card); border-radius: var(--radius); overflow: hidden; }
.file { display: flex; align-items: center; gap: .9rem; padding: .75rem 1.1rem; border-bottom: 1px solid var(--line); }
.file:last-child { border-bottom: 0; }
.file-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.file-title { color: #000; font-weight: 700; overflow-wrap: anywhere; }
.file-title:hover { color: var(--red-dark); }
.file-meta { white-space: nowrap; font-size: .9rem; }
.badge { flex: 0 0 3.6rem; text-align: center; background: var(--yellow-light); color: #000; border-radius: 8px; font-size: .72rem; font-weight: 700; padding: .3rem 0; }
.featured { outline: 3px solid var(--yellow); }
.snippet { font-size: .95rem; margin-top: .15rem; }
mark { background: var(--yellow); color: #000; padding: 0 .15rem; border-radius: 3px; }
.index-date { font-size: .9rem; margin-top: 1.5rem; }

/* --- Document Markdown --- */
.doc { background: var(--card); border-radius: var(--radius); border-top: 6px solid var(--green); padding: .5rem 2rem 1.5rem; margin: 1rem 0; max-width: 82ch; overflow-wrap: anywhere; }
.doc h1, .doc h2, .doc h3 { margin: 1.4rem 0 .5rem; }
.doc table { border-collapse: collapse; }
.doc th, .doc td { border: 1px solid var(--line); padding: .4rem .7rem; }
.doc blockquote { margin-left: 0; padding-left: 1rem; border-left: 4px solid var(--yellow); color: var(--muted); }
.doc code { background: var(--bg); padding: .1rem .35rem; border-radius: 4px; }
.doc-actions { display: flex; gap: .75rem; flex-wrap: wrap; }

/* --- Pied de page --- */
.footer { background: var(--green-header); margin-top: 2rem; }
.footer-inner { max-width: 1280px; margin: 0 auto; padding: 1rem 1.25rem; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between; font-size: .95rem; }
.footer a { color: #000; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media (max-width: 800px) {
    .topbar-inner { flex-wrap: wrap; }
    .search { order: 3; flex-basis: 100%; max-width: none; margin: 0; }
    .userbox { margin-left: auto; }
    .shell { flex-direction: column; }
    .sidebar { position: static; flex-direction: row; flex-wrap: wrap; padding: .75rem 1.25rem 0; flex-basis: auto; }
    .file { flex-wrap: wrap; }
    .file-meta { order: 3; flex-basis: 100%; }
    .brand span { display: none; }
}
