/*
 * Kit UI medelio pharma.
 *
 * Chaque composant existe UNE fois, ici, et sert aux blocs de l'accueil, a
 * l'iframe de l'editeur et aux composants React. Les valeurs viennent toutes
 * de theme.json (--wp--preset--*, --wp--custom--*) : les alias ci-dessous ne
 * portent aucune teinte, seulement des noms courts qui reprennent ceux de la
 * maquette pour que les deux se lisent cote a cote.
 *
 * Reference : brief-rebranding/maquettes-medelio-pharma/maquette-home.html,
 * sections « Fondations » a « Reveal » et surcharges v5, v9 et v12.
 */

:root {
  --petrole: var(--wp--preset--color--petrole);
  --petrole-900: var(--wp--preset--color--petrole-900);
  --teal-ui: var(--wp--preset--color--teal-ui);
  --teal-sable: var(--wp--preset--color--teal-sable);
  --bleu: var(--wp--preset--color--bleu);
  --bleu-50: var(--wp--preset--color--bleu-50);
  --jaune: var(--wp--preset--color--jaune);
  --jaune-l: var(--wp--preset--color--jaune-l);
  --rose: var(--wp--preset--color--rose);
  --rose-l: var(--wp--preset--color--rose-l);
  --rose-fonce: var(--wp--preset--color--rose-fonce);
  --sable: var(--wp--preset--color--sable);
  --sable-l: var(--wp--preset--color--sable-l);
  --or: var(--wp--preset--color--or);
  --ink: var(--wp--preset--color--ink);
  --ink-2: var(--wp--preset--color--ink-2);
  --ink-3: var(--wp--preset--color--ink-3);
  --blanc: var(--wp--preset--color--blanc);
  --line: var(--wp--custom--ligne--fine);
  --line-2: var(--wp--custom--ligne--appuyee);
  --survol: var(--wp--custom--survol);
  --sur-fonce: var(--wp--custom--texte-sur-fonce);
  --ok: var(--wp--custom--etat--ok);
  --ok-bg: var(--wp--custom--etat--ok-fond);
  --err: var(--wp--custom--etat--erreur);
  --err-d: var(--wp--custom--etat--erreur-fonce);
  --err-bg: var(--wp--custom--etat--erreur-fond);
  --warn: var(--wp--custom--etat--alerte);
  --warn-bg: var(--wp--custom--etat--alerte-fond);
  --info: var(--wp--custom--etat--info);
  --info-bg: var(--wp--custom--etat--info-fond);
  --disabled-bg: var(--wp--custom--etat--desactive-fond);
  --disabled-line: var(--wp--custom--etat--desactive-ligne);
  --g-text: var(--wp--preset--gradient--petrole);
  --sh-1: var(--wp--preset--shadow--sh-1);
  --sh-2: var(--wp--preset--shadow--sh-2);
  --sh-hover: var(--wp--preset--shadow--sh-hover);
  --ease: var(--wp--custom--courbe--standard);
  --ease-out: var(--wp--custom--courbe--sortie);
  --r-carte: var(--wp--custom--rayon--carte);
  --r-interne: var(--wp--custom--rayon--interne);
  --r-visuel: var(--wp--custom--rayon--visuel);
  --f: var(--wp--preset--font-family--lato);
}

/* ---------------------------------------------------------------- Base */

/* Les span des composants heritent de leur taille, malgre le style global des
   pages React qui en impose une a chaque span. */
.btn span, .c-link .u, .badge span, .tag span, .alert span, .err-msg { font-size: inherit; }

/* Le kit ne suppose pas de reset global : l'iframe de l'editeur et la page de
   recette n'en ont pas. Chaque composant porte son modele de boite. */
.btn, .input, .tag, .seg, .seg button, .badge, .alert, .carte, .c-fo, .c-fo *, .icon-btn, .box, .pg a, .pg span,
:where(input, select, textarea) { box-sizing: border-box; }

/* Pages interieures : le style global des pages React (theme/global-styles.ts)
   impose une taille a chaque p, span, a, li..., et l'interligne de theme.json
   n'est imprime que sur l'accueil. Les composants du kit reprennent la main. */
/* Seuls les elements sans classe heritent : un .kicker ou un .chapeau garde sa taille. */
:is(.c-fo, .bc, .filtres, .entete-page, .alert, .carrousel-nav, .plus) :where(p, span, a, ul, ol, li, label, legend, small, b):not([class]) { font-size: inherit; }
:where(.c-fo, .filtres, .entete-page, .alert, .mf2) { line-height: 1.6; }

/* Comme la maquette : un titre sur deux lignes se coupe en lignes equilibrees. */
:where(h1, h2, h3, h4, h5) { text-wrap: balance; }

:focus-visible { outline: 3px solid var(--petrole); outline-offset: 3px; }
/* Sur fond petrole, l'anneau passe au jaune pour rester visible. */
.sur-fonce :focus-visible, .has-petrole-background-color :focus-visible { outline-color: var(--jaune); }

.sr {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip {
  position: absolute; left: 16px; top: -80px; z-index: 100; padding: 12px 18px;
  border-radius: 999px; background: var(--petrole); color: var(--blanc);
  font-weight: 700; text-decoration: none;
}
.skip:focus { top: 12px; }

.kicker { font: 700 12px/1.4 var(--f); letter-spacing: .1em; text-transform: uppercase; color: var(--petrole); }
/* Chapeau : le paragraphe d'introduction sous un titre. */
.chapeau { margin: 0; font-size: 17px; line-height: 1.6; color: var(--ink-2); }
.lt { font-weight: 300; }

/* Point rose a la fin d'un titre (heros, accroche du pied de page) : la classe
   .point, ou le style « Point final rose » d'un bloc Titre dans l'editeur. */
.point::after, .is-style-point::after { content: "."; font-weight: 700; color: var(--rose); }

/* Icones du sprite : static/icons/kit.svg. */
.ico { width: 20px; height: 20px; flex: none; }

/* ------------------------------------------------------------- Boutons */

.btn, .editor-styles-wrapper .wp-block-button__link {
  --h: 46px;
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: var(--h); padding: 0 22px; border-radius: 999px;
  border: 2px solid var(--bd, transparent); background: var(--bg); color: var(--fg);
  font: 700 15.5px/1.1 var(--f); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .2s, color .2s, border-color .2s, transform .2s var(--ease);
}
.btn .ar { width: 18px; height: 18px; flex: none; transition: transform .32s var(--ease-out); }
.btn:hover .ar { transform: translateX(4px); }
.btn-l { --h: 52px; padding: 0 26px; font-size: 16px; }
.btn-s { --h: 44px; padding: 0 18px; font-size: 15px; }
.btn-full { width: 100%; }
.btn:focus-visible { outline: 3px solid var(--ring, var(--petrole)); outline-offset: 3px; }
.btn:active { transform: scale(.98); }
.btn:hover, .btn:focus { color: var(--fg); }

/* Primaire, inverse et jaune : un demi-panneau plus clair se deplie depuis la gauche. */
.btn-primary, .editor-styles-wrapper :is(.is-style-primaire, .wp-block-button:not([class*="is-style-"])) > .wp-block-button__link { --bg: var(--petrole); --fg: var(--blanc); --half: var(--teal-ui); }
.btn-inverse, .editor-styles-wrapper .is-style-inverse > .wp-block-button__link { --bg: var(--blanc); --fg: var(--petrole); --half: var(--sable); --ring: var(--jaune); }
.btn-yellow, .editor-styles-wrapper .is-style-jaune > .wp-block-button__link { --bg: var(--jaune); --fg: var(--petrole); --half: var(--jaune-l); --ring: var(--blanc); }
.btn-primary::before, .btn-inverse::before, .btn-yellow::before,
.editor-styles-wrapper :is(.is-style-primaire, .wp-block-button:not([class*="is-style-"])) > .wp-block-button__link::before, .editor-styles-wrapper .is-style-inverse > .wp-block-button__link::before, .editor-styles-wrapper .is-style-jaune > .wp-block-button__link::before {
  content: ""; position: absolute; inset: 0 50% 0 0; z-index: -1; background: var(--half);
  transform: scaleX(0); transform-origin: left; transition: transform .34s var(--ease-out);
}
.btn-primary:hover::before, .btn-primary:focus-visible::before,
.btn-inverse:hover::before, .btn-inverse:focus-visible::before,
.btn-yellow:hover::before, .btn-yellow:focus-visible::before { transform: scaleX(1); }
.btn-primary:active { --bg: var(--petrole-900); --half: var(--petrole); }
@media (hover: none) {
  .btn-primary:active::before, .btn-inverse:active::before, .btn-yellow:active::before { transform: scaleX(1); }
}

.btn-secondary, .editor-styles-wrapper .is-style-secondaire > .wp-block-button__link { --bg: transparent; --fg: var(--petrole); --bd: var(--petrole); }
.btn-secondary:hover { --bg: var(--survol); }
.btn-ghost-w, .editor-styles-wrapper .is-style-fantome > .wp-block-button__link { --bg: transparent; --fg: var(--blanc); --bd: var(--blanc); --ring: var(--jaune); }
.btn-ghost-w:hover { --bg: color-mix(in srgb, var(--blanc) 12%, transparent); }
.btn-danger { --bg: var(--err); --fg: var(--blanc); }
.btn-danger:hover { --bg: var(--err-d); }

.btn[aria-disabled="true"], .btn:disabled {
  --bg: var(--disabled-bg); --fg: var(--ink-3); --bd: var(--disabled-line);
  cursor: not-allowed; transform: none;
}
.btn[aria-disabled="true"]::before, .btn:disabled::before { display: none; }
.btn[aria-disabled="true"] .ar, .btn:disabled .ar { transform: none; }

.spin {
  width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor;
  border-right-color: transparent; animation: kit-spin .8s linear infinite;
}
@keyframes kit-spin { to { transform: rotate(360deg); } }

@media (max-width: 720px) { .btn { white-space: normal; text-align: center; } }
@media (forced-colors: active) { .btn { border-color: ButtonText; } .btn::before { display: none; } }

/* Dans l'editeur, le bouton du coeur n'a pas les classes du kit, posees au
   rendu PHP (includes/lib/blocs.php) : les regles ci-dessus le visent aussi
   par son style de bloc, et sa fleche vient d'un masque. */
.editor-styles-wrapper .wp-block-button:not(.is-sans-fleche) > .wp-block-button__link::after {
  content: ""; width: 18px; height: 18px; flex: none; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%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 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ---------------------------------------------------------------- Liens */

/* CTA tertiaire unique : le soulignement se retracte vers la droite et la
   fleche avance de 4 px, au survol du lien comme de la carte qui le porte. */
.c-link {
  display: inline-flex; align-items: center; gap: 8px; min-height: 24px;
  font: 700 15px/1.3 var(--f); color: var(--petrole); text-decoration: none;
}
.c-link .u {
  background: linear-gradient(currentColor, currentColor) left bottom / 100% 1.5px no-repeat;
  padding-bottom: 2px; transition: background-size .3s var(--ease-out);
}
.c-link .ar { width: 16px; height: 16px; flex: none; transition: transform .32s var(--ease-out); }
a.c-link:hover .u, .carte-lien:hover .c-link .u { background-size: 0 1.5px; background-position: right bottom; }
a.c-link:hover .ar, .carte-lien:hover .c-link .ar { transform: translateX(4px); }

/* Lien dans un texte courant. */
.lnk {
  color: var(--teal-sable); font-weight: 700; text-decoration: none; padding-bottom: 1px;
  background:
    linear-gradient(currentColor, currentColor) left bottom / 100% 1px no-repeat,
    linear-gradient(currentColor, currentColor) left bottom / 0 2px no-repeat;
  transition: background-size .3s var(--ease-out), color .2s;
}
.lnk:hover { color: var(--petrole); background-size: 100% 1px, 100% 2px; }

/* Lien de notice : le soulignement apparait par sa couleur, ligne par ligne
   quand le lien passe sur plusieurs lignes. */
.lien-notice {
  color: inherit; text-decoration: underline; text-decoration-thickness: 1px;
  text-underline-offset: 4px; text-decoration-color: transparent;
  transition: text-decoration-color .25s;
}
.lien-notice:hover { text-decoration-color: currentColor; }

/* ------------------------------------------------------------------ Nav */

.nav { position: relative; display: flex; gap: 4px; flex-wrap: wrap; }
.nav a {
  position: relative; z-index: 1; display: inline-flex; align-items: center; min-height: 44px;
  padding: 0 16px; border-radius: 999px; font-weight: 700; font-size: 15px;
  color: var(--petrole); text-decoration: none; transition: color .25s;
}
.nav a[aria-current="page"], .nav a.is-active { color: var(--blanc); }
.nav a:not([aria-current]):not(.is-active):hover { background: var(--survol); }
/* Sans pastille (JS absent ou pas encore pose), le lien actif porte son fond. */
.nav:not(:has(.ind)) a[aria-current="page"], .nav:not(:has(.ind)) a.is-active { background: var(--petrole); }
/* La pastille qui glisse d'un lien a l'autre (position posee en JS). */
.nav .ind {
  position: absolute; z-index: 0; top: 0; height: 44px; border-radius: 999px; background: var(--petrole);
  transition: left .38s var(--ease-out), width .38s var(--ease-out), opacity .2s;
}

/* --------------------------------------------------------------- Pictos */

.pi { display: block; flex: none; width: 24px; height: 24px; }
.pi-b {
  width: 48px; height: 48px; border-radius: 50%; background: var(--bleu-50);
  display: grid; place-items: center; flex: none;
}
.sur-fonce .pi-b { background: color-mix(in srgb, var(--blanc) 12%, transparent); --pi-trait: var(--blanc); }

/* ------------------------------------------------------------ Formulaires */

.field { display: grid; gap: 6px; width: 100%; min-width: 0; align-content: start; }
.field label, .lbl { font-weight: 700; font-size: 15px; color: var(--ink); }
.req { color: var(--err); }
.help { font-size: 13.5px; color: var(--ink-2); }

/* Un seul jeu de regles pour la classe .input et pour les champs nus des
   formulaires React : :where() leur laisse une specificite nulle, n'importe
   quel style de composant les surcharge. */
.input,
:where(input:not([type="checkbox"], [type="radio"], [type="hidden"], [type="range"], [type="submit"], [type="button"]), select, textarea) {
  display: flex; align-items: center; width: 100%; min-width: 0; min-height: 52px; padding: 0 16px;
  border-radius: var(--r-carte); background: var(--blanc); border: 1.5px solid var(--ink-3);
  font: 400 17px var(--f); color: var(--ink); outline: none;
  transition: border-color .2s, box-shadow .2s;
}
:where(textarea), textarea.input { padding: 14px 16px; min-height: 120px; }
.input::placeholder, :where(input, textarea)::placeholder { color: var(--wp--custom--etat--placeholder); }
.input:hover, :where(input, select, textarea):hover { border-color: var(--petrole); }
.input:focus, :where(input, select, textarea):focus {
  border-color: var(--petrole);
  box-shadow: 0 0 0 4px var(--wp--custom--etat--anneau), 0 0 0 1px var(--petrole) inset;
}
.input.is-error, :where(input, select, textarea)[aria-invalid="true"] { border-color: var(--err); box-shadow: 0 0 0 1px var(--err) inset; }
.input:disabled, :where(input, select, textarea):disabled {
  background: var(--disabled-bg); border-color: var(--disabled-line); color: var(--ink-3); cursor: not-allowed;
}
.select, :where(select) {
  appearance: none; padding-right: 46px;
  background: var(--blanc) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230B515B' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 16px center / 18px;
}
.err-msg { display: flex; gap: 6px; align-items: flex-start; font-size: 13.5px; font-weight: 700; color: var(--err); }
.err-msg .ico { width: 16px; height: 16px; margin-top: 2px; }

/* Case a cocher et bouton radio : l'input natif reste dans le flux (focus,
   lecteurs d'ecran), la boite dessinee le suit. */
.ck { position: relative; display: inline-flex; align-items: center; gap: 12px; min-height: 44px; font-size: 16px; cursor: pointer; }
.ck > input { position: absolute; width: 24px; height: 24px; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.box {
  width: 24px; height: 24px; flex: none; border-radius: 6px; border: 2px solid var(--ink-3); background: var(--blanc);
  display: grid; place-items: center; color: var(--blanc);
  transition: background-color .2s, border-color .2s, transform .2s var(--ease);
}
.box .ico { width: 16px; height: 16px; stroke-dasharray: 24; stroke-dashoffset: 24; transition: stroke-dashoffset .3s var(--ease-out) .05s; }
.box.r { border-radius: 50%; }
.ck:hover .box { border-color: var(--petrole); }
.ck > input:checked + .box { background: var(--petrole); border-color: var(--petrole); }
.ck > input:checked + .box .ico { stroke-dashoffset: 0; }
.ck > input:checked + .box.r { background: var(--blanc); }
.ck > input:checked + .box.r::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--petrole); }
.ck > input:focus-visible + .box { outline: 3px solid var(--petrole); outline-offset: 3px; }
.ck > input[aria-invalid="true"] + .box { border-color: var(--err); }
.ck > input:disabled + .box { background: var(--disabled-bg); border-color: var(--disabled-line); }
.ck:has(> input:disabled) { color: var(--ink-3); cursor: not-allowed; }
.ck:active .box { transform: scale(.9); }

/* Choix obligatoire en boutons radio (pixel de suivi, handicap). */
.choix { display: grid; gap: 4px; min-width: 0; margin: 0; padding: 0; border: 0; }
.choix legend { padding: 0; margin-bottom: 2px; font-weight: 700; font-size: 15px; color: var(--ink); }
.choix__options { display: flex; flex-wrap: wrap; gap: 0 24px; }
.choix .ck { min-height: 40px; font-size: 15px; }
/* Groupement : le nom ne se demande qu'apres « Oui » (sans script, meme rendu en PHP et en React). */
.groupement__nom { display: none; margin-top: 6px; }
.groupement:has(input[value="Oui"]:checked) .groupement__nom { display: grid; }

/* Recherche de pharmacie (resources/js/utils/pharmacie.ts). Le champ prend
   toute la largeur de la grille du formulaire ; le code postal ne parait
   qu'en saisie libre. */
.pharmacie { display: contents; }
.pharmacie [hidden] { display: none !important; }
.pharmacie__champ { grid-column: 1 / -1; }
.pharmacie__champ .help { margin: -2px 0 2px; }
.pharmacie__saisie { position: relative; }
.pharmacie__saisie .input { padding-inline: 48px; }
.pharmacie__loupe { position: absolute; left: 16px; top: 50%; translate: 0 -50%; width: 20px; height: 20px; color: var(--petrole); pointer-events: none; }
.pharmacie__roue { position: absolute; right: 18px; top: 50%; margin-top: -8px; color: var(--petrole); }
.pharmacie__effacer {
  position: absolute; right: 8px; top: 50%; translate: 0 -50%; display: grid; place-items: center;
  width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--ink-2); cursor: pointer;
}
.pharmacie__effacer:hover { background: var(--sable-l); color: var(--petrole); }
.pharmacie__effacer .ico { width: 18px; height: 18px; }
.pharmacie__menu {
  position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; right: 0; max-height: min(340px, 50vh); overflow-y: auto;
  padding: 6px; background: var(--blanc); border-radius: var(--r-carte); box-shadow: var(--sh-2); outline: 1px solid var(--line-2);
}
.pharmacie__info { margin: 0; padding: 12px 14px; font-size: 14.5px; line-height: 1.45; color: var(--ink-2); }
.pharmacie__liste { margin: 0; padding: 0; list-style: none; }
.pharmacie__liste [role="option"] { display: grid; gap: 2px; padding: 11px 14px; border-radius: 10px; font-size: 15.5px; line-height: 1.35; cursor: pointer; }
.pharmacie__liste [role="option"] b { color: var(--petrole); }
.pharmacie__liste [role="option"] span { font-size: 14px; color: var(--ink-2); }
.pharmacie__liste [role="option"]:hover, .pharmacie__liste [aria-selected="true"] { background: var(--sable-l); }
.pharmacie__liste [aria-selected="true"] { box-shadow: inset 3px 0 0 var(--petrole); }
.pharmacie__liste .pharmacie__manuel { display: flex; align-items: center; gap: 10px; margin-top: 4px; border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; font-weight: 700; color: var(--petrole); }
.pharmacie__liste .pharmacie__manuel span { font-size: 15px; color: inherit; }
.pharmacie__manuel .ico { width: 18px; height: 18px; flex: none; }
.pharmacie__choisie {
  display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 12px 12px 12px 14px;
  border-radius: var(--r-carte); background: var(--blanc); border: 1.5px solid var(--petrole);
}
.pharmacie__ok { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--petrole); color: var(--blanc); }
.pharmacie__ok .ico { width: 18px; height: 18px; }
.pharmacie__carte { display: grid; gap: 2px; min-width: 0; font-size: 15.5px; line-height: 1.35; }
.pharmacie__carte b { color: var(--petrole); }
.pharmacie__carte span { font-size: 14px; color: var(--ink-2); }
.pharmacie__modifier, .pharmacie__retour {
  display: inline-flex; align-items: center; gap: 6px; padding: 0 6px; border: 0; background: none; cursor: pointer;
  font: 700 15px var(--f); color: var(--petrole); text-decoration: underline; text-underline-offset: 3px;
}
.pharmacie__modifier { margin-left: auto; min-height: 44px; flex: none; }
.pharmacie__modifier .ico { width: 16px; height: 16px; }
.pharmacie__note { margin: 0; font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.pharmacie__retour { padding: 0; font-size: 14px; }

/* Controle segmente : la pastille .ind est positionnee en JS. */
.seg { position: relative; display: inline-flex; padding: 4px; border-radius: 999px; background: var(--blanc); box-shadow: inset 0 0 0 1.5px var(--line-2); }
.seg button {
  position: relative; z-index: 1; min-height: 44px; padding: 0 20px; border: 0; background: transparent;
  border-radius: 999px; font: 700 15px var(--f); color: var(--petrole); cursor: pointer; transition: color .3s;
}
.seg button[aria-pressed="true"], .seg button[aria-selected="true"] { color: var(--blanc); }
.seg .ind { position: absolute; z-index: 0; top: 4px; bottom: 4px; border-radius: 999px; background: var(--petrole); transition: left .4s var(--ease-out), width .4s var(--ease-out); }

/* -------------------------------------------------------- Etiquettes */

.badge {
  display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 12px; border-radius: 999px;
  font: 700 12px/1 var(--f); letter-spacing: .04em; color: var(--petrole); background: var(--blanc);
  box-shadow: inset 0 0 0 1px var(--line-2);
}
.badge.soft { background: var(--bleu-50); box-shadow: none; }
.badge.new { background: var(--jaune); box-shadow: none; }
.badge.dpc { background: var(--petrole); color: var(--blanc); box-shadow: none; }
.badge.full { background: var(--err-bg); color: var(--err); box-shadow: none; }
.badge .ico { width: 14px; height: 14px; }

/* Filtre a bascule. */
.tag {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 999px;
  font: 700 14.5px/1 var(--f); color: var(--petrole); background: transparent; border: 1.5px solid var(--petrole);
  cursor: pointer; text-decoration: none; transition: background-color .2s, color .2s, transform .2s var(--ease);
}
.tag:hover { background: var(--survol); }
.tag[aria-pressed="true"], .tag[aria-current="true"], .tag[aria-current="page"] { background: var(--petrole); color: var(--blanc); }
.tag:active { transform: scale(.96); }
.tag[aria-disabled="true"] { color: var(--ink-3); border-color: var(--disabled-line); background: var(--disabled-bg); cursor: not-allowed; }
@media (forced-colors: active) { .tag[aria-pressed="true"] { background: Highlight; color: HighlightText; forced-color-adjust: none; } }

/* ---------------------------------------------------------------- Alertes */

.alert {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding: 14px 16px; border-radius: var(--r-carte); background: var(--bgc);
}
.alert .ico-r { width: 40px; height: 40px; border-radius: 50%; background: var(--blanc); display: grid; place-items: center; color: var(--c); }
.alert b { display: block; color: var(--c); font-size: 15.5px; }
.alert p { margin: 0; font-size: 14.5px; }
.a-info { --c: var(--info); --bgc: var(--info-bg); }
.a-ok { --c: var(--ok); --bgc: var(--ok-bg); }
.a-warn { --c: var(--warn); --bgc: var(--warn-bg); }
.a-err { --c: var(--err); --bgc: var(--err-bg); }

/* ------------------------------------------------------------------ Cartes */

.carte {
  background: var(--blanc); border-radius: var(--r-carte); box-shadow: var(--sh-1);
  outline: 1px solid var(--sable); outline-offset: -1px;
}
/* Carte entierement cliquable : le lien du titre s'etend a toute la carte. */
.carte-lien { position: relative; transition: box-shadow .45s var(--ease-out); }
.carte-lien:hover { box-shadow: var(--sh-hover); }
.carte-lien .etendu::after { content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: 3; }
.carte-lien:has(.etendu:focus-visible) { outline: 3px solid var(--petrole); outline-offset: 4px; }
.carte-lien .etendu:focus-visible { outline: none; }

.icon-btn {
  width: 48px; height: 48px; border-radius: 50%; display: inline-grid; place-items: center; border: 0;
  background: transparent; color: var(--petrole); box-shadow: none; cursor: pointer;
  transition: background-color .2s, color .2s, transform .2s var(--ease), box-shadow .2s;
}
.icon-btn:hover { background: var(--petrole); color: var(--blanc); transform: translateY(-2px); box-shadow: var(--sh-2); }
.icon-btn .ico { width: 20px; height: 20px; }
.icon-btn.contour { box-shadow: inset 0 0 0 1.5px var(--petrole); }
.ico.retourne { transform: scaleX(-1); }
.carrousel-nav { display: flex; gap: 8px; }

/* Titre de section des pages interieures, comme ceux de l'accueil (Light + Bold). */
.titre-section { margin: 0; font-size: var(--wp--preset--font-size--titre-section); line-height: 1.04; letter-spacing: -.03em; font-weight: 300; color: var(--petrole); text-wrap: balance; }
.titre-section strong { font-weight: 700; }

/* Carte formation (catalogue). */
.c-fo {
  position: relative; display: flex; flex-direction: column; padding: 12px;
  background: var(--blanc); border-radius: var(--r-carte); box-shadow: var(--sh-1);
  transition: box-shadow .45s var(--ease-out);
}
.c-fo .ph { aspect-ratio: 16 / 10; border-radius: var(--r-visuel); overflow: hidden; }
.c-fo .ph img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease-out); }
.c-fo .badges { position: absolute; top: 24px; left: 24px; right: 24px; z-index: 2; display: flex; gap: 6px; flex-wrap: wrap; }
.c-fo .badges .badge { box-shadow: none; }
.c-fo .bd { flex: 1; display: grid; gap: 10px; align-content: start; padding: 16px 10px 8px; }
.c-fo :is(h2, h3) { margin: 0; font-size: 19px; font-weight: 700; line-height: 1.28; letter-spacing: -.01em; color: var(--petrole); }
.c-fo :is(h2, h3) a { color: inherit; text-decoration: none; }
.c-fo :is(h2, h3) a::after { content: ""; position: absolute; inset: 0; border-radius: var(--r-carte); z-index: 3; }
.c-fo .meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; color: var(--ink-2); }
.c-fo .meta span { display: inline-flex; align-items: center; gap: 6px; }
.c-fo .meta .ico { width: 16px; height: 16px; color: var(--petrole); }
.c-fo .ft {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 6px;
  padding: 12px 10px 4px; border-top: 1px solid var(--line);
}
.c-fo:hover { box-shadow: var(--sh-hover); }
.c-fo:hover .ph img { transform: scale(1.06); }
.c-fo:hover .c-link .u { background-size: 0 1.5px; background-position: right bottom; }
.c-fo:hover .c-link .ar { transform: translateX(4px); }
.c-fo:has(a:focus-visible) { outline: 3px solid var(--petrole); outline-offset: 4px; }
.c-fo :is(h2, h3) a:focus-visible { outline: none; }

/* ------------------------------------------- Fil d'Ariane et pagination */

.bc ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: 14.5px; }
.bc li { display: inline-flex; align-items: center; }
.bc li + li::before { content: "/"; color: var(--ink-3); margin: 0 6px; }
.bc a { min-height: 44px; display: inline-flex; align-items: center; color: var(--teal-sable); }
.bc [aria-current="page"] { font-weight: 700; color: var(--ink); }

.pg { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pg a, .pg span {
  min-width: 44px; height: 44px; padding: 0 10px; border-radius: 999px; display: inline-grid; place-items: center;
  font-weight: 700; color: var(--petrole); text-decoration: none; transition: background-color .2s;
}
.pg a:hover { background: var(--survol); }
.pg a[aria-current="page"] { background: var(--petrole); color: var(--blanc); }
.pg .edge { display: inline-flex; gap: 6px; padding: 0 16px; box-shadow: inset 0 0 0 1.5px var(--petrole); }
.pg .edge[aria-disabled="true"] { box-shadow: none; background: var(--disabled-bg); color: var(--ink-3); }

/* ------------------------------------------- Pages interieures : cadre */

/* Le conteneur des pages interieures, aux memes largeur et gouttieres que l'accueil. */
.conteneur { box-sizing: border-box; width: 100%; max-width: var(--wp--custom--page--largeur); margin-inline: auto; padding-inline: var(--wp--custom--page--gouttiere); }
.section-page { padding-block: clamp(40px, 6vw, 80px); }

/* Hero d'une page interieure (maquette finale : catalogue, a propos, contact). */
.hero-page { padding-top: 12px; }
.hero-page__carte {
  display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(24px, 4vw, 56px);
  padding: clamp(16px, 2vw, 24px); border-radius: var(--r-carte); background: var(--blanc);
}
.hero-page__texte { display: flex; flex-direction: column; justify-content: center; padding: clamp(16px, 4vw, 48px) 0 clamp(16px, 4vw, 48px) clamp(8px, 3vw, 40px); }
.hero-page h1 { margin: 0; font-size: clamp(34px, 4.4vw, 60px); line-height: 1.04; letter-spacing: -.03em; font-weight: 300; color: var(--petrole); text-wrap: balance; }
.hero-page h1 strong { font-weight: 700; }
.hero-page__texte p { margin: 20px 0 0; max-width: 52ch; font-size: clamp(17px, 1.3vw, 19px); line-height: 1.55; color: var(--ink-2); }
.hero-page__texte p + p { margin-top: 12px; }
.hero-page__texte .btn { align-self: flex-start; margin-top: 28px; }
.hero-page__visuel { position: relative; min-height: clamp(420px, 44vw, 600px); overflow: hidden; border-radius: 16px; background: var(--fond); }
.hero-page__visuel img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: var(--cadrage); }
@media (max-width: 980px) {
  .hero-page__carte { grid-template-columns: minmax(0, 1fr); }
  .hero-page__texte { padding: 24px 12px 8px; }
  .hero-page__texte p { max-width: none; }
  .hero-page__visuel { min-height: clamp(320px, 88vw, 620px); }
  .hero-page__visuel img { object-position: var(--cadrage-mobile); }
}
@media (max-width: 700px) { .hero-page__texte .btn { align-self: stretch; } }
@media (max-width: 560px) { .hero-page h1 { font-size: clamp(28px, 8vw, 36px); } }

/* Catalogue : de l'air entre le hero et les filtres. */
.hero-page + .filtres-sous-hero { margin-top: clamp(32px, 4vw, 56px); }

/* En-tete d'une page interieure : fil d'Ariane, surtitre, titre, chapeau, actions. */
.entete-page { display: grid; gap: 14px; padding-block: 24px clamp(28px, 4vw, 48px); }
.entete-page h1 {
  margin: 0; max-width: 22ch; font-size: var(--wp--preset--font-size--titre-section); line-height: 1.04;
  letter-spacing: -.03em; font-weight: 300; color: var(--petrole); text-wrap: balance;
}
.entete-page h1 strong { font-weight: 700; }
.entete-page .chapeau { margin: 0; max-width: 62ch; font-size: 17px; color: var(--ink-2); }
.entete-page__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }

/* ------------------------------------------------- Catalogue : filtres */

/* Recherche, puis les cinq menus du formulaire GET sur une ligne : champs du
   kit resserres, pour que la premiere formation reste au-dessus de la ligne
   de flottaison. */
.filtres { display: grid; gap: 14px; padding: 18px 20px; background: var(--blanc); border-radius: var(--r-carte); box-shadow: var(--sh-1); }
.filtres .field { gap: 4px; }
.filtres .field label { font-size: 13.5px; }
.filtres .input { min-height: 44px; font-size: 15.5px; }
.filtres__axes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 12px; }
.filtres__pied { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.filtres__compte { margin: 0; font-size: 15px; color: var(--ink-2); }
/* Sur telephone, les criteres vivent derriere une poignee : un <details> natif,
   dont le panneau est le frere, pour rester ouvrable sans JavaScript. */
.filtres__pli { display: none; }
.filtres__pli > summary { list-style: none; }
.filtres__pli > summary::-webkit-details-marker { display: none; }
@media (max-width: 760px) {
  .filtres__pli { display: block; }
  .filtres__axes { display: none; }
  .filtres__pli[open] + .filtres__axes { display: grid; }
}

/* ---------------------------------------------- Catalogue : liste */

.grille-fo { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 20px; }
.grille-fo > .plus { grid-column: 1 / -1; display: flex; justify-content: center; padding-top: 12px; }
.c-fo .chapeau { margin: 0; font-size: 15px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ----------------------------------------------------------------- 404 */
.page-404 { justify-items: start; padding-block: clamp(48px, 8vw, 120px); }

/* ------------------------------------------------------ Animations reduites */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
}

/* ------------------------------------------------------------ En-tete du site */

.site-h-zone { box-sizing: border-box; max-width: var(--wp--custom--page--largeur); margin-inline: auto; padding-inline: clamp(12px, 2.4vw, 32px); position: sticky; top: calc(env(safe-area-inset-top, 0px) + 12px); z-index: 50; }
.site-h { padding-top: 12px; transition: translate .35s var(--ease-out); }
.site-h.is-hid { translate: 0 calc(-100% - 24px); }
.mh {
  display: flex; flex-wrap: wrap; align-items: center; gap: 20px; row-gap: 10px; padding: 12px 14px 12px 22px;
  background: color-mix(in srgb, var(--sable-l) 95%, transparent); border-radius: var(--r-carte); box-shadow: var(--sh-1);
  transition: background-color .35s, box-shadow .35s;
}
.mh.scrolled { background: color-mix(in srgb, var(--blanc) 95%, transparent); box-shadow: var(--sh-2); }
.mh-logo { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; font-weight: 900; color: var(--petrole); }
.mh-logo img { display: block; height: 30px; width: auto; }
.mh .nav { margin-left: auto; }
.mh-act { display: flex; align-items: center; gap: 10px; }
.s-btn[aria-expanded="true"] { background: var(--petrole); --pi-trait: var(--blanc); }
.srch { flex-basis: 100%; display: flex; gap: 8px; padding: 4px 0 2px; }
.srch[hidden] { display: none; }
.burger { display: none; }
.drawer { flex-basis: 100%; }
.drawer[hidden] { display: none; }
.drawer ul { list-style: none; margin: 0; padding: 4px 0 12px; }
.drawer li a {
  display: flex; justify-content: space-between; align-items: center; min-height: 52px; border-bottom: 1px solid var(--line);
  font-weight: 700; font-size: 18px; color: var(--petrole); text-decoration: none;
}
.drawer li a .ico { width: 20px; height: 20px; }
/* Sous-menu d'une entree du menu de l'en-tete : au survol ou au focus. */
.mh-sous { position: relative; }
.mh-sous > ul { display: none; position: absolute; top: 100%; left: 0; z-index: 2; min-width: 220px; margin: 0; padding: 8px; list-style: none; background: var(--blanc); border-radius: var(--r-carte); box-shadow: var(--sh-hover); }
.mh-sous:hover > ul, .mh-sous:focus-within > ul { display: grid; gap: 2px; }
.mh-sous > ul a { display: block; padding: 10px 12px; border-radius: var(--r-interne); font-size: 15px; color: var(--ink); text-decoration: none; }
.mh-sous > ul a:hover { background: var(--survol); color: var(--petrole); }
.drawer > .btn, .drawer > .mh-plateforme > summary { width: 100%; margin-bottom: 6px; }

/* « Acces plateforme » a plusieurs destinations : une liste native, sans JavaScript. */
.mh-plateforme { position: relative; }
.mh-plateforme > summary { list-style: none; }
.mh-plateforme > summary::-webkit-details-marker { display: none; }
.mh-plateforme[open] > summary .ar { transform: rotate(180deg); }
.mh-plateforme ul {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; min-width: 220px; margin: 0; padding: 8px; list-style: none;
  background: var(--blanc); border-radius: var(--r-interne); box-shadow: var(--sh-2);
}
.mh-plateforme--tiroir ul { position: static; box-shadow: none; padding: 0; }
.mh-plateforme li a { display: flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: var(--r-visuel); font-weight: 700; color: var(--petrole); text-decoration: none; }
.mh-plateforme li a:hover { background: var(--survol); }

@media (max-width: 1020px) {
  .mh .nav, .mh-act .hide-m { display: none; }
  .burger { display: inline-grid; }
  .mh-act { margin-left: auto; }
}
@media (prefers-reduced-motion: reduce) { .site-h, .mh { transition: none; } }

/* ------------------------------------------------- Pied de page « notice » */

.mf2-zone { box-sizing: border-box; max-width: var(--wp--custom--page--largeur); margin: clamp(64px, 8vw, 112px) auto 24px; padding-inline: clamp(12px, 2.4vw, 32px); }
.mf2 {
  position: relative; overflow: hidden; padding: var(--wp--custom--espace--bloc); color: var(--ink);
  background: var(--blanc); border-radius: var(--r-carte); box-shadow: var(--sh-2); outline: 1px solid var(--sable); outline-offset: -1px;
}
/* theme/global-styles.ts impose 16 px a chaque span, a, li... : ici la taille s'herite. */
.mf2 :where(p, span, a, li, ul, ol, small) { font-size: inherit; }
.mf2 p, .mf2 ul, .mf2 ol, .mf2 h2, .mf2 h3 { margin: 0; }
.mf2 .lien-notice { color: var(--petrole); text-decoration-thickness: 1.5px; }
.mf2 .lien-notice:focus-visible { text-decoration-color: currentColor; }
.nt-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 24px; padding-bottom: 24px; border-bottom: 2px solid var(--petrole); }
.nt-h { font-size: clamp(28px, 3vw, 40px); letter-spacing: -.02em; font-weight: 900; color: var(--petrole); }
.nt-h small { display: block; margin-top: 4px; font-size: 15px; font-weight: 400; letter-spacing: 0; color: var(--ink-2); }
.nt-logo { display: block; width: clamp(200px, 22vw, 274px); height: auto; }
.nt-warn { display: flex; gap: 10px; max-width: 60ch; padding: 12px 16px; border-radius: var(--r-interne); background: var(--sable-l); font-size: 14px; font-weight: 700; color: var(--petrole); }
.nt-warn .ico { width: 20px; height: 20px; }
/* Une colonne par entree : une colonne de liens vide n'est pas envoyee (pied-de-page.php). */
.nt-grid { list-style: none; padding: 28px 0 0 !important; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 28px; }
.nt-grid > li { display: grid; gap: 12px; align-content: start; }
.nt-grid h3 { display: flex; gap: 10px; align-items: flex-start; font-size: 16px; line-height: 1.3; font-weight: 700; letter-spacing: 0; color: var(--petrole); }
.nt-grid h3 span {
  flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px var(--petrole); font-size: 13px; font-weight: 900; transition: background-color .3s, color .3s;
}
.nt-grid > li:hover h3 span { background: var(--petrole); color: var(--blanc); }
.nt-grid p { font-size: 14.5px; color: var(--ink-2); }
.nt-grid ul { list-style: none; padding: 0; display: grid; gap: 2px; }
.nt-grid ul li { display: flex; align-items: center; min-height: 32px; font-size: 15px; }
.nt-big { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 24px; margin-top: 44px; padding: 32px 0; border-block: 1px solid var(--line); }
.nt-accroche { font-size: var(--wp--preset--font-size--titre-hero); line-height: 1.02; letter-spacing: -.035em; font-weight: 700; color: var(--petrole); }
.nt-cert { display: flex; align-items: center; gap: 16px; margin-top: 24px; font-size: 12.5px; color: var(--ink-2); }
.nt-cert p { max-width: 72ch; padding-top: 4px; font-size: 12.5px; }
.nt-qimg { flex: none; width: 130px; height: auto; padding: 6px; border-radius: var(--r-visuel); background: var(--blanc); }
.lien-notice.is-souligne { text-decoration-color: currentColor; }
.nt-acces { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 32px; padding: 18px 0; border-top: 1px solid var(--line); font-size: 14px; line-height: 1.6; color: var(--ink-2); }
.nt-acces p { margin: 0; }
.nt-acces a { color: var(--petrole); }
/* Liens dans une phrase (referent handicap, pied de page et fiches) : soulignes,
   la couleur seule ne les distingue pas. */
.note-handicap a { color: var(--petrole); text-decoration: underline; text-underline-offset: 3px; }
.nt-legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; margin-top: 20px; font-size: 12.5px; color: var(--ink-2); }
.nt-right { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.nt-social { list-style: none; padding: 0; display: flex; gap: 8px; }
.nt-social a {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: var(--petrole);
  box-shadow: inset 0 0 0 1.5px var(--line-2); transition: background-color .2s, color .2s;
}
.nt-social a:hover { background: var(--petrole); color: var(--blanc); }
.nt-social .ico { width: 18px; height: 18px; }
@media (max-width: 1100px) { .nt-grid { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px) { .nt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 460px) { .nt-grid { grid-template-columns: minmax(0, 1fr); } }
