:root {
  --bg: #0d0d0f;
  --bg-2: #16161a;
  --acid: #fbc92e;          /* le jaune caustique */
  --acid-dim: #d1a51a;
  --ink: #f2f2ef;
  --ink-dim: #9a9aa0;
  --radius: 14px;
  --display: "Archivo Black", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
/* L'attribut hidden doit toujours l'emporter : sinon un display: grid/flex
   de même spécificité, déclaré plus loin, ré-affiche l'élément (croix de
   recherche, bouton « Afficher plus »…). */
[hidden] { display: none !important; }
/* Pas de flash bleu au tap sur mobile ; focus clavier en jaune caustique. */
a, button, input, select, [tabindex] { -webkit-tap-highlight-color: transparent; }
.btn:focus, dialog button:focus { outline: none; }
.btn:focus-visible, dialog button:focus-visible {
  outline: 2px solid var(--acid);
  outline-offset: 2px;
}
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 24px; }

/* ---------- Bandeau ---------- */
header.nav {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #26262c;
}
header.nav .wrap {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 12px; padding-bottom: 12px;
}
.brand {
  font-family: var(--display);
  font-size: 1.05rem;
  letter-spacing: .02em;
  text-decoration: none;
  color: var(--acid);
  text-transform: uppercase;
}
.plats { display: flex; gap: 2px; }
.plats a {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 8px;
  color: var(--ink-dim);
  transition: color .15s, background .15s;
}
.plats a:hover { color: var(--acid); background: var(--bg-2); }
.plats svg { width: 18px; height: 18px; fill: currentColor; }
@media (max-width: 400px) { .plats a { width: 28px; } }

/* ---------- Héro ---------- */
.hero { padding: 72px 0 56px; }
.hero .wrap {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 48px;
  align-items: center;
}
@media (max-width: 760px) {
  .hero .wrap { grid-template-columns: 1fr; text-align: center; }
  .hero .cover { margin: 0 auto; }
}
.cover {
  width: 300px; max-width: 80vw;
  border-radius: var(--radius);
  box-shadow: 0 0 0 1px #2c2c33, 0 24px 60px -20px rgba(251, 201, 46, .25);
  rotate: -2deg;
  transition: rotate .3s;
}
.cover:hover { rotate: 0deg; }
h1 {
  font-family: var(--display);
  font-size: clamp(2.4rem, 6vw, 4rem);
  line-height: 1.02;
  text-transform: uppercase;
  letter-spacing: -.01em;
}
h1 .acid { color: var(--acid); }
.tagline { margin-top: 18px; color: var(--ink-dim); font-size: 1.08rem; max-width: 46ch; }
.tagline strong { color: var(--ink); }
.hero-cta { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 12px; }
@media (max-width: 760px) { .hero-cta { justify-content: center; } .tagline { margin-inline: auto; } }

.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 800; font-size: .95rem;
  text-decoration: none;
  transition: transform .12s, box-shadow .12s;
}
.btn:hover { transform: translateY(-2px); }
.btn-acid { background: var(--acid); color: #101204; box-shadow: 0 8px 24px -8px rgba(251,201,46,.5); }
.btn-ghost { border: 1.5px solid #3a3a42; color: var(--ink); }
.btn-ghost:hover { border-color: var(--acid); color: var(--acid); }

/* ---------- Sections ---------- */
section { padding: 56px 0; }
h2 {
  font-family: var(--display);
  font-size: clamp(1.5rem, 3.4vw, 2.1rem);
  text-transform: uppercase;
  margin-bottom: 8px;
}
h2::after {
  content: ""; display: block;
  width: 64px; height: 5px; margin-top: 10px;
  background: var(--acid);
}
.section-sub { color: var(--ink-dim); margin-bottom: 32px; max-width: 72ch; }

/* Épisodes */
.ep-toolbar {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin-bottom: 20px;
}
.ep-toolbar input, .ep-toolbar select {
  background: var(--bg-2);
  border: 1px solid #33333b;
  border-radius: 10px;
  color: var(--ink);
  font: inherit; font-size: .95rem;
  padding: 11px 14px;
}
.ep-toolbar input { flex: 1; min-width: 220px; }
.ep-toolbar input::placeholder { color: var(--ink-dim); }
.ep-toolbar input:focus, .ep-toolbar select:focus { outline: 2px solid var(--acid); border-color: transparent; }
.ep-count { color: var(--ink-dim); font-size: .85rem; margin-bottom: 14px; }
.ep-desc { color: var(--ink-dim); font-size: .88rem; margin-top: 8px; }
.btn-more { margin-top: 20px; cursor: pointer; background: none; font-family: inherit; }
.episodes { display: grid; gap: 14px; }
.ep {
  background: var(--bg-2);
  border: 1px solid #26262c;
  border-radius: var(--radius);
  padding: 18px 20px;
}
.ep-date {
  color: var(--acid);
  font-weight: 800; font-size: .8rem;
  text-transform: uppercase; letter-spacing: .05em;
  margin-bottom: 6px;
}
.ep-date span { color: var(--ink-dim); font-weight: 400; text-transform: none; letter-spacing: 0; }
.ep h3 { font-size: 1.02rem; font-weight: 800; line-height: 1.35; }
.ep audio { width: 100%; margin-top: 12px; height: 36px; }
.ep .ep-links { margin-top: 10px; font-size: .85rem; }
.ep .ep-links a { color: var(--acid-dim); }
#eps-note { color: var(--ink-dim); font-size: .85rem; margin-top: 16px; }

/* Avis */
.review .stars { color: var(--acid); letter-spacing: 2px; font-size: .9rem; }
.review h3 { font-size: 1rem; font-weight: 800; margin: 8px 0 6px; }
.review blockquote { color: var(--ink-dim); font-size: .92rem; }
.review .review-author { margin-top: 12px; margin-bottom: 0; font-size: .82rem; color: var(--ink); font-weight: 600; }
.review .review-date { color: var(--ink-dim); font-weight: 400; }

/* Participer */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.card {
  background: var(--bg-2);
  border: 1px solid #26262c;
  border-radius: var(--radius);
  padding: 24px;
}
.card h3 { font-family: var(--display); font-size: 1.05rem; text-transform: uppercase; margin-bottom: 10px; }
.card p { color: var(--ink-dim); font-size: .95rem; margin-bottom: 16px; }
.card .btn { font-size: .88rem; padding: 10px 16px; }

footer {
  border-top: 1px solid #26262c;
  padding: 32px 0 48px;
  color: var(--ink-dim);
  font-size: .85rem;
}
footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
footer a { color: var(--acid-dim); }

/* Encart dernier épisode (accueil) */
.ep-latest { border-color: var(--acid-dim); padding: 24px; }
.ep-latest h3 { font-size: 1.25rem; }
.ep-latest audio { margin-top: 16px; }

/* Badge "Dernier episode" (accueil + page episodes) */
.tag-dernier {
  display: inline-block;
  background: var(--acid);
  color: #101204;
  font-weight: 800;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 10px;
}

/* Modale (alerte nouvel episode, en attente d'autorisation) */
dialog {
  background: var(--bg-2);
  color: var(--ink);
  border: 1px solid #3a3a42;
  border-radius: var(--radius);
  padding: 28px;
  max-width: 460px;
  margin: auto;
}
dialog::backdrop { background: rgba(0, 0, 0, .65); backdrop-filter: blur(3px); }
dialog h3 {
  font-family: var(--display);
  font-size: 1.1rem;
  text-transform: uppercase;
  margin-bottom: 12px;
}
dialog p { color: var(--ink-dim); font-size: .95rem; margin-bottom: 20px; }

/* Cartes : l'action se cale en bas, boutons alignes entre cartes voisines */
.card { display: flex; flex-direction: column; }
.card > :last-child { margin-top: auto; align-self: flex-start; }

/* Reset des <button> portant .btn : meme rendu que les liens .btn */
button.btn { background: none; font-family: inherit; line-height: inherit; cursor: pointer; }
button.btn-acid { background: var(--acid); border: none; }

/* Select saison : chevron custom, la fleche native se positionne mal */
.ep-toolbar select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239a9aa0' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 14px;
}

/* Lien retour accueil (page episodes) : discret, chevron dessine */
.lien-retour {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-dim);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 600;
  margin-bottom: 28px;
  transition: color .15s;
}
.lien-retour:hover { color: var(--acid); }
.lien-retour svg { width: 15px; height: 15px; }

/* Bouton mis en avant (Encenser) */
.btn-grand { font-size: 1.05rem; padding: 16px 32px; }

/* Mobile : la marque reste sur une ligne, les icones passent dessous si besoin */
header.nav .wrap { flex-wrap: wrap; }
.brand { white-space: nowrap; }

/* Vignettes d'episodes */
.ep { display: flex; gap: 16px; }
.ep-img { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; flex: none; }
.ep-corps { flex: 1; min-width: 0; }
.ep-latest .ep-img { width: 104px; height: 104px; }
@media (max-width: 480px) {
  .ep-img { width: 52px; height: 52px; }
  .ep-latest .ep-img { width: 72px; height: 72px; }
}

/* Lecteur audio maison (voir assets/player.js) */
.lecteur {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}
.lecteur-btn {
  width: 40px; height: 40px;
  flex: none;
  display: grid; place-items: center;
  border: none;
  border-radius: 50%;
  background: var(--acid);
  color: #101204;
  cursor: pointer;
  transition: transform .12s;
}
.lecteur-btn:hover { transform: scale(1.07); }
.lecteur-btn svg { width: 18px; height: 18px; fill: currentColor; }
.lecteur-piste {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: #2e2e36;
  cursor: pointer;
  overflow: hidden;
}
.lecteur-progres {
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: var(--acid);
  transition: width .15s linear;
}
.lecteur-temps {
  flex: none;
  min-width: 92px;
  text-align: right;
  font-size: .78rem;
  color: var(--ink-dim);
  font-variant-numeric: tabular-nums;
}

/* Menus natifs (liste deroulante des saisons, scrollbars) en sombre des l'ouverture :
   sans ca, Windows affiche un flash blanc avant l'application du style. */
:root { color-scheme: dark; }
.ep-toolbar select option {
  background: var(--bg-2);
  color: var(--ink);
}

/* Quizz */
.quizz-entete {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: .82rem;
  color: var(--ink-dim);
  margin-bottom: 8px;
}
.quizz-score { color: var(--acid); font-weight: 800; }
.quizz-jauge {
  height: 4px;
  border-radius: 999px;
  background: #2e2e36;
  overflow: hidden;
  margin-bottom: 28px;
}
.quizz-jauge-remplie {
  width: 0;
  height: 100%;
  background: var(--acid);
  transition: width .3s ease;
}
#quizz-enonce::after { display: none; }
.quizz-indice {
  color: var(--ink-dim);
  font-size: .95rem;
  border-left: 3px solid var(--acid-dim);
  padding: 4px 0 4px 14px;
  margin: 16px 0 4px;
}
.quizz-reponses {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}
.quizz-rep {
  text-align: left;
  background: var(--bg-2);
  border: 1px solid #33333b;
  border-radius: var(--radius);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  font-size: .95rem;
  padding: 15px 18px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.quizz-rep:hover { border-color: var(--acid); }
.quizz-reponses.verrouille .quizz-rep { cursor: default; }
.quizz-reponses.verrouille .quizz-rep:hover { border-color: #33333b; }
.quizz-rep.juste {
  border-color: #7ad17a;
  background: rgba(122, 209, 122, .12);
  color: #b6ecb6;
}
.quizz-rep.faux {
  border-color: #e07b7b;
  background: rgba(224, 123, 123, .12);
  color: #f2b8b8;
}
.quizz-note {
  font-family: var(--display);
  font-size: clamp(3rem, 12vw, 5rem);
  line-height: 1;
  color: var(--acid);
  margin-bottom: 8px;
}

/* Bouton mail + confirmation de copie affichee a cote */
.mail-ligne { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.mail-copie { font-size: .85rem; font-weight: 600; color: var(--acid); }

/* Loupe dans le champ de recherche des episodes */
.ep-toolbar input[type="search"] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239a9aa0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4.3-4.3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 14px center;
  background-size: 17px;
  padding-left: 42px;
}

/* Loupe en coin de vignette + agrandissement (lightbox, voir player.js) */
.ep-img-wrap {
  position: relative;
  flex: none;
  align-self: flex-start; /* sinon le flex étire le conteneur à la hauteur de la carte */
  display: block;
  padding: 0;
  border: none;
  background: none;
  cursor: zoom-in;
  line-height: 0;
}
.ep-zoom {
  position: absolute;
  bottom: 5px;
  right: 5px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: rgba(13, 13, 15, .72);
  color: var(--acid);
  opacity: .9;
  transition: opacity .15s, transform .12s;
}
.ep-img-wrap:hover .ep-zoom { opacity: 1; transform: scale(1.08); }
.ep-zoom svg { width: 13px; height: 13px; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, .85);
  cursor: zoom-out;
}
.lightbox[hidden] { display: none; }
.lightbox img {
  max-width: 92vw;
  max-height: 92vh;
  border-radius: 12px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .6);
}

/* Champ de recherche avec croix de remise a zero */
.ep-search-wrap { position: relative; flex: 1; min-width: 220px; display: flex; }
.ep-search-wrap input { flex: 1; min-width: 0; padding-right: 40px; }
.ep-search-wrap input::-webkit-search-cancel-button { display: none; } /* on remplace par notre croix */
.ep-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: none;
  background: none;
  color: var(--ink-dim);
  cursor: pointer;
  border-radius: 50%;
}
.ep-clear svg { width: 15px; height: 15px; }
.ep-clear:hover { color: var(--acid); }
