/* =============================================================================
   SIDEREUS — INDEX RECHERCHE
   Design : épuré, sériel, école suisse. Continuité graphique FP01.
   Système monochrome (encre / papier) + un accent fonctionnel réservé
   aux signaux « renvoi / externe / en cours ».
   -----------------------------------------------------------------------------
   Tout est piloté par les variables ci-dessous : pour adopter la charte
   exacte de FP01, il suffit de remplacer --font-sans et --accent.
   ============================================================================= */

/* ----------------------------------------------------------------- TOKENS -- */
:root {
  /* Couleurs */
  --paper:    #f4f2ec;   /* fond papier, chaud */
  --paper-2:  #efece4;   /* fond légèrement creusé */
  --ink:      #15140f;   /* encre, noir chaud */
  --ink-2:    #6c6a60;   /* texte secondaire */
  --ink-3:    #9b988d;   /* labels, tertiaire */
  --line:     #d7d3c8;   /* filet */
  --line-2:   #e6e2d8;   /* filet ténu */
  --field:    #ebe8df;   /* survol / champ */
  --accent:   #d63a16;   /* vermillon — renvoi / externe / en cours */
  --on-dark:  #f4f2ec;   /* texte sur bloc inversé */

  /* Typographie — remplacer --font-sans par la fonte FP01 le cas échéant */
  --font-sans: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --font-mono: "SF Mono", ui-monospace, "Menlo", Consolas, monospace;

  /* Mise en page */
  --page-x: clamp(1.25rem, 4.2vw, 4rem);   /* marges latérales communes */
  --maxw: 1600px;
  --gap: 1.25rem;                          /* gouttière de la grille index */

  /* Colonne « À propos » : largeur du panneau et rétraction du corps */
  --about-panel-w: 400px;
  --about-w: 400px;

  /* Grille de l'index : N° · Code · Titre+Description (empilés) · Acteurs · Année · Statut · ± */
  --grid:
    3.25rem
    4.5rem
    minmax(14rem, 3fr)
    minmax(6.5rem, 1fr)
    4rem
    6.75rem
    1.75rem;
  --detail-indent: 0rem;                   /* détail aligné à gauche du tableau (sous N°) */

  /* Mouvement */
  --dur: .42s;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ------------------------------------------------------------------ RESET -- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1;
}
ul { list-style: none; padding: 0; }
a { color: inherit; text-decoration: none; }
button {
  font: inherit; color: inherit; background: none;
  border: 0; padding: 0; cursor: pointer;
}
img { display: block; max-width: 100%; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Conteneur : marges latérales partagées par toutes les bandes */
.utility, .masthead, .controls__row, .index, .colophon {
  padding-inline: var(--page-x);
  max-width: var(--maxw);
  margin-inline: auto;
}

/* Petite glyphe d'accompagnement (flèches ↗ → ×) */
.glyph { display: inline-block; }

/* ============================================================= UTILITY BAR == */
.utility {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: .55rem;
  position: relative;
  font-size: .75rem;
}

/* — Grands traits horizontaux unifiés : tous en retrait de --page-x,
     alignés sur l'index (au lieu de toucher les bords gauche/droite) — */
.utility::after,
.controls__row::before, .controls__row::after,
.colophon::before {
  content: ""; position: absolute;
  left: .5rem; right: .5rem; height: 1px;
}
.utility::after        { bottom: 0; background: var(--line); }
.controls__row::before { top: 0;    background: var(--ink); }
.controls__row::after  { bottom: 0; background: var(--line); }
.colophon::before      { top: 0;    background: var(--ink); }

/* « À propos » ouvert : à droite, les traits rejoignent la barre verticale du
   panneau — y compris en grande largeur, où le conteneur (plafonné à --maxw et
   centré) ne touche plus le panneau. On compense alors la marge droite du
   conteneur pour coller la barre du panneau (sinon : micro-décalage). */
body.about-open .utility::after,
body.about-open .controls__row::before,
body.about-open .controls__row::after,
body.about-open .colophon::before {
  right: min(0px, calc((var(--maxw) + var(--about-w) - 100vw) / 2));
}
.utility__nav { display: flex; align-items: baseline; flex-wrap: wrap; gap: .9rem 1.4rem; min-width: 0; }
.utility__label, .control__label, .colophon__label {
  font-size: .6875rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
}
/* Deux familles de renvoi, séparées par un filet */
.renvoi-group { display: flex; align-items: baseline; gap: .9rem; min-width: 0; }
.renvoi-group--outils { padding-left: 1.4rem; border-left: 1px solid var(--line); }
/* Masqué dans l'en-tête dès qu'il basculerait sous « Réseau » (piloté par le JS
   fitTools). Les Outils restent repris dans le pied de page. */
.renvoi-group--outils.is-collapsed { display: none; }
.renvoi-list { display: flex; flex-wrap: wrap; align-items: baseline; gap: .6rem 1rem; }

/* — Acteur (site pair) : lien texte sobre — */
.renvoi--actor { display: inline-flex; align-items: baseline; gap: .3em; letter-spacing: .01em; }
.renvoi--actor .glyph { color: var(--accent); transition: transform .2s var(--ease); }
.renvoi--actor:hover { color: var(--accent); }
.renvoi--actor:hover .glyph { transform: translate(2px, -2px); }
.renvoi__note { color: var(--ink-3); font-size: .6875rem; margin-left: .15rem; }
/* Description d'outil en pied de page (gris clair, sous la pastille) */
.renvoi__note--block { display: block; margin: .3rem 0 0; max-width: 28ch; line-height: 1.35; }

/* — Outil : pastille accent, traitée en appel à l'action — */
.renvoi--tool {
  display: inline-flex; align-items: center; gap: .45em;
  padding: .22rem .55rem;
  border: 1px solid var(--accent); color: var(--accent);
  letter-spacing: .01em; line-height: 1.15;
  transition: background .15s, color .15s;
}
.renvoi--tool .glyph { color: currentColor; transition: transform .2s var(--ease); }
.renvoi--tool:hover { background: var(--accent); color: var(--on-dark); }
.renvoi--tool:hover .glyph { transform: translate(2px, -2px); }
.utility__about {
  display: inline-flex; align-items: baseline; gap: .35em;
  letter-spacing: .04em; text-transform: uppercase; font-size: .6875rem;
  white-space: nowrap;
}
.utility__about .glyph { color: var(--accent); transition: transform .2s var(--ease); }
.utility__about:hover { color: var(--accent); }
.utility__about:hover .glyph { transform: translateX(3px); }

/* ================================================================ MASTHEAD == */
.masthead { padding-block: clamp(1.5rem, 4vw, 3.25rem) clamp(1.25rem, 3vw, 2.25rem); }
.masthead__brand { display: flex; align-items: baseline; gap: clamp(1.25rem, 4vw, 3.25rem); flex-wrap: wrap; }
.wordmark {
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: .9;
}
.masthead__descriptor {
  font-size: .8125rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-2);
  padding-bottom: .2em;
}
.masthead__intro {
  margin-top: clamp(1rem, 2.5vw, 1.75rem);
  max-width: 74ch;
  font-size: clamp(1rem, 1.5vw, 1.1875rem);
  line-height: 1.45;
  color: var(--ink);
  text-wrap: pretty;
  white-space: pre-line;   /* respecte les sauts de ligne explicites de SITE.intro */
}

/* ================================================================ CONTROLS == */
.controls {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
}
.controls__row {
  display: flex; align-items: center; gap: 1.5rem 2rem;
  padding-block: .7rem;
  flex-wrap: wrap;
  position: relative;
}
.control { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.control--grow { flex: 1 1 auto; }
.control--count { margin-left: auto; gap: 1rem; }
.control__label { flex: none; }

/* Pastilles de filtre (groupes & mots-clés) */
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip {
  padding: .3rem .65rem;
  font-size: .8125rem; letter-spacing: .01em;
  color: var(--ink-2);
  border: 1px solid var(--line);
  background: transparent;
  transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap;
}
.chip:hover { background: var(--field); color: var(--ink); border-color: var(--ink-3); }
.chip.is-active { background: var(--ink); color: var(--on-dark); border-color: var(--ink); }
.chips--kw .chip.is-active { background: var(--accent); border-color: var(--accent); color: var(--on-dark); }

.count {
  font-family: var(--font-mono);
  font-size: .8125rem; font-variant-numeric: tabular-nums;
  color: var(--ink-2); white-space: nowrap;
}
.reset {
  font-size: .6875rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-3); text-decoration: underline; text-underline-offset: 3px;
}
.reset:hover { color: var(--accent); }

/* =================================================================== INDEX == */
.index { padding-top: 1.5rem; padding-bottom: 4rem; }

.index__head,
.entry__head {
  display: grid;
  grid-template-columns: var(--grid);
  grid-template-areas:
    "num code title actors year status toggle"
    "num code sub   actors year status toggle";
  column-gap: var(--gap);
  row-gap: .15rem;
  align-items: start;
}

/* Affectation des cellules aux zones (titre + description dans la même colonne) */
.cell--num      { grid-area: num; }
.cell--code     { grid-area: code; }
.cell--title    { grid-area: title; }
.cell--subtitle { grid-area: sub; }
.cell--actors   { grid-area: actors; }
.cell--year     { grid-area: year; }
.cell--status   { grid-area: status; }
.cell--toggle   { grid-area: toggle; }
.entry__meta    { grid-area: meta; }
.index__head {
  padding-block: .6rem;
  border-bottom: 1px solid var(--ink);
}
.index__head .cell {
  font-size: .6875rem; letter-spacing: .09em; text-transform: uppercase;
  color: var(--ink-3);
}

/* En-têtes cliquables : tri par colonne (flèches alphabétiques) */
.index__head .sort {
  display: inline-flex; align-items: baseline; gap: .35em;
  width: 100%; text-align: left;
  transition: color .15s;
}
.index__head .sort:hover,
.index__head .sort.is-active { color: var(--ink); }
.sort__arr { color: var(--ink-3); font-size: .95em; transition: color .15s; }
.index__head .sort:hover .sort__arr { color: var(--ink-2); }
.index__head .sort.is-active .sort__arr { color: var(--accent); }

.cell { min-width: 0; }
/* Plus de troncature : le texte revient à la ligne au lieu d'être coupé */
.cell--title, .cell--subtitle, .cell--actors {
  white-space: normal;
  overflow-wrap: break-word;
  text-wrap: pretty;
}
.cell--num, .cell--code, .cell--year { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.cell--year { font-size: .8125rem; color: var(--ink-2); }
.cell--toggle { justify-self: end; }
.entry__meta { display: none; }   /* visible en mode fiche (mobile) uniquement */

/* --- Ligne / entrée --- */
.entry { border-bottom: 1px solid var(--line-2); }
.entry.is-hidden { display: none; }   /* masquée par le filtre */
.entry__head {
  width: 100%;
  text-align: left;
  padding-block: .95rem;
  transition: background .15s;
}
.entry__head:hover { background: var(--field); }
.entry.is-open .entry__head { background: var(--paper-2); }

.entry .cell--num  { font-size: .8125rem; color: var(--ink-3); }
.entry .cell--code { font-size: .8125rem; color: var(--ink); letter-spacing: .02em; }
.entry .cell--title {
  font-size: .8125rem; font-weight: 500; letter-spacing: -.01em;
  line-height: 1.25; text-underline-offset: 3px;
}
.entry__head:hover .cell--title { text-decoration: underline; }
.entry .cell--subtitle { font-size: .8125rem; color: var(--ink-2); line-height: 1.35; }
.entry .cell--actors  { font-size: .8125rem; color: var(--ink-2); }

/* --- Sous-catégorie : articles & publications (sous-lignes fines) ---
   Une seule ligne, la plus fine possible, portant la citation complète. */
.entry__head--child {
  display: flex; align-items: baseline; gap: .55rem;
  width: 100%; text-align: left;
}
/* padding fin imposé avec assez de spécificité pour battre la règle mobile
   générique (.entry__head { padding-block: 1.1rem }) → ligne fine partout */
/* Ligne fine, décalée pour que la flèche ↳ commence sous la colonne « Titre »
   (= largeur N° + Code + 2 gouttières). Pas de barre rouge à gauche. */
.entry--child > .entry__head--child {
  padding-block: .3rem;
  padding-left: calc(3.25rem + 4.5rem + 2 * var(--gap));   /* début colonne Titre */
}
/* Même fond que le site (pas de teinte de survol hors mode admin) */
body:not(.is-admin) .entry__head--child:hover { background: transparent; }
.entry--child > .entry__head--child .cell--code {
  flex: none;
  font-family: var(--font-mono); font-size: .6875rem; letter-spacing: .02em;
  color: var(--accent);
}
.entry--child.is-nested > .entry__head--child .cell--code::before {
  content: "↳"; margin-right: .35em; color: var(--accent);
}
.entry__cite {
  flex: 1 1 auto; min-width: 0;
  font-size: .8125rem; line-height: 1.3; color: var(--ink-2);
  text-wrap: pretty;
}
.entry__cite .citation__revue, .entry__cite em { font-style: italic; color: inherit; }
/* Flèche-lien rouge, tout à droite de la ligne : lien direct vers l'article */
.cite-link {
  flex: none; margin-left: .75rem; align-self: baseline;
  display: inline-flex; align-items: center;
  color: var(--accent); font-size: 1rem; line-height: 1;
  transition: transform .2s var(--ease);
}
.cite-link .glyph { color: inherit; }
.cite-link:hover { transform: translate(2px, -2px); }

/* Statut */
.status {
  display: inline-flex; align-items: center; gap: .45em;
  font-style: normal;
  font-size: .6875rem; letter-spacing: .05em; text-transform: uppercase;
  color: var(--ink-2); white-space: nowrap;
}
.status::before {
  content: ""; width: .5em; height: .5em; border-radius: 50%;
  background: var(--ink); flex: none;
}
.status--live::before { background: var(--accent); }
.status--done::before { background: var(--ink); }
.status--soon::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ink-3); }

/* Bouton ± */
.toggle {
  display: inline-grid; place-items: center;
  width: 1.25rem; height: 1.25rem;
  color: var(--ink-3);
  transition: color .15s, transform var(--dur) var(--ease);
}
.entry__head:hover .toggle { color: var(--ink); }
.entry.is-open .toggle { color: var(--accent); transform: rotate(45deg); }

/* --- Détail dépliable --- */
.entry__detail {
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows var(--dur) var(--ease);
}
.entry.is-open .entry__detail { grid-template-rows: 1fr; }
.entry__detail-inner { overflow: hidden; min-height: 0; }

.detail {
  display: grid;
  /* Texte : prend tout l'espace restant. Image : largeur fixe à droite.
     Le gap fait la marge de vide entre le texte et l'image. */
  grid-template-columns: minmax(0, 1fr) 22rem;
  gap: clamp(2rem, 5vw, 4rem);
  padding: .35rem 0 2.25rem var(--detail-indent);
  opacity: 0; transform: translateY(4px);
  transition: opacity .35s var(--ease) .06s, transform .35s var(--ease) .06s;
}
.entry.is-open .detail { opacity: 1; transform: none; }
/* Sans image : le texte occupe toute la largeur (pas de colonne média vide) */
.detail--no-media { grid-template-columns: 1fr; }

.detail__summary {
  font-size: .8125rem; line-height: 1.62;
  color: var(--ink); text-wrap: pretty;
}
/* Bloc « Rattaché à » (détail d'un article / publication) */
.detail__parents { margin-top: 1.5rem; }
.detail__parents h4 {
  font-size: .6875rem; letter-spacing: .09em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: .5rem;
}
.parents__list { display: flex; flex-direction: column; gap: .35rem; }
.parents__link {
  display: inline-flex; align-items: baseline; gap: .6rem;
  text-align: left; color: var(--ink); transition: color .15s;
}
.parents__link:hover { color: var(--accent); }
.parents__link:hover .parents__title { text-decoration: underline; text-underline-offset: 3px; }
.parents__code {
  font-family: var(--font-mono); font-size: .8125rem;
  color: var(--accent); flex: none;
}
.parents__title { font-size: .9375rem; }

/* Article / publication : référence bibliographique + lien unique obligatoire */
.detail__citation {
  font-size: 1.0625rem; line-height: 1.5; color: var(--ink); margin-bottom: 1.5rem;
}
.detail__citation em, .citation__revue { font-style: italic; }
.detail__articlelink { margin-bottom: 1.5rem; }
.articlelink {
  display: inline-flex; align-items: baseline; gap: .4rem;
  padding: .55rem .95rem;
  border: 1px solid var(--accent); color: var(--accent);
  font-size: .9375rem; letter-spacing: .01em;
  transition: background .15s, color .15s;
}
.articlelink:hover { background: var(--accent); color: var(--on-dark); }
.articlelink .glyph { color: inherit; }

.detail__biblio { margin-top: 1.5rem; }
.detail__biblio h4 {
  font-size: .6875rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 600; margin-bottom: 0;
  padding-bottom: .4rem; border-bottom: 1px solid var(--line-2);
}
.biblio__item {
  display: grid; grid-template-columns: 6.5rem 1fr; gap: .75rem;
  align-items: center;            /* centre les deux colonnes verticalement */
  padding: .6rem 0; border-bottom: 1px solid var(--line-2);
  font-size: .875rem;
}
.biblio__type {
  font-size: .6875rem; letter-spacing: .04em; text-transform: uppercase;
  color: var(--ink-3);
}
.biblio__link {
  display: inline-flex; align-items: baseline; gap: .35em;
  color: var(--ink); text-underline-offset: 3px;
}
.biblio__link:hover { color: var(--accent); text-decoration: underline; }
.biblio__link .glyph { color: var(--accent); font-size: .85em; }

/* Média — format fixe (notice §05.01). Largeur FIXE (indépendante de la longueur
   de la légende), alignée à droite ; se réduit seulement si la colonne est plus
   étroite. (Sans width définie, justify-self:end rétractait le cadre à la largeur
   de la légende → images à légende courte affichées trop petites.) */
.detail__media { align-self: start; justify-self: end; width: 22rem; max-width: 100%; }
.media__frame {
  position: relative;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  background: #fff;            /* le vide hors image est comblé en blanc */
  overflow: hidden;
}
/* Image en object-fit:contain (jamais déformée) ; zoom + déplacement appliqués
   par transform. Si l'image ne remplit pas le cadre, le pourtour reste blanc. */
.media__frame img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain; object-position: center;
  transform: translate(var(--tx, 0%), var(--ty, 0%)) scale(var(--s, 1));
  transform-origin: center center;
  display: block;
}
.media__cap {
  margin-top: .5rem;
  font-size: .6875rem; letter-spacing: .04em; text-transform: uppercase;
  color: var(--ink-3);
}

/* État vide */
.index__empty {
  padding: 3rem 0; color: var(--ink-2); font-size: .9375rem;
}

/* ================================================================ COLOPHON == */
.colophon {
  position: relative;
  margin-top: 2rem;
  padding-block: 2.5rem 3.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr 1.4fr auto;
  gap: 2rem;
  align-items: start;
  font-size: .8125rem;
}
.colophon__label { display: block; margin-bottom: .7rem; }
.colophon__group li { margin-bottom: .45rem; }
.colophon__group .renvoi { font-size: .8125rem; }
/* Outils en pied : un peu plus d'air entre chaque outil (pastille + description) */
#outils-links-foot li:not(:last-child) { margin-bottom: 1rem; }
.colophon__meta { color: var(--ink-2); line-height: 1.5; }
.colophon__note { color: var(--ink-3); margin-top: .4rem; }
.colophon__year {
  font-family: var(--font-mono); justify-self: end; color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

/* ================================================================== ABOUT === */
/* Le corps se rétracte pour céder la place au panneau */
body { transition: padding-right var(--dur) var(--ease); }
body.about-open { padding-right: var(--about-w); }

.about {
  position: fixed; top: 0; right: 0; z-index: 60;
  width: var(--about-panel-w); height: 100dvh;
  background: var(--paper);
  border-left: 1px solid var(--ink);
  transform: translateX(100%);
  transition: transform var(--dur) var(--ease);
  display: flex; flex-direction: column;
}
.about.is-open { transform: none; }
.about__inner { display: flex; flex-direction: column; height: 100%; }
.about__bar {
  display: flex; align-items: center; justify-content: space-between;
  /* Padding vertical volontairement faible : le bandeau doit être plus court
     que la barre utilitaire pour que le JS (minHeight = hauteur de .utility)
     puisse l'égaliser et aligner les deux filets. min-height = confort mobile,
     surchargé par le style inline du JS en desktop. */
  padding: .4rem clamp(1.25rem, 3vw, 1.75rem);
  min-height: 3rem;
  border-bottom: 1px solid var(--line);
  flex: none;
}
.about__title { font-size: .8125rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; }
.about__close {
  display: inline-flex; align-items: center; gap: .4em;
  font-size: .6875rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2);
}
.about__close .glyph { font-size: 1.1em; }
.about__close:hover { color: var(--accent); }
.about__body { padding: clamp(1.5rem, 3vw, 2.25rem); overflow-y: auto; flex: 1; }
.about__body p { line-height: 1.62; font-size: 1rem; color: var(--ink); text-wrap: pretty; }
.about__body p + p { margin-top: 1rem; }

/* Voile : uniquement en mobile, quand le corps ne se rétracte pas */
.about-scrim { position: fixed; inset: 0; z-index: 55; background: rgba(21, 20, 15, .42); }
.about-scrim[hidden] { display: none; }
@media (min-width: 761px) { .about-scrim { display: none; } }

/* ============================================================== RESPONSIVE === */
@media (max-width: 1080px) {
  :root {
    --grid:
      3rem
      4rem
      minmax(10rem, 1fr)
      4rem
      6.5rem
      1.75rem;
    --detail-indent: 0rem;
  }
  .index__head,
  .entry__head {
    grid-template-areas:
      "num code title year status toggle"
      "num code sub   year status toggle";
  }
  /* Acteurs masqués (passent dans le détail) */
  .cell--actors { display: none; }
}

@media (max-width: 760px) {
  /* En mobile, le panneau « À propos » recouvre (pas de rétraction) */
  :root { --about-panel-w: min(26rem, 92vw); --about-w: 0px; }

  /* Bandeau de renvoi empilé */
  .utility { flex-direction: column; align-items: flex-start; gap: .65rem; padding-block: .8rem; }
  .utility__nav { flex-direction: column; align-items: flex-start; gap: .55rem; }
  .renvoi-group { gap: .7rem; }
  .renvoi-group--outils { border-left: 0; padding-left: 0; }   /* pas de filet une fois empilé */
  .utility__about { align-self: flex-start; }

  .masthead__intro { font-size: 1.0625rem; }
  .control--count { width: 100%; margin-left: 0; justify-content: space-between; }

  /* L'index passe en fiches empilées ; l'en-tête devient une barre de tri */
  .index__head {
    display: flex; flex-wrap: wrap; align-items: center; gap: .4rem;
    padding-block: .55rem;
  }
  .index__head::before {
    content: "Trier"; flex: none; margin-right: .25rem;
    font-size: .6875rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3);
  }
  .index__head .cell--toggle { display: none; }
  .index__head .sort {
    width: auto; border: 1px solid var(--line); padding: .26rem .5rem;
    white-space: nowrap; overflow: visible;
  }
  .index__head .sort.is-active { border-color: var(--ink); background: var(--field); }
  .entry__head {
    grid-template-columns: 2.75rem 1fr auto;
    grid-template-areas:
      "num title toggle"
      "num sub   toggle"
      "num meta  toggle";
    row-gap: .2rem;
    column-gap: .9rem;
    padding-block: 1.1rem;
  }
  .entry .cell--num    { grid-area: num; align-self: start; padding-top: .2rem; color: var(--ink-3); }
  .entry .cell--title  { grid-area: title; white-space: normal; font-size: 1.0625rem; }
  .entry .cell--subtitle { grid-area: sub; white-space: normal; margin-top: .1rem; }
  .cell--toggle        { grid-area: toggle; align-self: start; padding-top: .2rem; }
  .entry .cell--code, .entry .cell--year, .entry .cell--status { display: none; }

  /* Méta compacte : Code | Année | Statut, séparés par filets verticaux */
  .entry__meta {
    grid-area: meta; display: flex; align-items: center; flex-wrap: wrap;
    margin-top: .5rem;
    font-family: var(--font-mono); font-size: .75rem; color: var(--ink-2);
    font-variant-numeric: tabular-nums;
  }
  .entry__meta > * {
    padding-right: .6rem; margin-right: .6rem; border-right: 1px solid var(--line);
  }
  .entry__meta > *:last-child { padding-right: 0; margin-right: 0; border-right: 0; }
  .entry__meta .m-code { color: var(--ink); }
  .entry__meta .status { font-family: var(--font-sans); }

  .detail { grid-template-columns: 1fr; gap: 1.25rem; padding-left: 3.65rem; padding-bottom: 1.75rem; }
  .detail__media { order: -1; max-width: 22rem; }
  .biblio__item { grid-template-columns: 5rem 1fr; }

  .colophon { grid-template-columns: 1fr; gap: 1.5rem; }
  .colophon__year { justify-self: start; }
}

@media (max-width: 420px) {
  .entry__head { grid-template-columns: 2.5rem 1fr auto; }
  .detail { padding-left: 0; }
}

/* =========================================================== PREFERENCES ==== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
  .entry__detail { transition: none; }
}

/* ================================================================== PRINT === */
@media print {
  :root { --paper: #fff; --paper-2: #fff; }
  .utility, .controls, .toggle, .about { display: none !important; }
  body { font-size: 11pt; }
  .entry__detail { grid-template-rows: 1fr !important; }
  .entry__detail-inner { overflow: visible; }
  .detail { opacity: 1 !important; transform: none !important; }
  .entry { break-inside: avoid; }
  a { text-decoration: none; }
}
