/* amhe.info · socle commun : jetons de la charte + composants
   Mobile d'abord. Tous les espacements sont des multiples de 8 px. */

@font-face { font-family: "Grenze Gotisch"; src: url("../assets/fonts/grenze-gotisch-var.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Literata"; src: url("../assets/fonts/literata-var.woff2") format("woff2"); font-weight: 200 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Literata"; src: url("../assets/fonts/literata-var-italic.woff2") format("woff2"); font-weight: 200 900; font-style: italic; font-display: swap; }

:root {
  /* Pigments */
  --velin: #F7F1E3;
  --velin-clair: #FFFBF1;
  --filet: #D9CBA8;
  --encre: #221A12;
  --encre-douce: #5A4C3B;
  --lapis: #1D3C8F;
  --lapis-fonce: #12265E;
  --vermillon: #B4301C;
  --or: #C69A3A;
  --or-fonce: #7C5B12;
  --or-feuille: linear-gradient(135deg, #8F6A1C 0%, #E7C76E 38%, #C69A3A 58%, #F2DD9A 78%, #9C7522 100%);

  /* Rôles */
  --fond: var(--velin);
  --surface: var(--velin-clair);
  --texte: var(--encre);
  --texte-doux: var(--encre-douce);
  --lien: var(--lapis);
  --accent: var(--vermillon);

  /* Typographie */
  --gothique: "Grenze Gotisch", "Literata", Georgia, serif;
  --livre: "Literata", Georgia, "Times New Roman", serif;

  --t-petit: 0.875rem;
  --t-corps: 1.0625rem;
  --t-20: 1.25rem;
  --t-25: 1.5625rem;
  --t-31: 1.9375rem;
  --t-39: 2.4375rem;
  --t-49: 3.0625rem;

  /* Rythme */
  --u: 8px;
  --gouttiere: 16px;
  --section: 64px;
  --largeur: 1280px;
  --ombre: 0 1px 0 rgb(34 26 18 / 8%), 0 12px 32px -16px rgb(34 26 18 / 35%);

  --diapre-lapis: url("../assets/ornaments/diapre-lapis.svg");
  --diapre-fonce: url("../assets/ornaments/diapre-lapis-fonce.svg");
  --diapre-vermillon: url("../assets/ornaments/diapre-vermillon.svg");
}

@media (min-width: 768px) { :root { --gouttiere: 32px; --section: 96px; --t-corps: 1.125rem; } }
@media (min-width: 1200px) { :root { --gouttiere: 48px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 96px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
body { margin: 0; background: var(--fond); color: var(--texte); font-family: var(--livre); font-size: var(--t-corps); line-height: 1.65; font-feature-settings: "liga", "dlig", "onum"; overflow-wrap: break-word; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--lien); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); }
/* Lien façon wiki vers une fiche du site : le texte reste lisible, le filet d'or signale le lien. */
a.terme { color: inherit; text-decoration-color: var(--or); }
a.terme:hover { color: var(--accent); text-decoration-color: currentColor; }
:focus-visible { outline: 3px solid var(--vermillon); outline-offset: 2px; }
p { margin: 0 0 16px; }
h1, h2, h3 { font-family: var(--gothique); font-weight: 600; line-height: 1.04; margin: 0; letter-spacing: 0.002em; overflow-wrap: normal; }
sup { font-size: 0.65em; line-height: 0; }
.cadre { width: min(100%, var(--largeur)); margin-inline: auto; padding-inline: var(--gouttiere); }
.lien-evitement { position: absolute; left: 8px; top: -64px; z-index: 100; padding: 8px 16px; background: var(--encre); color: var(--velin); }
.lien-evitement:focus { top: 8px; }

/* ── Bandeau de la maquette : navigation entre les propositions ── */
.maquette { background: var(--encre); color: #E9E2CF; font-size: var(--t-petit); line-height: 1.3; }
.maquette__dedans { display: flex; align-items: center; gap: 8px 16px; padding-block: 8px; overflow-x: auto; white-space: nowrap; }
.maquette strong { font-weight: 600; color: #E7C76E; }
.maquette a { color: inherit; padding: 8px; text-decoration: none; border-radius: 2px; }
.maquette a:hover { color: #fff; text-decoration: underline; }
.maquette a[aria-current="page"] { background: #E9E2CF; color: var(--encre); }

/* ── Banderole des flux ── */
.banderole { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 32px; padding: 0 var(--gouttiere); background: var(--lapis-fonce); color: #EDE6D3; font-size: var(--t-petit); line-height: 1.2; }
.banderole[hidden] { visibility: hidden; }
.banderole__titre { display: none; flex: none; padding-right: 12px; border-right: 1px solid rgba(217, 203, 168, 0.4); color: #D9CBA8; font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; }
@media (min-width: 768px) { .banderole__titre { display: block; } }
.banderole__source { flex: none; color: #F2DD9A; font-weight: 600; }
.banderole__source::after { content: " ·"; }
.banderole a { min-width: 0; overflow: hidden; color: inherit; text-overflow: ellipsis; white-space: nowrap; }
.banderole a:hover, .banderole a:focus-visible { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.banderole__suite { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 32px; padding: 0 0 2px; border: 0; background: none; color: #F2DD9A; font: 1.25rem/1 var(--livre); cursor: pointer; }
.banderole__suite:hover { color: #fff; }

/* ── En-tête ── */
.tete { position: sticky; top: 0; z-index: 20; background: var(--velin); border-bottom: 1px solid var(--encre); box-shadow: 0 3px 0 -1px var(--velin), 0 4px 0 -1px var(--or); }
/* Le menu reste collé au logo sur toutes les pages, avec ou sans recherche dans l'en-tête. */
.tete__dedans { display: flex; align-items: center; justify-content: flex-start; gap: 16px 24px; min-height: 72px; }
.marque { flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--encre); text-decoration: none; font-family: var(--gothique); font-size: var(--t-31); font-weight: 600; line-height: 1; }
.marque img { width: 36px; height: 38px; }
.marque b { font-weight: inherit; }
.marque span { color: var(--vermillon); }
.tete__dedans { flex-wrap: wrap; padding-block: 8px; }
.nav { display: flex; gap: 8px; }
.nav a { color: var(--encre); text-decoration: none; padding: 8px; font-size: 1rem; }
.nav a:hover { color: var(--vermillon); text-decoration: underline; }
.nav a[aria-current="page"] { color: var(--vermillon); font-weight: 600; }
.nav { flex-wrap: wrap; }
@media (max-width: 767px) {
  .nav { order: 2; width: 100%; justify-content: space-between; gap: 0; }
  .recherche--tete { order: 3; }
  .nav a { padding-inline: 4px; }
}
.menu { position: relative; }
.menu summary { list-style: none; min-height: 44px; min-width: 44px; display: grid; place-items: center; padding: 0 16px; border: 1px solid var(--encre); cursor: pointer; font-size: 1rem; }
.menu summary::-webkit-details-marker { display: none; }
.menu__liste { position: absolute; right: 0; top: calc(100% + 8px); min-width: 240px; display: grid; background: var(--surface); border: 1px solid var(--encre); box-shadow: var(--ombre); }
.menu__liste a { padding: 16px; color: var(--encre); border-bottom: 1px solid var(--filet); text-decoration: none; }
@media (min-width: 1024px) { .menu { display: none; } }

/* Lien vers un autre site : il s'ouvre dans un nouvel onglet. */
a[target="_blank"]:not(.bouton)::after { content: " ↗"; font-size: 0.8em; white-space: nowrap; }
.banderole a[target="_blank"]::after, a.billet__logo[target="_blank"]::after { content: none; }

/* ── Rubriques ── */
.rubrique { display: block; margin-bottom: 8px; color: var(--vermillon); font-size: var(--t-petit); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.pied-de-mouche::before { content: "¶"; color: var(--vermillon); margin-right: 0.3em; font-style: normal; }
.titre-section { font-size: var(--t-49); }
@media (min-width: 768px) { .titre-section { font-size: 4rem; } }

/* ── Lettrine enluminée ── */
.lettrine {
  float: left; display: grid; place-items: center; width: 1.3em; height: 1.3em; margin: 0.06em 0.14em 0 0;
  font-family: var(--gothique); font-weight: 700; font-style: normal; line-height: 1;
  background: var(--diapre-fonce) center / 20px;
  border: 0.05em solid var(--or); outline: 1px solid var(--vermillon); outline-offset: -0.1em;
  box-shadow: 0 0 0 1px var(--or-fonce);
}
.lettrine > span { display: block; padding-bottom: 0.08em; background: var(--or-feuille); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lettrine--vermillon { background: var(--diapre-vermillon) center / 20px; outline-color: var(--velin-clair); }
.lettrine--vermillon > span { background: none; color: var(--velin-clair); }
.chapeau .lettrine { font-size: 3.9em; margin: 0.08em 0.12em 0 0; }
.chapeau::after { content: ""; display: block; clear: both; }

/* Lettrine d'une page inachevée, comme dans un manuscrit : l'emplacement réglé avec sa lettre d'attente (ébauche),
   puis la lettre tracée à l'encre de lapis (en construction). L'or ne vient qu'une fois la page complète. */
.lettrine--reserve { background: none; border: 1px dashed var(--or-fonce); outline: none; box-shadow: none; }
.lettrine--reserve > span { background: none; color: var(--encre-douce); font-family: var(--livre); font-weight: 400; font-size: 0.42em; padding: 0; }
.lettrine--trace { background: var(--velin-clair); border: 1px solid var(--lapis); outline-color: transparent; box-shadow: none; }
.lettrine--trace > span { background: none; color: var(--lapis); }

/* ── État d'une fiche : carré réglé (à venir, ébauche), à demi peint (en construction), doré (complète) ── */
.etat { display: inline-flex; align-items: baseline; gap: 6px; color: var(--encre-douce); font: italic 400 var(--t-petit)/1.4 var(--livre); letter-spacing: 0; white-space: nowrap; }
.etat::before { content: ""; flex: none; align-self: center; width: 12px; height: 12px; border: 1px dashed var(--or-fonce); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.etat--avenir::before { border-style: dotted; border-color: var(--encre-douce); border-radius: 50%; }
.etat--construction { color: var(--lapis); }
.etat--construction::before { border: 1px solid var(--lapis); background: linear-gradient(to top right, var(--lapis) 50%, transparent 50%); }
.etat--complete { color: var(--or-fonce); font-weight: 600; }
.etat--complete::before { border: 1px solid var(--lapis-fonce); background: var(--or-feuille); }
.etat--seul { margin-right: 8px; vertical-align: -1px; }
.etats-legende { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 24px; margin: 8px 0 16px; padding: 0; color: var(--encre-douce); font-size: var(--t-petit); line-height: 1.45; }
.etats-legende .etat::after { content: "\00a0:"; margin-left: -6px; }
.etats-barre { display: flex; height: 12px; background: var(--fond); border: 1px solid var(--or-fonce); overflow: hidden; }
.etats-barre span { flex: none; min-width: 2px; }
.etats-barre__complete { background: var(--or-feuille); border-right: 1px solid var(--lapis-fonce); }
.etats-barre__construction { background: var(--lapis); }
.etats-barre__ebauche { background: var(--filet); }

/* Note d'une page inachevée : la marge d'un copiste, filet à gauche, pas un bandeau d'alerte. */
.avis { max-width: 62em; margin: 0 0 8px; padding: 4px 0 4px 16px; border-left: 3px double var(--or-fonce); font-size: 1rem; line-height: 1.55; }
.avis--construction { border-left-color: var(--lapis); }
.avis p { margin: 0; }
.avis details { margin-top: 4px; }
.avis summary { width: fit-content; min-height: 24px; cursor: pointer; color: var(--texte-doux); font-style: italic; }
.avis summary:hover { color: var(--vermillon); }
.avis .liste-rubriquee { margin: 4px 0 0; }
.avis b { color: var(--vermillon); }
.avis--construction b { color: var(--lapis); }
.sr-seul { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ── Miniature encadrée ── */
.miniature { margin: 0; }
.miniature__cadre { position: relative; padding: 16px; background: var(--diapre-lapis) center / 28px; border: 2px solid var(--or); outline: 1px solid var(--or-fonce); box-shadow: var(--ombre); }
.miniature__cadre--arcade { padding-top: 56px; }
.miniature__cadre--arcade::before { content: ""; position: absolute; left: 14px; right: 14px; top: 14px; height: 40px; background: url("../assets/ornaments/arcade.svg") center top / 64px 40px repeat-x; border: 1px solid var(--or); border-bottom-width: 2px; }
.miniature__cadre img { width: 100%; border: 2px solid var(--or); background: var(--velin); }
figcaption { margin-top: 8px; color: var(--texte-doux); font-size: var(--t-petit); line-height: 1.45; font-style: italic; }

/* ── Boutons et recherche ── */
.bouton { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 8px 24px; background: var(--vermillon); border: 1px solid var(--vermillon); color: var(--velin-clair); font: 600 1.0625rem/1.2 var(--livre); text-decoration: none; cursor: pointer; transition: background 0.15s; }
.bouton:hover { background: #8F2413; color: var(--velin-clair); }
.bouton--discret { background: transparent; color: var(--encre); border-color: var(--encre); }
.bouton--discret:hover { background: var(--encre); color: var(--velin); }
.recherche { display: flex; border: 2px solid var(--encre); background: var(--surface); box-shadow: 6px 6px 0 -1px var(--or); }
.recherche label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.recherche input { flex: 1; min-width: 0; min-height: 56px; padding: 8px 16px; border: 0; background: none; font: 1.0625rem var(--livre); color: var(--encre); }
.recherche input::placeholder { color: var(--encre-douce); font-style: italic; opacity: 1; }
.recherche input:focus { outline: none; }
.recherche:focus-within { outline: 3px solid var(--vermillon); outline-offset: 2px; }
.recherche .bouton { border: 0; flex: none; min-height: 56px; padding-inline: 16px; }
@media (min-width: 768px) { .recherche .bouton { padding-inline: 32px; } }
.recherche--tete { flex: 1 1 100%; min-width: 0; box-shadow: none; border-width: 1px; }
.recherche--tete input { min-height: 44px; font-size: 1rem; }
.recherche--tete .bouton { min-height: 44px; padding-inline: 16px; font-size: 1rem; }
@media (min-width: 1024px) { .recherche--tete { flex: 0 1 360px; margin-left: auto; } }

/* ── Pied de page ── */
.pied { background: var(--lapis-fonce); color: #EDE6D3; border-top: 8px solid transparent; border-image: url("../assets/ornaments/diapre-vermillon.svg") 8 round; font-size: var(--t-petit); }
.pied a { color: #F2DD9A; }
.pied a:hover { color: #fff; }
.pied__grille { display: grid; gap: 32px; padding-block: 48px; }
.pied h2 { font-size: var(--t-25); color: #F2DD9A; margin-bottom: 8px; }
.pied ul { list-style: none; margin: 0; padding: 0; }
.pied li { padding-block: 4px; }
.pied__etat { margin-bottom: 8px; color: #D9CBA8; }
.pied__etat span { display: block; margin-bottom: 4px; color: #E7C76E; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
@media (min-width: 768px) { .pied__grille { grid-template-columns: 2fr 1fr 2fr; gap: 48px; } }

/* ── Copier une adresse (pied de page, sur lapis profond) ── */
.copie { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.copie__bouton { min-height: 44px; min-width: 44px; padding: 0 16px; border: 1px solid var(--filet); background: transparent; color: #F2DD9A; font: 1rem/1.2 var(--livre); cursor: pointer; transition: background 0.15s, color 0.15s; }
.copie__bouton:hover { background: #F2DD9A; color: var(--lapis-fonce); }
.copie__bouton:focus-visible { outline-color: #F2DD9A; }
.copie__bouton[data-copie]::before { content: "✓ "; }
.copie__bulle { color: #E7C76E; font-style: italic; }

/* ── Retour en haut : sceau carré, ombre d'or comme le champ de recherche ── */
.pied .haut { position: fixed; right: var(--gouttiere); bottom: 16px; z-index: 30; display: grid; place-items: center; width: 48px; height: 48px; background: var(--velin-clair); border: 1px solid var(--encre); box-shadow: 4px 4px 0 -1px var(--or); color: var(--encre); font: 600 1.5rem/1 var(--livre); text-decoration: none; transition: opacity 0.2s, translate 0.2s, visibility 0.2s, background 0.15s; }
.pied .haut:hover { background: var(--encre); color: var(--velin); }
.haut-auto:not(.haut-visible) .pied .haut { opacity: 0; visibility: hidden; translate: 0 16px; }
.haut-repere { position: absolute; top: 0; left: 0; width: 1px; height: 100vh; pointer-events: none; }
/* Le bouton ne doit pas cacher la fin du pied de page. */
.pied { padding-bottom: 72px; }

/* ── Chargement : anneau lapis sur filet (élément <progress> indéterminé) ── */
@property --arc-debut { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@property --arc-fin { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
progress.chargement::-webkit-progress-bar, progress.chargement::-webkit-progress-value { display: none; background: none; }
progress.chargement::-moz-progress-bar { display: none; background: none; }
progress.chargement {
  --_de: calc(90deg + var(--arc-debut, 0deg));
  --_a: calc(90deg + var(--arc-fin, 158deg));
  --epaisseur: 4px;
  display: inline-block; vertical-align: -0.2em; width: 1.25em; height: 1.25em; margin-right: 8px; border-radius: 50%; appearance: none; border: 0;
  background: conic-gradient(from var(--_de), var(--lapis) calc(var(--_a) - var(--_de)), transparent 0) var(--filet);
  mask-image: radial-gradient(farthest-side, transparent calc(100% - var(--epaisseur)), #000 calc(100% - var(--epaisseur)));
  animation: chargement-tour 1.5s linear infinite, chargement-arc 3s ease-in-out infinite;
}
@media (forced-colors: active) { progress.chargement { forced-color-adjust: none; background: conic-gradient(from 90deg, CanvasText 158deg, Canvas 0); } }
@keyframes chargement-tour { to { rotate: 1turn; } }
@keyframes chargement-arc { from { --arc-debut: 0deg; --arc-fin: 3deg; } 50% { --arc-debut: 100deg; --arc-fin: 358deg; } to { --arc-debut: 360deg; --arc-fin: 363deg; } }
/* Mouvement réduit : la règle globale coupe toute animation ; l'anneau garde une rotation lente pour montrer que ça travaille. */
@media (prefers-reduced-motion: reduce) { progress.chargement { --arc-fin: 158deg; animation: chargement-tour 6s linear infinite !important; } }

/* ── Impression : le texte et ses sources, sans navigation ── */
@media print {
  @page { margin: 16mm 14mm; }
  body { background: #fff; color: #000; font-size: 11pt; line-height: 1.5; }
  .avis details, .banderole, .lien-evitement, .nav, .recherche--tete, .pied, .fil, .sommaire, .lecture, .haut-repere, .filtres-moteur, .slider__fleche, .slider__vignettes, .clubs__regions, .copie { display: none !important; }
  .article-grille { display: block; }
  .tete { position: static; background: none; box-shadow: none; border-bottom: 1px solid #000; }
  a { color: #000; text-decoration: underline; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.85em; overflow-wrap: anywhere; }
  a[target="_blank"]:not(.bouton)::after { content: " (" attr(href) ")"; }
  h1, h2, h3 { break-after: avoid; }
  figure, img, table, blockquote, li { break-inside: avoid; }
  .miniature__cadre, .lettrine { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
