/* Identical outer frame and masthead on every route. */
body { margin:0; }
body > .portal { width:100%; max-width:none; margin:0; border:0; box-shadow:none; }
header.masthead {
  box-sizing:border-box; display:flex; align-items:center; justify-content:space-between;
  gap:20px; height:86px; margin:0;
  padding:0 max(24px,calc((100vw - 1104px)/2));
  background:#142820; color:#f3ecd7;
}
/* An illustrated frontispiece, followed by the navigation rather than toolbar chrome. */
header.masthead {
 position:relative; isolation:isolate; flex-direction:column; justify-content:center;
 width:calc(100% - 48px); max-width:1200px; height:260px; margin:24px auto 0;
 padding:25px 20px; gap:8px; text-align:center;
 border:1px solid #ad9364; border-bottom:0;
 background:linear-gradient(90deg,#14271d80,#14271dd9 48%,#14271d70),url('assets/reborn-forest-hero.png') center 48%/cover;
 box-shadow:inset 0 0 0 5px #182b2055,0 12px 35px #16251920;
}
header.masthead .masthead-kicker { margin:0 0 5px; font:12px/1.4 'Trebuchet MS',sans-serif; letter-spacing:.16em; text-transform:uppercase; color:#e0d1af; }
header.masthead .brand { display:block; font:54px/.95 Georgia,serif; letter-spacing:.03em; color:#f2dd9d; text-shadow:0 3px 1px #152219,0 5px 20px #101c14; }
header.masthead .brand b { display:block; margin:10px 0 2px; font-size:19px; letter-spacing:.43em; padding-left:.43em; color:#f4e4bb; }
header.masthead .masthead-tagline { margin:5px 0 0; color:#f2ead6; font:italic 17px/1.5 Georgia,serif; }
header.masthead .project-state { position:absolute; right:20px; bottom:16px; font-size:12px; background:#15281ed9; border:1px solid #b6a07566; padding:5px 10px; border-radius:3px; }
@media(max-width:600px) {
 header.masthead { width:calc(100% - 24px); margin-top:12px; height:252px; gap:7px; padding:52px 12px 42px; }
 header.masthead .brand { font-size:44px; }
 header.masthead .brand b { font-size:16px; }
 header.masthead .masthead-kicker { font-size:11px; letter-spacing:.09em; }
 header.masthead .masthead-tagline { font-size:15px; }
 header.masthead .project-state { right:50%; transform:translateX(50%); bottom:10px; white-space:nowrap; }
}
header.masthead .brand { text-decoration:none; }
header.masthead .brand b { font-weight:400; }
header.masthead .brand-seal { box-sizing:border-box; display:grid; place-items:center; width:37px; height:43px; border:1px solid #bda16a; border-radius:45% 45% 48% 48%; font-size:26px; color:#d7bf8e; flex-shrink:0; }
header.masthead .project-state { display:flex; align-items:center; gap:9px; color:#dfdccb; text-decoration:none; font:12px/1.4 'Trebuchet MS',Arial,sans-serif; letter-spacing:.03em; }
header.masthead .project-state i { width:6px; height:6px; background:#d0aa61; border-radius:50%; flex-shrink:0; }
header.masthead a:focus-visible { outline:3px solid #d5ac63; outline-offset:4px; }
main.archive-main { box-sizing:border-box; width:100%; max-width:1200px; margin:0 auto; padding:40px 48px; overflow-wrap:anywhere; }
main.archive-main > * { min-width:0; }
/* The shared illustration replaces duplicated decorative page banners. */
.portal > section.banner.archive-banner {
 width:calc(100% - 48px); max-width:1200px; margin:0 auto; min-height:0; height:auto;
 padding:28px 32px; background:#e9dfc5; color:#33412d; border:0;
 display:block; box-sizing:border-box;
}
.portal > section.banner.archive-banner::before { display:none; }
.portal > section.banner.archive-banner .banner-copy { position:static; padding:0; max-width:none; }
.portal > section.banner.archive-banner .banner-copy > p,
.portal > section.banner.archive-banner .banner-ribbon { display:none; }
/* Le mot-symbole decoratif du bandeau etait le <h1> de chaque page -- masque
   par la regle ci-dessus, et identique partout ("DOFUS REBORN"). Il est passe
   en <p class="banner-wordmark"> (donc toujours masque) et la ligne visible du
   bandeau porte desormais le <h1>. developpement.html garde son <h1> dans
   <main> et conserve ici un <strong> : les deux se stylent a l'identique,
   valeurs reprises de premium.css pour que le rendu ne bouge pas. */
.portal > section.banner.archive-banner .banner-copy > strong,
.portal > section.banner.archive-banner .banner-copy > h1 {
 display:block; margin:0; max-width:350px; letter-spacing:normal;
 font:italic 20px/1.5 Georgia,serif; text-shadow:none; color:#33412d;
}
@media(max-width:480px) {
 .portal > section.banner.archive-banner .banner-copy > strong,
 .portal > section.banner.archive-banner .banner-copy > h1 { max-width:260px; }
}
section.hero { min-height:0; background:#ede5d1; color:#2c3b2c; width:calc(100% - 48px); max-width:1200px; margin:0 auto; }
section.hero::before { display:none; }
section.hero .hero-content { padding:40px 48px; }
section.hero h1 { font-size:clamp(30px,3.3vw,46px); text-shadow:none; margin-bottom:18px; }
section.hero h1 em { color:#637046; }
section.hero .eyebrow { color:#626e49; margin-bottom:15px; }
section.hero .hero-description { max-width:660px; font-size:16px; color:#48543e; }
section.hero .hero-actions { margin-top:20px; }
/* Accueil, chapeau : deux actions cote a cote. premium.css remplit le second
   lien d'un vert sombre (.hero-actions a + a, #263c30d9) ; cette feuille lui
   donnait ensuite un texte vert fonce #435435 -- soit, une fois le fond
   compose sur le parchemin #ede5d1, un rapport de contraste de 1,03:1 : le
   texte « L'histoire du projet » etait invisible. Il devient une plaque de
   bois lisible (8,8:1), en pendant du bouton dore. */
section.hero .hero-actions .text-link {
  background:linear-gradient(#2f4536,#24382c);
  border:1px solid #7f6b3f;
  color:#f6ecd0;
  box-shadow:0 4px 14px #14251b1f;
  transition:background .2s,color .2s,border-color .2s;
}
section.hero .hero-actions .text-link:hover,
section.hero .hero-actions .text-link:focus-visible {
  background:linear-gradient(#3a5443,#2c4234);
  border-color:#a98f52; color:#fff7e2;
}
section.hero .hero-actions .text-link span { color:#e8cf91; }
@media(prefers-reduced-motion:reduce) { section.hero .hero-actions .text-link { transition:none; } }
section.hero .hero-caption,section.hero .art-credit { display:none; }
@media(max-width:600px) {
  header.masthead .brand-seal { width:28px; height:32px; font-size:22px; }
  main.archive-main { padding:24px 18px; }
  .portal > section.banner.archive-banner { width:calc(100% - 24px); padding:22px 18px; }
  section.hero { width:calc(100% - 24px); }
  section.hero .hero-content { padding:28px 20px; }
}

/* ---------------------------------------------------------------------------
   PIED DE PAGE COMMUN (.site-footer)
   Ces regles ne vivaient que dans reborn-home.css, que seul index.html charge ;
   elles sont ici pour que les 20 autres routes (dont versions.php et les pages
   de tests/) aient la meme mise en page.
   Tout est porte par .site-footer : cela neutralise du meme coup les regles
   generiques footer{} de styles.css et premium.css -- display:flex, le filet
   brun/vert border-top, et footer p{max-width:540px;text-align:right} qui
   retrecissait la mention legale.
   Attention : layout.css est charge APRES reborn-home.css sur index.html,
   ces regles l'emportent donc aussi sur l'accueil ; les valeurs et les
   requetes media sont reprises a l'identique de reborn-home.css.
   --------------------------------------------------------------------------- */
.site-footer { display:block; border-top:0; background:#12251f; color:#d4d6c3; padding:46px 0 34px; }
.site-footer .content { box-sizing:border-box; max-width:1200px; margin-left:auto; margin-right:auto; padding-left:48px; padding-right:48px; }

/* Colonnes : la marque, puis Le site / Jouer / Le projet. */
.site-footer .footer-columns { display:grid; grid-template-columns:minmax(0,1.5fr) repeat(3,minmax(0,1fr)); gap:36px 44px; align-items:start; }
.site-footer .footer-brand { max-width:360px; }
.site-footer .footer-brand p { margin:15px 0 0; max-width:none; text-align:left; font:italic 17px/1.5 Georgia,'Times New Roman',serif; color:#c8cfbb; }
.site-footer .footer-faq { display:inline-block; margin-top:17px; font-size:12px; letter-spacing:.05em; }
.site-footer .footer-col h2 { margin:0 0 15px; padding-bottom:10px; font:400 13px/1.35 Georgia,'Times New Roman',serif; letter-spacing:.15em; text-transform:uppercase; color:#e2bd79; border-bottom:1px solid #ad743666; }
.site-footer .footer-col ul { margin:0; padding:0; list-style:none; }
.site-footer .footer-col li { margin:0 0 10px; }
.site-footer .footer-col li:last-child { margin-bottom:0; }
.site-footer .footer-col a { font-size:13px; line-height:1.5; color:#c7cfba; text-decoration:none; }
.site-footer .footer-col a:hover,
.site-footer .footer-col a:focus-visible { color:#f2c75b; text-decoration:underline; text-underline-offset:4px; }

.site-footer .brand { display:flex; align-items:center; gap:12px; text-decoration:none; font:19px Georgia,'Times New Roman',serif; letter-spacing:.04em; }
.site-footer .brand b { font-weight:400; font-size:14px; letter-spacing:.16em; color:#c6ad78; }
.site-footer .legal { max-width:none; text-align:left; margin:30px 0 0; padding-top:23px; border-top:1px solid #80917430; font-size:11px; line-height:1.8; color:#9fab96; }

@media(max-width:800px) {
  .site-footer { padding:38px 0 30px; }
  .site-footer .content { padding-left:26px; padding-right:26px; }
  .site-footer .footer-columns { grid-template-columns:repeat(2,minmax(0,1fr)); gap:28px 30px; }
  .site-footer .footer-brand { grid-column:1/-1; max-width:none; }
}
@media(max-width:580px) {
  .site-footer .footer-columns { grid-template-columns:1fr; gap:26px; }
}

/* Avertissement de la page des versions : la sous-section « Comment ca marche »
   (regles de base dans navigation.css, hors perimetre). */
.essai-avertissement h3 { margin:18px 0 11px; padding-top:14px; border-top:1px solid #d7ab63; font:400 19px/1.3 Georgia,'Times New Roman',serif; color:#7a3f13; }
.essai-avertissement a { color:#6d3a10; overflow-wrap:anywhere; }

/* ---------------------------------------------------------------------------
   BOUTONS DES PAGES D'ARCHIVE
   .button / .primary n'existaient que dans reborn-home.css, que seul
   index.html charge : sur developpement.html, versions.php et les douze
   dossiers, <a class="button primary"> se rendait en lien nu. On le pose ici,
   sous main.archive-main, pour ne pas toucher au chapeau de l'accueil.
   --------------------------------------------------------------------------- */
.archive-main .button {
  box-sizing:border-box; display:inline-flex; align-items:center; gap:12px;
  margin:6px 8px 6px 0; padding:13px 21px;
  background:#fbf1d4; color:#5b3016;
  border:1px solid #ad7436; box-shadow:2px 3px 0 #8d5628;
  font:700 15px/1.2 'Trebuchet MS',Arial,sans-serif;
  text-decoration:none; text-shadow:none;
}
.archive-main .button.primary { background:linear-gradient(#f7dd9e,#f0c96f); color:#4a2a12; }
.archive-main .button:hover { background:#fff8e4; }
.archive-main .button.primary:hover { background:linear-gradient(#fdeab6,#f4d68a); }
.archive-main .button:active { box-shadow:1px 1px 0 #8d5628; transform:translate(1px,2px); }
.archive-main .button:focus-visible { outline:3px solid #8d7038; outline-offset:3px; }

/* ===========================================================================
   LA LARGEUR D'ECRAN  --  seconde passe
   ---------------------------------------------------------------------------
   Le grief : sur 1920 px, le site n'occupait que 1200 px, soit 62 % de l'ecran.
   La reponse n'est PAS d'elargir la prose : une ligne de 1 500 px est illisible,
   l'oeil ne retrouve pas la ligne suivante. Ce qui gagne de la largeur ici,
   c'est ce qui est structure -- grilles de cartes, releves, accordeons,
   catalogue, pied a quatre colonnes ; la prose garde sa mesure (--mesure),
   et plusieurs listes verticales interminables deviennent des grilles.

   Trois reglages, et rien d'autre :
     --gouttiere  la marge laissee de chaque cote (elle grandit avec l'ecran)
     --cadre      la largeur de la coquille (bandeau, onglets, corps, pied)
     --mesure     la mesure de lecture, ~65-75 signes, exprimee en `ch` donc
                  recalculee dans le corps de chaque bloc

   Largeur du cadre :  375 -> 351 | 1280 -> 1203 | 1440 -> 1354 | 1920 -> 1600
   `--cadre` est calcule en `vw` (donc absolu) : les blocs imbriques s'ecrivent
   `width:100%; max-width:var(--cadre)` et ne depassent jamais leur parent.
   La gouttiere ne descend jamais sous 12 px de chaque cote, ce qui couvre la
   barre de defilement (15 px) : aucun debordement horizontal possible.
   =========================================================================== */

:root {
  --gouttiere: max(24px, 3vw);
  --cadre: min(1600px, 100vw - 2 * var(--gouttiere));
  --mesure: 74ch;
  --mesure-large: 90ch;
}
@media (max-width: 600px) { :root { --gouttiere: 12px; } }

/* --- la coquille : tout s'aligne sur la meme largeur, au pixel pres -------- */
header.masthead,
nav.wood-nav,
.portal > section.banner.archive-banner,
section.hero,
main.archive-main,
.content,
.site-footer .content,
.editorial-supplement {
  box-sizing: border-box;
  width: 100%;
  max-width: var(--cadre);
  margin-left: auto;
  margin-right: auto;
}
main.archive-main { padding-left: 48px; padding-right: 48px; }
/* Le chapeau de l'accueil : reborn-home.css lui imposait 1200 px en dur. */
section.hero .hero-content { width: 100%; }
/* Au telephone, le corps et les bandes de l'accueil restent bord a bord,
   exactement comme avant cette passe. */
@media (max-width: 600px) {
  main.archive-main { max-width: none; padding-left: 18px; padding-right: 18px; }
  .content { max-width: none; }
}
/* Au telephone, les grilles a deux colonnes de l'accueil n'en avaient aucune
   qui les replie : `.intro`, `.era-collection` et `.document-layout` restaient
   en 2 x 128 px sur un ecran de 375 px, et la ligne d'epoque (`.era-list > a`,
   une boite flex dont l'enfant n'avait pas de `min-width:0`) debordait de la
   page. Une colonne sous 700 px. */
@media (max-width: 700px) {
  .intro, .era-collection, .document-layout { grid-template-columns: minmax(0, 1fr); }
  .era-list > a > div { min-width: 0; }
}
/* patchnotes.css est charge APRES cette feuille : specificite doublee. */
.archive-main .local-patchnotes { max-width: var(--cadre); }

/* --- la mesure de lecture -------------------------------------------------
   Ces blocs sont de la prose : ils ne s'elargissent pas, ils se cadrent.
   Plusieurs depassaient deja 1 030 px avant cette passe (130 signes) : ils
   gagnent donc en lisibilite au passage. */
.archive-intro { max-width: none; margin-left: 0; margin-right: 0; }
/* Le chapeau de page : titre a gauche, texte a droite, plutot qu'un cartouche
   plein cadre dont la moitie droite serait vide. Le `.scroll-title` est en
   position absolue : ce n'est pas un element de grille, la premiere ligne
   commence donc bien au titre. */
@media (min-width: 1250px) {
  .archive-intro {
    display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
    column-gap: 48px; align-items: start;
  }
  .archive-intro > h2 { grid-column: 1; grid-row: 1; margin-bottom: 0; }
  .archive-intro > p  { grid-column: 2; }
}
.archive-main .parchment > p,
.archive-main .parchment > ul,
.archive-main .parchment > ol,
.archive-intro p,
.timeline-title p,
.heritage-copy p,
.faq-catalog p,
.patchnote-body p,
.patchnote-body li { max-width: var(--mesure); }
.source-note { max-width: var(--mesure-large); }
/* Les paragraphes poses directement dans le corps (chapeau du catalogue, ligne
   de comptage) et ceux des panneaux verts, qui n'ont pas de cartouche autour
   d'eux pour les borner. `.archive-back` est exclu : ce sont des boutons
   centres, pas de la prose. */
.archive-main > p:not(.archive-back),
.progress-board p,
.archive-interface p,
.archive-briefing p,
.version-shelves > p,
.catalogue-empty p,
.catalogue-status { max-width: var(--mesure); }

/* ===========================================================================
   LES LISTES QUI DEVIENNENT DES GRILLES
   Un seul seuil, 1250 px : en dessous, tout reste en une colonne, exactement
   comme aujourd'hui. Au-dessus, chaque colonne fait au moins ~430 px, donc
   reste lisible.
   =========================================================================== */
@media (min-width: 1250px) {

  /* FAQ : huit questions a la file sur 1 500 px de large, c'etait une colonne
     de 8 lignes dans un desert. Deux colonnes, chaque repli reste dans la
     sienne (une reponse ouverte garde donc une mesure de lecture). */
  .faq-catalog {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px; align-items: start;
    border: 0; background: none; box-shadow: none;
  }
  .faq-catalog details,
  .faq-catalog details:first-child {
    border: 2px solid #9a6c40; background: #f8e9c2; box-shadow: 2px 3px 0 #85603b;
  }

  /* Les replis du supplement editorial : meme traitement. */
  .editorial-details {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 20px; align-items: start;
  }
  .editorial-details details { margin: 0; }

  /* Les dossiers de patch (le projet + les douze epoques) : la pile de
     <details> devient deux colonnes, chacune bordee comme une carte. Le corps
     perd son alinea de 160 px, inutile une fois la colonne reduite. */
  .patch-accordion {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px; border: 0; box-shadow: none; background: none;
  }
  .patch-accordion details,
  .patch-accordion details:last-child { border: 1px solid #c8ba99; }
  .patch-accordion details > div { padding: 0 20px 16px; }

  /* Les actualites : quatre entrees empilees deviennent 2 x 2. */
  .news-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px; align-items: start;
  }

  /* « La taverne » du projet : trois replis cote a cote. */
  .inn {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    gap: 14px; border: 0; background: none; box-shadow: none; margin-top: 21px;
  }
  .inn details { border: 1px solid #bfae88; background: #f8e9c2; }
  /* Le bandeau de l'auberge reste un bandeau : il coiffe les trois replis. */
  .inn > .inn-title { grid-column: 1 / -1; }

  /* Le tableau d'avancement : la jauge etait figee a 280 px au milieu d'un
     panneau devenu deux fois plus large. */
  .progress-board { grid-template-columns: minmax(0, 1fr) minmax(280px, 26%); }

  /* La galerie d'epoque : l'image d'archive avait 255 px fixes au milieu de
     l'ecran ; elle prend enfin la place qui lui revient. */
  .heritage-gallery { grid-template-columns: minmax(0, 1fr) minmax(255px, 34%); }
  .legacy-shot img { height: 300px; }

  /* L'avertissement du catalogue : sept puces sur toute la largeur faisaient
     des lignes de 1 500 px. Deux colonnes de journal, titre en pleine largeur. */
  .essai-avertissement { column-count: 2; column-gap: 42px; }
  .essai-avertissement h2 { column-span: all; }
  .essai-avertissement h3 { break-after: avoid; }
  .essai-avertissement ul,
  .essai-avertissement li,
  .essai-avertissement p { break-inside: avoid; }

  /* Les pages juridiques (mentions, confidentialite, conditions) : des
     cartouches independants empiles sur plusieurs ecrans de haut. En colonnes
     de journal ils se lisent dans l'ordre, du haut de la premiere colonne au
     bas de la seconde, et la mesure retombe a ~65 signes.
     `break-inside:avoid` garde chaque cartouche entier. */
  /* L'onglet de section (`.scroll-title`) est en `position:absolute` : dans un
     bloc a colonnes, son bloc conteneur se resout hors du fragment et il part
     se coller en haut de la colonne. On le repasse en flux (`relative`), au
     meme endroit a l'oeil pres, avec une marge basse negative pour qu'il ne
     pousse pas le titre vers le bas. */
  .pages-legales > section:not(.archive-intro) > .scroll-title {
    position: relative; display: inline-block;
    top: -48px; left: -8px; margin-bottom: -29px;
  }
  .pages-legales { column-count: 2; column-gap: 26px; }
  .pages-legales > * { break-inside: avoid; }
  .pages-legales > .archive-intro,
  .pages-legales > .archive-back { column-span: all; }
}

/* ===========================================================================
   LE CATALOGUE DES VERSIONS (versions.php)
   Trente entrees a la file, chacune une barre de 1 500 px portant trois mots.
   A partir de 1 500 px d'ecran elles se rangent deux par deux ; une entree
   ouverte reprend toute la largeur (`grid-column:1/-1`), pour que son panneau
   « notes d'epoque / essayer cette version » garde ses deux colonnes.
   catalogue.css est charge apres cette feuille : specificite doublee.
   =========================================================================== */
@media (min-width: 1500px) {
  .catalogue-list {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px; align-items: start;
  }
  .catalogue-list > .catalogue-version { margin: 0; }
  .catalogue-list > .catalogue-version[open] { grid-column: 1 / -1; }
}
.catalogue .version-columns li,
.catalogue .version-columns > section > p { max-width: var(--mesure); }

/* ===========================================================================
   L'ACCUEIL
   =========================================================================== */
@media (min-width: 701px) {
  .era-collection { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
}
@media (min-width: 1250px) {
  .document-layout { gap: 40px 70px; }
  .document-stack { align-content: start; }
  /* La carte d'epoque : la capture etait bloquee a 260 px de haut dans une
     carte devenue bien plus large -- deux bandes noires de chaque cote. */
  .era-feature > img { height: 330px; }
}
