/* ═════════════════════════════════════════════════════════════════════════════
   illegalsite.eu — charte (CONTEXTE §5.2)
   Bleu nuit, papier, terracotta pastel (surfaces) et profond (texte).
   Contrastes vérifiés WCAG AA.
   ═════════════════════════════════════════════════════════════════════════════ */

/* Polices IBM Plex (licence OFL) servies localement — fichiers .woff2 à déposer
   dans /assets/fonts/. En leur absence, la pile de repli prend le relais. */
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-display: swap; src: url("/assets/fonts/IBMPlexSans-Regular.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-display: swap; src: url("/assets/fonts/IBMPlexSans-Medium.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-display: swap; src: url("/assets/fonts/IBMPlexMono-Regular.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url("/assets/fonts/IBMPlexMono-Medium.woff2") format("woff2"); }

:root {
    --ink:          #2B3A55;   /* bleu nuit — texte (10,2:1 sur papier) */
    --paper:        #F6F1EA;   /* fond */
    --terra:        #D9967A;   /* terracotta pastel — SURFACES, texte encre dessus */
    --terra-text:   #A3563F;   /* terracotta profond — TEXTE (4,7:1) */
    --line:         #D9D2C6;
    --muted:        #5A6478;
    --font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --ink:        #E9E4DC;
        --paper:      #1C2333;
        --terra:      #E4A88E;
        --terra-text: #E4A88E;
        --line:       #39425A;
        --muted:      #A9B0C0;
        color-scheme: dark;
    }
}

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

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.6;
}

a { color: var(--terra-text); }
:focus-visible { outline: 3px solid var(--terra); outline-offset: 2px; }

h1, h2, h3 { font-weight: 500; line-height: 1.25; }
h1 { font-size: 1.9rem; margin: 0 0 .75rem; }
h2 { font-size: 1.25rem; margin: 2.5rem 0 1rem; }
h3 { font-size: 1.05rem; margin: 0; }

.brand { font-family: var(--font-mono); font-weight: 500; letter-spacing: .02em; font-size: 1.25rem; margin: 0;
         color: var(--ink); text-decoration: none; }
.brand span { color: var(--terra-text); }
.mono  { font-family: var(--font-mono); }
.muted { color: var(--muted); }
.lead  { font-size: 1.15rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
           clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.hold { max-width: 40rem; margin: 20vh auto 0; padding: 0 1rem; }

/* ─── Structure ─────────────────────────────────────────────────────────── */
.wrap   { max-width: 52rem; margin: 0 auto; padding: 0 1rem; }
.narrow { max-width: 36rem; }
main.wrap { padding-top: 2.5rem; padding-bottom: 4rem; min-height: 60vh; }

.top { border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 1rem;
          flex-wrap: wrap; padding-top: .9rem; padding-bottom: .9rem; }

.foot { border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; padding: 2rem 0 3rem; }
.foot nav { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }

/* ─── Recherche ─────────────────────────────────────────────────────────── */
.hero { padding: 6vh 0 2rem; }
.search { display: flex; gap: .5rem; max-width: 36rem; }
.search input { flex: 1; min-width: 0; font-family: var(--font-mono); font-size: 1.05rem; }
.search-small { max-width: 22rem; }
.search-small input { font-size: .95rem; padding: .45rem .7rem; }
.search-small button { padding: .45rem 1rem; }

.explain { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1.5rem; margin-top: 3rem; }
.explain h2 { margin: 0 0 .4rem; font-size: 1.05rem; }
.explain p { margin: 0; color: var(--muted); }

/* ─── Formulaires ───────────────────────────────────────────────────────── */
input[type=text], input[type=email], textarea {
    width: 100%; font: inherit; color: var(--ink); background: transparent;
    border: 1px solid var(--ink); border-radius: 6px; padding: .6rem .8rem;
}
textarea { resize: vertical; }
[aria-invalid=true] { border-color: var(--terra-text); border-width: 2px; }

button, .button {
    display: inline-block; font: inherit; font-weight: 500; cursor: pointer; text-decoration: none;
    color: var(--ink); background: var(--terra); border: 1px solid var(--terra);
    border-radius: 6px; padding: .6rem 1.2rem;
}
button:hover, .button:hover { filter: brightness(.95); }

.form .field { margin: 0 0 1.5rem; border: 0; padding: 0; }
.form label, .form legend { display: block; font-weight: 500; margin-bottom: .35rem; padding: 0; }
.optional { font-weight: 400; color: var(--muted); font-size: .9rem; }
.hint { color: var(--muted); font-size: .92rem; margin: .35rem 0 .6rem; }
.check { display: flex !important; gap: .6rem; align-items: flex-start; font-weight: 400 !important; margin-top: .9rem; }
.check input { margin-top: .3rem; accent-color: var(--terra-text); }
.field-error { color: var(--terra-text); font-weight: 500; margin: .4rem 0 0; }
.alert { border-left: 4px solid var(--terra); padding: .6rem 1rem; background: color-mix(in srgb, var(--terra) 15%, transparent); }
.cf-turnstile { margin: 0 0 1.5rem; min-height: 65px; }

/* ─── Fiche ─────────────────────────────────────────────────────────────── */
.kicker { margin: 0; color: var(--muted); font-size: .9rem; }
.report h1 { word-break: break-word; }
.rate { margin: 1.5rem 0; }
.rate-value { font-size: 3rem; font-weight: 500; line-height: 1; margin: 0; }
.rate-detail { margin: .5rem 0 0; color: var(--muted); }
.notice { font-size: .92rem; color: var(--muted); border-left: 3px solid var(--line); padding-left: 1rem; }

.findings { list-style: none; padding: 0; margin: 0; }
.finding { border-top: 1px solid var(--line); padding: 1.1rem 0; }
.finding p { margin: .5rem 0; }
.finding-head { display: flex; align-items: baseline; gap: .75rem; flex-wrap: wrap; }

.badge { font-size: .78rem; font-weight: 500; border-radius: 4px; padding: .1rem .55rem; white-space: nowrap;
         border: 1px solid var(--ink); }
.badge-not_found, .badge-not_met { background: var(--terra); border-color: var(--terra); color: var(--ink); }
.badge-undetermined { border-style: dashed; color: var(--muted); border-color: var(--muted); }

.evidence { font-size: .92rem; }
.evidence span { color: var(--muted); }
.refs { list-style: none; padding: 0; margin: .5rem 0 0; font-size: .92rem; }
.refs li { padding: .2rem 0; }
.transp { color: var(--muted); font-size: .88rem; }

.history { border-collapse: collapse; width: 100%; max-width: 30rem; }
.history th, .history td { text-align: left; padding: .45rem .75rem .45rem 0; border-bottom: 1px solid var(--line); }
.history th { font-weight: 500; }

.reply { border-top: 1px solid var(--line); margin-top: 3rem; }

/* ─── Pages de texte ────────────────────────────────────────────────────── */
.prose { max-width: 42rem; }
.prose h3 { font-size: 1.1rem; margin: 2rem 0 .5rem; }
.prose h4 { font-size: 1rem; font-weight: 500; margin: 0; }
.prose li { margin: .3rem 0; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.25rem; }
.facts dt { font-weight: 500; }
.facts dd { margin: 0; }
@media (max-width: 30rem) { .facts { grid-template-columns: 1fr; } .facts dd { margin-bottom: .5rem; } }

@media (max-width: 30rem) {
    h1 { font-size: 1.5rem; }
    .rate-value { font-size: 2.4rem; }
    .search { flex-direction: column; }
}
