/* Blocs de la home : tout passe par les variables du site (--c-*) et par les
   formes du theme (rayons arrondis, ombres douces). Aucune couleur en dur.
   Repere par le portier : les jetons --c-accent, --c-texte-doux, --c-surface-2
   et --c-sur-accent n'existent pas dans da.css ; ils sont remplaces par les
   jetons reels du site (--c-primaire, --c-texte-2, --c-fond-2, --c-sur-primaire). */

.hb-section { padding-top: 4.5rem; padding-bottom: 4.5rem; }
@media (min-width: 768px) { .hb-section { padding-top: 6rem; padding-bottom: 6rem; } }
.hb-section > .hb-int { max-width: 80rem; margin-left: auto; margin-right: auto; padding-left: 1rem; padding-right: 1rem; }
@media (min-width: 640px) { .hb-section > .hb-int { padding-left: 1.5rem; padding-right: 1.5rem; } }
@media (min-width: 1024px) { .hb-section > .hb-int { padding-left: 2rem; padding-right: 2rem; } }

.hb-kicker {
  font-family: var(--f-texte);
  font-size: var(--tm);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--c-primaire-texte);
  font-weight: 600;
}
.hb-titre { font-family: var(--f-titre); letter-spacing: -.02em; line-height: 1.12; color: var(--c-texte); }
.hb-t1 { font-size: var(--t6); }
.hb-t2 { font-size: var(--t5); }
.hb-t3 { font-size: var(--t3); }
.hb-chapo { color: var(--c-texte-2); font-size: 1.05rem; line-height: 1.65; }

/* ─── cartes : rayon 1rem, bord 1px, ombre douce, padding 1.5rem ───
   Une carte dont le premier enfant est une photo la laisse sortir du padding
   (bord a bord) : la photo garde son ratio, le texte garde sa marge. */
.hb-carte {
  position: relative;
  background: var(--c-surface);
  border: 1px solid var(--c-bord);
  border-radius: var(--r-carte);
  box-shadow: var(--o-carte);
  padding: 1.5rem;
  transition: box-shadow .25s ease, transform .25s ease, border-color .25s ease;
}
.hb-carte:hover { box-shadow: var(--o-survol); transform: translateY(-2px); }
.hb-carte > .hb-photo:first-child {
  width: calc(100% + 3rem);
  max-width: none;
  height: auto;
  aspect-ratio: 16 / 10;
  margin: -1.5rem -1.5rem 0;
  border-radius: var(--r-carte) var(--r-carte) 0 0;
  object-fit: cover;
}
.hb-carte > :last-child { margin-bottom: 0; }
.hb-carte-teinte { background: var(--c-doux); }
.hb-carte-encre { color: var(--c-sur-doux); }

/* ─── boutons : primitives du theme (48 px, rayon .5rem, icone 18 px) ─── */
/* .hb-btn-porte les formes ; .hb-btn-primaire / .hb-btn-contour s'en servent seuls
   (les pages du site posent l'une ou l'autre classe sans la classe de base). */
.hb-btn, .hb-btn-primaire, .hb-btn-contour {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 48px; padding: .85rem 1.4rem;
  border-radius: var(--r-bouton);
  font-family: var(--f-texte); font-weight: 700; font-size: 1rem;
  line-height: 1.2;
  text-decoration: none; cursor: pointer;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .15s ease;
}
.hb-btn svg, .hb-btn .hb-btn-ico,
.hb-btn-primaire svg, .hb-btn-primaire .hb-btn-ico,
.hb-btn-contour svg, .hb-btn-contour .hb-btn-ico { width: 18px; height: 18px; flex: none; }
.hb-btn:hover, .hb-btn-primaire:hover, .hb-btn-contour:hover { transform: translateY(-2px); }

.hb-figures { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; padding: 0; margin-inline: 0; }
.hb-btn-primaire { background: var(--btn-fond); color: var(--btn-texte); border: 2px solid var(--c-texte); box-shadow: var(--o-carte); }
.hb-btn-primaire:hover { background: var(--c-secondaire-texte); color: #fff; }
.hb-btn-contour { background: transparent; color: var(--c-texte); border: 2px solid var(--c-bord); }
.hb-btn-contour:hover { background: var(--c-doux); border-color: var(--c-texte); }
form[data-contact] .hb-btn-primaire,
form[data-contact] .hb-btn { width: 100%; }

/* ─── tags / pastilles ─── */
.hb-tag {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .375rem .75rem; border-radius: 999px;
  background: var(--c-doux); color: var(--c-sur-doux);
  font-size: var(--tm); line-height: 1.3; text-decoration: none;
}
a.hb-tag:hover { background: color-mix(in srgb, var(--c-primaire) 14%, transparent); color: var(--c-primaire-texte); }

.hb-ico { width: 24px; height: 24px; color: var(--c-primaire-texte); flex: none; }
.hb-ico-sm { width: 20px; height: 20px; color: var(--c-primaire-texte); flex: none; }

.hb-photo { border-radius: var(--r-image); object-fit: cover; width: 100%; height: 100%; display: block; }
.hb-photo-cadre { border-radius: var(--r-image); overflow: hidden; background: var(--c-fond-2); }

/* Etoiles : toujours en rangee, autant de pleines que la note.
   Le remplissage est porte par le SVG lui-meme (fill inline) : une regle CSS `fill`
   ecraserait l'attribut et viderait les etoiles. La couleur ne joue donc que sur le
   trait et sur le degrade de la demi-etoile. */
.hb-etoiles { display: flex; align-items: center; gap: .15rem; flex-wrap: nowrap; margin: 0; line-height: 1; }
.hb-etoile { width: 1.15rem; height: 1.15rem; flex: none; color: var(--c-primaire-texte); }
.hb-etoile-vide { color: var(--c-bord); }

/* ─── hero : un seul ecran, photo en fond desaturee, contenu centre ───
   Le bandeau est DANS le header collant : --chrome-h (pose par le bandeau, mesure
   sur #site-header) est la hauteur exacte a retirer pour que le bas du hero tombe
   au bas de l'ecran a 1440, 820 et 390 px (portier_da, mesure:da_hauteurs). */
.hb-hero { position: relative; overflow: hidden; background: var(--c-fond-2); }
.hb-hero-fond {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; max-width: none;
  filter: grayscale(.4) saturate(.72) contrast(.95);
}
.hb-hero-voile {
  position: absolute; inset: 0;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--c-voile) 68%, transparent) 0%,
    color-mix(in srgb, var(--c-voile) 74%, transparent) 55%,
    color-mix(in srgb, var(--c-voile) 90%, transparent) 100%);
}
.hb-hero-int {
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
  min-height: calc(100svh - var(--chrome-h, calc(var(--header-h) + var(--bandeau-h))));
  padding-top: 2rem; padding-bottom: 1.5rem;
  color: var(--c-sur-voile);
}
.hb-hero-coeur { flex: 1 1 auto; display: flex; flex-direction: column; justify-content: center; }
.hb-hero-kicker {
  font-size: var(--tm); text-transform: uppercase; letter-spacing: .12em;
  font-weight: 600; color: var(--c-sur-voile);
}
.hb-hero .hb-titre, .hb-hero .hb-chapo, .hb-hero h1 { color: var(--c-sur-voile); }
.hb-hero h1 { font-size: var(--t-hero); line-height: 1.03; letter-spacing: -.02em; }
.hb-hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.hb-hero .hb-btn-contour { color: var(--c-sur-voile); border-color: color-mix(in srgb, var(--c-sur-voile) 62%, transparent); }
.hb-hero .hb-btn-contour:hover { background: color-mix(in srgb, var(--c-sur-voile) 16%, transparent); border-color: var(--c-sur-voile); }
.hb-hero-bas { padding-bottom: .5rem; }
.hb-hero-logo-k { font-size: var(--tm); color: color-mix(in srgb, var(--c-sur-voile) 85%, transparent); }
/* Sous 640 px, le hero doit encore tenir dans un seul ecran : on resserre l'echelle du
   titre, les marges et la bande de logos plutot que de laisser le bas passer sous le bord. */
@media (max-width: 639px) {
  .hb-hero-int { padding-top: 1rem; padding-bottom: .75rem; }
  .hb-hero h1 { font-size: clamp(1.62rem, 7.1vw, 2rem); line-height: 1.07; margin-top: .6rem; }
  .hb-hero .hb-chapo { font-size: .97rem; line-height: 1.5; margin-top: .85rem; }
  .hb-hero .hb-hero-actions { flex-direction: column; gap: .5rem; margin-top: 1.25rem; }
  .hb-hero .hb-hero-actions .hb-btn { width: 100%; min-height: 44px; padding: .6rem 1rem; }
  .hb-hero .hb-hero-logo-k { font-size: .78rem; line-height: 1.35; margin-bottom: .6rem; }
  .hb-defile img, .hb-hero .hb-defile img { height: 26px; }
  .hb-hero-bas { padding-bottom: .25rem; }
}

.hb-defile { overflow: hidden; position: relative; }
.hb-defile .kv-piste { display: flex; align-items: center; gap: 3rem; width: max-content; animation: hb-defile 40s linear infinite; }
/* Logotypes reels (OpenBrand) : chaque contexte a SA declinaison (logos_fond.py), jamais de
   filtre. `brightness(0) invert(1)` aplatissait le logo en une tache blanche : le cartouche de
   l'Ordre des experts-comptables perdait tout son texte (refus du portier DA, 26/09). */
.hb-defile img { height: 34px; width: auto; object-fit: contain; opacity: .95; }
.hb-hero .hb-defile img { opacity: .95; }
/* Un logo ne se coupe jamais en pleine lettre au bord du conteneur : on fondu les deux bords. */
.hb-defile { mask-image: linear-gradient(90deg, transparent 0, #000 3.5%, #000 96.5%, transparent 100%);
             -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 3.5%, #000 96.5%, transparent 100%); }
@keyframes hb-defile { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .hb-defile .kv-piste { animation: none; } }

/* ─── etapes : trois colonnes, une photo 4/3 chacune ─── */
.hb-etapes { display: grid; gap: 2rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .hb-etapes { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; } }
.hb-etape { display: flex; flex-direction: column; cursor: pointer; }
.hb-etape > .hb-photo:first-child { aspect-ratio: 4 / 3; }
.hb-etape .hb-etape-n {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem; margin-top: 1.15rem;
  border-radius: 999px; background: color-mix(in srgb, var(--c-primaire) 16%, transparent);
  color: var(--c-primaire-texte); font-family: var(--f-titre); font-weight: 700; font-size: .95rem;
}
.hb-etape[data-actif], .hb-etape.kv-actif { border-color: var(--c-primaire); box-shadow: var(--o-survol); }
/* la photo reste pleinement visible : le kit ne doit pas eclaircir deux etapes sur trois */
.hb-etapes [data-etape] { opacity: 1; transform: none; }

/* Frise : se remplit au defilement. */
.hb-frise { list-style: none; padding: 0; margin: 0; position: relative; }
.hb-frise::before { content: ""; position: absolute; left: .65rem; top: .4rem; bottom: .4rem; width: 2px; background: var(--c-bord); }
.hb-frise-j { position: relative; padding: 0 0 1.75rem 2.25rem; }
.hb-frise-j::before { content: ""; position: absolute; left: .1rem; top: .35rem; width: 1.15rem; height: 1.15rem; border-radius: 999px; background: var(--c-fond); border: 3px solid var(--c-bord); }
.hb-frise-j[data-atteint]::before, .hb-frise-j.kv-atteint::before { border-color: var(--c-primaire); background: var(--c-primaire); }
.hb-frise-e { display: inline-block; font-family: var(--f-titre); font-weight: 700; color: var(--c-primaire-texte); margin-bottom: .35rem; }

.hb-jauge { height: .5rem; border-radius: 999px; background: var(--c-fond-2); overflow: hidden; }
.hb-jauge > span { display: block; height: 100%; background: var(--c-primaire); width: 0; transition: width .3s ease; }

.hb-onglet { padding: .6rem 1.15rem; border-radius: var(--r-bouton); border: 1px solid var(--c-bord); background: var(--c-surface); color: var(--c-texte-2); font-weight: 600; cursor: pointer; }
.hb-onglet.kv-actif { background: var(--c-primaire); color: var(--c-sur-primaire); border-color: var(--c-primaire); }

.hb-bascule-btn { padding: .6rem 1.15rem; border-radius: var(--r-bouton); border: 1px solid var(--c-bord); background: var(--c-surface); color: var(--c-texte-2); font-weight: 700; cursor: pointer; }
.hb-bascule-btn.kv-actif { background: var(--c-primaire); color: var(--c-sur-primaire); border-color: var(--c-primaire); }
.hb-offre { border: 1px solid var(--c-bord); border-radius: var(--r-carte); background: var(--c-surface); padding: 1.5rem; }
.hb-offre.kv-en-avant { border-color: var(--c-primaire); box-shadow: var(--o-survol); }

/* ─── accordeons (lexique, FAQ, « avant d'ecrire ») : icone Lucide, jamais de glyphe ─── */
.hb-lexique { display: grid; gap: .5rem; }
@media (min-width: 900px) { .hb-lexique { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.hb-lexique-item { border: 1px solid var(--c-bord); border-radius: var(--r-carte); background: var(--c-surface); padding: 1rem 1.25rem; }
.hb-lexique-item summary {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  cursor: pointer; font-family: var(--f-titre); font-weight: 600; list-style: none;
}
.hb-lexique-item summary::-webkit-details-marker { display: none; }
.hb-lexique-item summary::marker { content: ""; }
.hb-lexique-item summary svg { transition: transform .2s ease; }
.hb-lexique-item[open] summary svg { transform: rotate(180deg); }
.hb-lexique-item[open] summary { color: var(--c-primaire-texte); }
.hb-faq { display: grid; gap: .5rem; max-width: 60rem; }

/* Un aplat sombre reste sombre dans les deux modes. */
.hb-encre { background: var(--c-voile); color: var(--c-sur-voile); }
.hb-encre .hb-titre, .hb-encre .hb-chapo, .hb-encre h2 { color: var(--c-sur-voile); }
.hb-encre .hb-carte { background: color-mix(in srgb, #ffffff 8%, transparent); border-color: color-mix(in srgb, #ffffff 22%, transparent); color: var(--c-sur-voile); }
.hb-encre .hb-btn-contour { color: var(--c-sur-voile); border-color: color-mix(in srgb, var(--c-sur-voile) 55%, transparent); }
.hb-encre .hb-btn-contour:hover { background: color-mix(in srgb, var(--c-sur-voile) 16%, transparent); }
.hb-encre .hb-cta-actions { justify-content: center; }

.hb-auteur-img { width: 96px; height: 96px; border-radius: 999px; object-fit: cover; }
.hb-auteur-vignette { width: 8rem; height: 8rem; object-fit: cover; border-radius: var(--r-image); flex: none; }
.hb-auteur-rail { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 768px) { .hb-auteur-rail { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.hb-auteur-carte { display: flex; flex-direction: column; align-items: flex-start; text-decoration: none; }
.hb-auteur-carte-large { grid-column: span 1; }
.hb-tete-article { max-width: 52rem; }

.hb-avatar { width: 3rem; height: 3rem; border-radius: 999px; object-fit: cover; flex: none; }
.hb-avis-carte { display: flex; flex-direction: column; min-width: 18rem; }
.hb-avis-carte blockquote { margin: 0; }

/* ─── formulaire ─── */
form[data-contact] { position: relative; }
.hb-champ { display: block; margin-bottom: 1rem; }
.hb-champ > span { display: block; font-weight: 600; margin-bottom: .35rem; font-size: .95rem; }
.hb-champ input, .hb-champ select, .hb-champ textarea {
  width: 100%; padding: .65rem .85rem;
  border: 1px solid var(--c-bord); border-radius: var(--r-bouton);
  background: var(--c-fond); color: var(--c-texte); font: inherit;
}
.hb-champ input:focus, .hb-champ select:focus, .hb-champ textarea:focus {
  outline: 2px solid var(--c-primaire); outline-offset: 1px; border-color: var(--c-primaire);
}
.hb-pot-de-miel { position: absolute; left: -9999px; top: 0; width: 1px; height: 1px; overflow: hidden; }
.hb-resultat { margin-top: .5rem; border-top: 1px solid var(--c-bord); padding-top: 1rem; display: grid; gap: .5rem; }
.hb-resultat p { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.hb-resultat span { color: var(--c-texte-2); }
.hb-resultat output { font-family: var(--f-titre); font-weight: 700; font-size: 1.15rem; }

.hb-interrupteur { display: inline-flex; gap: .25rem; padding: .25rem; border: 1px solid var(--c-bord); border-radius: 999px; background: var(--c-fond); }
.hb-interrupteur .hb-bascule-btn { border: 0; background: transparent; border-radius: 999px; }
.hb-interrupteur .hb-bascule-btn.kv-actif { background: var(--c-primaire); color: var(--c-sur-primaire); }

/* Comparatif a bascule : une CARTE par critere, jamais un tableau administratif.
   Les deux formes restent visibles cote a cote, la forme choisie est mise en avant
   (.kv-en-avant, pose par le kit) : le differentiel se lit d'un coup d'oeil. */
.hb-comp-liste { display: grid; gap: .85rem; }
.hb-comp {
  display: grid; gap: .5rem;
  padding: 1.15rem 1.25rem; margin: 0;
  border: 1px solid var(--c-bord); border-radius: var(--r-carte);
  background: var(--c-surface); box-shadow: 0 1px 2px rgba(15, 30, 36, .06);
}
@media (min-width: 900px) {
  .hb-comp { grid-template-columns: 14rem minmax(0, 1fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
}
.hb-comp-critere { display: flex; align-items: center; gap: .55rem; margin: 0; font-weight: 700; font-family: var(--f-titre); }
.hb-comp-ico { width: 20px; height: 20px; flex: none; color: var(--c-primaire-texte); }
.hb-comp-val {
  margin: 0; padding: .7rem .85rem; border-radius: .6rem;
  border: 1px solid transparent; background: var(--c-fond);
  font-size: .97rem; line-height: 1.5; color: var(--c-texte-2);
}
.hb-comp-val.kv-en-avant {
  background: color-mix(in srgb, var(--c-primaire) 9%, var(--c-surface));
  border-color: color-mix(in srgb, var(--c-primaire) 34%, transparent);
  color: var(--c-texte);
}
.hb-comp-forme {
  display: block; margin-bottom: .2rem;
  font-family: var(--f-titre); font-weight: 700; font-size: .74rem;
  letter-spacing: .08em; text-transform: uppercase; color: var(--c-texte-2);
}
.hb-comp-val.kv-en-avant .hb-comp-forme { color: var(--c-primaire-texte); }

.hb-onglets { display: flex; flex-wrap: wrap; gap: .5rem; }
.hb-panneau { display: none; margin-top: 1.5rem; }
.hb-panneau.kv-actif { display: block; }
.hb-jauge-barre { display: block; height: 100%; width: 0; background: var(--c-primaire); transition: width .3s; }
.hb-checklist { display: grid; gap: .75rem; }
@media (min-width: 900px) { .hb-checklist { grid-template-columns: repeat(2, 1fr); } }
.hb-check { display: flex; gap: .6rem; align-items: flex-start; cursor: pointer; }
.hb-check input { margin-top: .3rem; accent-color: var(--c-primaire); }

.hb-signature { font-family: var(--f-titre); font-weight: 600; }
.hb-montant { font-family: var(--f-titre); font-weight: 700; font-size: 1.25rem; color: var(--c-primaire-texte); }

.hb-lottie { max-width: 16rem; margin: 0 auto 1.5rem; }

.hb-coord { display: grid; gap: .6rem; list-style: none; padding: 0; margin: 0; }
.hb-coord li { display: flex; gap: .6rem; align-items: center; }

.hb-lien { color: var(--c-primaire-texte); text-decoration: underline; text-decoration-thickness: var(--lien-epaisseur); text-underline-offset: 3px; }

/* ─── apparitions au defilement ───
   L'etat par defaut est VISIBLE : c'est la classe .kv-js, posee par le kit, qui
   autorise le masquage, et l'animation ne se joue qu'a l'entree dans le viewport.
   Sans ce garde-fou, un observateur qui ne se declenche pas (capture pleine page,
   JS coupe) laissait cinq blocs de la home gris et vides (portier-1). */
html.kv-js [data-apparait],
html.kv-js [data-apparait]:not(.kv-vu) { opacity: 1; transform: none; }
html.kv-js [data-apparait].kv-vu { animation: hb-apparait .55s ease both; }
html.kv-js [data-apparait="gauche"].kv-vu,
html.kv-js [data-apparait="droite"].kv-vu { animation-name: hb-apparait; }
@keyframes hb-apparait { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  html.kv-js [data-apparait].kv-vu { animation: none; }
}
