/* ==========================================================================
   ABLOGUI — Base : socle, typographie, éléments communs, en-tête, pied de page
   (en-tête et pied de page = gabarits PHP du thème, pas des widgets)
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--ab-police);
  font-size: var(--ab-fs-m);
  font-weight: var(--ab-graisse-texte);
  line-height: 1.6;
  color: var(--ab-texte);
  background: var(--ab-blanc);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
:focus-visible { outline: 3px solid var(--ab-jaune); outline-offset: 3px; border-radius: 4px; }

.ab-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* --- Gabarit ---------------------------------------------------------- */
.ab-conteneur { width: 100%; max-width: calc(var(--ab-conteneur) + 2 * var(--ab-gouttiere)); margin-inline: auto; padding-inline: var(--ab-gouttiere); }
.ab-section { padding-block: var(--ab-section); }
.ab-section--papier { background: var(--ab-papier); }
.ab-section--nuit { background: var(--ab-vert-nuit); color: var(--ab-blanc); }

/* --- Titres : le duo Light + Bold de la charte ------------------------- */
/* « Au service de la **démocratie** » : texte léger, mot-clé en gras */
.ab-titre {
  font-size: var(--ab-fs-2xl);
  font-weight: var(--ab-graisse-legere);
  line-height: 1.04;
  letter-spacing: -.025em;
  text-wrap: balance;
}
.ab-titre strong { font-weight: var(--ab-graisse-forte); letter-spacing: -.03em; }
.ab-titre--xl { font-size: var(--ab-fs-3xl); line-height: .98; }
.ab-titre--l { font-size: var(--ab-fs-xl); line-height: 1.12; }

/* Surtitre précédé du tiret de la signature photo */
.ab-surtitre {
  display: inline-flex; align-items: center; gap: 12px;
  font-size: var(--ab-fs-xs); font-weight: var(--ab-graisse-forte);
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--ab-vert-texte);
  margin-bottom: 18px;
}
.ab-surtitre::before { content: ""; width: 28px; height: 2px; background: currentColor; }
.ab-section--nuit .ab-surtitre, .ab-sur-sombre .ab-surtitre { color: var(--ab-jaune); }

.ab-chapeau { font-size: var(--ab-fs-l); line-height: 1.5; color: var(--ab-texte-doux); max-width: 60ch; }
.ab-section--nuit .ab-chapeau { color: rgba(255, 255, 255, .78); }

.ab-entete-bloc { display: flex; align-items: end; justify-content: space-between; gap: 24px 48px; flex-wrap: wrap; margin-bottom: clamp(32px, 4vw, 56px); }
.ab-entete-bloc > div { max-width: 720px; }
.ab-entete-bloc .ab-chapeau { margin-top: 16px; }

/* --- Boutons ---------------------------------------------------------- */
.ab-bouton {
  --_fond: var(--ab-noir); --_texte: var(--ab-blanc);
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 12px 22px;
  border: 2px solid var(--_fond); border-radius: 999px;
  background: var(--_fond); color: var(--_texte);
  font-weight: var(--ab-graisse-forte); font-size: var(--ab-fs-s); letter-spacing: .01em;
  transition: transform var(--ab-transition), background var(--ab-transition), color var(--ab-transition), border-color var(--ab-transition);
}
.ab-bouton:hover { transform: translateY(-2px); }
.ab-bouton svg { width: 18px; height: 18px; transition: transform var(--ab-transition); }
.ab-bouton:hover svg { transform: translateX(3px); }
.ab-bouton--vert { --_fond: var(--ab-vert); }
.ab-bouton--vert:hover { --_fond: var(--ab-vert-texte); }
.ab-bouton--jaune { --_fond: var(--ab-jaune); --_texte: var(--ab-noir); }
.ab-bouton--contour { background: transparent; color: var(--_fond); }
.ab-bouton--contour:hover { background: var(--_fond); color: var(--_texte); }
.ab-bouton--clair { --_fond: var(--ab-blanc); --_texte: var(--ab-noir); }

.ab-lien-fleche {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: var(--ab-graisse-forte); font-size: var(--ab-fs-s);
  color: var(--ab-vert-texte);
  border-bottom: 2px solid currentColor; padding-bottom: 2px;
}
.ab-lien-fleche svg { width: 16px; height: 16px; transition: transform var(--ab-transition); }
.ab-lien-fleche:hover svg { transform: translateX(4px); }
.ab-section--nuit .ab-lien-fleche { color: var(--ab-jaune); }

/* Étiquettes */
.ab-etiquette {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: var(--ab-graisse-forte); letter-spacing: .04em; text-transform: uppercase;
  background: var(--ab-vert-clair); color: var(--ab-vert-texte);
}
.ab-etiquette--rouge { background: var(--ab-rouge-clair); color: var(--ab-rouge-texte); }
.ab-etiquette--jaune { background: var(--ab-jaune-clair); color: #7a5b00; }
.ab-etiquette--neutre { background: var(--ab-papier); color: var(--ab-texte-doux); }
.ab-etiquette--point::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* --- Ruban tricolore (motif tiré des bandes du logo) ------------------ */
.ab-ruban { position: absolute; pointer-events: none; fill: none; stroke-width: 9; stroke-linecap: round; }
.ab-ruban path { fill: none; stroke-width: 9; stroke-linecap: round; }

/* Signature photo (charte) : pictogramme blanc + tiret, centré en bas */
.ab-signature-photo { position: relative; }
.ab-signature-photo::after {
  content: ""; position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%);
  width: 64px; height: 26px;
  background:
    url("../assets/picto-ablogui-blanc.svg") right center / auto 26px no-repeat,
    linear-gradient(#fff, #fff) left center / 28px 2px no-repeat;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .45));
  opacity: .95;
}

/* ==========================================================================
   EN-TÊTE (thème : header.php)
   ========================================================================== */
.ab-bandeau-haut {
  background: var(--ab-noir); color: rgba(255, 255, 255, .82);
  font-size: var(--ab-fs-xs);
}
.ab-bandeau-haut .ab-conteneur { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 40px; }
.ab-bandeau-haut a:hover { color: var(--ab-jaune); }
.ab-bandeau-haut__alerte { display: inline-flex; align-items: center; gap: 10px; }
.ab-bandeau-haut__alerte b { color: var(--ab-jaune); font-weight: var(--ab-graisse-forte); }
.ab-pastille { width: 8px; height: 8px; border-radius: 50%; background: var(--ab-jaune); box-shadow: 0 0 0 0 rgba(237, 183, 16, .6); animation: ab-pulse 2.2s infinite; }
@keyframes ab-pulse { 70% { box-shadow: 0 0 0 9px rgba(237, 183, 16, 0); } 100% { box-shadow: 0 0 0 0 rgba(237, 183, 16, 0); } }
.ab-reseaux { display: flex; gap: 14px; align-items: center; }
.ab-reseaux svg { width: 16px; height: 16px; }

.ab-entete {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--ab-transition), box-shadow var(--ab-transition);
}
.ab-entete.est-colle { border-color: var(--ab-ligne); box-shadow: 0 6px 20px -16px rgba(0, 0, 0, .4); }
/* Retour 01 (lisibilité) : logo plus grand, intitulés en noir plein et en gras */
.ab-entete .ab-conteneur { display: flex; align-items: center; gap: 28px; min-height: 96px; }
.ab-entete__logo { flex: none; }
.ab-entete__logo img { height: 74px; width: auto; }
.ab-nav { margin-left: auto; }
.ab-nav ul { list-style: none; margin: 0; padding: 0; }
.ab-nav > ul { display: flex; gap: 2px; }
.ab-nav li { position: relative; }
.ab-nav a {
  position: relative; display: block; padding: 10px 11px;
  font-weight: var(--ab-graisse-forte); font-size: 1rem; color: var(--ab-noir); white-space: nowrap;
  border-radius: var(--ab-rayon-s);
}
.ab-nav > ul > li > a::after {
  content: ""; position: absolute; left: 11px; right: 11px; bottom: 3px; height: 3px; border-radius: 2px;
  background: var(--ab-vert); transform: scaleX(0); transform-origin: left; transition: transform var(--ab-transition);
}
.ab-nav > ul > li > a:hover::after,
.ab-nav a[aria-current="page"]::after,
.ab-nav .current-menu-ancestor > a::after,
.ab-nav .current_page_parent > a::after { transform: scaleX(1); }
.ab-nav a:hover { color: var(--ab-vert-texte); }

/* Sous-menu (mêmes classes que wp_nav_menu : .menu-item-has-children / .sub-menu) */
.ab-nav .menu-item-has-children > a { padding-right: 32px; }
.ab-nav .menu-item-has-children > a::after { right: 32px; }
.ab-nav__deplier {
  position: absolute; right: 6px; top: 50%; translate: 0 -50%;
  display: grid; place-items: center; width: 26px; height: 26px; padding: 0;
  border: 0; border-radius: 50%; background: none; color: var(--ab-noir);
}
.ab-nav__deplier svg { width: 14px; height: 14px; transition: transform var(--ab-transition); }
.ab-nav .sub-menu {
  position: absolute; left: 0; top: 100%; z-index: 5; min-width: 270px; padding: 10px;
  background: var(--ab-blanc); border: 1px solid var(--ab-ligne); border-radius: var(--ab-rayon); box-shadow: var(--ab-ombre-forte);
  opacity: 0; visibility: hidden; translate: 0 8px; transition: opacity var(--ab-transition), translate var(--ab-transition), visibility 0s linear 220ms;
}
.ab-nav li:hover > .sub-menu, .ab-nav li:focus-within > .sub-menu, .ab-nav li.est-deplie > .sub-menu {
  opacity: 1; visibility: visible; translate: 0 0; transition-delay: 0s;
}
.ab-nav li:hover > .ab-nav__deplier svg, .ab-nav li.est-deplie > .ab-nav__deplier svg { transform: rotate(180deg); }
.ab-nav .sub-menu a { padding: 11px 14px; font-weight: var(--ab-graisse-moyenne); }
.ab-nav .sub-menu a:hover, .ab-nav .sub-menu a[aria-current="page"] { background: var(--ab-papier); color: var(--ab-noir); }
.ab-nav .sub-menu a[aria-current="page"] { font-weight: var(--ab-graisse-forte); box-shadow: inset 3px 0 0 var(--ab-vert); }
.ab-entete__actions { display: flex; align-items: center; gap: 10px; }
.ab-bouton-icone {
  display: inline-grid; place-items: center; width: 44px; height: 44px;
  border: 1px solid var(--ab-ligne); border-radius: 50%; background: var(--ab-blanc);
}
.ab-bouton-icone svg { width: 18px; height: 18px; }
.ab-burger { display: none; }

@media (max-width: 1180px) {
  /* backdrop-filter piégerait le panneau fixe dans l'en-tête */
  .ab-entete { backdrop-filter: none; background: var(--ab-blanc); }
  .ab-nav { position: fixed; inset: 0 0 0 auto; width: min(360px, 88vw); margin: 0; padding: 96px 28px 32px;
    background: var(--ab-blanc); box-shadow: var(--ab-ombre-forte); transform: translateX(105%); visibility: hidden;
    transition: transform var(--ab-transition), visibility 0s linear 220ms; z-index: 60; overflow-y: auto; }
  .ab-nav.est-ouverte { transform: none; visibility: visible; transition-delay: 0s; }
  .ab-nav > ul { flex-direction: column; }
  .ab-nav a { font-size: var(--ab-fs-l); padding: 14px 4px; border-bottom: 1px solid var(--ab-ligne); border-radius: 0; white-space: normal; }
  .ab-nav > ul > li > a::after { display: none; }
  .ab-nav a[aria-current="page"], .ab-nav .current-menu-ancestor > a, .ab-nav .current_page_parent > a { color: var(--ab-vert-texte); }
  /* Sous-menu toujours déplié dans le panneau mobile */
  .ab-nav .menu-item-has-children > a { padding-right: 4px; }
  .ab-nav__deplier { display: none; }
  .ab-nav .sub-menu { position: static; min-width: 0; padding: 4px 0 10px 16px; border: 0; border-radius: 0; box-shadow: none;
    opacity: 1; visibility: visible; translate: none; border-bottom: 1px solid var(--ab-ligne); }
  .ab-nav .sub-menu a { font-size: var(--ab-fs-m); padding: 9px 12px; border-bottom: 0; border-radius: var(--ab-rayon-s); }
  .ab-burger { display: inline-grid; position: relative; z-index: 70; }
  .ab-entete__actions { margin-left: auto; }
  .ab-entete__adherer { display: none; }
}
@media (max-width: 640px) {
  .ab-bandeau-haut .ab-reseaux { display: none; }
  .ab-entete .ab-conteneur { min-height: 76px; }
  .ab-entete__logo img { height: 56px; }
}

/* ==========================================================================
   PIED DE PAGE (thème : footer.php) — verso de la carte de visite :
   fond noir, logo blanc, bande verte en bas
   ========================================================================== */
.ab-pied { background: var(--ab-noir); color: rgba(255, 255, 255, .72); font-size: var(--ab-fs-s); position: relative; }
.ab-pied::after { content: ""; display: block; height: 14px; background: var(--ab-vert); }
.ab-pied__grille { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 48px; padding-block: 80px 56px; }
.ab-pied__logo img { height: 74px; width: auto; margin-bottom: 22px; }
.ab-pied h3 { color: var(--ab-blanc); font-size: var(--ab-fs-s); font-weight: var(--ab-graisse-forte); letter-spacing: .12em; text-transform: uppercase; margin-bottom: 18px; }
.ab-pied ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.ab-pied a:hover { color: var(--ab-jaune); }
.ab-pied__coord li { display: flex; gap: 10px; }
.ab-pied__coord svg { width: 16px; height: 16px; flex: none; margin-top: 4px; color: var(--ab-vert); }
.ab-pied__bas { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-block: 22px; border-top: 1px solid rgba(255, 255, 255, .12); font-size: var(--ab-fs-xs); }
.ab-pied .ab-reseaux a { display: inline-grid; place-items: center; width: 38px; height: 38px; border: 1px solid rgba(255, 255, 255, .2); border-radius: 50%; }
.ab-pied .ab-reseaux a:hover { border-color: var(--ab-jaune); }
@media (max-width: 900px) { .ab-pied__grille { grid-template-columns: 1fr 1fr; } .ab-pied__marque { grid-column: 1 / -1; } }
@media (max-width: 520px) { .ab-pied__grille { grid-template-columns: 1fr; gap: 36px; } }

/* --- Apparition au défilement ---------------------------------------- */
.ab-js [data-apparait] { opacity: 0; transform: translateY(16px); transition: opacity 1s cubic-bezier(.16, 1, .3, 1), transform 1.1s cubic-bezier(.16, 1, .3, 1); transition-delay: var(--delai, 0ms); }
.ab-js [data-apparait].est-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .ab-js [data-apparait] { opacity: 1; transform: none; }
}

/* --- Mode « repères » : affiche le nom du widget sur chaque bloc ------ */
.ab-reperes [data-widget] { outline: 2px dashed var(--ab-rouge); outline-offset: -6px; position: relative; }
.ab-reperes [data-widget]::before {
  content: attr(data-widget); position: absolute; top: 10px; left: 10px; z-index: 40;
  padding: 4px 10px; border-radius: 6px; background: var(--ab-rouge); color: #fff;
  font: 700 12px/1.4 ui-monospace, Menlo, monospace;
}
.ab-bascule-reperes {
  position: fixed; right: 16px; bottom: 16px; z-index: 90;
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px;
  border: 0; border-radius: 999px; background: var(--ab-noir); color: #fff;
  font-size: 13px; font-weight: 700; box-shadow: var(--ab-ombre-forte);
}
.ab-bascule-reperes[aria-pressed="true"] { background: var(--ab-rouge); }
