/* words.css — pages de listes de mots (/mots/).
   S'appuie sur styles.css (variables de thème) et blog.css (article, CTA).
   Ne redéfinit que ce qui est propre à ces pages. */

/* Le lien du logo hérite sinon du style de lien par défaut (souligné, coloré) —
   styles.css ne cible que .topbar-title, pas le <a> à l'intérieur. */
.topbar-title a { color: inherit; text-decoration: none; }

.wl-play-top {
  padding: 0.45rem 0.95rem;
  border-radius: 8px;
  background: var(--accent, #6c5ce7);
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
  white-space: nowrap;
}
.wl-play-top:hover { filter: brightness(1.1); }

.wl-breadcrumb {
  max-width: 760px;
  margin: 1.5rem auto 0;
  padding: 0 1.2rem;
  font-size: 0.8rem;
  opacity: 0.7;
}
.wl-breadcrumb a { color: inherit; }
.wl-breadcrumb span { margin: 0 0.35rem; }

.wl-article {
  max-width: 760px;
  margin: 0 auto;
  padding: 1.2rem 1.2rem 3rem;
}

.wl-title {
  font-family: "Russo One", system-ui, sans-serif;
  font-size: clamp(1.5rem, 4.5vw, 2.1rem);
  line-height: 1.2;
  margin: 0.8rem 0 1rem;
}

.wl-answer {
  font-size: 1.05rem;
  line-height: 1.6;
  padding: 0.9rem 1.1rem;
  border-left: 3px solid var(--accent, #6c5ce7);
  background: rgba(108, 92, 231, 0.08);
  border-radius: 0 8px 8px 0;
  margin-bottom: 1.8rem;
}

/* ── Bandeau de stats ─────────────────────────────────────────────── */

.wl-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.6rem;
  margin-bottom: 2rem;
}
.wl-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.8rem 0.4rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  text-align: center;
}
.wl-stat-val {
  font-family: "JetBrains Mono", monospace;
  font-size: clamp(0.95rem, 3vw, 1.3rem);
  font-weight: 700;
  color: var(--accent, #6c5ce7);
  word-break: break-all;
}
.wl-stat-lbl { font-size: 0.68rem; opacity: 0.65; text-transform: uppercase; letter-spacing: 0.04em; }

/* ── Liste de mots ────────────────────────────────────────────────── */

.wl-words {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 0.4rem;
  padding: 0;
  margin: 0 0 2rem;
}
.wl-words li { margin: 0; }
.wl-word {
  display: block;
  padding: 0.5rem 0.3rem;
  text-align: center;
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.03);
}

/* ── Tableau de fréquences ────────────────────────────────────────── */

.wl-freq { width: 100%; border-collapse: collapse; margin-bottom: 2rem; font-size: 0.9rem; }
.wl-freq th, .wl-freq td { padding: 0.55rem 0.6rem; text-align: left; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.wl-freq th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; opacity: 0.65; }
.wl-freq td:last-child { display: flex; align-items: center; gap: 0.5rem; }
.wl-letter { font-family: "JetBrains Mono", monospace; font-weight: 700; color: var(--accent, #6c5ce7); }
.wl-bar {
  flex: 1;
  height: 7px;
  min-width: 40px;
  border-radius: 4px;
  background: linear-gradient(
    to right,
    var(--accent, #6c5ce7) var(--pct),
    rgba(255, 255, 255, 0.09) var(--pct)
  );
}
.wl-pct { font-size: 0.78rem; opacity: 0.7; min-width: 34px; text-align: right; }

/* ── FAQ ──────────────────────────────────────────────────────────── */

.wl-faq { margin-bottom: 2rem; }
.wl-faq-item { padding: 0.9rem 0; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.wl-faq-item h3 { font-size: 0.98rem; margin: 0 0 0.35rem; }
.wl-faq-item p { margin: 0; opacity: 0.85; line-height: 1.55; }

/* ── Listes voisines ──────────────────────────────────────────────── */

.wl-related { padding-left: 1.1rem; margin-bottom: 2rem; line-height: 1.9; }

/* ── Hub ──────────────────────────────────────────────────────────── */

.wl-hub-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 0.5rem;
  padding: 0;
  margin: 0 0 2.2rem;
}
.wl-hub-grid a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.4rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
}
.wl-hub-grid a:hover { border-color: var(--accent, #6c5ce7); }
.wl-hub-key { font-family: "JetBrains Mono", monospace; font-weight: 700; letter-spacing: 0.06em; }
.wl-hub-n { font-size: 0.72rem; opacity: 0.6; white-space: nowrap; }

/* Fonds semi-transparents clairs : sans override, le texte passe en blanc
   sur blanc en thème clair (cf. .claude/rules/conventions.md). */
[data-theme="light"] .wl-stat,
[data-theme="light"] .wl-word,
[data-theme="light"] .wl-hub-grid a { border-color: rgba(0, 0, 0, 0.14); }
[data-theme="light"] .wl-word { background: rgba(0, 0, 0, 0.03); }
[data-theme="light"] .wl-freq th,
[data-theme="light"] .wl-freq td { border-bottom-color: rgba(0, 0, 0, 0.1); }
[data-theme="light"] .wl-faq-item { border-bottom-color: rgba(0, 0, 0, 0.1); }
[data-theme="light"] .wl-bar {
  background: linear-gradient(to right, var(--accent, #6c5ce7) var(--pct), rgba(0, 0, 0, 0.09) var(--pct));
}

@media (max-width: 680px) {
  .wl-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wl-words { grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); }
  .wl-article { padding: 1rem 1rem 2.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  .wl-play-top:hover { filter: none; }
}
