/*
  Projet  : InfluenceursQC.com
  Fichier : css/style.css
  Author  : Simon-Pierre Boucher — InfluenceursQC.com
  Contact : contact@spboucher.ai
  Date    : 2026-07-31
  Rôle    : Feuille de style principale — design mobile-first, identité
            visuelle québécoise (bleus, accents fleurdelisés subtils)
*/

:root {
  color-scheme: light;
  /* Identité Québec */
  --bleu-qc: #095797;
  --bleu-profond: #0d366b;
  --bleu-royal: #1c5cab;
  /* Palette de données validée (dataviz) */
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  --series-5: #e87ba4;
  --series-6: #008300;
  --series-7: #4a3aa7;
  --series-8: #e34948;
  /* Chrome */
  --surface-1: #fcfcfb;
  --page: #f4f6f9;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --muted: #898781;
  --grid: #e1e0d9;
  --baseline: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);
  --radius: 12px;
  --shadow: 0 1px 3px rgba(13, 54, 107, 0.08), 0 4px 16px rgba(13, 54, 107, 0.06);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--page);
  color: var(--text-primary);
  line-height: 1.55;
}

a { color: var(--bleu-qc); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, th button:focus-visible {
  outline: 3px solid var(--bleu-royal);
  outline-offset: 2px;
}

.conteneur { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

/* ---------- En-tête ---------- */
.entete {
  background: linear-gradient(135deg, var(--bleu-profond), var(--bleu-qc));
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow);
}
.entete .conteneur {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  flex-wrap: wrap;
  padding-top: 6px;
  padding-bottom: 6px;
}
.logo {
  font-weight: 800;
  font-size: 1.15rem;
  color: #fff;
  text-decoration: none;
  letter-spacing: 0.2px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo .lys { font-size: 1.05rem; opacity: 0.9; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a {
  color: #eaf1fb;
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 600;
}
.nav a:hover, .nav a:focus-visible { background: rgba(255, 255, 255, 0.14); color: #fff; }

/* ---------- Héros ---------- */
.heros {
  background:
    radial-gradient(1100px 420px at 85% -10%, rgba(255, 255, 255, 0.14), transparent 60%),
    linear-gradient(160deg, var(--bleu-profond) 0%, var(--bleu-qc) 62%, var(--bleu-royal) 100%);
  color: #fff;
  padding: 52px 0 100px;
  position: relative;
  overflow: hidden;
}
.heros::after {
  content: "⚜";
  position: absolute;
  right: -30px;
  bottom: -70px;
  font-size: 300px;
  opacity: 0.05;
  transform: rotate(-12deg);
  pointer-events: none;
}
.heros h1 { font-size: clamp(1.7rem, 4.5vw, 2.7rem); margin: 0 0 10px; line-height: 1.15; }
.heros p.sous-titre { max-width: 640px; font-size: 1.05rem; color: #dce8f7; margin: 0 0 26px; }
.compteurs { display: flex; gap: 28px; flex-wrap: wrap; margin-bottom: 34px; }
.compteur .valeur { font-size: 2rem; font-weight: 800; display: block; }
.compteur .etiquette { font-size: 0.85rem; color: #c9dcf3; }

.podium { display: grid; grid-template-columns: 1fr; gap: 14px; }
.carte-podium {
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  color: inherit;
  text-align: left;
  font: inherit;
  width: 100%;
  transition: background 0.15s ease;
}
.carte-podium:hover, .carte-podium:focus-visible { background: rgba(255, 255, 255, 0.18); }
.medaille { font-size: 1.6rem; }
.carte-podium .infos { flex: 1; min-width: 0; }
.carte-podium .nom { font-weight: 800; font-size: 1.05rem; }
.carte-podium .categorie { font-size: 0.82rem; color: #c9dcf3; }
.carte-podium .score { font-size: 1.5rem; font-weight: 800; white-space: nowrap; }
.carte-podium .score small { font-size: 0.75rem; font-weight: 600; color: #c9dcf3; display: block; text-align: right; }

/* ---------- Sections ---------- */
.section { padding: 46px 0; }
.section > .conteneur > h2 { font-size: 1.55rem; margin: 0 0 6px; color: var(--bleu-profond); }
.section .intro-section { color: var(--text-secondary); margin: 0 0 22px; max-width: 760px; }
.section-blanche { background: #fff; }

/* ---------- Filtres ---------- */
.filtres {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 16px;
}
.filtres input[type="search"], .filtres select {
  padding: 9px 12px;
  border: 1px solid var(--baseline);
  border-radius: 8px;
  font-size: 0.95rem;
  background: #fff;
  color: var(--text-primary);
  min-width: 0;
}
.filtres input[type="search"] { flex: 1 1 220px; }
.pastilles { display: flex; gap: 8px; flex-wrap: wrap; }
.pastille {
  border: 1px solid var(--baseline);
  background: #fff;
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.pastille[aria-pressed="true"] {
  background: var(--bleu-qc);
  border-color: var(--bleu-qc);
  color: #fff;
}

/* ---------- Tableau du palmarès ---------- */
.enveloppe-tableau {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow-x: auto;
}
table.palmares { width: 100%; border-collapse: collapse; min-width: 760px; }
.palmares th, .palmares td { padding: 11px 12px; text-align: left; }
.palmares thead th {
  position: sticky;
  top: 0;
  background: var(--bleu-profond);
  color: #fff;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
}
.palmares thead th button {
  all: unset;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.palmares thead th button:hover { text-decoration: underline; }
.palmares tbody tr { border-top: 1px solid var(--grid); cursor: pointer; }
.palmares tbody tr:hover { background: #eef4fc; }
.palmares td.numerique, .palmares th.numerique { text-align: right; font-variant-numeric: tabular-nums; }
.palmares .rang { font-weight: 800; color: var(--bleu-qc); width: 46px; }
.palmares .nom-cell { font-weight: 700; }
.palmares .cat-cell { white-space: nowrap; }
.point-cat {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 7px;
  vertical-align: baseline;
}
.badge-ascension {
  font-size: 0.72rem;
  background: #eaf4ea;
  color: #006300;
  border: 1px solid #bfe0bf;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 700;
  white-space: nowrap;
}
.spq-cell { font-weight: 800; color: var(--bleu-profond); }
.barre-spq {
  height: 5px;
  background: var(--grid);
  border-radius: 4px;
  margin-top: 4px;
  min-width: 70px;
  overflow: hidden;
}
.barre-spq > span { display: block; height: 100%; background: var(--series-1); border-radius: 4px; }
.note-resultats { color: var(--muted); font-size: 0.85rem; margin-top: 10px; }

/* ---------- Graphiques ---------- */
.grille-graphiques { display: grid; grid-template-columns: 1fr; gap: 22px; }
.carte-graphique {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.carte-graphique h3 { margin: 0 0 4px; font-size: 1.05rem; color: var(--bleu-profond); }
.carte-graphique .note { color: var(--text-secondary); font-size: 0.85rem; margin: 0 0 12px; }
.zone-canvas { position: relative; height: 320px; }
.zone-canvas.haute { height: 560px; }

/* Statistiques par catégorie */
.tableau-stats { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.tableau-stats th, .tableau-stats td { padding: 8px 10px; border-top: 1px solid var(--grid); text-align: right; font-variant-numeric: tabular-nums; }
.tableau-stats th:first-child, .tableau-stats td:first-child { text-align: left; }
.tableau-stats thead th { border-top: none; color: var(--text-secondary); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.4px; }

.tuiles-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 22px; }
.tuile {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}
.tuile .valeur { font-size: 1.65rem; font-weight: 800; color: var(--bleu-profond); }
.tuile .etiquette { font-size: 0.82rem; color: var(--text-secondary); margin-top: 2px; }

/* ---------- Modal fiche ---------- */
dialog.fiche {
  border: none;
  border-radius: var(--radius);
  padding: 0;
  max-width: 660px;
  width: calc(100vw - 32px);
  box-shadow: 0 24px 60px rgba(13, 54, 107, 0.3);
}
dialog.fiche::backdrop { background: rgba(13, 54, 107, 0.45); }
.fiche-entete {
  background: linear-gradient(135deg, var(--bleu-profond), var(--bleu-qc));
  color: #fff;
  padding: 20px 22px;
  display: flex;
  gap: 16px;
  align-items: center;
}
.avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  border: 2px solid rgba(255, 255, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  flex-shrink: 0;
}
.fiche-entete h3 { margin: 0; font-size: 1.3rem; }
.fiche-entete .sous { color: #c9dcf3; font-size: 0.88rem; margin-top: 2px; }
.fiche-corps { padding: 20px 22px; }
.fiche-corps .description { color: var(--text-secondary); font-size: 0.95rem; margin: 0 0 16px; }
.fiche-grille { display: grid; grid-template-columns: 1fr; gap: 18px; }
.zone-radar { position: relative; height: 260px; }
.liste-plateformes { list-style: none; padding: 0; margin: 0; display: grid; gap: 7px; }
.liste-plateformes li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.92rem;
  border-bottom: 1px dashed var(--grid);
  padding-bottom: 6px;
}
.liste-plateformes .pf { font-weight: 600; }
.liste-plateformes .val { font-variant-numeric: tabular-nums; }
.liste-plateformes .est { color: var(--muted); font-size: 0.78rem; }
.fiche-pied {
  padding: 14px 22px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.fiche-pied .date-donnees { color: var(--muted); font-size: 0.8rem; }
.bouton-fermer {
  background: var(--bleu-qc);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 18px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
}
.bouton-fermer:hover { background: var(--bleu-profond); }

/* ---------- Méthodologie / À propos ---------- */
.prose { max-width: 800px; }
.prose h2 { color: var(--bleu-profond); margin-top: 34px; }
.prose h3 { color: var(--bleu-qc); }
.prose table { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
.prose th, .prose td { border: 1px solid var(--grid); padding: 9px 11px; text-align: left; }
.prose thead th { background: #eef4fc; color: var(--bleu-profond); }
.prose code {
  background: #eef2f7;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.88em;
}
.formule {
  background: var(--bleu-profond);
  color: #fff;
  border-radius: var(--radius);
  padding: 16px 18px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.95rem;
  overflow-x: auto;
}

/* ---------- Pied de page ---------- */
.pied {
  background: var(--bleu-profond);
  color: #c9dcf3;
  padding: 34px 0;
  margin-top: 40px;
  font-size: 0.9rem;
}
.pied a { color: #fff; }
.pied .lys { opacity: 0.7; }
.pied .conteneur { display: grid; gap: 8px; }

/* ---------- Utilitaires ---------- */
.visuellement-cache {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.chargement { text-align: center; color: var(--muted); padding: 40px 0; }

/* ---------- Responsive ---------- */
@media (min-width: 640px) {
  .podium { grid-template-columns: repeat(3, 1fr); }
  .fiche-grille { grid-template-columns: 1fr 1fr; align-items: start; }
}
@media (min-width: 900px) {
  .grille-graphiques { grid-template-columns: 1fr 1fr; }
  .carte-graphique.pleine-largeur { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
