/* =========================================================================
   AF2PVision — Styles de base + mise en page
   Les composants n'utilisent que les RÔLES de tokens.css (--surface-*,
   --text-*, --on-*…) afin que les thèmes d'affichage restent lisibles.
   ========================================================================= */

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

html {
  /* La taille de base pilote tout le reste ; le panneau a11y agit dessus. */
  font-size: calc(100% * var(--a11y-scale));
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Décalage des ancres et du focus sous l'en-tête collant (hauteur réelle
     mesurée : --af-header-h), et réserve en bas pour le lecteur vocal :
     l'élément qui reçoit le focus n'est jamais masqué (WCAG 2.4.11). */
  scroll-padding-top: calc(var(--af-header-h, 88px) + 16px);
  scroll-padding-bottom: 100px;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

html, body {
  /* Garde-fou anti-défilement horizontal. « clip » (et non « hidden ») :
     hidden transforme body en conteneur de défilement et casse position:sticky
     (en-tête et bouton d'accessibilité « toujours visibles » exigés par le CdC). */
  overflow-x: clip;
  max-width: 100%;
}

body {
  margin: 0;
  font-family: var(--font-base);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: var(--fw-normal);
  color: var(--text);
  background: var(--surface-page);
  /* jamais justifié — alignement à gauche pour faciliter le retour à la ligne */
  text-align: left;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* L'attribut hidden doit TOUJOURS l'emporter (boutons masqués par JS, etc.). */
[hidden] { display: none !important; }

/* ---- Titres : hiérarchie stricte, jamais justifiés ---- */
h1, h2, h3, h4 {
  font-weight: var(--fw-bold);
  line-height: var(--lh-titre);
  color: var(--text);
  margin: 0 0 0.5em;
  text-wrap: balance;
  /* Un mot long (« AF2PVision ») ne déborde jamais à 320px / texte 125 %. */
  overflow-wrap: break-word;
  hyphens: auto;
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: 1.25rem; }
p { margin: 0 0 1em; max-width: 72ch; }

/* Jamais de texte justifié (exigence CdC : les blancs freinent la lecture) */
p, li, blockquote, dd, dt, figcaption { text-align: left; }

/* ---- Liens : contrastés, soulignés dans le corps ---- */
a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: 0.08em; }
a:hover { color: var(--link-hover); text-decoration-thickness: 0.14em; }
.entry-content a,
.rich-text a { text-decoration: underline; font-weight: var(--fw-bold); }
/* Soulignement discret (retour cliente : un trait épais « brouille » la
   lecture) mais conservé : la couleur seule ne suffit pas à repérer un lien
   (WCAG 1.4.1). Plein et plus épais au survol / au focus. */
.entry-content a:not(.af-btn),
.rich-text a:not(.af-btn) {
  text-decoration-thickness: 1px; text-underline-offset: 0.28em;
  text-decoration-color: color-mix(in srgb, currentColor 50%, transparent);
}
.entry-content a:not(.af-btn):is(:hover, :focus-visible),
.rich-text a:not(.af-btn):is(:hover, :focus-visible) { text-decoration-color: currentColor; text-decoration-thickness: 2px; }
/* Contraste renforcé (réglage du site ou du système) : soulignement plein. */
html.af-contrast-high :is(.entry-content, .rich-text) a:not(.af-btn) { text-decoration-color: currentColor; text-decoration-thickness: 2px; }
@media (prefers-contrast: more) {
  :is(.entry-content, .rich-text) a:not(.af-btn) { text-decoration-color: currentColor; text-decoration-thickness: 2px; }
}
/* Paragraphe mis en avant (retrait du document de la cliente) : filet + aplat doux. */
.rich-text .af-mise-en-avant {
  margin-inline: 0; padding: 16px 20px; border-left: 6px solid var(--c-sarcelle);
  background: var(--surface-soft); border-radius: 0 var(--r-sm) var(--r-sm) 0;
}
/* Photo d'illustration en tête de la page « Nous soutenir ». */
.entry-content .af-soutien-photo { display: block; width: 100%; height: auto; border-radius: var(--r-carte); margin: 0 0 32px; }

/* ---- Pages de contenu : photos, témoignages, tarifs (textes 11/2026) ---- */
.entry-content .af-figure { margin: 1.5em 0; }
/* Jamais agrandie au-delà de sa taille réelle (photo nette) ; une photo en
   hauteur ne dépasse pas 560 px. */
.entry-content .af-figure img { display: block; width: auto; max-width: 100%; height: auto; max-height: 560px; border-radius: var(--r-carte); }
.entry-content .af-figure--tete { margin-top: 0; }
.entry-content .af-figure--tete img { width: 100%; max-height: none; aspect-ratio: 16 / 7; object-fit: cover; }
/* Photo d'illustration plus discrète (« un peu grandes par rapport au texte »,
   cliente, 18/11/2026) : au plus 32rem de large, toujours entière. */
.entry-content .af-figure--moyenne img { max-width: min(100%, 32rem); }
.entry-content .af-figure--logo { margin: 0 0 1.5em; }
.entry-content .af-figure--logo img { width: 140px; border-radius: var(--r-sm); }
.entry-content .af-figure figcaption,
.entry-content .af-galerie figcaption { margin-top: 8px; font-size: 1.0625rem; color: var(--text-muted); }
.entry-content .af-galerie {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 20px; margin: 1.5em 0; padding: 0; list-style: none;
}
.entry-content .af-galerie figure { margin: 0; }
.entry-content .af-galerie img { display: block; width: 100%; height: auto; border-radius: var(--r-md); }
/* Cadrage uniforme 4/3, sauf galerie « entière » : là, le ratio vient des
   attributs width/height de l'image (place réservée avant chargement). */
.entry-content .af-galerie:not(.af-galerie--entier) img { aspect-ratio: 4 / 3; object-fit: cover; }
.entry-content .af-galerie--portraits { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.entry-content .af-galerie.af-galerie--portraits img { aspect-ratio: 4 / 5; object-position: center 25%; }
.entry-content .af-galerie--portraits figcaption { font-weight: var(--fw-bold); color: var(--text); }
/* Photos montrées entières, avec leur propre cadrage : pas de découpe au
   format 4/3. Côte à côte à la même hauteur (une photo en largeur et une en
   hauteur restent équilibrées) ; elles passent l'une sous l'autre quand la
   place manque. Hauteur fixe + largeur déduite des attributs width/height :
   la place est réservée avant le chargement (pas de saut de la page).
   Prévu pour des photos d'au moins 380 px de haut. */
.entry-content .af-galerie--entier { display: flex; flex-wrap: wrap; align-items: flex-start; }
.entry-content .af-galerie--entier figure { flex: 0 0 auto; max-width: 100%; }
.entry-content .af-galerie--entier img { width: auto; height: 380px; max-width: 100%; object-fit: contain; } /* très large : réduite dans la hauteur réservée, jamais de débordement */
@media (max-width: 599px) {
  .entry-content .af-galerie--entier figure { flex-basis: 100%; }
  .entry-content .af-galerie--entier img { width: 100%; height: auto; }
}
/* Témoignage : citation + auteur (le guillemet est dessiné, jamais d'italique). */
.entry-content .af-temoignage { margin: 1.5em 0; }
.entry-content .af-temoignage blockquote { margin: 0; }
.entry-content .af-temoignage figcaption { margin-top: 10px; padding-left: calc(6px + var(--sp-6)); font-weight: var(--fw-bold); color: var(--text-brand); }
/* Tarifs d'adhésion mis en valeur (page « Nous soutenir »). */
.af-tarifs { font-size: 1.375rem; line-height: 1.5; }
.af-tarifs strong { font-size: 1.75rem; color: var(--text-brand); }

/* ---- Images : responsives par défaut ---- */
img { max-width: 100%; height: auto; display: block; }

/* ---- Contenu éditorial ---- */
.entry-content > * + h2 { margin-top: 1.6em; }
.entry-content > * + h3 { margin-top: 1.3em; }
.entry-content ul, .entry-content ol { padding-left: 1.4em; margin: 0 0 1em; }
.entry-content li { margin-bottom: 0.35em; }
.entry-content li::marker { color: var(--text-brand); }
.entry-content blockquote {
  margin: 1.5em 0; padding: var(--sp-5) var(--sp-6);
  border-left: 6px solid var(--c-or); background: var(--surface-warm);
  border-radius: 0 var(--r-md) var(--r-md) 0; font-size: 1.3125rem;
}
.entry-content blockquote p:last-child { margin-bottom: 0; }

/* ---- Listes accessibles (puces sobres) ---- */
ul.af-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
ul.af-list > li { display: flex; gap: 14px; }
ul.af-list > li::before {
  content: "";
  flex-shrink: 0;
  width: 12px; height: 12px;
  margin-top: 0.5em;
  border-radius: 50%;
  background: var(--text-brand);
}

/* =========================================================================
   FOCUS — visible et épais sur TOUT élément interactif (WCAG 2.4.7 + CdC)
   ========================================================================= */
/* Indicateur de focus à DEUX tons : trait sombre + halo clair.
   Reste visible sur tout fond (clair, sombre, sarcelle, or) — WCAG 1.4.11. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: var(--focus-w) solid var(--focus-c);
  outline-offset: var(--focus-off);
  box-shadow: 0 0 0 calc(var(--focus-w) + var(--focus-off)) var(--focus-halo);
  border-radius: 4px;
}
/* Fallback navigateurs sans :focus-visible */
:where(a, button, input, select, textarea, summary, [tabindex]):focus {
  outline: var(--focus-w) solid var(--focus-c);
  outline-offset: var(--focus-off);
  box-shadow: 0 0 0 calc(var(--focus-w) + var(--focus-off)) var(--focus-halo);
}
:focus:not(:focus-visible) { outline: none; box-shadow: none; } /* pas au clic souris */
/* Le conteneur principal reçoit le focus du lien d'évitement : pas de cadre. */
#contenu-principal:focus { outline: none; box-shadow: none; }

/* =========================================================================
   Utilitaires de mise en page
   ========================================================================= */
.af-section { padding: var(--pad-section) var(--pad-x); }
/* Sur mobile : padding latéral réduit + rythme vertical resserré (maquette 1b). */
@media (max-width: 767px) {
  .af-section { padding: 40px var(--pad-x-mobile); }
}
.af-wrap    { max-width: var(--maxw-site); margin-inline: auto; }
/* Colonne de lecture centrée par défaut : le contenu d'une page (texte, form.)
   ne reste pas collé à gauche dans le grand conteneur. Neutralisé quand
   .af-reading est une colonne d'une grille (page à sommaire). */
.af-reading { max-width: var(--maxw-texte); margin-inline: auto; }
.af-content-layout .af-reading { margin-inline: 0; }

.bg-creme       { background: var(--surface-page); }
.bg-creme-jaune { background: var(--surface-warm); }
.bg-blanc       { background: var(--surface-card); }
.bg-eau         { background: var(--surface-soft); }
.bg-sarcelle    { background: var(--surface-brand); color: var(--on-brand); }
.bg-encre       { background: var(--surface-ink); color: var(--on-ink); }
.bg-sarcelle :where(h1, h2, h3, h4, p, li) { color: var(--on-brand); }
.bg-sarcelle a:not(.af-btn) { color: var(--on-brand); }

/* =========================================================================
   En-têtes de section : surtitre + titre + vague (fil conducteur Matisse)
   ========================================================================= */
/* Surtitre : capitales réservées aux libellés COURTS (CdC §7), rendues en CSS
   pour que les lecteurs d'écran lisent le texte normalement. */
.af-eyebrow {
  display: block; margin: 0 0 var(--sp-3);
  font-size: 1.125rem; font-weight: var(--fw-bold); line-height: 1.3;
  letter-spacing: var(--ls-label); text-transform: uppercase;
  color: var(--text-label);
}
.bg-sarcelle .af-eyebrow { color: var(--on-brand-accent); }
.af-heading { margin-bottom: var(--sp-7); max-width: 60ch; }
.af-heading h2 { margin: 0; color: var(--text-brand); }
.af-heading p { margin: var(--sp-3) 0 0; font-size: var(--fs-lead); line-height: 1.5; color: var(--text-muted); }
.bg-sarcelle .af-heading h2, .bg-sarcelle .af-heading p { color: var(--on-brand); }
/* Petite vague dorée sous le titre (décorative, jamais porteuse de sens). */
.af-heading h2::after {
  content: ""; display: block; width: 72px; height: 12px; margin-top: var(--sp-3);
  background: var(--decor-2);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 72 12'%3E%3Cpath d='M2 6 Q 11 0 20 6 T 38 6 T 56 6 T 70 6' fill='none' stroke='black' stroke-width='3.5' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 72 12'%3E%3Cpath d='M2 6 Q 11 0 20 6 T 38 6 T 56 6 T 70 6' fill='none' stroke='black' stroke-width='3.5' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
.af-heading--center { margin-inline: auto; text-align: center; }
.af-heading--center h2, .af-heading--center p { text-align: center; }
.af-heading--center h2::after { margin-inline: auto; }

/* Lien « voir tout » avec flèche */
.af-more {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  min-height: var(--cible-min);
  color: var(--link); font-size: 1.1875rem; font-weight: var(--fw-bold);
  text-decoration: underline;
}
.af-more .af-ico { transition: transform var(--t-rapide); }
.af-more:hover .af-ico { transform: translateX(3px); }

/* =========================================================================
   Boutons & CTA
   ========================================================================= */
.af-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-base);
  font-size: 1.1875rem;   /* 19px */
  font-weight: var(--fw-bold);
  line-height: 1.3;
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: var(--r-btn);
  padding: var(--btn-pad);
  min-height: var(--btn-h);
  cursor: pointer;
  transition: background-color var(--t-rapide), color var(--t-rapide), border-color var(--t-rapide);
}
.af-btn--or       { background: var(--surface-accent); color: var(--on-accent); box-shadow: var(--ombre-bouton); }
.af-btn--or:hover { background: var(--c-or-hover); color: var(--on-accent); }
.af-btn--sarcelle { background: var(--surface-brand); color: var(--on-brand); box-shadow: var(--ombre-bouton); }
.af-btn--sarcelle:hover { background: var(--c-sarcelle-dark); color: var(--on-brand); }
.af-btn--ghost {
  background: var(--surface-card); color: var(--text-brand);
  border-color: currentColor;
}
.af-btn--ghost:hover { background: var(--surface-soft); color: var(--link-hover); }
/* Le focus remplace le relief (sinon deux ombres se superposent). */
.af-btn:focus-visible { box-shadow: 0 0 0 calc(var(--focus-w) + var(--focus-off)) var(--focus-halo); }

/* =========================================================================
   Éléments graphiques (esprit Matisse, par petites touches)
   ========================================================================= */
/* Pictogrammes SVG inline (jamais d'emoji) — alignés au texte */
.af-ico { display: inline-block; vertical-align: -0.15em; flex-shrink: 0; }
.af-cta__arrow .af-ico, .af-contact__ico .af-ico { vertical-align: middle; }

.af-vague { display: block; width: 100%; height: auto; }
.af-feuille {
  display: inline-block; width: 36px; height: 36px;
  background: var(--c-or); border-radius: 50% 50% 50% 0;
}
.af-demilune {
  display: inline-block; width: 48px; height: 24px;
  background: var(--c-sarcelle); border-radius: 0 0 48px 48px;
}

/* =========================================================================
   Cartes
   ========================================================================= */
.af-card {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--r-carte);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color var(--t-rapide);
}

/* =========================================================================
   Contenu masqué visuellement mais lu par les lecteurs d'écran
   ========================================================================= */
.screen-reader-text,
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
/* Rendu visible au focus (utile pour skip-link) */
.screen-reader-text:focus,
.visually-hidden:focus {
  position: fixed !important;
  top: 8px; left: 8px;
  width: auto; height: auto;
  padding: 14px 20px; margin: 0;
  clip: auto; white-space: normal;
  background: var(--c-or); color: var(--c-fix-encre);
  font-weight: var(--fw-bold); font-size: 1.125rem;
  border-radius: var(--r-bouton-s);
  z-index: 100000;
  box-shadow: var(--ombre-panel);
}

/* Repère éditeur (visible uniquement des personnes connectées pouvant éditer) */
.af-editor-hint {
  display: inline-block; margin: 0 0 var(--sp-2); padding: 2px 10px;
  border: 2px dashed currentColor; border-radius: var(--r-sm);
  font-size: 1rem; font-weight: var(--fw-bold); color: var(--text-label);
}
