/* ==========================================================================
   Le Programme Ouvert - presidentielle27.fr
   Feuille de style unique. Aucune dependance externe.
   Polices a auto-heberger dans /assets/fonts/ (voir @font-face plus bas).
   ========================================================================== */

/* --- 1. Polices ----------------------------------------------------------
   A telecharger et convertir en woff2 :
   - Newsreader        https://fonts.google.com/specimen/Newsreader
   - IBM Plex Sans     https://fonts.google.com/specimen/IBM+Plex+Sans
   - IBM Plex Mono     https://fonts.google.com/specimen/IBM+Plex+Mono
   Si les fichiers sont absents, les piles de secours prennent le relais
   sans casser la mise en page. -------------------------------------------- */

@font-face {
  font-family: 'Newsreader';
  src: url('/assets/fonts/newsreader-variable.woff2') format('woff2-variations');
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: 'Newsreader';
  src: url('/assets/fonts/newsreader-variable-italic.woff2') format('woff2-variations');
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Plex Sans';
  src: url('/assets/fonts/ibm-plex-sans-400.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Plex Sans';
  src: url('/assets/fonts/ibm-plex-sans-600.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Plex Mono';
  src: url('/assets/fonts/ibm-plex-mono-400.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

/* --- 2. Tokens ----------------------------------------------------------- */

:root {
  /* Couleurs */
  --encre:      #14161a;   /* texte principal, froid, pas de noir pur */
  --encre-2:    #4a4f58;   /* texte secondaire */
  --encre-3:    #7b818c;   /* metadonnees, legendes */
  --papier:     #f1f2ee;   /* fond de page, gris pale legerement vert */
  --papier-2:   #e7e9e3;   /* surfaces surelevees */
  --trait:      #d3d6cd;   /* filets */
  --prune:      #6b2d4f;   /* accent principal */
  --prune-clair:#8f4a71;   /* survol */
  --prune-voile:#f3e8ee;   /* fond d'accent tres pale */
  --signal:     #a06a12;   /* statut, alertes editoriales */
  --blanc:      #fbfbf9;

  /* Typographie */
  --serif: 'Newsreader', 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --sans:  'Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono:  'Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;

  /* Echelle typographique (base 18px, ratio 1.25) */
  --t-xs:   0.75rem;
  --t-sm:   0.875rem;
  --t-base: 1rem;
  --t-md:   1.125rem;
  --t-lg:   1.375rem;
  --t-xl:   1.75rem;
  --t-2xl:  2.25rem;
  --t-3xl:  3rem;
  --t-4xl:  4rem;

  /* Rythme */
  --espace:   1.5rem;
  --colonne:  40rem;   /* largeur de lecture confortable */
  --marge:    13rem;   /* colonne de marge des reperes structurels */
  --large:    72rem;   /* conteneur large */
}

/* --- 3. Socle ------------------------------------------------------------ */

*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 18px;
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--papier);
  color: var(--encre);
  font-family: var(--serif);
  font-size: var(--t-base);
  line-height: 1.65;
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 0.6em;
  text-wrap: balance;
}

p { margin: 0 0 1.15em; }
p:last-child { margin-bottom: 0; }

a {
  color: var(--prune);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: color-mix(in srgb, var(--prune) 35%, transparent);
  transition: text-decoration-color 0.15s ease, color 0.15s ease;
}
a:hover { color: var(--prune-clair); text-decoration-color: currentColor; }

:focus-visible {
  outline: 2px solid var(--prune);
  outline-offset: 3px;
  border-radius: 2px;
}

strong { font-weight: 600; }

hr {
  border: 0;
  border-top: 1px solid var(--trait);
  margin: calc(var(--espace) * 2) 0;
}

img { max-width: 100%; height: auto; }

.saut-contenu {
  position: absolute;
  left: -9999px;
  background: var(--encre);
  color: var(--papier);
  padding: 0.75rem 1.25rem;
  z-index: 100;
}
.saut-contenu:focus { left: 1rem; top: 1rem; }

/* --- 4. Utilitaires typographiques --------------------------------------- */

.surtitre {
  font-family: var(--mono);
  font-size: var(--t-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--encre-3);
  margin: 0 0 0.9rem;
  display: block;
}

.chapeau {
  font-size: var(--t-md);
  line-height: 1.55;
  color: var(--encre-2);
}

.mono { font-family: var(--mono); font-size: var(--t-sm); }

/* --- 5. Conteneurs -------------------------------------------------------- */

.enveloppe {
  width: 100%;
  max-width: var(--large);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.colonne-texte { max-width: var(--colonne); }

.section { padding-block: calc(var(--espace) * 3); }
.section--dense { padding-block: calc(var(--espace) * 2); }
.section + .section { border-top: 1px solid var(--trait); }

/* --- 6. En-tete ----------------------------------------------------------- */

.entete {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--papier) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--trait);
}

.entete__grille {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 4.25rem;
}

.marque {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--encre);
}
.marque:hover { color: var(--encre); }

.marque__nom {
  font-family: var(--serif);
  font-size: var(--t-md);
  font-weight: 600;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.marque__nom em {
  font-style: normal;
  color: var(--prune);
}
.marque__annee {
  font-family: var(--mono);
  font-size: var(--t-xs);
  color: var(--encre-3);
  letter-spacing: 0.08em;
}

.nav { display: flex; align-items: center; gap: 1.75rem; }

.nav__lien {
  font-family: var(--sans);
  font-size: var(--t-sm);
  text-decoration: none;
  color: var(--encre-2);
  padding-block: 0.35rem;
  border-bottom: 2px solid transparent;
}
.nav__lien:hover { color: var(--encre); border-bottom-color: var(--prune); }
.nav__lien[aria-current="page"] { color: var(--encre); border-bottom-color: var(--prune); }

.nav__bascule {
  display: none;
  background: none;
  border: 1px solid var(--trait);
  border-radius: 3px;
  padding: 0.45rem 0.7rem;
  font-family: var(--sans);
  font-size: var(--t-sm);
  color: var(--encre);
  cursor: pointer;
}

@media (max-width: 820px) {
  .nav__bascule { display: block; }
  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--papier);
    border-bottom: 1px solid var(--trait);
    padding: 0.5rem 1.5rem 1.25rem;
  }
  .nav[hidden] { display: none; }
  .nav__lien {
    padding-block: 0.75rem;
    border-bottom: 1px solid var(--trait);
  }
  .nav__lien:hover { border-bottom-color: var(--trait); }
}

/* --- 7. Bandeau d'identification (transparence editoriale) ---------------- */

.bandeau {
  background: var(--encre);
  color: color-mix(in srgb, var(--papier) 80%, transparent);
  font-family: var(--sans);
  font-size: var(--t-xs);
  padding-block: 0.55rem;
}
.bandeau a { color: var(--papier); text-decoration-color: color-mix(in srgb, var(--papier) 45%, transparent); }
.bandeau a:hover { color: var(--blanc); }

/* --- 8. Accueil : accroche ------------------------------------------------ */

.accroche { padding-block: clamp(3rem, 9vw, 6.5rem) clamp(2.5rem, 6vw, 4rem); }

.accroche__titre {
  font-size: clamp(2.25rem, 6.2vw, var(--t-4xl));
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.05;
  max-width: 20ch;
  margin-bottom: 1.5rem;
}
.accroche__titre em {
  font-style: italic;
  font-weight: 500;
  color: var(--prune);
}

.accroche__texte {
  font-size: var(--t-lg);
  line-height: 1.5;
  color: var(--encre-2);
  max-width: 34rem;
  margin-bottom: 2rem;
}

.accroche__actions { display: flex; flex-wrap: wrap; gap: 0.9rem; align-items: center; }

/* --- 9. Boutons ----------------------------------------------------------- */

.bouton {
  display: inline-block;
  font-family: var(--sans);
  font-size: var(--t-sm);
  font-weight: 600;
  text-decoration: none;
  padding: 0.7rem 1.4rem;
  border-radius: 3px;
  border: 1px solid var(--encre);
  background: var(--encre);
  color: var(--papier);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.bouton:hover { background: var(--prune); border-color: var(--prune); color: var(--blanc); }

.bouton--fantome { background: transparent; color: var(--encre); }
.bouton--fantome:hover { background: var(--encre); color: var(--papier); border-color: var(--encre); }

/* --- 10. Bloc signature : la fiche versionnee ----------------------------- */
/* C'est l'element identitaire du site. Chaque axe est un document date,
   versionne et citable. Ne pas le decorer davantage.                        */

.fiche {
  font-family: var(--mono);
  font-size: var(--t-xs);
  border: 1px solid var(--trait);
  border-left: 3px solid var(--prune);
  background: var(--blanc);
  padding: 1rem 1.25rem;
  margin-bottom: 2.5rem;
  max-width: var(--colonne);
}

.fiche__ligne {
  display: flex;
  gap: 1rem;
  padding-block: 0.3rem;
  color: var(--encre-2);
}
.fiche__ligne + .fiche__ligne { border-top: 1px dotted var(--trait); }

.fiche__cle {
  flex: 0 0 8.5rem;
  color: var(--encre-3);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.fiche__val { color: var(--encre); }

.statut {
  display: inline-block;
  padding: 0.05rem 0.5rem;
  border-radius: 2px;
  font-size: var(--t-xs);
  letter-spacing: 0.05em;
}
.statut--debat     { background: var(--prune-voile); color: var(--prune); }
.statut--stabilise { background: #e2ece5; color: #2c5c42; }
.statut--brouillon { background: #f5ecd9; color: var(--signal); }

/* --- 11. Grille des axes -------------------------------------------------- */

.axes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: 1px;
  background: var(--trait);
  border: 1px solid var(--trait);
  margin-top: 2.5rem;
}

.axe {
  background: var(--papier);
  padding: 1.6rem 1.5rem 1.4rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: background 0.18s ease;
}
.axe:hover { background: var(--blanc); color: inherit; }
.axe:hover .axe__titre { color: var(--prune); }

.axe__code {
  font-family: var(--mono);
  font-size: var(--t-xs);
  letter-spacing: 0.1em;
  color: var(--encre-3);
}
.axe__titre {
  font-size: var(--t-lg);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
  transition: color 0.18s ease;
}
.axe__resume {
  font-size: var(--t-sm);
  color: var(--encre-2);
  line-height: 1.5;
  margin: 0;
}
.axe--vide { opacity: 0.55; }
.axe--vide:hover { background: var(--papier); }

/* --- 12. Page d'axe : mise en page a marge -------------------------------- */

.axe-page { padding-block: 3rem 5rem; }

.axe-page__grille {
  display: grid;
  grid-template-columns: var(--marge) minmax(0, var(--colonne));
  gap: 3rem;
  align-items: start;
}

@media (max-width: 960px) {
  .axe-page__grille { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
}

.sommaire { position: sticky; top: 6rem; font-family: var(--sans); }
@media (max-width: 960px) {
  .sommaire {
    position: static;
    border: 1px solid var(--trait);
    background: var(--blanc);
    padding: 1.25rem;
  }
}

.sommaire__titre {
  font-family: var(--mono);
  font-size: var(--t-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--encre-3);
  margin-bottom: 0.9rem;
}
.sommaire__liste { list-style: none; margin: 0; padding: 0; }
.sommaire__liste li { margin-bottom: 0.55rem; }
.sommaire__liste a {
  font-size: var(--t-sm);
  text-decoration: none;
  color: var(--encre-2);
  border-left: 2px solid transparent;
  padding-left: 0.7rem;
  display: block;
  line-height: 1.35;
}
.sommaire__liste a:hover { color: var(--encre); border-left-color: var(--trait); }
.sommaire__liste a.est-actif { color: var(--prune); border-left-color: var(--prune); }

/* --- 13. Corps de l'axe --------------------------------------------------- */

.corps { font-size: var(--t-md); }

.corps h2 {
  font-size: var(--t-2xl);
  font-weight: 500;
  letter-spacing: -0.025em;
  margin-top: 3.5rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--trait);
}
.corps h2:first-of-type { margin-top: 2.5rem; }

.corps h3 {
  font-size: var(--t-lg);
  font-weight: 600;
  margin-top: 2.25rem;
}

.corps > p:first-of-type {
  font-size: var(--t-lg);
  line-height: 1.5;
  color: var(--encre-2);
}

.corps ul, .corps ol { padding-left: 1.3rem; margin-bottom: 1.25rem; }
.corps li { margin-bottom: 0.55rem; }
.corps li::marker { color: var(--prune); }

/* --- 14. Mesure : unite citable ------------------------------------------ */

.mesure {
  border-left: 2px solid var(--prune);
  padding: 0.1rem 0 0.1rem 1.4rem;
  margin: 1.75rem 0;
}
.mesure__id {
  font-family: var(--mono);
  font-size: var(--t-xs);
  letter-spacing: 0.08em;
  color: var(--prune);
  text-decoration: none;
  display: inline-block;
  margin-bottom: 0.35rem;
}
.mesure__id:hover { text-decoration: underline; }
.mesure__titre {
  font-size: var(--t-md);
  font-weight: 600;
  margin: 0 0 0.4rem;
  letter-spacing: -0.01em;
}
.mesure__titre + p { margin-bottom: 0; }
.mesure p { font-size: var(--t-base); color: var(--encre-2); }

/* --- 15. Encadres editoriaux ---------------------------------------------- */

.encadre {
  border: 1px solid var(--trait);
  background: var(--blanc);
  padding: 1.35rem 1.5rem;
  margin: 2rem 0;
  font-size: var(--t-base);
}
.encadre__titre {
  font-family: var(--sans);
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--signal);
  margin: 0 0 0.6rem;
}
.encadre--objection { border-left: 3px solid var(--signal); }
.encadre--objection .encadre__titre { color: var(--signal); }
.encadre--existant { border-left: 3px solid var(--encre-3); }
.encadre--existant .encadre__titre { color: var(--encre-3); }

/* --- 16. Calendrier ------------------------------------------------------- */

.calendrier { margin: 2rem 0; border-top: 1px solid var(--trait); }
.jalon {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr);
  gap: 1.5rem;
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--trait);
}
@media (max-width: 620px) {
  .jalon { grid-template-columns: minmax(0, 1fr); gap: 0.35rem; }
}
.jalon__date {
  font-family: var(--mono);
  font-size: var(--t-xs);
  letter-spacing: 0.08em;
  color: var(--prune);
  padding-top: 0.3rem;
}
.jalon__texte { font-size: var(--t-base); color: var(--encre-2); }
.jalon__texte strong { color: var(--encre); }

/* --- 17. Liens entre axes ------------------------------------------------- */

.connexes {
  margin-top: 3.5rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--trait);
}
.connexes__titre {
  font-family: var(--mono);
  font-size: var(--t-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--encre-3);
  margin-bottom: 1rem;
}
.connexes__liste { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; }
.connexes__liste a { font-size: var(--t-base); }

/* --- 18. Pied de page ----------------------------------------------------- */

.pied {
  background: var(--encre);
  color: color-mix(in srgb, var(--papier) 72%, transparent);
  font-family: var(--sans);
  font-size: var(--t-sm);
  padding-block: 3.5rem 2rem;
  margin-top: 4rem;
}
.pied a { color: color-mix(in srgb, var(--papier) 88%, transparent); text-decoration: none; }
.pied a:hover { color: var(--blanc); text-decoration: underline; }

.pied__grille {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid color-mix(in srgb, var(--papier) 18%, transparent);
}
@media (max-width: 760px) { .pied__grille { grid-template-columns: 1fr; gap: 2rem; } }

.pied__titre {
  font-family: var(--mono);
  font-size: var(--t-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--papier) 45%, transparent);
  margin-bottom: 0.9rem;
}
.pied__liste { list-style: none; margin: 0; padding: 0; }
.pied__liste li { margin-bottom: 0.5rem; }

.pied__manifeste {
  font-family: var(--serif);
  font-size: var(--t-base);
  line-height: 1.55;
  max-width: 30rem;
  color: color-mix(in srgb, var(--papier) 78%, transparent);
}

.pied__bas {
  padding-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: space-between;
  font-size: var(--t-xs);
  color: color-mix(in srgb, var(--papier) 50%, transparent);
  font-family: var(--mono);
}

/* --- 19. Pages de contenu simple ------------------------------------------ */

.page-simple { padding-block: 3rem 4rem; }
.page-simple h1 { font-size: var(--t-2xl); font-weight: 500; letter-spacing: -0.025em; }
.page-simple h2 { font-size: var(--t-lg); margin-top: 2.5rem; }
.page-simple dl { margin: 0; }
.page-simple dt { font-family: var(--sans); font-size: var(--t-sm); font-weight: 600; margin-top: 1.25rem; }
.page-simple dd { margin: 0.2rem 0 0; color: var(--encre-2); }

/* --- 20. Impression ------------------------------------------------------- */

@media print {
  .entete, .pied, .sommaire, .bandeau, .nav__bascule { display: none; }
  body { background: #fff; font-size: 11pt; }
  .axe-page__grille { grid-template-columns: 1fr; }
  a { text-decoration: none; color: #000; }
  .mesure { break-inside: avoid; }
}
