/* =====================================================================
   V6.5 — Refonte homepage portail. CSS spécifique chargé uniquement
   sur is_front_page() && blog_id=1 (cf. inc/portail/init.php).
   Dépend de portail.css (vars --alm-blue, --cta-bg, etc.) et de
   portail-blocks.css (classes .alm-block, .alm-cards-grid, etc.).
   ===================================================================== */

/* === HERO HOME — overrides ciblés (.home = body class WP) ===
   V6.5-fix-9 : reproduction stricte de la maquette de référence. */
.home.almaviva-portail-body .alm-hero {
  min-height: 75vh;
  padding-block: 60px;
}
@media (max-width: 768px) {
  .home.almaviva-portail-body .alm-hero { min-height: 64vh; padding-block: 48px; }
}

/* V6.5-fix-24 : refonte fond hero — overlay bleu Almaviva (charte) +
   réseau de lignes courbes animées par-dessus (remplace les 2 SVG
   monogrammes "A" précédents qui faisaient parasites).
   Photo de fond conservée mais opacity 0.55 pour laisser le bleu prendre. */
.home.almaviva-portail-body .alm-hero::before {
  opacity: 0.55;
}

/* Overlay bleu Almaviva diagonal — remplace le dégradé sombre vertical
   précédent. Couvre toute la zone, sous les lignes SVG et le contenu. */
.home.almaviva-portail-body .alm-hero::after {
  background: linear-gradient(135deg, rgba(0,72,153,0.78) 0%, rgba(14,37,72,0.85) 100%);
}

.home.almaviva-portail-body .alm-hero > .alm-container { z-index: 3; width: 100%; }

/* Réseau de lignes animées (4 blanches + 2 orange Almaviva) + 4 dots
   pulsants. preserveAspectRatio="none" → s'étire à la largeur du hero
   pour donner une grille fluide. Stack : image (z=0) → overlay (z=1)
   → lignes (z=2) → contenu container (z=3). */
.home.almaviva-portail-body .alm-hero-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}
.home.almaviva-portail-body .alm-line {
  fill: none;
  stroke: rgba(255, 255, 255, 0.45);
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-dasharray: 600;
  stroke-dashoffset: 600;
  animation: alm-draw 9s ease-in-out infinite;
  vector-effect: non-scaling-stroke; /* garde stroke 1.2px malgré preserveAspectRatio=none */
}
.home.almaviva-portail-body .alm-line-orange {
  stroke: rgba(238, 114, 3, 0.6);
  stroke-width: 1.4;
}
.home.almaviva-portail-body .l1 { animation-delay: 0s; }
.home.almaviva-portail-body .l2 { animation-delay: 1.4s; }
.home.almaviva-portail-body .l3 { animation-delay: 2.8s; }
.home.almaviva-portail-body .l4 { animation-delay: 4.2s; }
.home.almaviva-portail-body .l5 { animation-delay: 5.6s; }
.home.almaviva-portail-body .l6 { animation-delay: 7s; }

.home.almaviva-portail-body .alm-dot {
  fill: rgba(255, 255, 255, 0.7);
  animation: alm-pulse 5s ease-in-out infinite;
}
.home.almaviva-portail-body .d1 { animation-delay: 0.5s; }
.home.almaviva-portail-body .d2 { animation-delay: 1.8s; }
.home.almaviva-portail-body .d3 { animation-delay: 3s; }
.home.almaviva-portail-body .d4 { animation-delay: 4.2s; }

@keyframes alm-draw {
  0%   { stroke-dashoffset: 600; opacity: 0.2; }
  35%  { stroke-dashoffset: 0;   opacity: 1; }
  65%  { stroke-dashoffset: 0;   opacity: 0.8; }
  100% { stroke-dashoffset: -600; opacity: 0; }
}
@keyframes alm-pulse {
  0%, 100% { opacity: 0.2; }
  50%      { opacity: 0.9; }
}

@media (prefers-reduced-motion: reduce) {
  .home.almaviva-portail-body .alm-line,
  .home.almaviva-portail-body .alm-dot { animation: none; }
  .home.almaviva-portail-body .alm-line { stroke-dashoffset: 0; opacity: 0.4; }
  .home.almaviva-portail-body .alm-dot  { opacity: 0.5; }
}

/* V6.5-fix-9 : H1 ~88px desktop, wrap "Tous acteurs de votre / Santé"
   contrôlé par <br> injecté en PHP. max-width retiré → laisse le <br>
   décider du wrap au lieu d'une contrainte ch arbitraire. line-height
   resserré pour titre énorme. Espace H1→paragraphe = 32px. */
/* V6.5-fix-12 : H1 — font-size cap remonté à 4.5rem (72px desktop),
   margin-top 0, margin-bottom 20px pour compacter le bloc texte. */
.home.almaviva-portail-body .alm-hero h1 {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  max-width: none;
  margin-top: 0;
  margin-bottom: 20px;
}
/* V6.5-fix-9 : "Tous acteurs de votre" sur une seule ligne (forcée),
   "Santé" sur la ligne 2 (via <br>). */
.home.almaviva-portail-body .alm-portail-h1 .alm-hero-h1-line {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: break-word;
}
@media (max-width: 1023px) {
  /* Mobile/tablette : restaure le wrap naturel + scale H1 plus petit pour
     éviter qu'un mot ne déborde de l'écran (le span nowrap garderait
     "Tous acteurs de votre" sur 1 ligne, mais ~460px > viewport mobile). */
  .home.almaviva-portail-body .alm-portail-h1 .alm-hero-h1-line {
    white-space: normal;
  }
  .home.almaviva-portail-body .alm-hero h1 {
    font-size: clamp(2rem, 6vw, 2.75rem); /* V6.5-fix-10 : max 44px → mobile 40px @375 */
  }
}

/* V6.5-fix-10 : paragraphe font-size -10%. V6.5-fix-12 : margin-bottom 32px. */
.home.almaviva-portail-body .alm-hero-lead {
  font-size: clamp(0.95rem, 1.45vw, 1.25rem);
  margin-bottom: 32px;
}

/* Gap entre les 2 boutons CTA = 16px. V6.5-fix-12 : margin-top 0 pour
   coller les CTAs directement au paragraphe (qui a déjà mb 32px). */
.home.almaviva-portail-body .alm-hero-cta-row {
  gap: 16px;
  margin-top: 0;
  margin-bottom: 0;
}

/* Grille alignée sur tools/maquettes/hero-portail.html : texte en minmax(0, 1fr),
   carte en largeur fixe, dans le MÊME conteneur — le bord gauche du texte et le
   bord droit de la carte tombent sur ses gouttières, qui sont celles des sections
   suivantes. align-items:end cale le bas de la carte sur le bas des CTA (la rangée
   de CTA est le dernier enfant de la colonne, sans marge basse). Aucun étirement :
   chaque colonne garde la hauteur de son contenu. À 900 px et moins, la grille
   d'une colonne de portail.css reprend la main : mise en page empilée.
   Le bloc « hauteur courte » (max-height: 420px), écrit plus bas, reste prioritaire. */
@media (min-width: 901px) {
  .home.almaviva-portail-body .alm-hero-grid {
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 32px;
    align-items: end;
  }
  .home.almaviva-portail-body .alm-hero-visual {
    margin-top: 0;
    position: relative;
    z-index: 4;
  }
}
@media (min-width: 1101px) {
  .home.almaviva-portail-body .alm-hero-grid {
    grid-template-columns: minmax(0, 1fr) 420px;
    gap: clamp(28px, 4vw, 64px);
  }
}
@media (max-width: 900px) {
  .home.almaviva-portail-body .alm-hero-grid { align-items: start; }
}

/* V6.5-fix-9 : max-width 440px pour matcher la maquette de référence. */
.home.almaviva-portail-body .alm-hero-visual {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 440px;
  width: 100%;
  margin-left: auto;
}
@media (max-width: 1023px) {
  .home.almaviva-portail-body .alm-hero-visual {
    display: flex !important;
    margin-left: auto;
    margin-right: 0;
  }
}

.home.almaviva-portail-body .alm-hero-search2 {
  width: 100%;
  background: #fff;
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 12px 32px -10px rgba(0, 24, 64, 0.25);
}
.home.almaviva-portail-body .alm-hs2-title {
  margin: 0 0 14px;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.18rem;
  line-height: 1.25;
  color: #004899;
}
.home.almaviva-portail-body .alm-hs2-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.home.almaviva-portail-body .alm-hs2-field { position: relative; }
.home.almaviva-portail-body .alm-hs2-field input[type="search"] {
  width: 100%;
  height: 54px;
  padding: 0 16px;
  border: 1px solid #c9d4e2;
  border-radius: 10px;
  background: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  color: #1a2433;
}
.home.almaviva-portail-body .alm-hs2-field input[type="search"]:focus {
  outline: 2px solid #004899;
  outline-offset: 1px;
  border-color: #004899;
}
.home.almaviva-portail-body .alm-hs2-results {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 4px;
  list-style: none;
  max-height: 440px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #fff;
  border: 1px solid #c9d4e2;
  border-radius: 10px;
  box-shadow: 0 14px 34px -12px rgba(0, 24, 64, 0.35);
}
.home.almaviva-portail-body .alm-hs2-results[hidden] { display: none; }
.home.almaviva-portail-body .alm-hs2-result {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 11px;
  border-radius: 7px;
  cursor: pointer;
}
.home.almaviva-portail-body .alm-hs2-result.is-active {
  background: #eef2f7;
}
.home.almaviva-portail-body .alm-hs2-result-name {
  font-weight: 600;
  font-size: 0.92rem;
  color: #004899;
}
.home.almaviva-portail-body .alm-hs2-result-sub {
  font-size: 0.8rem;
  color: #51607a;
}
.home.almaviva-portail-body .alm-hs2-groupe + .alm-hs2-groupe {
  margin-top: 6px;
  border-top: 1px solid #e2e8f1;
  padding-top: 6px;
}
.home.almaviva-portail-body .alm-hs2-groupe-titre {
  padding: 6px 11px 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #51607a;
}
.home.almaviva-portail-body .alm-hs2-squelette {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 11px;
}
.home.almaviva-portail-body .alm-hs2-squelette span {
  display: block;
  height: 9px;
  border-radius: 5px;
  background: #e8edf4;
}
.home.almaviva-portail-body .alm-hs2-squelette span:first-child { width: 62%; }
.home.almaviva-portail-body .alm-hs2-squelette span:last-child  { width: 40%; height: 8px; }
@media (prefers-reduced-motion: no-preference) {
  .home.almaviva-portail-body .alm-hs2-squelette span {
    animation: almHs2Pulse 1.2s ease-in-out infinite;
  }
  @keyframes almHs2Pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.55; }
  }
}
@media (max-width: 767px) {
  .home.almaviva-portail-body .alm-hs2-results { max-height: 320px; }
}
.home.almaviva-portail-body .alm-hs2-results.is-au-dessus {
  top: auto;
  bottom: calc(100% + 4px);
}
.home.almaviva-portail-body .alm-hs2-proximite {
  margin-top: 12px;
}
.home.almaviva-portail-body .alm-hs2-villes {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid #c9d4e2;
  border-radius: 10px;
  background: #f5f8fc;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: left;
  color: #004899;
}
.home.almaviva-portail-body .alm-hs2-villes svg {
  flex: 0 0 auto;
}
.home.almaviva-portail-body .alm-hs2-villes:hover {
  background: #eef2f7;
  border-color: #004899;
}
.home.almaviva-portail-body .alm-hs2-villes:focus-visible {
  outline: 2px solid #004899;
  outline-offset: 2px;
}
.home.almaviva-portail-body .alm-hs2-amorces {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f1;
}
.home.almaviva-portail-body .alm-hs2-amorces-titre {
  flex: 0 0 auto;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #51607a;
}
.home.almaviva-portail-body .alm-hs2-amorces-liste {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.home.almaviva-portail-body .alm-hs2-amorce {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid #c9d4e2;
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: #004899;
}
.home.almaviva-portail-body .alm-hs2-amorce:hover {
  background: #eef2f7;
  border-color: #004899;
}
.home.almaviva-portail-body .alm-hs2-amorce:focus-visible {
  outline: 2px solid #004899;
  outline-offset: 2px;
}
@media (max-width: 767px) {
  .home.almaviva-portail-body .alm-hs2-field input[type="search"] { font-size: 1rem; }
  .home.almaviva-portail-body .alm-hs2-result { padding: 11px; }
  .home.almaviva-portail-body .alm-hero-search2 { padding: 16px; }
  .home.almaviva-portail-body .alm-hs2-title { font-size: 1.05rem; margin-bottom: 10px; }
  .home.almaviva-portail-body .alm-hs2-form { gap: 8px; }
  .home.almaviva-portail-body .alm-hs2-proximite { margin-top: 10px; }
  .home.almaviva-portail-body .alm-hs2-amorces { margin-top: 10px; padding-top: 10px; }
}
@media (max-width: 413px) {
  .home.almaviva-portail-body .alm-hs2-field input[type="search"]::placeholder { font-size: 0.875rem; }
}
@media (max-width: 374px) {
  .home.almaviva-portail-body .alm-hs2-field input[type="search"]::placeholder { font-size: 0.8125rem; }
}
@media (max-height: 420px) and (min-width: 560px) {
  .home.almaviva-portail-body .alm-hero { padding-block: 24px; }
  .home.almaviva-portail-body .alm-hero .alm-container {
    max-width: none;
    padding-left: 24px;
    padding-right: 24px;
  }
  .home.almaviva-portail-body .alm-hero-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 360px);
    gap: 24px;
    align-items: center;
  }
  .home.almaviva-portail-body .alm-hero-visual {
    margin-top: 0;
    margin-inline: 0;
    max-width: none;
  }
  .home.almaviva-portail-body .alm-portail-h1 { font-size: 1.5rem; line-height: 1.15; }
  .home.almaviva-portail-body .alm-hero-lead { font-size: 0.875rem; margin-bottom: 14px; }
  .home.almaviva-portail-body .alm-hero-cta-row { gap: 8px; }
}
@media (max-height: 560px) {
  .home.almaviva-portail-body .alm-hero-search2 { padding: 14px; }
  .home.almaviva-portail-body .alm-hs2-title { font-size: 1rem; margin-bottom: 10px; }
  .home.almaviva-portail-body .alm-hs2-form { gap: 8px; }
  .home.almaviva-portail-body .alm-hs2-field input[type="search"] { height: 46px; }
  .home.almaviva-portail-body .alm-hs2-submit { height: 46px; }
  .home.almaviva-portail-body .alm-hs2-proximite { margin-top: 8px; }
  .home.almaviva-portail-body .alm-hs2-amorces { margin-top: 8px; padding-top: 8px; }
  .home.almaviva-portail-body .alm-hs2-results { max-height: 240px; }
}
.home.almaviva-portail-body .alm-hs2-villes.is-occupe {
  cursor: progress;
  color: #51607a;
}
.home.almaviva-portail-body .alm-hs2-villes.is-occupe svg {
  animation: almHs2Pouls 1s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .home.almaviva-portail-body .alm-hs2-villes.is-occupe svg { animation: none; opacity: 0.6; }
}
@keyframes almHs2Pouls {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}
.home.almaviva-portail-body .alm-hs2-motif {
  margin: 0;
  padding: 10px 11px 6px;
  font-size: 0.82rem;
  line-height: 1.35;
  color: #51607a;
}
.home.almaviva-portail-body .alm-hs2-vide {
  padding: 14px 11px;
  font-size: 0.88rem;
  color: #51607a;
}
.home.almaviva-portail-body .alm-hs2-submit {
  height: 54px;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  background: #004899;
  color: #fff;
}
.home.almaviva-portail-body .alm-hs2-submit:hover { background: #003670; }
.home.almaviva-portail-body .alm-hs2-submit:focus-visible {
  outline: 2px solid #004899;
  outline-offset: 2px;
}

/* Hauteur courte seulement : la carte reste calée en haut de sa rangée, comme
   avant l'alignement par le bas. Ailleurs le visuel suit l'align-items:end de la
   grille, qu'un align-self posé ici annulerait. */
@media (min-width: 1024px) and (max-height: 420px) {
  .home.almaviva-portail-body .alm-hero-visual {
    align-self: start;
  }
}
@media (min-width: 1024px) {
  .home.almaviva-portail-body .alm-hero-search2 {
    --alm-hs2-resserrement: clamp(0px, (1345px - 100vw) / 300, 1px);
    display: flex;
    flex-direction: column;
    padding: calc(22px - 8 * var(--alm-hs2-resserrement));
  }
  .home.almaviva-portail-body .alm-hs2-title {
    margin-bottom: calc(14px - 6 * var(--alm-hs2-resserrement));
  }
  .home.almaviva-portail-body .alm-hs2-form {
    gap: calc(10px - 3 * var(--alm-hs2-resserrement));
  }
  .home.almaviva-portail-body .alm-hs2-field input[type="search"],
  .home.almaviva-portail-body .alm-hs2-submit {
    height: calc(54px - 9 * var(--alm-hs2-resserrement));
  }
  .home.almaviva-portail-body .alm-hs2-proximite {
    margin-top: calc(12px - 4 * var(--alm-hs2-resserrement));
  }
  .home.almaviva-portail-body .alm-hs2-amorces {
    margin-top: calc(12px - 4 * var(--alm-hs2-resserrement));
    padding-top: calc(12px - 4 * var(--alm-hs2-resserrement));
    row-gap: calc(8px - 2 * var(--alm-hs2-resserrement));
  }
}

/* =====================================================================
   V6.5-fix-18 — CARTE LEAFLET INTERACTIVE (section maillage territorial)
   ===================================================================== */
#alm-map-portail {
  height: 500px;
  width: 100%;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 12px 32px -16px rgba(0, 24, 64, 0.20);
  background: var(--alm-bg-grey);
  position: relative;
}
@media (max-width: 1023px) { #alm-map-portail { height: 400px; } }
@media (max-width: 767px)  { #alm-map-portail { height: 320px; } }

/* Mobile : la carte sort du split et passe en pleine largeur sous le bloc texte. */
@media (max-width: 767px) {
  .alm-home-map-section .alm-block-split__grid { grid-template-columns: 1fr; }
  .alm-home-map-section__media { margin-top: 32px; }
}

/* Fallback (script raté / pas de data) : lien clair vers liste complète. */
.alm-map-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  margin: 0;
  padding: 24px;
  text-align: center;
}
.alm-map-fallback a {
  color: var(--alm-blue);
  font-weight: 600;
  text-decoration: underline;
}

/* === Markers DivIcon === */
.alm-map-marker {
  background: transparent;
  border: 0;
}
.alm-map-marker__dot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 24, 64, 0.35);
  color: #fff;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
  transition: transform 200ms ease, box-shadow 200ms ease;
  cursor: pointer;
}
.alm-map-marker:hover { z-index: 1000 !important; }
.alm-map-marker:hover .alm-map-marker__dot {
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(0, 24, 64, 0.45);
}

/* === Cluster icons === */
.alm-map-cluster {
  background: transparent;
  border: 0;
  display: flex !important;
  align-items: center;
  justify-content: center;
}
.alm-map-cluster__count {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #004899;
  color: #004899;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(0, 24, 64, 0.25);
}
.alm-map-cluster--medium .alm-map-cluster__count { width: 44px; height: 44px; font-size: 15px; }
.alm-map-cluster--large  .alm-map-cluster__count { width: 48px; height: 48px; font-size: 16px; }
@media (max-width: 767px) {
  .alm-map-cluster--small .alm-map-cluster__count { width: 44px; height: 44px; }
}

/* === Tooltip hover desktop === */
.leaflet-tooltip.alm-map-tooltip {
  background: rgba(0, 72, 153, 0.95);
  color: #fff;
  border: 0;
  border-radius: 6px;
  padding: 6px 10px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 24, 64, 0.25);
}
.leaflet-tooltip.alm-map-tooltip::before { border-top-color: rgba(0, 72, 153, 0.95); }

/* === Popups (click) === */
.alm-map-popup-wrapper .leaflet-popup-content-wrapper {
  position: relative;
  z-index: 1;
  border-radius: 12px;
  padding: 0;
  box-shadow: 0 12px 32px rgba(0, 24, 64, 0.20);
}
.alm-map-popup-wrapper .leaflet-popup-content {
  margin: 0;
  padding: 16px;
  font-family: var(--font-body);
}
.alm-map-popup-wrapper .leaflet-popup-tip { box-shadow: 0 4px 12px rgba(0, 24, 64, 0.20); }
.alm-map-popup {
  overflow-wrap: anywhere;
}
.alm-map-popup__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  padding-right: 34px;
  min-width: 0;
}
.alm-map-popup .alm-map-popup__logo {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  max-width: 40px;
  object-fit: contain;
  border-radius: 4px;
  background: var(--alm-bg-grey);
}
.alm-map-popup .alm-map-popup__title {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--alm-blue);
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.alm-map-popup__badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}
.alm-map-popup__spec {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.alm-map-popup__spec li {
  font-size: 12px;
  color: #333;
  background: var(--alm-bg-grey);
  padding: 3px 8px;
  border-radius: 4px;
}
.alm-map-popup__ville {
  margin: 0 0 12px;
  font-size: 13px;
  color: #666;
}
.alm-map-popup .alm-map-popup__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 8px;
  background: var(--cta-bg);
  color: var(--cta-text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
}
.alm-map-popup .alm-map-popup__cta:hover,
.alm-map-popup .alm-map-popup__cta:focus-visible {
  background: var(--cta-bg-hover);
  color: var(--cta-text);
  text-decoration: none;
}
.leaflet-container .alm-map-popup-wrapper a.leaflet-popup-close-button,
.leaflet-container .alm-map-popup-wrapper a.leaflet-popup-close-button:hover {
  display: flex;
  align-items: center;
  justify-content: center;
  top: 0;
  right: 0;
  z-index: 2;
  width: 44px;
  height: 44px;
  padding: 0;
  font-size: 20px;
  line-height: 1;
  color: var(--alm-gray-700);
}

/* === Zoom controls (custom blanc + var(--alm-gray-200)) === */
.leaflet-bar a, .leaflet-bar a:hover {
  background: #fff;
  border: 1px solid var(--alm-gray-200);
  color: #004899;
}
.home.almaviva-portail-body .leaflet-bar a { width: 44px; height: 44px; line-height: 44px; font-size: 20px; }
.leaflet-bar a:hover { background: #F5F5F5; }
.leaflet-bar a:first-child { border-top-left-radius: 6px; border-top-right-radius: 6px; }
.leaflet-bar a:last-child  { border-bottom-left-radius: 6px; border-bottom-right-radius: 6px; }

/* V6.5-fix-19 : attribution discrète mais conforme licence OSM/CARTO. */
.leaflet-control-attribution {
  font-size: 9px;
  color: #666;
  background: rgba(255, 255, 255, 0.7);
  padding: 1px 4px;
  opacity: 0.5;
  transition: opacity 200ms ease;
}
.leaflet-control-attribution:hover { opacity: 1; }
.leaflet-control-attribution a { color: #666; }
@media (max-width: 767px) {
  .leaflet-control-attribution a { padding: 34px 0 0 28px; margin-left: -28px; }
}

/* V6.5-fix-19 : bouton Reset View (custom Leaflet Control). */
.alm-map-reset { margin-top: 8px !important; }
.alm-map-reset__btn {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  background: #fff;
  border: 1px solid var(--alm-gray-200);
  border-radius: 4px;
  color: #004899;
  cursor: pointer;
  transition: background 200ms ease;
}
.alm-map-reset__btn:hover { background: #F5F5F5; color: #004899; }
.alm-map-reset__btn:focus-visible { outline: 2px solid #004899; outline-offset: 2px; }
.alm-map-reset__btn svg { display: block; pointer-events: none; }

/* prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .alm-map-marker__dot { transition: none; }
  .alm-map-marker:hover .alm-map-marker__dot { transform: none; }
}

/* === SECTION TRANSITIONS — espacements verticaux harmonieux === */
.home .alm-block { padding-block: clamp(56px, 7vw, 96px); }
.home .alm-block + .alm-block { border-top: 1px solid transparent; } /* hook future */

/* KPI-PORTAIL (28/09) — « Nos chiffres clés », maquette validée.
   Carte blanche ; en-tête (surtitre, titre facultatif) et lien à droite ; cartes
   sur 12 colonnes, 4 par ligne, la dernière ligne incomplète s'étire (≥ 1024) ;
   2 colonnes et orpheline pleine largeur (768–1023) ; liste à filets (< 768). */
.alm-home-kpi {
  padding-block: clamp(48px, 6vw, 80px);
  background: var(--alm-bg-grey);
}
.alm-home-kpi__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "tete lien" "grille grille" "mention mention";
  column-gap: 24px;
  align-items: end;
  background: #ffffff;
  border-radius: 24px;
  padding: 44px 48px;
  box-shadow: 0 1px 2px rgba(20, 30, 50, 0.04);
  text-align: left;
}
.alm-home-kpi__tete { grid-area: tete; min-width: 0; }
.alm-home-kpi__eyebrow {
  display: block;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #EE7203;
}
.alm-home-kpi__titre {
  margin: 8px 0 0;
  font-family: var(--font-title);
  font-size: 32px;
  font-weight: 800;
  line-height: 1.2;
  color: #004899;
}
.almaviva-portail-body a.alm-home-kpi__lien {
  grid-area: lien;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  color: #004899;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-decoration-color: #C9D8EA;
  text-underline-offset: 5px;
  white-space: nowrap;
}
.almaviva-portail-body a.alm-home-kpi__lien:hover,
.almaviva-portail-body a.alm-home-kpi__lien:focus-visible {
  color: #004899;
  text-decoration-color: currentColor;
}
.alm-home-kpi__lien svg { flex: none; width: 18px; height: 18px; }
.alm-home-kpi__items {
  grid-area: grille;
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}
.alm-home-kpi__item {
  grid-column: span 3;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  background: #FAF9F6;
  border: 1px solid #E8E4DC;
  border-radius: 16px;
  padding: 22px 24px;
  transition: opacity 600ms cubic-bezier(0.16, 1, 0.3, 1),
              transform 600ms cubic-bezier(0.16, 1, 0.3, 1);
}
@media (min-width: 1024px) {
  .alm-home-kpi__items > .alm-home-kpi__item:nth-child(4n+1):last-child { grid-column: span 12; }
  .alm-home-kpi__items > .alm-home-kpi__item:nth-child(4n+1):nth-last-child(2),
  .alm-home-kpi__items > .alm-home-kpi__item:nth-child(4n+1):nth-last-child(2) + .alm-home-kpi__item { grid-column: span 6; }
  .alm-home-kpi__items > .alm-home-kpi__item:nth-child(4n+1):nth-last-child(3),
  .alm-home-kpi__items > .alm-home-kpi__item:nth-child(4n+1):nth-last-child(3) ~ .alm-home-kpi__item { grid-column: span 4; }
}
@media (scripting: enabled) {
  .alm-home-kpi__item { opacity: 0; transform: translateY(20px); }
}
.alm-home-kpi__item.is-visible { opacity: 1; transform: translateY(0); }
.alm-home-kpi__icon {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #E9F0F8;
  color: #004899;
}
.alm-home-kpi__icon svg { display: block; width: 24px; height: 24px; }
.alm-home-kpi__value {
  display: block;
  margin-top: 18px;
  font-family: var(--font-title);
  font-size: 40px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.01em;
  color: #EE7203;
  font-variant-numeric: tabular-nums;
}
.alm-home-kpi__suffix { font-size: 0.55em; margin-left: 2px; font-weight: 600; }
.alm-home-kpi__label {
  display: block;
  margin-top: 8px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  color: #2A3441;
}
.alm-home-kpi__mention {
  grid-area: mention;
  margin: 20px 0 0;
  font-size: 13px;
  font-style: normal;
  line-height: 1.4;
  color: #5B6470;
  text-align: left;
}

@media (max-width: 1023px) {
  .alm-home-kpi__inner { padding: 32px; }
  .alm-home-kpi__titre { font-size: 28px; }
  .alm-home-kpi__items { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .alm-home-kpi__item { grid-column: auto; }
  .alm-home-kpi__value { font-size: 36px; }
}
@media (min-width: 768px) and (max-width: 1023px) {
  .alm-home-kpi__items > .alm-home-kpi__item:nth-child(2n+1):last-child {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    gap: 16px;
  }
  .alm-home-kpi__items > .alm-home-kpi__item:nth-child(2n+1):last-child .alm-home-kpi__value,
  .alm-home-kpi__items > .alm-home-kpi__item:nth-child(2n+1):last-child .alm-home-kpi__label { margin-top: 0; }
}
@media (max-width: 767px) {
  .alm-home-kpi__inner {
    grid-template-areas: "tete tete" "grille grille" "mention lien";
    align-items: center;
    column-gap: 12px;
    padding: 24px 20px;
  }
  .alm-home-kpi__titre { font-size: 24px; }
  .alm-home-kpi__items { display: block; margin-top: 12px; }
  .alm-home-kpi__items > .alm-home-kpi__item {
    flex-direction: row;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    background: none;
    border: 0;
    border-radius: 0;
  }
  .alm-home-kpi__items > .alm-home-kpi__item + .alm-home-kpi__item { border-top: 1px solid #ECE8E0; }
  .alm-home-kpi__icon { width: 40px; height: 40px; }
  .alm-home-kpi__value { flex: 0 0 96px; min-width: 0; margin-top: 0; font-size: 26px; }
  .alm-home-kpi__label { margin-top: 0; font-size: 14px; min-width: 0; }
  .alm-home-kpi__mention { margin-top: 8px; }
  .alm-home-kpi__lien { margin-top: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .alm-home-kpi__item { transition: none; opacity: 1; transform: none; }
}
.alm-home-kpi .alm-home-kpi__bento{--alm-kpi-sand:#FAF9F6;--alm-kpi-sand-line:#E8E4DC;--alm-kpi-sky:#E9F0F8;--alm-kpi-sky-line:#D5E3F4;--alm-kpi-sky-rule:#C5D7EC;--alm-kpi-ink:#2A3441;grid-area:grille;margin:28px 0 0;display:flex;flex-wrap:wrap;gap:16px}
.alm-home-kpi .alm-home-kpi__hero{position:relative;overflow:hidden;flex:1.25 1 380px;box-sizing:border-box;min-height:clamp(300px,29.2vw,420px);background:var(--alm-blue);color:#FFFFFF;border-radius:20px;padding:clamp(28px,2.8vw,40px);display:flex;flex-direction:column;justify-content:flex-end}
.alm-home-kpi .alm-home-kpi__hero-img{position:absolute;top:0;left:0;width:100%;height:100%;object-fit:cover;object-position:var(--alm-kpi-photo-x,52%) 50%}
.alm-home-kpi .alm-home-kpi__hero-veil{position:absolute;top:0;left:0;width:100%;height:100%;background:linear-gradient(180deg,rgba(0,60,130,.32) 0%,rgba(0,60,130,.6) 40%,rgba(0,48,108,.9) 74%,rgba(0,42,96,.96) 100%)}
.alm-home-kpi .alm-home-kpi__hero-text{margin:0;position:relative;display:flex;flex-direction:column;gap:8px}
.alm-home-kpi .alm-home-kpi__hero-value{font-size:clamp(104px,11.2vw,160px);font-weight:800;line-height:.82;letter-spacing:-.04em;white-space:nowrap;word-spacing:-.08em}
.alm-home-kpi .alm-home-kpi__hero-label{font-size:clamp(20px,1.7vw,24px);font-weight:600;line-height:1.3}
.alm-home-kpi .alm-home-kpi__duo{flex:1 1 300px;display:flex;flex-direction:column;gap:16px}
.alm-home-kpi .alm-home-kpi__feat{margin:0;position:relative;overflow:hidden;flex:1 1 auto;box-sizing:border-box;min-height:150px;border-radius:20px;padding:clamp(24px,1.95vw,28px) clamp(24px,2.5vw,36px);display:flex;flex-direction:column;justify-content:flex-end;gap:6px}
.alm-home-kpi .alm-home-kpi__feat::before{content:"";position:absolute;top:-80px;right:-80px;box-sizing:border-box;width:180px;height:180px;border-radius:50%;border:24px solid transparent}
.alm-home-kpi .alm-home-kpi__feat-value{position:relative;font-size:clamp(48px,5vw,72px);font-weight:800;line-height:1;letter-spacing:-.02em;white-space:nowrap;word-spacing:-.08em}
.alm-home-kpi .alm-home-kpi__feat-label{position:relative;font-size:clamp(16px,1.3vw,18px);line-height:1.3}
.alm-home-kpi .alm-home-kpi__feat--orange{background:var(--alm-orange);color:#FFFFFF}
.alm-home-kpi .alm-home-kpi__feat--orange::before{border-color:rgba(255,255,255,.2)}
.alm-home-kpi .alm-home-kpi__feat--orange .alm-home-kpi__feat-value{text-shadow:0 1px 2px rgba(0,0,0,.16)}
.alm-home-kpi .alm-home-kpi__feat--orange .alm-home-kpi__feat-label{font-weight:700;text-shadow:0 1px 2px rgba(0,0,0,.16)}
.alm-home-kpi .alm-home-kpi__feat--sand{background:var(--alm-kpi-sand);border:1px solid var(--alm-kpi-sand-line)}
.alm-home-kpi .alm-home-kpi__feat--sand::before{border-color:rgba(238,114,3,.1)}
.alm-home-kpi .alm-home-kpi__feat--sand .alm-home-kpi__feat-value{color:var(--alm-orange)}
.alm-home-kpi .alm-home-kpi__feat--sand .alm-home-kpi__feat-label{font-weight:600;color:var(--alm-kpi-ink)}
.alm-home-kpi .alm-home-kpi__list{list-style:none;margin:0;flex:1.1 1 320px;box-sizing:border-box;background:var(--alm-kpi-sky);border:1px solid var(--alm-kpi-sky-line);border-radius:20px;padding:clamp(14px,1.1vw,16px) clamp(24px,2.2vw,32px);display:flex;flex-direction:column}
.alm-home-kpi .alm-home-kpi__row{flex:1 1 auto;padding:10px 0;display:flex;flex-direction:column;justify-content:center;gap:2px}
.alm-home-kpi .alm-home-kpi__row + .alm-home-kpi__row{border-top:1px solid var(--alm-kpi-sky-rule)}
.alm-home-kpi .alm-home-kpi__row-value{font-size:clamp(32px,2.5vw,36px);font-weight:800;line-height:1.1;letter-spacing:-.01em;color:var(--alm-blue);white-space:nowrap;word-spacing:-.08em}
.alm-home-kpi .alm-home-kpi__row-label{font-size:14px;font-weight:600;line-height:1.4;color:var(--alm-kpi-ink)}

body.almaviva-portail-body .alm-hero a.alm-btn-secondary { background: rgba(0, 72, 153, 0.25); }
.home .alm-news-card .alm-news-card__date { opacity: 0.8; }
@media (max-width: 767px) {
  .home .alm-news-card .alm-card__title a { padding: 7px 0 11px; }
}

/* R1.9 : section LATEST-NEWS BLOCK (V6.5) déplacée vers
   src/blocks/latest-news/style.scss (auto-inlinée par WP via block.json).
   Les classes .alm-block-latest-news* / .alm-news-card* sont maintenant
   scopées au bloc, plus de doublon CSS. */

/* === Quote témoignage cards (section 7) — utilise alm-block-cards minimal ===
   Le bloc cards/minimal n'a pas de style "quote" par défaut. On l'enrichit
   en home : tagline = nom auteur en italique sous le text-quote. */
.home .alm-block-cards--minimal .alm-card .alm-card__text { font-style: italic; position: relative; padding-left: 16px; border-left: 3px solid var(--alm-orange); }
.home .alm-block-cards--minimal .alm-card .alm-card__tagline { color: var(--alm-blue); font-weight: 600; margin-top: 12px; font-size: 0.95rem; }

/* === Espace Pro CTA final (section 9) — orange + texte blanc forcé ===
   Le bloc cta--orange a déjà des styles, on ajoute juste un margin-top
   pour bien séparer du bloc précédent en home. */
.home .alm-block-cta--orange { margin-top: 0; }

/* === Mobile : grilles cards 1col, KPI déjà géré par portail-blocks.css === */
@media (max-width: 640px) {
  .home .alm-block-cards--cols-3 .alm-cards-grid,
  .home .alm-block-cards--cols-4 .alm-cards-grid,
  .home .alm-block-cards--cols-6 .alm-cards-grid {
    grid-template-columns: 1fr;
  }
}

/* === Reduced motion === */
@media (prefers-reduced-motion: reduce) {
  .home.almaviva-portail-body .alm-hero-filigrane { animation: none; }
  .alm-news-card, .alm-news-card__media img { transition: none; }
  .alm-news-card:hover { transform: none; }
  .alm-news-card:hover .alm-news-card__media img { transform: none; }
}

.home.almaviva-portail-body .alm-hs2-logo {
  height: 70px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  object-position: center;
  align-self: center;
  flex: 0 0 auto;
  display: block;
  margin: 0 auto 12px;
}

.alm-map-pays {
  display: flex;
  overflow: hidden;
}

.alm-map-pays__btn {
  appearance: none;
  border: 0;
  border-right: 1px solid rgba(0, 24, 64, 0.15);
  background: #fff;
  color: #004899;
  font: 600 12px/1 var(--font-title, inherit);
  padding: 8px 10px;
  cursor: pointer;
}

.alm-map-pays__btn:last-child { border-right: 0; }

.alm-map-pays__btn:hover,
.alm-map-pays__btn:focus-visible { background: #EAF1FA; }

.alm-map-pays__btn:focus-visible { outline: 2px solid #004899; outline-offset: -2px; }
