/* Comparateur HDS — CSS sobre, lisible, mobile-first */
:root {
  --color-bg: #ffffff;
  --color-fg: #0f172a;
  /* Tokens legacy non thémés → aliasés sur les tokens thémés de
     style.css (light + dark définis par spécificité). Sans cet alias,
     --color-muted/-accent-soft/-bg-alt restaient clairs en mode sombre
     (note méthodologique, bandeau alphabétique, zebra des tables, etc.
     restaient sur fond blanc/illisibles). Fallback = ancienne valeur
     light si le token thémé venait à manquer. */
  --color-muted: var(--color-fg-muted, #51596A);
  --color-accent: #1e40af;
  --color-accent-soft: var(--color-info-bg, #dbeafe);
  --color-border: #e2e8f0;
  --color-bg-alt: var(--color-bg-secondary, #f8fafc);
  --color-ok: #15803d;
  --color-warn: #b45309;
  --color-danger: #7f1d1d;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  --container: 1100px;
}

* { box-sizing: border-box; }

html { font-size: 16px; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-fg);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1rem;
}

a { color: var(--color-accent); }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { font-weight: 700; line-height: 1.25; }
h1 { font-size: 2rem; margin: 2rem 0 1rem; }
h2 { font-size: 1.5rem; margin: 2rem 0 0.75rem; }
h3 { font-size: 1.2rem; margin: 1.5rem 0 0.5rem; }

p { margin: 0 0 1rem; }

/* Header */
.site-header {
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg);
  padding: 1rem 0;
}
.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
}
.brand {
  text-decoration: none;
  color: var(--color-fg);
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.brand strong { font-size: 1rem; }
.brand span { font-size: 0.8rem; color: var(--color-muted); }
/* display géré par style.css (desktop: flex ; mobile @max-767: none +
   .is-open). NE PAS redéclarer `display` ici : legacy étant chargé
   APRÈS style.css, un `display:flex` non-media écrasait le display:none
   mobile (burger inopérant). gap/font-size conservés (cosmétique). */
.site-header nav { gap: 1.5rem; font-size: 0.9rem; }

/* Footer */
.site-footer {
  /* Tokens thémés (override dark défini dans style.css) — était
     var(--color-bg-alt)/--color-muted, non thémés → footer restait
     blanc en mode sombre (texte illisible). */
  border-top: 1px solid var(--color-border-strong);
  background: var(--color-bg-secondary);
  padding: 2rem 0;
  margin-top: 4rem;
  color: var(--color-fg-secondary);
  font-size: 0.85rem;
}
.site-footer .legal { font-size: 0.75rem; margin-top: 0.5rem; }

/* Main */
main { padding: 2rem 0 3rem; }

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  margin: 1.5rem 0;
}
table th, table td {
  border: 1px solid var(--color-border);
  padding: 0.5rem 0.75rem;
  text-align: left;
  vertical-align: top;
}
table th {
  background: var(--color-bg-alt);
  font-weight: 600;
}
table tr:nth-child(even) { background: var(--color-bg-alt); }

/* Status badges */
.status { display: inline-block; padding: 0.125rem 0.5rem; border-radius: 4px; font-size: 0.8rem; font-weight: 500; }
.status-yes { background: #dcfce7; color: var(--color-ok); }
.status-no { background: #fef2f2; color: var(--color-danger); }
.status-partial { background: #fef3c7; color: var(--color-warn); }
.status-unknown { background: var(--color-bg-alt); color: var(--color-muted); }
.status-neutral { background: #e0f2fe; color: #075985; }
.status-warn { background: #fef3c7; color: #92400e; border: 1px solid #fbbf24; }

/* Filters / cards */
.host-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.host-card {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1rem;
  background: var(--color-bg);
}
.host-card h3 { margin-top: 0; font-size: 1.1rem; }
.host-card .meta { color: var(--color-muted); font-size: 0.8rem; margin-bottom: 0.5rem; }
.host-card .badges { display: flex; flex-wrap: wrap; gap: 0.25rem; margin: 0.5rem 0; }
.host-card .actions { margin-top: 0.75rem; }
.host-card .actions a { font-size: 0.85rem; color: var(--color-accent); }
.host-card h3 a { color: var(--color-fg); }
.host-card .meta a { color: var(--color-fg); }
.letters-index a { color: var(--color-fg); }
.host-card.host-stub { background: var(--color-bg-alt); }
.host-card.host-stub h3 a { color: var(--color-fg); }
.host-card.host-stub .meta { font-style: italic; color: var(--color-muted); }

/* Profile pages */
.profile-meta {
  background: var(--color-bg-alt);
  border-left: 4px solid var(--color-accent);
  padding: 1rem;
  margin: 1.5rem 0;
}
.profile-meta dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.25rem 1rem; margin: 0; }
.profile-meta dt { font-weight: 600; color: var(--color-muted); }
.profile-meta dd { margin: 0; }

/* Criteria table */
.criteria-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  margin: 1rem 0;
}
.criterion {
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 0.75rem;
}
.criterion-header { display: flex; justify-content: space-between; align-items: center; }
.criterion-label { font-weight: 500; }
.criterion-status { font-size: 0.8rem; }
.criterion-source { font-size: 0.8rem; color: var(--color-muted); margin-top: 0.25rem; }
.criterion-verbatim {
  font-size: 0.8rem;
  font-style: italic;
  background: var(--color-bg-alt);
  padding: 0.5rem;
  border-radius: 4px;
  margin-top: 0.5rem;
}

/* Cross table compact */
.cross-table {
  overflow-x: auto;
}
.cross-table table { font-size: 0.75rem; }
.cross-table th, .cross-table td { padding: 0.25rem 0.5rem; text-align: center; }
.cross-table th:first-child, .cross-table td:first-child { text-align: left; min-width: 200px; }

/* Editor transparency note */
.editor-note {
  background: var(--color-accent-soft);
  border: 1px solid var(--color-accent);
  border-radius: 4px;
  padding: 1rem;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}

/* Editorial content (rendered from markdown) */
.editorial-content {
  margin: 1.5rem 0;
  padding: 1.5rem;
  background: var(--color-bg-secondary); /* thémé : était #fafafa (clair en dark) */
  border-left: 4px solid var(--color-accent);
  border-radius: 0 4px 4px 0;
}
.editorial-content h1 { font-size: 1.5rem; margin-top: 0; }
.editorial-content h2 { font-size: 1.2rem; margin-top: 1.5rem; }
.editorial-content h3 { font-size: 1.05rem; margin-top: 1rem; }
.editorial-content table { font-size: 0.85rem; }
.editorial-content blockquote {
  border-left: 3px solid var(--color-warn);
  background: var(--color-warning-bg, #fef3c7); /* thémé : était #fef3c7 (clair en dark) */
  padding: 0.5rem 1rem;
  margin: 1rem 0;
  border-radius: 0 4px 4px 0;
}

/* Mobile */
@media (max-width: 640px) {
  .site-header .container { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .site-header nav { flex-wrap: wrap; gap: 0.75rem; }
  h1 { font-size: 1.6rem; }
  table { font-size: 0.8rem; }
  table th, table td { padding: 0.4rem; }
}

/* Print */
@media print {
  .site-header nav, .site-footer { display: none; }
  body { font-size: 11pt; }
  a { color: var(--color-fg); text-decoration: underline; }
}
