/* ---------- Thème ----------
   La couleur dominante se règle dans links.json ("color").
   --brand ci-dessous n'est que la valeur par défaut. */
:root {
  color-scheme: light dark;
  --brand: #c8102e;
  --bg: #f7f7f5;
  --surface: #ffffff;
  --text: #1c1e21;
  --muted: #5f6670;
  --border: #e3e3df;
  --accent: var(--brand);
  --accent-soft: color-mix(in srgb, var(--accent) 12%, var(--surface));
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 12px rgba(0,0,0,.04);
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16181c;
    --surface: #1f2228;
    --text: #e8e9eb;
    --muted: #9aa1ab;
    --border: #2e323a;
    /* en sombre, la couleur est éclaircie automatiquement pour rester lisible */
    --accent: color-mix(in oklab, var(--brand) 65%, white);
    --accent-soft: color-mix(in srgb, var(--brand) 22%, var(--surface));
    --shadow: none;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
.wrap { width: 100%; max-width: 960px; margin: 0 auto; padding: 0 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- En-tête ---------- */
.site-header { padding: 40px 0 32px; text-align: center; border-top: 4px solid var(--accent); }
.brand { display: inline-block; }
.brand img { display: block; max-height: 96px; max-width: min(320px, 70vw); width: auto; height: auto; margin: 0 auto; }

/* ---------- Sections et cartes ---------- */
section { margin-bottom: 32px; }
section h2 {
  font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); margin: 0 0 12px;
}
.grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

.card {
  display: flex; gap: 14px; align-items: center;
  height: 100%;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: inherit; text-decoration: none;
  transition: border-color .15s, transform .15s;
}
.card:hover { border-color: var(--accent); transform: translateY(-1px); }
.card:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.icon {
  flex: none; width: 40px; height: 40px; border-radius: 8px;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
  font-size: .7rem; font-weight: 700; letter-spacing: .03em;
}
.card-body { min-width: 0; }
.card-title { font-weight: 600; margin: 0; overflow-wrap: anywhere; }
.card-desc { margin: 2px 0 0; color: var(--muted); font-size: .92rem; }
.card-meta { margin: 6px 0 0; color: var(--muted); font-size: .8rem; }

.notice { text-align: center; color: var(--muted); padding: 32px 0; }

/* ---------- Pied de page ---------- */
.site-footer { padding: 24px 0 32px; text-align: center; color: var(--muted); font-size: .85rem; }
.site-footer:empty { display: none; }

@media (prefers-reduced-motion: reduce) { .card { transition: none; } .card:hover { transform: none; } }
