/* ============================================================
   Design tokens — charte thbl (agents/THEME.md §4), copiés tels quels
   ============================================================ */
:root {
  /* --- clair (valeurs par défaut) --- */
  --bg: #ffffff;
  --text: #17151c;
  --text-muted: #6b7280;
  --text-faint: #9ca3af;
  --border: #ececef;
  --accent-strong: #7c3aed; /* fond plein (boutons actifs, badges) */
  --accent-text: #7c3aed;   /* texte/icônes posés sur --bg */
  --focus-ring: #8c52ff;    /* anneau de focus */
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131117;
    --text: #f1eef7;
    --text-muted: #a39cae;
    --text-faint: #6f6879;
    --border: #2b2733;
    --accent-text: #b794ff;
    --focus-ring: #b794ff;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #131117;
  --text: #f1eef7;
  --text-muted: #a39cae;
  --text-faint: #6f6879;
  --border: #2b2733;
  --accent-text: #b794ff;
  --focus-ring: #b794ff;
  color-scheme: dark;
}

/* ============================================================
   Reset minimal
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  letter-spacing: 0;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

/* ============================================================
   Skip link
   ============================================================ */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--accent-strong);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 0 0 8px 0;
  text-decoration: none;
  font-weight: 600;
}
.skip-link:focus {
  left: 0;
}

/* ============================================================
   Focus visible — partout
   ============================================================ */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* ============================================================
   Layout général
   ============================================================ */
.page {
  max-width: 46rem;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

/* ============================================================
   En-tête
   ============================================================ */
.site-header {
  padding: 2rem 0 1.5rem;
}

.site-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text);
}

.brand img {
  height: 1.5rem;
  width: auto;
}

.brand-title {
  font-size: 0.95rem;
  color: var(--text-muted);
  border-left: 1px solid var(--border);
  padding-left: 0.75rem;
  margin-left: 0.1rem;
}

/* ============================================================
   Navigation principale (catégories)
   ============================================================ */
.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 1.25rem;
}

.main-nav a {
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.main-nav a:hover,
.main-nav a:focus-visible {
  color: var(--text);
  background: var(--border);
}

.main-nav a[aria-current="page"] {
  color: var(--accent-text);
  font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
  .main-nav a { transition: none; }
}

/* ============================================================
   Fil d'ariane simplifié (retour au sommaire)
   ============================================================ */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  margin-top: 1.5rem;
}

.back-link:hover,
.back-link:focus-visible {
  color: var(--accent-text);
}

/* ============================================================
   Switch pill — clair/sombre (charte §7)
   ============================================================ */
.theme-switch {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px;
  gap: 2px;
}

.theme-switch button {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.85rem;
  line-height: 1;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.theme-switch button:hover {
  color: var(--text);
}

.theme-switch button[aria-pressed="true"] {
  background: var(--accent-strong);
  color: #fff;
}

@media (prefers-reduced-motion: reduce) {
  .theme-switch button { transition: none; }
}

/* ============================================================
   Intro
   ============================================================ */
.intro h1 {
  font-size: 1.75rem;
  margin: 0.5rem 0 0.75rem;
  line-height: 1.25;
}

.intro p {
  color: var(--text-muted);
  margin: 0 0 0.75rem;
}

.updated {
  font-size: 0.85rem;
  color: var(--text-faint);
}

/* ============================================================
   Table des matières
   ============================================================ */
.toc {
  margin: 2rem 0 2.5rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.toc h2 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0;
  color: var(--text-faint);
  margin: 0 0 0.75rem;
  font-weight: 600;
}

.toc ol {
  margin: 0;
  padding-left: 1.25rem;
  columns: 1;
}

.toc li {
  margin-bottom: 0.4rem;
}

.toc a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 2px;
}

.toc a:hover,
.toc a:focus-visible {
  color: var(--accent-text);
  text-decoration-color: currentColor;
}

/* ============================================================
   Liste des catégories (page d'accueil)
   ============================================================ */
.hub-list {
  list-style: none;
  margin: 2rem 0 2.5rem;
  padding: 0;
  border-top: 1px solid var(--border);
}

.hub-list li {
  border-bottom: 1px solid var(--border);
}

.hub-list a {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 0.25rem;
  text-decoration: none;
  color: inherit;
}

.hub-list-body {
  flex: 1;
}

.hub-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
  color: var(--text);
  transition: color 0.15s ease;
}

.hub-list a:hover .hub-title,
.hub-list a:focus-visible .hub-title {
  color: var(--accent-text);
}

.hub-desc {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin: 0;
}

.hub-arrow {
  color: var(--text-faint);
  font-size: 1.1rem;
  flex-shrink: 0;
}

@media (prefers-reduced-motion: reduce) {
  .hub-title { transition: none; }
}

/* ============================================================
   Tableaux (ex. liste des cookies)
   ============================================================ */
.table-wrap {
  overflow-x: auto;
  margin: 0 0 1.25rem;
  border: 1px solid var(--border);
  border-radius: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

th, td {
  text-align: left;
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

thead th {
  color: var(--text-faint);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  white-space: nowrap;
}

tbody tr:last-child td {
  border-bottom: none;
}

/* ============================================================
   Sections
   ============================================================ */
.legal-section {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  scroll-margin-top: 1.5rem;
}

.legal-section:first-of-type {
  border-top: none;
}

.legal-section h2 {
  font-size: 1.15rem;
  margin: 0 0 1rem;
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}

.legal-section h2 .num {
  color: var(--accent-text);
  font-variant-numeric: tabular-nums;
  font-size: 0.9rem;
}

.legal-section h3 {
  font-size: 0.95rem;
  margin: 1.25rem 0 0.5rem;
  color: var(--text);
}

.legal-section p {
  margin: 0 0 0.9rem;
}

.legal-section ul {
  margin: 0 0 0.9rem;
  padding-left: 1.25rem;
}

.legal-section li {
  margin-bottom: 0.4rem;
}

.legal-section a {
  color: var(--accent-text);
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 2px;
  transition: color 0.15s ease;
}

.legal-section a:hover,
.legal-section a:focus-visible {
  text-decoration-color: currentColor;
}

.note-box {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.host-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.25rem;
}

.host-card dl {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 1rem;
}

.host-card dt {
  color: var(--text-faint);
  font-size: 0.85rem;
}

.host-card dd {
  margin: 0;
}

@media (prefers-reduced-motion: reduce) {
  .legal-section a { transition: none; }
}

/* ============================================================
   Footer standard (charte §7)
   ============================================================ */
.site-footer {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--text-faint);
}

.footer-link {
  color: var(--text-faint);
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 2px;
  transition: color 0.15s ease;
}

.footer-link:hover,
.footer-link:focus-visible {
  color: var(--accent-text);
  text-decoration-color: currentColor;
}

@media (max-width: 30rem) {
  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .footer-link { transition: none; }
}
