/* ═══════════════════════════════════════════════════════════════════════
   Cours de français — Gouvieux

   Design note. The subject is French schoolwork, so the page is built on
   the object every French pupil knows: the cahier Seyès, its violet-blue
   ruling and rose margin line. The hero heading sits ON the ruling, like
   handwriting. That is the one bold move; everything else stays quiet.

   Paper is white, not cream — French exercise paper is white, and cream
   plus terracotta is the house style of every generated page this year.
   Colour comes from ink: bleu encre, the blue of a schoolroom pen.

   Type: Spectral (Production Type, Paris — a serif drawn for screens) for
   voice; Archivo for the interface. Both self-hosted: faster, and no
   visitor IP is handed to a font CDN on a site that registers children.
   ═══════════════════════════════════════════════════════════════════════ */

/* ------------------------------------------------------------- fonts */
@font-face { font-family: Spectral; src: url(/assets/fonts/spectral-400-normal.woff2) format('woff2');
             font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: Spectral; src: url(/assets/fonts/spectral-400-italic.woff2) format('woff2');
             font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: Spectral; src: url(/assets/fonts/spectral-500-normal.woff2) format('woff2');
             font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: Spectral; src: url(/assets/fonts/spectral-600-normal.woff2) format('woff2');
             font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: Archivo; src: url(/assets/fonts/archivo-var.woff2) format('woff2');
             font-weight: 100 900; font-style: normal; font-display: swap; }

/* ------------------------------------------------------------ tokens */
:root {
  /* paper & ink */
  --paper:      #fdfdfb;   /* exercise-book white */
  --wash:       #f4f6fb;   /* faintest blue tint */
  --card:       #ffffff;
  --ink:        #16224a;   /* bleu encre */
  --ink-2:      #4d5878;   /* softened ink, still AA on paper */
  --seyes:      #b9c5e8;   /* the ruling */
  --seyes-pale: #d5ddf1;
  --marge:      #cf7f92;   /* the margin line — decoration only */
  --marge-ink:  #ad4f68;   /* the same rose, darkened to pass AA as text */
  --marge-pale: #f0dae0;
  --line:       #e4e8f1;

  /* type */
  --voice: Spectral, ui-serif, Georgia, serif;
  --ui:    Archivo, ui-sans-serif, system-ui, -apple-system, sans-serif;

  /* rhythm */
  --pitch: 3.4rem;         /* ruling pitch — the hero h1 line-height IS this */
  --rule-y: -0.93rem;      /* shifts the rule onto the type baseline */
  --marge-x: 2.25rem;      /* where the rose margin line falls */
  --indent: 3.25rem;       /* text starts after the margin */
  --wrap:  60rem;
  --r:     4px;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.7 var(--voice);
  font-feature-settings: "kern", "liga";
  text-rendering: optimizeLegibility;
}

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }

/* ---------------------------------------------------------- typography */
h1, h2, h3 { font-weight: 600; letter-spacing: -0.015em; margin: 0 0 .5em; }
h1 { font-size: clamp(2.05rem, 5vw, 2.95rem); line-height: 1.14; }
h2 { font-size: clamp(1.3rem, 3vw, 1.55rem); line-height: 1.25; }
h3 { font-size: 1.05rem; }

p { margin: 0 0 1.1em; max-width: 68ch; }

a { color: var(--ink); text-decoration-color: var(--seyes);
    text-underline-offset: .18em; text-decoration-thickness: 1.5px; }
a:hover { text-decoration-color: var(--marge); }

strong { font-weight: 600; }

.eyebrow {
  font: 500 .78rem/1 var(--ui); text-transform: uppercase;
  letter-spacing: .13em; color: var(--ink-2);
}
.small { font: 400 .875rem/1.6 var(--ui); color: var(--ink-2); }
.small p { max-width: 68ch; }

/* ═══ THE SIGNATURE — cahier Seyès ═══════════════════════════════════
   Horizontal ruling at the heading's exact line-height, plus the rose
   vertical margin line. Only the hero earns the full treatment.        */
.cahier {
  position: relative;
  padding: var(--pitch) 0 calc(var(--pitch) * 1.05) var(--indent);
  background-image:
    /* rose margin line */
    linear-gradient(to right,
      transparent 0 var(--marge-x), var(--marge-pale) var(--marge-x) calc(var(--marge-x) + 1px),
      transparent calc(var(--marge-x) + 1px)),
    /* the ruling */
    repeating-linear-gradient(to bottom,
      transparent 0 calc(var(--pitch) - 1px),
      var(--seyes-pale) calc(var(--pitch) - 1px) var(--pitch));
  background-position: 0 0, 0 var(--rule-y);
}
.cahier h1 { line-height: var(--pitch); margin-bottom: 0; }

.accroche {
  font: 400 clamp(1.08rem, 2.4vw, 1.28rem)/1.6 var(--voice);
  color: var(--ink-2); margin: 1.4rem 0 0 var(--indent); max-width: 42ch;
}

/* ------------------------------------------------------------- header */
.site-header { border-bottom: 1px solid var(--line); background: var(--card); }
.header-inner {
  display: flex; flex-wrap: wrap; gap: .5rem 2rem;
  align-items: center; justify-content: space-between; padding-block: .95rem;
}
.brand {
  font: 600 1.02rem/1.2 var(--voice); color: var(--ink);
  text-decoration: none; letter-spacing: -.01em;
}
.brand span { display: block; font: 500 .76rem/1.4 var(--ui);
              text-transform: uppercase; letter-spacing: .14em; color: var(--marge-ink); }
.site-header nav ul { display: flex; gap: 1.6rem; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.site-header nav a {
  font: 500 .875rem/1 var(--ui); color: var(--ink-2);
  text-decoration: none; padding: .7rem 0; display: inline-block;
}
.site-header nav a:hover { color: var(--ink); }
.site-header nav a[aria-current="page"] {
  color: var(--ink); box-shadow: inset 0 -2px 0 var(--marge);
}

main { padding-block: 0 4.5rem; }

/* -------------------------------------------------------------- proof */
.proof {
  display: grid; gap: 0; margin: 2.75rem 0 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
@media (min-width: 44rem) { .proof { grid-template-columns: repeat(3, 1fr); } }
.proof > div { padding: 1.35rem 1.5rem 1.35rem 0; }
@media (min-width: 44rem) {
  .proof > div + div { border-left: 1px solid var(--line); padding-left: 1.5rem; }
}
@media (max-width: 43.99rem) { .proof > div + div { border-top: 1px solid var(--line); } }
.proof dt { font: 600 1.02rem/1.3 var(--voice); margin-bottom: .15rem; }
.proof dd { margin: 0; font: 400 .875rem/1.55 var(--ui); color: var(--ink-2); }

/* -------------------------------------------------------------- prose */
.prose { max-width: 34rem; }
.lead { font-size: 1.14rem; }

/* -------------------------------------------------------------- cards */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); padding: 1.6rem 1.75rem;
}

.stages { display: grid; gap: 1.25rem; margin-block: 2rem; }
@media (min-width: 46rem) { .stages { grid-template-columns: 1fr 1fr; } }

.stage { display: flex; flex-direction: column; }
.stage .num {
  font: 500 .78rem/1 var(--ui); letter-spacing: .13em; text-transform: uppercase;
  color: var(--marge-ink); display: block; margin-bottom: .5rem;
}
.stage h2 { margin-bottom: .45rem; }
.stage p { font-size: 1rem; }

.facts { margin: auto 0 0; padding-top: 1.1rem; border-top: 1px solid var(--seyes-pale); }
.facts div { display: flex; justify-content: space-between; gap: 1rem; padding: .34rem 0; }
.facts dt { font: 500 .78rem/1.5 var(--ui); text-transform: uppercase;
            letter-spacing: .08em; color: var(--ink-2); }
.facts dd { margin: 0; font: 500 .95rem/1.5 var(--ui); text-align: right; }
.facts dd.todo { color: var(--ink-2); font-style: italic; font-weight: 400;
                 font-family: var(--voice); }

/* ------------------------------------------------------------ buttons */
.cta-row { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 2rem; }
.btn {
  display: inline-flex; align-items: center; min-height: 44px;
  padding: .7rem 1.5rem; border-radius: var(--r); cursor: pointer;
  font: 500 .935rem/1 var(--ui); text-decoration: none;
  background: var(--ink); color: var(--paper); border: 1px solid var(--ink);
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}
.btn:hover { background: #0e1836; border-color: #0e1836; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--seyes); }
.btn-ghost:hover { background: var(--wash); border-color: var(--ink); color: var(--ink); }
.btn-small { min-height: 38px; padding: .4rem 1rem; font-size: .85rem; }

/* -------------------------------------------------------------- forms */
.form { max-width: 34rem; }
.form fieldset { border: 0; padding: 0; margin: 0 0 1.5rem; }
.form fieldset + fieldset { padding-top: 1.4rem; border-top: 1px solid var(--line); }
legend {
  font: 500 .78rem/1 var(--ui); text-transform: uppercase; letter-spacing: .13em;
  color: var(--marge-ink); padding: 0 0 .35rem;
}

label { display: block; margin-block: .95rem; font: 500 .82rem/1.4 var(--ui); color: var(--ink-2); }

input[type=text], input[type=email], input[type=tel], input[type=number],
input[type=password], select, textarea {
  display: block; width: 100%; margin-top: .35rem; min-height: 44px;
  padding: .62rem .75rem; font: 400 1rem/1.5 var(--voice); color: var(--ink);
  background: var(--card); border: 1px solid var(--seyes);
  border-radius: var(--r); transition: border-color 160ms ease, box-shadow 160ms ease;
}
input[type=number] { max-width: 8rem; }
textarea { resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: var(--ink-2); }
input:focus, select:focus, textarea:focus {
  outline: 0; border-color: var(--ink); box-shadow: 0 0 0 3px var(--seyes-pale);
}
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.choices { display: grid; gap: .6rem; }
label.radio {
  display: flex; align-items: flex-start; gap: .7rem; margin: 0; min-height: 44px;
  padding: .85rem 1rem; border: 1px solid var(--line); border-radius: var(--r);
  cursor: pointer; font: 400 1rem/1.5 var(--voice); color: var(--ink);
  transition: border-color 160ms ease, background 160ms ease;
}
label.radio:hover { border-color: var(--seyes); background: var(--wash); }
label.radio:has(input:checked) { border-color: var(--ink); background: var(--wash); }
label.radio input { width: auto; min-height: 0; margin: .35rem 0 0; accent-color: var(--ink); }

.hp { position: absolute; left: -9999px; }
.privacy { margin-top: 1.75rem; padding-top: 1.1rem; border-top: 1px solid var(--line); }

/* ------------------------------------------------------------ notices */
.alert, .notice {
  border-radius: var(--r); padding: 1rem 1.25rem; margin-block: 1.5rem;
  font: 400 .95rem/1.6 var(--ui);
}
.alert  { background: #fdf2f4; border: 1px solid var(--marge-pale); color: #8e2540; }
.notice { background: var(--wash); border: 1px solid var(--seyes); }
.alert ul { margin: .5rem 0 0; padding-left: 1.15rem; }
.warn { color: #8e2540; }

/* ------------------------------------------------------------- footer */
.site-footer { border-top: 1px solid var(--line); background: var(--card); padding-block: 2rem; }
.site-footer p { margin: .15rem 0; font: 400 .875rem/1.6 var(--ui); color: var(--ink-2); max-width: none; }
.site-footer a { color: var(--ink-2); display: inline-block; padding-block: .35rem; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 10; background: var(--card);
              padding: .7rem 1.1rem; border: 1px solid var(--ink); border-radius: var(--r); }

/* -------------------------------------------------------------- admin */
.admin { background: var(--wash); }
.admin .wrap { padding-block: 2rem 4rem; }
.admin-bar { display: flex; flex-wrap: wrap; gap: .6rem 1.6rem; align-items: baseline;
             justify-content: space-between; border-bottom: 1px solid var(--seyes);
             padding-bottom: .9rem; margin-bottom: 1.75rem; }
.admin-bar h1 { font-size: 1.35rem; margin: 0; }
.admin-bar nav { display: flex; gap: 1.4rem; flex-wrap: wrap; }
.admin-bar nav a { font: 500 .875rem/1 var(--ui); color: var(--ink-2); text-decoration: none; padding: .5rem 0; }
.admin-bar nav a.on { color: var(--ink); box-shadow: inset 0 -2px 0 var(--marge); }
.admin .card { margin-bottom: 1.25rem; }
.admin .card h2 { font-size: 1.1rem; padding-bottom: .6rem; border-bottom: 1px solid var(--line); }
.login { max-width: 21rem; }
form.inline { display: flex; gap: .5rem; align-items: center; margin-top: 1.1rem; }
form.inline select { width: auto; margin: 0; }
.inscription h2 { font-size: 1.05rem; }
.inscription .facts { border-top: 0; padding-top: .5rem; }
.inscription .facts div { border-bottom: 1px solid var(--line); }

/* ------------------------------------------------------------- mobile */
@media (max-width: 40rem) {
  :root { --marge-x: 1rem; --indent: 1.75rem; --pitch: 2.9rem; --rule-y: -0.8rem; }
  .accroche { margin-left: var(--indent); }
}

/* ---------------------------------------------------------- a11y prefs */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
