/* Styles de composants, reconstruits à partir de l'analyse du vrai site
   (voir DESIGN_ANALYSIS.md). Les valeurs viennent de tokens.css. */

* {
  box-sizing: border-box;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  color: var(--color-text);
  background-color: var(--color-bg);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--color-text);
  line-height: 1.3;
  margin-top: 0;
}

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

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

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

/* ------------------------------------------------------------------ */
/* En-tête (§2)                                                       */
/* ------------------------------------------------------------------ */

.site-header {
  background: var(--color-header);
  box-shadow: var(--shadow-header);
  position: relative;
  z-index: 10;
}

.site-header__inner {
  max-width: var(--container-wide);
  margin: 0 auto;
  min-height: var(--header-height);
  padding: 0 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.site-header__logo img {
  height: 90px;
  width: auto;
  transition: opacity 0.3s;
  display: block;
}

.site-header__logo:hover img {
  opacity: 0.5;
}

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
}

.site-nav > ul {
  display: flex;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav > ul > li {
  position: relative;
}

.site-nav > ul > li > a {
  display: block;
  padding: 13px 20px;
  font: 400 20px/1 var(--font-heading);
  color: #fff;
  position: relative;
}

.site-nav > ul > li > a:hover {
  text-decoration: none;
}

.site-nav .caret {
  font-size: 0.7em;
}

.site-nav > ul > li > a::after {
  content: "";
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 0;
  height: 3px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s;
}

.site-nav > ul > li > a:hover,
.site-nav .is-active > a {
  color: var(--color-header-ink);
}

.site-nav > ul > li > a:hover::after,
.site-nav .is-active > a::after {
  transform: scaleX(1);
}

.site-nav__sub {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 240px;
  background: var(--color-dropdown);
  box-shadow: var(--shadow-dropdown);
  list-style: none;
  padding: 0;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  transition: 0.2s;
}

.has-sub:hover > .site-nav__sub,
.has-sub:focus-within > .site-nav__sub {
  opacity: 1;
  visibility: visible;
}

.site-nav__sub a {
  display: block;
  padding: 13px 20px;
  font: 600 15px var(--font-heading);
  text-transform: uppercase;
  color: #33373d;
}

.site-nav__sub a:hover {
  background: #3f444b;
  color: #fff;
  text-decoration: none;
}

@media (max-width: 1024px) {
  .site-header__inner {
    flex-direction: column;
    justify-content: center;
    padding: 10px 16px;
    min-height: 0;
  }
  .site-header__logo img {
    height: 60px;
  }
  .nav-toggle {
    display: block;
  }
  .site-nav {
    display: none;
    width: 100%;
    max-width: 290px;
  }
  .site-nav.is-open {
    display: block;
  }
  .site-nav > ul {
    flex-direction: column;
    background: var(--color-dropdown);
    box-shadow: var(--shadow-dropdown);
  }
  .site-nav > ul > li > a {
    color: #33373d;
    font-weight: 700;
    text-transform: uppercase;
  }
  .site-nav .is-active > a {
    background: #3f444b;
    color: #fff;
  }
  .site-nav__sub {
    position: static;
    opacity: 1;
    visibility: visible;
    box-shadow: none;
  }
}

/* ------------------------------------------------------------------ */
/* Hero de page (§3)                                                  */
/* ------------------------------------------------------------------ */

.page-hero {
  position: relative;
  min-height: 269px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0 24px;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  text-align: center;
  padding: 24px 16px;
  overflow: hidden;
}

.page-hero--home {
  min-height: 485px;
  flex-direction: column;
}

.page-hero--home::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(32, 46, 36, 0.82);
}

.page-hero > * {
  position: relative;
}

.page-hero__title {
  font: 700 clamp(49px, 8vw, 100px) / 1.1 var(--font-heading);
  color: #fff;
  margin: 0;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.page-hero--home .page-hero__title {
  font-size: clamp(55px, 10vw, 150px);
  text-shadow: var(--text-shadow-hero);
}

.page-hero__logo {
  width: min(320px, 42vw);
}

.page-hero__text {
  max-width: 1100px;
  margin: 40px auto 0;
  font: italic 500 clamp(20px, 2vw, 28px) / 1.5 var(--font-body);
  color: var(--color-text-soft);
  text-shadow: 0 0 8px #000;
}

/* Titre centré simple (fiche série / chapitre, pas de hero) */
.plain-title {
  font: 700 clamp(30px, 4vw, 50px) / 1.2 var(--font-heading);
  text-transform: uppercase;
  text-align: center;
  margin: 10px 0 30px;
}

/* ------------------------------------------------------------------ */
/* Éléments décoratifs récurrents (§13)                                */
/* ------------------------------------------------------------------ */

.divider {
  border: 0;
  border-top: 3px solid #fff;
  width: var(--divider-width);
  margin: 14px auto;
}

.divider--80 {
  width: 80%;
}

.section-title--accent {
  font: 600 clamp(28px, 4vw, 35px) / 1.2 var(--font-heading);
  color: var(--color-accent);
  text-align: center;
  margin: 0;
}

.group-title {
  font: 700 clamp(32px, 4vw, 53px) / 1.2 var(--font-heading);
  text-align: center;
  color: #fff;
  margin: 19px 0 0;
}

.group-desc {
  text-align: center;
  color: #fff;
  max-width: 700px;
  margin: 10px auto 0;
}

.reveal {
  opacity: 0;
  transition: opacity 1.25s ease, transform 1.25s ease;
}
.reveal.from-left {
  transform: translateX(-60px);
}
.reveal.from-right {
  transform: translateX(60px);
}
.reveal.zoom {
  transform: scale(0.6);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
.reveal.slow {
  transition-duration: 2s;
}
html:not(.js) .reveal {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ------------------------------------------------------------------ */
/* Badge de statut — composant nouveau (pas dans l'original)           */
/* ------------------------------------------------------------------ */

.status-badge {
  display: inline-block;
  padding: 4px 10px;
  font: 700 11px/1 var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #fff;
  background: var(--color-status-en-cours);
}
.status-badge--terminee { background: var(--color-status-terminee); color: #2b1a3d; }
.status-badge--en_pause { background: var(--color-status-en-pause); }
.status-badge--abandonnee { background: var(--color-status-abandonnee); }

/* ------------------------------------------------------------------ */
/* Listes d'œuvres : bannières empilées (§5)                          */
/* ------------------------------------------------------------------ */

.banner-list {
  list-style: none;
  padding: 0;
  margin: 30px auto 0;
  width: min(75%, 860px);
  display: grid;
  gap: 30px;
}
@media (max-width: 767px) {
  .banner-list {
    width: 100%;
  }
}
.series-banner {
  display: block;
  position: relative;
}
/* Le survol réduit __media en entier (visuel + badge) et non la seule image :
   sinon le badge reste figé pendant que l'image recule, et le repli CSS —
   qui n'est pas un <img> — n'aurait aucune animation du tout. */
.series-banner__media {
  display: block;
  position: relative;
  transition: transform 0.3s;
}
.series-banner img {
  width: 100%;
  height: auto;
  display: block;
  transition: opacity 0.3s;
}
.series-banner:hover .series-banner__media,
.series-banner:focus-visible .series-banner__media {
  transform: scale(0.9);
}
.series-banner:hover img,
.series-banner:focus-visible img,
.series-banner:hover .series-banner--fallback,
.series-banner:focus-visible .series-banner--fallback {
  opacity: 0.5;
}
@media (prefers-reduced-motion: reduce) {
  .series-banner:hover .series-banner__media,
  .series-banner:focus-visible .series-banner__media {
    transform: none;
  }
}
.series-banner__status {
  position: absolute;
  top: 8px;
  left: 8px;
  /* Le repli est un élément positionné placé après le badge dans le DOM :
     sans z-index il repasserait devant (médaillon par-dessus le badge). */
  z-index: 2;
}
@media (max-width: 767px) {
  /* Les bannières (ratio ~5,3:1) ne font que ~74px de haut sur mobile :
     le badge pleine taille en couvrait un tiers. */
  .series-banner__status {
    top: 4px;
    left: 4px;
  }
  .series-banner__status .status-badge {
    padding: 2px 6px;
    font-size: 9px;
  }
}

/* Repli quand la série n'a pas de bannière dédiée (§5). Trois cas à tenir :
   bannière absente + couverture présente, ni l'une ni l'autre, et titre long. */
.series-banner--fallback {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  aspect-ratio: 5.27 / 1;
  overflow: hidden;
  color: #fff;
  /* La réserve à droite empêche un titre long de passer sous le genre ; à
     gauche, juste l'épaisseur du halo autour du médaillon (voir ci-dessous). */
  padding: 0 clamp(70px, 16%, 160px) 0 1.5%;
  /* Bout gauche en demi-cercle : la bande se referme autour du médaillon,
     comme le disque sombre qui ouvre les vraies bannières (§5). Le navigateur
     ramène ce rayon démesuré à la moitié de la hauteur, donc il suit le ratio
     5,27:1 sans valeur en dur. */
  border-radius: 9999px 0 0 9999px;
  /* Socle opaque : sans lui, une série sans couverture rendait une bande noire. */
  background: linear-gradient(105deg, var(--color-header-ink), var(--color-bg-elevated) 70%);
  transition: opacity 0.3s;
}
.series-banner--fallback::before {
  content: "";
  position: absolute;
  inset: -20px;
  /* `--cover` n'est posé par le gabarit que si la série a une couverture ;
     sinon la déclaration est invalide et l'image retombe sur `none`. */
  background-image: var(--cover);
  background-position: center;
  background-size: cover;
  filter: grayscale(1) blur(6px) brightness(0.7);
}
/* Voile dégradé côté texte : le titre reste lisible sur n'importe quelle
   couverture. z-index explicite, sinon ce voile couvrirait le contenu. */
.series-banner--fallback::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.25) 60%, transparent);
}
/* Sans couverture : pas de médaillon, le dégradé et le liseré vert portent
   seuls la bannière plutôt que de laisser un cercle vide. Le liseré suit
   l'arrondi et dessine un croissant ; le titre reprend sa marge, sinon il
   mordrait sur la courbe. */
.series-banner--sans-couverture {
  border-left: 4px solid var(--color-accent);
  padding-left: clamp(24px, 5%, 70px);
}
/* Le coin haut-gauche du repli est mangé par l'arrondi : sans ce décalage le
   badge flotterait à côté de la bande. */
.series-banner__media--repli .series-banner__status {
  top: 6%;
  left: 6.5%;
}
.series-banner__medal {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  /* 84 % et non 92 % : le reste de la hauteur fait le halo sombre entre la
     photo et le bout arrondi de la bande, concentrique avec lui. */
  height: 84%;
  aspect-ratio: 1;
  border-radius: 50%;
  background-image: var(--cover);
  background-position: center 20%;
  background-size: cover;
  border: 4px solid var(--color-accent);
  box-shadow: 0 0 12px #000;
}
.series-banner__title {
  position: relative;
  z-index: 2;
  min-width: 0;
  font: 800 clamp(16px, 3vw, 34px) / 1.1 var(--font-heading);
  text-transform: uppercase;
  text-shadow: 0 0 6px var(--color-accent), 2px 2px 0 #000;
  /* Deux lignes maximum : la bannière fait 5,27:1, un titre long la ferait
     déborder (overflow: hidden) au lieu de se replier proprement. */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.series-banner__genre {
  position: absolute;
  z-index: 2;
  top: 6%;
  right: 2%;
  font: italic 900 clamp(12px, 2vw, 26px) var(--font-heading);
  text-transform: uppercase;
  color: #000;
  -webkit-text-stroke: 1px #fff;
}

/* ------------------------------------------------------------------ */
/* Fiche série (§6)                                                    */
/* ------------------------------------------------------------------ */

.series-head {
  max-width: 1300px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 37fr 54fr;
  gap: 40px;
  align-items: center;
  padding: 0 20px;
}
.series-head__cover img {
  height: 500px;
  width: 100%;
  object-fit: contain;
}
.series-facts {
  list-style: none;
  padding: 0;
  margin: 0;
  font: 500 18px/20px var(--font-body);
}
.series-facts li {
  margin-bottom: 27px;
}
.series-facts .lbl {
  color: var(--color-teal);
}
.series--web_novel .series-facts .lbl {
  color: var(--color-orange);
}
.series-synopsis {
  font: 500 18px/1.65 var(--font-body);
}
.download-hint {
  font: 600 25px/1.2 var(--font-heading);
  text-align: center;
  margin: 40px 0 0;
}
.volume-grid {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  max-width: var(--container-max-width);
  margin: 20px auto 0;
}
.volume {
  flex: 0 1 calc(20% - 16px);
  text-align: center;
}
.volume img {
  /* max-height et non height fixe : une cover d'un autre ratio (ex.
     512×805 venue de MangaDex) flottait au milieu d'une boîte à moitié
     vide, libellé orphelin loin dessous. */
  max-height: 500px;
  width: 100%;
  height: auto;
  object-fit: contain;
  transition: opacity 0.3s, transform 0.3s;
}
.volume a:hover img {
  opacity: 0.8;
  transform: scale(0.9);
}
.volume__label {
  font: 600 20px var(--font-heading);
  margin: 8px 0 0;
}
/* Badge « brouillon » (éditeurs seulement) : le volume est relié à une
   sortie non publiée, le lien mène à la vue brouillon Wagtail. */
.volume__draft {
  font: 600 11px var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #1d1d1b;
  background: var(--color-gold);
  padding: 2px 8px;
  vertical-align: middle;
}

/* Chapitres d'un tome pas encore complet (cas Classics Club) : liste
   repliée sous la carte du tome. */
.volume__chapters {
  margin-top: 8px;
  font-size: 14px;
  text-align: center;
}
.volume__chapters summary {
  cursor: pointer;
  color: var(--color-accent);
  font: 600 13px var(--font-heading);
}
.volume__chapters ul {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 4px;
}
.volume__chapters a {
  color: var(--color-text-soft);
}
.volume__chapters a:hover {
  color: var(--color-accent);
}

/* Boutons sous chaque tome (sortie reliée) : lire en ligne / télécharger. */
.volume__actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 8px 0 0;
}
.btn--sm {
  font-size: 13px;
  padding: 6px 14px;
}
.btn--ghost {
  background: transparent;
  border: 1px solid var(--color-button);
  color: var(--color-text);
}
.btn--ghost:hover {
  background: var(--color-button);
  color: #fff;
}
@media (max-width: 1024px) {
  .series-head {
    grid-template-columns: 1fr 1.4fr;
    /* La colonne d'infos est bien plus haute que la couverture : centrer
       verticalement (comme sur desktop) perdait la couverture au milieu
       d'un grand vide. */
    align-items: start;
  }
  .series-head__cover img,
  .volume img {
    max-height: 274px;
  }
  .volume {
    flex-basis: calc(33.33% - 14px);
  }
}
@media (max-width: 767px) {
  .series-head {
    grid-template-columns: 1fr;
  }
  .series-head__cover img {
    height: 300px;
  }
  .series-facts {
    font-size: 16px;
    line-height: 1.4;
  }
  .series-facts li {
    margin-bottom: 14px;
  }
  .series-synopsis {
    font-size: 15px;
  }
  /* 2 colonnes au lieu d'une : l'original empilait les tomes pleine
     largeur, un par ligne — un scroll interminable dès 5 tomes. */
  .volume {
    flex-basis: calc(50% - 10px);
  }
  .volume img {
    max-height: 240px;
  }
  .volume__label {
    font-size: 16px;
  }
}

/* Liste de chapitres par tome (web novel) */
.book-row {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 20px;
  max-width: 900px;
  margin: 0 auto 40px;
  padding: 0 20px;
}
.book-row__cover img {
  width: 100%;
  box-shadow: var(--shadow-card);
}
.chapter-toc {
  list-style: none;
  padding: 0;
  margin: 0;
  font: 600 18px/2 var(--font-body);
}
.chapter-toc a {
  color: var(--color-accent);
}
.chapter-toc a:hover {
  color: var(--color-accent-hover);
}
.chapter-toc .interlude {
  font-style: italic;
}
.chapter-toc .arc-end {
  color: var(--color-lilac);
}
@media (max-width: 767px) {
  .book-row {
    grid-template-columns: 1fr;
  }
}

/* ------------------------------------------------------------------ */
/* Page chapitre (§7)                                                  */
/* ------------------------------------------------------------------ */

.chapter {
  padding: 0 20px;
}
.chapter__title {
  font: 700 clamp(26px, 3vw, 40px) / 1.5 var(--font-heading);
  text-transform: uppercase;
  text-align: center;
  margin: 10px 0 30px;
}
.chapter-subtitle {
  text-align: center;
  color: var(--color-lilac);
  font: italic 700 20px var(--font-heading);
  margin: -20px 0 30px;
}
.chapter-credits {
  text-align: center;
  color: var(--color-credits);
  font-size: 15px;
  margin-bottom: 30px;
}
.chapter-credits::before,
.chapter-credits::after {
  content: "";
  display: block;
  width: 230px;
  margin: 10px auto;
  border-top: 2px dashed var(--color-credits);
}
.chapter-credits__name {
  font-weight: 700;
}
.chapter-body {
  /* Taille/interligne/largeur pilotés par la barre de confort de lecture
     (reader-text.js pose ces variables) ; les replis reproduisent le
     réglage historique, donc rien ne change sans JS. */
  width: min(74%, var(--reader-width, var(--container-narrow-width)));
  margin: 0 auto;
  /* L'original affiche 15px/1,65 : un peu petit en blanc sur fond sombre.
     17px/1,7 améliore le confort de lecture sans changer l'ambiance
     (recommandation DESIGN_ANALYSIS.md §14, validée). */
  font: 400 var(--reader-font-size, 17px) / var(--reader-line-height, 1.7)
    var(--font-body);
  color: #fff;
}
/* Illustrations du corps de lecture : jamais plus large que la colonne,
   jamais plus haute qu'un écran — une pleine page importée d'un EPUB/PDF
   ne doit pas engloutir la lecture. Couvre aussi les images venues du
   rich text (futur import WordPress). */
.chapter-body img {
  display: block;
  max-width: 100%;
  width: auto;
  height: auto;
  max-height: 85vh;
  margin: 1.5em auto;
}
.chapter-body p {
  margin: 0 0 1.5em;
}
.chapter-body blockquote {
  margin: 0 0 1.5em 40px;
  padding: 0;
  border: 0;
}
@media (max-width: 767px) {
  .chapter-body {
    width: 100%;
  }
}

/* Barre de confort de lecture (phase 2, jalon 1) — composant nouveau,
   absent de l'original : réglages taille/interligne/largeur du texte.
   Masquée sans JS (elle ne ferait rien), d'où le garde html.js. */
.reader-toolbar {
  position: sticky;
  top: 12px;
  z-index: 60;
  width: min(74%, var(--reader-width, var(--container-narrow-width)));
  margin: 0 auto 10px;
  display: none;
  justify-content: flex-end;
}
html.js .reader-toolbar {
  display: flex;
}
.reader-toolbar__toggle {
  font: 600 15px var(--font-heading);
  color: var(--color-text);
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-header);
  padding: 6px 14px;
  cursor: pointer;
}
.reader-toolbar__toggle:hover,
.reader-toolbar__toggle[aria-expanded="true"] {
  background: var(--color-header);
  color: var(--color-header-ink);
}
.reader-toolbar__panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 280px;
  padding: 16px;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-header);
  box-shadow: var(--shadow-dropdown);
  display: grid;
  gap: 14px;
}
/* `display: grid` au-dessus écraserait le display:none que le navigateur
   donne à l'attribut hidden — on le réaffirme explicitement. */
.reader-toolbar__panel[hidden] {
  display: none;
}
.reader-toolbar__group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.reader-toolbar__label {
  width: 100%;
  font: 600 12px var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
}
.reader-toolbar__btn {
  font: 500 14px var(--font-body);
  color: var(--color-text);
  background: transparent;
  border: 1px solid var(--color-header);
  padding: 4px 10px;
  cursor: pointer;
}
.reader-toolbar__btn:hover {
  border-color: var(--color-accent);
}
.reader-toolbar__btn.is-active {
  background: var(--color-button);
  border-color: var(--color-button);
  color: #fff;
}
.reader-toolbar__size {
  min-width: 44px;
  text-align: center;
  font-weight: 600;
}
@media (max-width: 767px) {
  .reader-toolbar {
    width: 100%;
  }
}

/* Puce « Reprendre la lecture » : proposée (jamais imposée) quand une
   position est mémorisée pour ce chapitre — voir reader-text.js. */
.reader-resume {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  font: 600 14px var(--font-heading);
  color: #fff;
  background: var(--color-button);
  border: 0;
  padding: 10px 18px;
  box-shadow: var(--shadow-card);
  cursor: pointer;
}
.reader-resume:hover {
  background: var(--color-accent);
}

/* Bouton « Lire en ligne » d'une sortie manga (phase 2) */
.reader-cta {
  text-align: center;
  margin: 30px 0 0;
}

.download-links {
  list-style: none;
  margin: 30px auto 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

/* Languettes de bord (wp-post-nav) */
.edge-nav__item {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  width: 45vw;
  max-width: 380px;
  padding: 20px;
  background: var(--color-button);
  color: #fff;
  transition: left 0.5s, right 0.5s;
  text-align: center;
}
.edge-nav__item:hover,
.edge-nav__item:focus {
  color: #fff;
  text-decoration: none;
}
.edge-nav__item--prev {
  left: calc(-45vw - 50px);
}
.edge-nav__item--prev:hover,
.edge-nav__item--prev:focus {
  left: 0;
}
.edge-nav__item--next {
  right: calc(-45vw - 50px);
}
.edge-nav__item--next:hover,
.edge-nav__item--next:focus {
  right: 0;
}
.edge-nav__item::after {
  content: "▶";
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 70px;
  line-height: 70px;
  background: var(--color-button);
}
.edge-nav__item--next::after {
  left: -50px;
}
.edge-nav__item--prev::after {
  content: "◀";
  right: -50px;
}
.edge-nav__label {
  display: block;
  font: 600 20px var(--font-heading);
}
.edge-nav__title {
  display: block;
  font-size: 20px;
}
@media (max-width: 1024px) {
  .edge-nav__item {
    display: none;
  }
}

/* Barre précédent/suivant classique, gardée en plus des languettes pour
   l'accessibilité clavier et la découvrabilité mobile. */
.chapter-nav {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--color-bg-elevated);
  margin: 0 auto;
  max-width: var(--container-narrow-width);
  padding-top: 20px;
}
.chapter-nav a {
  color: var(--color-button);
  font-weight: 600;
}

/* ------------------------------------------------------------------ */
/* Grille d'actualités (§9)                                            */
/* ------------------------------------------------------------------ */

.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 35px 30px;
  max-width: var(--container-max-width);
  margin: 20px auto 0;
  list-style: none;
  padding: 0 20px;
}
@media (max-width: 1024px) {
  .news-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 767px) {
  .news-grid {
    grid-template-columns: 1fr;
  }
}
.news-card {
  transition: box-shadow 0.25s;
}
.news-card:hover {
  box-shadow: var(--shadow-card);
}
.news-card__thumb {
  aspect-ratio: 3 / 2;
  overflow: hidden;
  margin-bottom: 20px;
  background: var(--color-bg-elevated);
}
.news-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.news-card__title {
  font: 600 18px/1.3 var(--font-heading);
  margin: 0;
}
.news-card__title a {
  color: var(--color-text-soft);
}
.news-card__date {
  font-size: 12px;
  line-height: 1.3;
  color: var(--color-text-muted);
  margin: 4px 0 13px;
}
.news-card__more {
  font: 700 12px var(--font-heading);
  color: var(--color-accent);
}
.news-card__more::after {
  content: " »";
}

/* ------------------------------------------------------------------ */
/* Pages éditoriales (§10)                                             */
/* ------------------------------------------------------------------ */

.lead {
  font: 600 clamp(15px, 1.6vw, 22px) / 1.6 var(--font-body);
  text-align: center;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}
.faq {
  max-width: 1000px;
  margin: 30px auto;
  padding: 0 20px;
  font: 400 clamp(15px, 1.6vw, 22px) / 1.6 var(--font-body);
}
.faq__q {
  color: var(--color-faq-question);
  font-weight: 700;
  display: block;
}
.faq__a {
  margin: 0 0 1.4em;
}
.faq a {
  color: #6ec1e4;
}
.faq-group-title {
  font: 600 clamp(36px, 5vw, 60px) / 1.2 var(--font-heading);
  text-align: center;
}

/* ------------------------------------------------------------------ */
/* Boutons (§11)                                                       */
/* ------------------------------------------------------------------ */

.btn {
  display: inline-block;
  background: var(--color-button);
  color: #fff;
  font: 500 18px/1 var(--font-heading);
  text-transform: uppercase;
  padding: 12px 24px;
  border: 0;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  text-shadow: 0 0 7px rgba(17, 15, 15, 0.6);
  transition: transform 0.3s;
  cursor: pointer;
}
.btn:hover {
  color: #fff;
  transform: scale(1.1);
  text-decoration: none;
}
.btn--shrink:hover {
  transform: scale(0.9);
}
.btn-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  margin: 30px 0;
}
.link-more {
  font: 700 12px var(--font-heading);
  color: var(--color-accent);
}
.link-more::after {
  content: " »";
}

/* ------------------------------------------------------------------ */
/* Pied de page (§12)                                                  */
/* ------------------------------------------------------------------ */

.site-footer {
  background: var(--color-header);
  padding: 20px 16px 24px;
  text-align: center;
  margin-top: 30px;
}
.site-footer__copy {
  font: 700 20px var(--font-heading);
  color: #fff;
  margin: 0 0 15px;
}
.socials {
  display: flex;
  justify-content: center;
  gap: 5px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.social {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: transform 0.3s, opacity 0.3s;
}
.social svg {
  width: 25px;
  height: 25px;
  fill: currentColor;
}
.social:hover {
  transform: scale(0.9);
  opacity: 0.9;
}
.social--twitch {
  background: #6441a5;
}
.social--x {
  background: #000;
}
.social--youtube {
  background: #cd201f;
}
.social--discord {
  background: #20052a;
}

/* ------------------------------------------------------------------ */
/* Protection anti-copie — avertissement visuel (le blocage réel est   */
/* géré en JS, voir jgarden.js)                                        */
/* ------------------------------------------------------------------ */

html.no-select {
  user-select: none;
}
.copy-toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%) translateY(20px);
  background: var(--color-credits);
  color: #fff;
  padding: 10px 20px;
  font: 600 14px var(--font-heading);
  box-shadow: var(--shadow-card);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 1000;
}
.copy-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
@media print {
  body * {
    visibility: hidden;
  }
  body::before {
    content: "Tu touches pas cafard !";
    visibility: visible;
    display: block;
    text-align: center;
    margin-top: 40vh;
    font: 700 24px var(--font-heading);
  }
}

/* ------------------------------------------------------------------ */
/* Accueil : carrousel de couvertures + bloc Ko-fi (§4)                */
/* ------------------------------------------------------------------ */

.cover-carousel {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: var(--container-max-width);
  width: 90%;
  margin: 30px auto;
}
.cover-carousel__track {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
}
.cover-carousel__track::-webkit-scrollbar {
  display: none;
}
.cover-carousel__slide {
  flex: 0 0 calc((100% - 72px) / 4);
  scroll-snap-align: start;
  display: flex;
  justify-content: center;
}
.cover-carousel__slide img {
  height: 369px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  display: block;
}
.cover-carousel__arrow {
  background: none;
  border: 0;
  color: #fff;
  font-size: 42px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  flex: 0 0 auto;
}
.cover-carousel__arrow:hover {
  color: var(--color-accent);
}
@media (max-width: 767px) {
  /* Flèches en surimpression (comme l'original) : à côté des slides,
     elles mangeaient un tiers de la largeur de l'écran. */
  .cover-carousel {
    position: relative;
    width: 100%;
    padding: 0 10px;
  }
  .cover-carousel__track {
    gap: 10px;
  }
  .cover-carousel__slide {
    flex-basis: 100%;
  }
  .cover-carousel__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    text-shadow: 0 0 8px #000;
  }
  .cover-carousel__arrow--prev {
    left: 12px;
  }
  .cover-carousel__arrow--next {
    right: 12px;
  }
}

.section-title--accent small {
  display: block;
  font-size: 0.6em;
  font-weight: 500;
}

/* Vignettes d'actus de l'accueil : ratio ~1,85:1 (visuels « news ») */
.news-grid--home .news-card__thumb {
  aspect-ratio: 1 / 0.54;
}
.news-grid--home .news-card__title a {
  color: #fff;
}

.kofi {
  text-align: center;
  margin: 30px 0;
}
.kofi__btn {
  display: inline-block;
  margin-top: 20px;
  background: var(--color-kofi);
  color: #fff;
  font: 600 13px/1 var(--font-heading);
  padding: 10px 16px;
  border-radius: 4px;
}
.kofi__btn:hover {
  color: #fff;
  text-decoration: none;
  transform: scale(1.1);
}

/* ------------------------------------------------------------------ */
/* Fiche série : variantes sans couverture / liste de chapitres seule  */
/* ------------------------------------------------------------------ */

.series-head--no-cover {
  grid-template-columns: 1fr;
  max-width: 900px;
}

.chapter-toc-wrap {
  max-width: 900px;
  margin: 10px auto 30px;
  padding: 0 20px;
  text-align: center;
}

/* ------------------------------------------------------------------ */
/* Page d'erreur 404 (la 500 est autonome, voir templates/500.html)    */
/* ------------------------------------------------------------------ */

.error-page {
  text-align: center;
  padding: 60px 20px;
}
.error-page__code {
  font: 700 clamp(60px, 12vw, 120px) / 1 var(--font-heading);
  color: var(--color-accent);
  margin: 0;
  text-shadow: var(--text-shadow-hero, 0 0 11px rgba(0, 0, 0, 0.96));
}
.error-page__title {
  font: 700 clamp(24px, 4vw, 40px) / 1.2 var(--font-heading);
  text-transform: uppercase;
  margin: 10px 0 20px;
}
.error-page__text {
  color: var(--color-text-soft);
  max-width: 600px;
  margin: 0 auto;
}

/* ------------------------------------------------------------------ */
/* Lecteur manga (phase 2, jalon 3)                                    */
/* Composant nouveau, absent de l'original (le manga y est servi en    */
/* téléchargement). Un seul DOM pour tous les modes : reader-manga.js  */
/* bascule des classes --webtoon / --paged / --fit-*.                  */
/* ------------------------------------------------------------------ */

body.reader-mode .site-header,
body.reader-mode .site-footer {
  display: none;
}

.manga-reader {
  min-height: 100vh;
  background: #171816; /* plus sombre que le fond du site : focus sur la planche */
}

/* Barres haut/bas */
.manga-reader__bar {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  background: rgba(38, 40, 37, 0.95);
  transition: transform 0.25s, opacity 0.25s;
}
.manga-reader__bar--top {
  top: 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  /* Au-dessus de la barre du bas : le menu ⋮ vit DANS cette barre, dont
     le z-index fait contexte d'empilement — sans ça, la barre du bas
     (plus tard dans le DOM) repasserait sur le bas du menu mobile. */
  z-index: 81;
}
.manga-reader__bar--bottom {
  bottom: 0;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.5);
}
.manga-reader--immersive .manga-reader__bar--top {
  transform: translateY(-100%);
  opacity: 0;
}
.manga-reader--immersive .manga-reader__bar--bottom {
  transform: translateY(100%);
  opacity: 0;
}

.manga-reader__back {
  font: 600 20px var(--font-heading);
  color: var(--color-text);
  padding: 2px 10px;
}
.manga-reader__titles {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}
.manga-reader__series {
  font: 600 12px var(--font-heading);
  text-transform: uppercase;
  color: var(--color-accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.manga-reader__chapter {
  font-size: 14px;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.manga-reader__modes {
  display: flex;
  gap: 6px;
}
/* Pastille « Aperçu équipe » : lecteur visible du staff seulement
   (brouillon, ou gating lecture en ligne fermé). */
.manga-reader__draft {
  font: 600 11px var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #1d1d1b;
  background: var(--color-gold);
  padding: 4px 10px;
  white-space: nowrap;
}
.manga-reader__btn {
  font: 600 14px var(--font-heading);
  color: var(--color-text);
  background: transparent;
  border: 1px solid var(--color-header);
  padding: 4px 10px;
  cursor: pointer;
  text-decoration: none;
}
.manga-reader__btn:hover {
  border-color: var(--color-accent);
  color: var(--color-text);
}
.manga-reader__btn.is-active {
  background: var(--color-button);
  border-color: var(--color-button);
}
.manga-reader__slider {
  flex: 1;
  accent-color: var(--color-accent);
  /* En RTL paginé, reader-manga.js passe direction:rtl sur ce slider :
     la jauge progresse de droite à gauche, comme la lecture. */
}

/* Menu « ⋮ » : options libellées (mode, ajustement, sens de lecture).
   Desktop : panneau ancré sous la barre ; mobile : bottom sheet. */
.manga-reader__menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 10px;
  width: 300px;
  padding: 16px;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-header);
  box-shadow: var(--shadow-dropdown);
  display: grid;
  gap: 16px;
}
/* display:grid écraserait le display:none UA de l'attribut hidden. */
.manga-reader__menu[hidden] {
  display: none;
}
.manga-reader__menu-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.manga-reader__menu-label {
  width: 100%;
  font: 600 11px var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
}
@media (max-width: 767px) {
  .manga-reader__menu {
    position: fixed;
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.6);
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
    z-index: 90;
  }
}
.manga-reader__count {
  font-size: 13px;
  color: var(--color-text-soft);
  white-space: nowrap;
}

/* Scène */
.manga-reader__stage {
  padding: 64px 0 56px;
}

/* Mode webtoon (défaut sans JS) : pages empilées, largeur de lecture.
   width/height HTML + aspect-ratio auto : pas de reflow au chargement. */
.manga-reader--webtoon .reader-page {
  display: block;
  margin: 0 auto;
  width: min(100%, 840px);
  height: auto;
}

/* Modes paginés : seule la vue courante est visible. */
.manga-reader--paged .reader-page {
  display: none;
}
.manga-reader--paged .manga-reader__stage {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  min-height: 100vh;
}
.manga-reader--paged .reader-page.is-shown {
  display: block;
}
/* Double page en RTL : la planche suivante s'affiche à gauche. */
.manga-reader--rtl.manga-reader--paged .manga-reader__stage {
  flex-direction: row-reverse;
}

/* Ajustements. Largeur : la planche remplit l'écran, défilement vertical
   possible ; hauteur : la planche tient entière dans la vue. En vue à
   deux planches (classe is-spread posée par reader-manga.js), CHAQUE
   contrainte horizontale passe à une moitié d'écran — sinon deux pages
   « 100% max » débordent et imposent un scroll horizontal. */
.manga-reader--paged.manga-reader--fit-width .reader-page.is-shown {
  width: min(100%, 1100px);
  height: auto;
}
.manga-reader--paged.manga-reader--fit-width
  .manga-reader__stage.is-spread
  .reader-page.is-shown {
  width: auto;
  max-width: calc(50% - 2px); /* 2 × 2px = le gap du stage */
  height: auto;
}
.manga-reader--paged.manga-reader--fit-height .reader-page.is-shown {
  max-height: calc(100vh - 128px);
  width: auto;
  max-width: 100%;
  height: auto;
}
.manga-reader--paged.manga-reader--fit-height
  .manga-reader__stage.is-spread
  .reader-page.is-shown {
  max-width: calc(50% - 2px);
}

@media (max-width: 767px) {
  .manga-reader__series {
    display: none;
  }
  .manga-reader__btn {
    padding: 4px 8px;
  }
  .manga-reader--webtoon .reader-page,
  .manga-reader--paged.manga-reader--fit-width .reader-page.is-shown {
    width: 100%;
  }
}
