/* Promptocratie — feuille unique, sans dépendance, claire et sombre.
   Reprise et étendue depuis le squelette du premier test
   (archive/2026-09-04-premier-test/site/static/style.css).

   Un document politique se lit longtemps : mesure de ligne courte, contraste
   franc, tableaux qui défilent dans leur conteneur plutôt qu'une page qui
   déborde. Aucune couleur, aucune typographie n'évoque un fournisseur de
   modèles : la palette est encre et papier, les fontes sont celles du système. */

:root {
  --fond: #fbfaf7;
  --fond-2: #f2efe9;
  --fond-3: #e9e5dc;
  --texte: #14130f;
  --texte-doux: #55514a;
  --trait: #ddd8ce;
  --accent: #7a2e2e;
  --accent-doux: #f0e4e1;
  --largeur: 46rem;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #14130f;
    --fond-2: #1d1b17;
    --fond-3: #26231e;
    --texte: #f2efe9;
    --texte-doux: #a9a49a;
    --trait: #33302a;
    --accent: #e0a08f;
    --accent-doux: #2a211e;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font: 16px/1.65 ui-serif, Georgia, "Iowan Old Style", "Times New Roman", serif;
}
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

.bandeau {
  display: flex; flex-wrap: wrap; gap: .75rem 1.5rem;
  align-items: baseline; justify-content: space-between;
  padding: 1rem 1.25rem; border-bottom: 1px solid var(--trait); background: var(--fond-2);
}
.marque { text-decoration: none; color: inherit; display: flex; flex-direction: column; }
.marque strong { font-size: 1.15rem; letter-spacing: .01em; }
.marque span { font-size: .82rem; color: var(--texte-doux); }
.nav { display: flex; flex-wrap: wrap; gap: 1rem;
  font: 500 .85rem/1 ui-sans-serif, system-ui, -apple-system, sans-serif; }
.nav a { text-decoration: none; color: var(--texte-doux); }
.nav a:hover, .nav a.actif { color: var(--accent); }

main { display: flex; gap: 2.5rem; align-items: flex-start;
  max-width: 76rem; margin: 0 auto; padding: 2rem 1.25rem 4rem; }
article { max-width: var(--largeur); min-width: 0; flex: 1; }
article.large { max-width: 60rem; }

h1 { font-size: 1.9rem; line-height: 1.2; margin: 0 0 1rem; }
h2 { font-size: 1.3rem; margin: 2.5rem 0 .75rem; padding-top: .5rem;
     border-top: 1px solid var(--trait); }
h3 { font-size: 1.05rem; margin: 1.75rem 0 .5rem; }
h4 { font-size: .95rem; margin: 1.25rem 0 .4rem; color: var(--texte-doux); }
p, li { overflow-wrap: break-word; }
.chapo { font-size: 1.08rem; color: var(--texte-doux); }
.vide { background: var(--accent-doux); border-left: 3px solid var(--accent);
        padding: .85rem 1rem; }
.note { color: var(--texte-doux); font-size: .9rem; }

blockquote { margin: 1.5rem 0; padding: .1rem 1rem; border-left: 3px solid var(--trait);
             color: var(--texte-doux); }
code { font: .85em/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
       background: var(--fond-2); padding: .1em .35em; border-radius: 3px; }
pre { background: var(--fond-2); border: 1px solid var(--trait); border-radius: 4px;
      padding: .9rem 1rem; overflow-x: auto; }
pre code { background: none; padding: 0; }
hr { border: 0; border-top: 1px solid var(--trait); margin: 2.5rem 0; }

/* Tableaux : le conteneur défile, jamais la page. */
.scroll-x { overflow-x: auto; margin: 1.25rem 0; border: 1px solid var(--trait);
            border-radius: 4px; max-width: 100%; }
table { border-collapse: collapse; width: 100%;
        font: .84rem/1.45 ui-sans-serif, system-ui, sans-serif; }
th, td { text-align: left; vertical-align: top; padding: .5rem .65rem;
         border-bottom: 1px solid var(--trait); }
th { background: var(--fond-2); font-weight: 600; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
td a.src { word-break: break-all; font-size: .92em; }
td.nb { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.toc { position: sticky; top: 1.5rem; width: 15rem; flex: none;
       font: .82rem/1.5 ui-sans-serif, system-ui, sans-serif; }
.toc p { text-transform: uppercase; letter-spacing: .06em; font-size: .7rem;
         color: var(--texte-doux); margin: 0 0 .5rem; }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc li { margin: .35rem 0; }
.toc a { color: var(--texte-doux); text-decoration: none; }
.toc a:hover, .toc a.actif { color: var(--accent); text-decoration: underline; }

footer { border-top: 1px solid var(--trait); background: var(--fond-2);
         padding: 1.5rem 1.25rem; color: var(--texte-doux);
         font: .8rem/1.5 ui-sans-serif, system-ui, sans-serif; }
footer p { max-width: var(--largeur); margin: .3rem auto; }

/* --- Éléments propres à la SPA ------------------------------------------- */

.fil { font: .8rem/1.5 ui-sans-serif, system-ui, sans-serif; color: var(--texte-doux);
       margin: 0 0 .75rem; }
.fil a { color: var(--texte-doux); }

.cartes { list-style: none; margin: 1.25rem 0; padding: 0; display: grid; gap: .85rem; }
.carte { border: 1px solid var(--trait); border-radius: 5px; padding: 1rem 1.15rem;
         background: var(--fond-2); }
.carte h3 { margin: 0 0 .35rem; font-size: 1.05rem; }
.carte h3 a { text-decoration: none; }
.carte h3 a:hover { text-decoration: underline; }
.carte p { margin: .3rem 0; }
.carte dl { display: grid; grid-template-columns: auto 1fr; gap: .15rem .75rem;
            margin: .6rem 0 0;
            font: .8rem/1.5 ui-sans-serif, system-ui, sans-serif; }
.carte dt { color: var(--texte-doux); }
.carte dd { margin: 0; }

.etiquettes { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0 0; padding: 0;
              list-style: none;
              font: .74rem/1 ui-sans-serif, system-ui, sans-serif; }
.etiquette { border: 1px solid var(--trait); border-radius: 999px;
             padding: .3rem .6rem; color: var(--texte-doux); background: var(--fond); }

button, .bouton {
  font: 500 .85rem/1 ui-sans-serif, system-ui, sans-serif;
  color: var(--texte); background: var(--fond-3);
  border: 1px solid var(--trait); border-radius: 4px;
  padding: .55rem .8rem; cursor: pointer;
}
button:hover, .bouton:hover { border-color: var(--accent); color: var(--accent); }
button[aria-pressed="true"] { background: var(--accent-doux); border-color: var(--accent); }

.meta { border: 1px solid var(--trait); border-radius: 5px; background: var(--fond-2);
        margin: 2rem 0; padding: 1rem 1.15rem; }
.meta > header { display: flex; flex-wrap: wrap; gap: .75rem;
                 align-items: center; justify-content: space-between; }
.meta > header p { margin: 0; font-size: .92rem; color: var(--texte-doux); max-width: 34rem; }
.meta-corps { margin-top: 1rem; border-top: 1px solid var(--trait); padding-top: .75rem; }
.meta dl { display: grid; grid-template-columns: 12rem 1fr; gap: .3rem .9rem; margin: 0;
           font: .84rem/1.5 ui-sans-serif, system-ui, sans-serif; }
.meta dt { color: var(--texte-doux); }
.meta dd { margin: 0; }

.onglets { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1.5rem 0 1rem;
           padding: 0 0 .75rem; border-bottom: 1px solid var(--trait); list-style: none; }

.filtres { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1rem 0; padding: 0;
           list-style: none; }

.mesure { border: 1px solid var(--trait); border-radius: 5px; margin: .85rem 0;
          background: var(--fond-2); }
.mesure > summary { cursor: pointer; padding: .7rem .9rem; font-weight: 600; }
.mesure > summary::marker { color: var(--texte-doux); }
.mesure .corps { padding: 0 .9rem .9rem; }
.mesure dl { display: grid; grid-template-columns: 13rem 1fr; gap: .3rem .9rem;
             margin: .5rem 0 0; font: .84rem/1.5 ui-sans-serif, system-ui, sans-serif; }
.mesure dt { color: var(--texte-doux); }
.mesure dd { margin: 0; }

.galerie { list-style: none; margin: 1rem 0; padding: 0;
           display: grid; gap: .9rem;
           grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); }
.galerie figure { margin: 0; }
.galerie img { width: 100%; height: auto; display: block; border: 1px solid var(--trait);
               border-radius: 4px; background: var(--fond-2); }
/* Le prompt d'une image est un texte à lignes : `white-space: pre-line` le rend
   tel qu'il a été envoyé au modèle, sans le recoller en un bloc. */
.galerie figcaption { font: .74rem/1.4 ui-sans-serif, system-ui, sans-serif;
                      color: var(--texte-doux); margin-top: .35rem;
                      white-space: pre-line; }

/* Une conversation intégrale pèse près d'un mégaoctet : elle est repliée, et
   son texte n'est rendu qu'au dépliage. Rien n'y est coupé. */
.conversation { border: 1px solid var(--trait); border-radius: 5px; margin: .85rem 0;
                background: var(--fond-2); }
.conversation > summary { cursor: pointer; padding: .7rem .9rem; font-weight: 600; }
.conversation > summary::marker { color: var(--texte-doux); }
.conversation > p, .conversation > .corps-conversation { padding: 0 .9rem .9rem; }
.corps-conversation { max-height: 70vh; overflow-y: auto; }

.avert { border: 1px dashed var(--accent); background: var(--accent-doux);
         padding: .6rem 1.25rem; text-align: center;
         font: .8rem/1.5 ui-sans-serif, system-ui, sans-serif; }

.chargement { color: var(--texte-doux); font-style: italic; }

@media (max-width: 62rem) {
  main { display: block; padding: 1.5rem 1rem 3rem; }
  .toc { position: static; width: auto; margin: 0 0 2rem; padding-bottom: 1rem;
         border-bottom: 1px solid var(--trait); }
  .toc ul { columns: 2; column-gap: 1.5rem; }
  .meta dl, .mesure dl { grid-template-columns: 1fr; gap: .1rem; }
  .meta dt, .mesure dt { margin-top: .5rem; }
}
@media (max-width: 30rem) {
  h1 { font-size: 1.5rem; }
  .toc ul { columns: 1; }
  .carte dl { grid-template-columns: 1fr; }
  .carte dt { margin-top: .4rem; }
  .galerie { grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)); }
}
