@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:ital,wght@0,400;0,600;1,400&display=swap');

/* =========================================================================
   Contrôles PHP — feuille de style
   Reprend les tokens du design system « Broadsheet » puis les styles propres
   à la page (les styles inline d'origine ont été remontés en classes).
   ========================================================================= */

/* --- Tokens ------------------------------------------------------------- */
:root {
  --color-bg: #f3f2f2;
  --color-surface: #eae9e9;
  --color-text: #201e1d;
  --color-accent: #0088b0;
  --color-accent-2: #d6006c;
  --color-divider: color-mix(in srgb, #201e1d 16%, transparent);

  --color-accent-600: #1186ac;
  --color-accent-700: #006786;
  --color-accent-800: #004961;
  --color-accent-900: #0a303e;

  /* La 3e encre process : réservée au traitement d'impression CMJN
     (séparation des plaques, chiffres désalignés). Jamais du texte courant. */
  --color-process-yellow: #edbb00;

  --font-heading: "Source Serif 4", system-ui, sans-serif;
  --font-heading-weight: 600;
  --font-body: "Source Serif 4", system-ui, sans-serif;

  --space-1: 5px;
  --space-2: 10px;
  --space-3: 15px;
  --space-4: 20px;

  --radius-md: 2px;
}

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

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 28px;
  text-wrap: pretty;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: var(--font-heading-weight);
}

a { color: var(--color-accent-700); text-decoration: none; }
a:hover { color: var(--color-accent-2); text-decoration: underline; }

/* Lien d'évitement (RGAA 12.7) : masqué jusqu'au focus clavier. */
.skip-link {
  position: absolute; left: var(--space-3); top: -60px; z-index: 100;
  background: var(--color-accent-700); color: var(--color-bg);
  padding: var(--space-2) var(--space-3); border-radius: var(--radius-md);
  transition: top 0.15s ease;
}
.skip-link:focus { top: var(--space-3); text-decoration: none; color: var(--color-bg); }

img { display: block; max-width: 100%; }
figure { margin: 0; }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--color-accent) 30%, transparent); }

/* --- Boutons ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 14px; line-height: 1.2; color: var(--color-text);
  background: transparent; border: 1px solid transparent;
  padding: var(--space-2) calc(var(--space-3) * 1.2);
  border-radius: var(--radius-md);
}
/* Fond assombri à accent-700 : le texte clair passe alors le ratio 4.5:1
   (WCAG AA / RGAA 3.2). accent (#0088b0) échouait (3.65:1). */
.btn-primary { background: var(--color-accent-700); color: var(--color-bg); }
.btn-primary:hover { background: var(--color-accent-800); text-decoration: none; }
.btn-primary:active { background: var(--color-accent-900); }
.btn-ghost { color: var(--color-accent); padding-inline: var(--space-1); }
.btn-ghost:hover { background: color-mix(in srgb, var(--color-accent) 10%, transparent); text-decoration: none; }
.btn-ghost:active { background: color-mix(in srgb, var(--color-accent) 18%, transparent); }

/* --- Champ de saisie ---------------------------------------------------- */
.input {
  width: 100%; min-height: 36px; padding: 6px 10px; font: inherit;
  font-size: 14px; color: var(--color-text); caret-color: var(--color-accent);
  background: var(--color-surface);
  border: 1px solid var(--color-divider); border-radius: var(--radius-md);
}
.input::placeholder { color: color-mix(in srgb, var(--color-text) 65%, transparent); opacity: 1; }
.input:hover { border-color: color-mix(in srgb, var(--color-text) 45%, transparent); }
.input:focus-visible { border-color: var(--color-accent); outline-offset: 0; }

/* --- Navigation --------------------------------------------------------- */
.site-nav {
  display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-3) var(--space-4);
  padding-block: var(--space-3);
  padding-inline: max(clamp(20px, 5vw, 72px), calc((100% - 1200px) / 2 + clamp(20px, 5vw, 72px)));
}
.nav-brand {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 18px; margin-right: auto;
}
/* :not(.btn) — sinon ce sélecteur (plus spécifique) volerait au bouton sa
   couleur de texte claire et le ferait passer sous le ratio 4.5:1. */
.site-nav a:not(.btn) { color: inherit; font-size: 14px; }
.site-nav a:not(.btn):hover { color: var(--color-accent-700); text-decoration: underline; }

/* =========================================================================
   Traitements d'impression CMJN
   ========================================================================= */

/* Trame simili sur les photos */
.halftone { position: relative; filter: grayscale(0.35) contrast(1.15); overflow: hidden; }
.halftone::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(circle, rgba(0, 0, 0, 0.22) 30%, transparent 32%);
  background-size: 3px 3px; mix-blend-mode: multiply;
}

/* Le titre du hero reste en encre pleine : un contrôle s'annonce lisiblement.
   L'effet de plaques désalignées est réservé aux numéros des règles. */

/* Chiffres en plaques désalignées (C, M seulement) */
.cmyk-num {
  --cmyk-num-ground: var(--color-bg);
  position: relative; width: fit-content; line-height: 0.9;
  font-feature-settings: "pnum" 1;
  background: var(--cmyk-num-ground); padding: 0.12em; margin: -0.12em;
}
.cmyk-num .paper {
  color: var(--color-bg);
  text-shadow: 0.036em 0.025em 0 var(--color-bg), -0.031em -0.023em 0 var(--color-bg);
}
.cmyk-num .plate {
  position: absolute; inset: 0.12em; mix-blend-mode: multiply;
  pointer-events: none; user-select: none;
  text-box: trim-both cap alphabetic;
}
.cmyk-num .plate-c { color: var(--color-accent); }
.cmyk-num .plate-m {
  color: var(--color-accent-2);
  translate: calc(0.036em + 0.018em * var(--press-nx, 0)) calc(0.025em + 0.0125em * var(--press-ny, 0));
}

/* Repli tant que le JS n'a pas construit les plaques : encre pleine, lisible. */
.cmyk-num:not(.is-plated) { color: var(--color-text); }

/* =========================================================================
   Mise en page
   ========================================================================= */
.container { max-width: 1200px; margin: 0 auto; padding: 0 clamp(20px, 5vw, 72px); }

/* --- Hero --------------------------------------------------------------- */
.hero { padding: 30px 0 50px; }
.hero-title {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: clamp(42px, 6vw, 80px);
  line-height: clamp(45.5px, 6.5vw, 86.5px);
  letter-spacing: -0.02em;
  margin: 0 0 0 -0.035em;
  text-box: trim-both cap alphabetic;
}
.hero-title .hero-line { display: block; }
.hero-lead {
  font-size: 17px; line-height: 28px; max-width: 58ch; margin: 28px 0 0;
  /*text-box: trim-both cap alphabetic;*/
}

.access-form {
  display: flex; gap: var(--space-3); align-items: stretch;
  max-width: 480px; margin: 42px 0 0; scroll-margin-top: 28px;
}
.access-form .input {
  flex: 1; min-height: 40px;
  font-family: var(--font-heading); letter-spacing: 0.12em; text-transform: uppercase;
}
.access-form .btn { min-height: 40px; }

.access-status {
  font-size: 15.5px; line-height: 28px; margin: 14px 0 0; min-height: 28px;
  color: color-mix(in srgb, var(--color-text) 70%, transparent);
}
.access-status.is-error { color: var(--color-accent-2); }
.access-status.is-ok { color: var(--color-accent-700); }

/* --- Bandeau « en bref » ------------------------------------------------ */
.brief { padding: 56px 0 70px; }
.rule-strong { height: 5px; border: 0; margin: 0; border-top: 2px solid var(--color-text); border-bottom: 1px solid var(--color-text); }
.rule-thin { height: 0; border: 0; border-top: 1px solid var(--color-text); margin: 0; }

.brief-tags {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 14px 28px;
  margin: 0; padding: 14px 0;
  font-size: 13px; line-height: 14px; letter-spacing: 0.08em; text-transform: uppercase;
  color: color-mix(in srgb, var(--color-text) 70%, transparent);
}

.brief-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px 70px; padding: 14px 0 28px;
}
.stat { display: flex; align-items: baseline; gap: 8px; margin: 0; font-size: 15.5px; line-height: 28px; }
.stat-fill {
  flex: 1; min-width: 28px; align-self: flex-end; margin-bottom: 0.34em;
  border-bottom: 1px dotted color-mix(in srgb, var(--color-text) 45%, transparent);
}
.stat-value {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight); font-size: 17px;
}
.stat-value.is-accent { color: var(--color-accent-700); }

/* --- Sections courantes ------------------------------------------------- */
.kicker {
  display: block; font-size: 13px; line-height: 14px;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: color-mix(in srgb, var(--color-text) 70%, transparent);
  margin: 0 0 14px;
}

.section-evalue { padding: 84px 0 70px; scroll-margin-top: 28px; }
.section-heading {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 24px; line-height: 28px; letter-spacing: -0.01em; margin: 0;
  text-box: trim-both cap alphabetic;
}
.body-copy {
  font-size: 15.5px; line-height: 28px; margin: 14px 0 0;
  color: color-mix(in srgb, var(--color-text) 78%, transparent);
  text-align: justify; hyphens: auto;
}

.cols3 {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 42px clamp(28px, 4vw, 64px); margin-top: 14px;
}

/* --- Déroulé ------------------------------------------------------------ */
.section-deroule {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 28px clamp(24px, 5vw, 96px); align-items: center;
  padding: 56px 0 84px; scroll-margin-top: 28px;
}
.section-deroule h2 {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 32px; line-height: 42px; letter-spacing: -0.015em; margin: 0;
  text-box: trim-both cap alphabetic;
}
.section-deroule .body-copy { max-width: 48ch; }
.section-deroule figure { aspect-ratio: 3 / 2; }

/* Emplacement image (remplaçait <image-slot>) */
.image-placeholder {
  width: 100%; height: 100%; min-height: 220px;
  display: grid; place-items: center; padding: 24px;
  background: var(--color-surface);
  border: 1px dashed color-mix(in srgb, var(--color-text) 30%, transparent);
  color: color-mix(in srgb, var(--color-text) 55%, transparent);
  font-size: 13px; text-align: center; text-transform: uppercase; letter-spacing: 0.08em;
}

/* --- Règles ------------------------------------------------------------- */
.section-regles { padding: 10px 0 10px; scroll-margin-top: 28px; }
.rules-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 42px clamp(28px, 4vw, 64px); margin-top: 14px;
}
.rule { display: flex; gap: 18px; align-items: baseline; }
.rule .cmyk-num {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 34px; line-height: 1;
}
.rule p {
  font-size: 15.5px; line-height: 28px; margin: 0;
  color: color-mix(in srgb, var(--color-text) 78%, transparent);
}

/* --- Citation ----------------------------------------------------------- */
.section-quote { padding: 42px 0 25px; }
.pull-quote {
  font-family: var(--font-heading); font-style: italic; font-weight: 400;
  font-size: clamp(24px, 2.6vw, 34px); line-height: 42px; letter-spacing: -0.01em;
  /*max-width: 34ch;*/ margin: 0; text-indent: -0.475em;
  text-box: trim-both cap alphabetic;
}
.pull-quote-cite {
  font-size: 15.5px; line-height: 28px;
  color: color-mix(in srgb, var(--color-text) 70%, transparent);
  margin: 20px 20px; text-indent: -1.045em;
  text-box: trim-both cap alphabetic;
}

/* --- Appel final -------------------------------------------------------- */
.section-cta { padding: 42px 0 56px; }
.section-cta h3 {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 24px; line-height: 28px; margin: 0;
  text-box: trim-both cap alphabetic;
}
.section-cta p {
  font-size: 15.5px; line-height: 28px; margin: 14px 0 0; max-width: 58ch;
  color: color-mix(in srgb, var(--color-text) 78%, transparent);
}
.cta-actions { display: flex; gap: var(--space-3); flex-wrap: wrap; margin-top: 28px; }

/* --- Pied de page ------------------------------------------------------- */
.site-footer {
  padding: 10px 0; font-size: 13px; line-height: 28px;
  color: color-mix(in srgb, var(--color-text) 70%, transparent);
}

/* --- Responsive --------------------------------------------------------- */
@media (max-width: 1080px) {
  .cols3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols3 > :last-child { grid-column: 1 / -1; }
  .cols3 > :last-child p { max-width: 58ch; }
}
@media (max-width: 720px) {
  .cols3 { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  /* La barre passe à : marque sur une ligne, liens + action en dessous. */
  .nav-brand { margin-right: 0; flex-basis: 100%; }
  .hero { padding: 72px 0 56px; }
}

/* Repli si la ligne du formulaire d'accès devient trop étroite. */
@media (max-width: 420px) {
  .access-form { flex-wrap: wrap; }
  .access-form .input { flex-basis: 100%; }
}
