/**
 * Blocs d'appel du simulateur — feuille séparée et légère.
 *
 * Deux blocs, deux templates, la même feuille : `home.tpl` (la première
 * question posée sur place, rendu sur le hook `displayHome`) et `teaser.tpl`
 * (le bloc d'accroche simple, rendu partout ailleurs). Ils partagent une
 * feuille parce qu'ils partagent une contrainte : ils peuvent apparaître sur
 * n'importe quelle page, et cette feuille est donc chargée sur toutes.
 * Le CSS du questionnaire, lui, reste sur la seule page du simulateur.
 *
 * Mêmes jetons que `finder.css` (design system Highkeek, §06 du relevé), et
 * même principe : variables locales, aucun sélecteur du thème. Le bloc est
 * noir — c'est le fond du hero et du pied de page du site, et le seul sur
 * lequel le jaune de marque est lisible.
 */
.hkf-home {
  --hkf-ink: #000000;
  --hkf-paper: #ffffff;
  --hkf-surface: #f4f4f4;
  --hkf-yellow: #ffd51d;
  --hkf-night-text: #c9c9c4;
  --hkf-night-muted: #8a8a84;
  --hkf-night-line: #2a2a26;
  --hkf-radius-pill: 50px;
  --hkf-radius-field: 30px;
  --hkf-radius-media: 10px;
  --hkf-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.5);
  --hkf-font-body: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  --hkf-font-display: "Coolvetica", "Archivo", var(--hkf-font-body);

  background: var(--hkf-ink);
  border-radius: var(--hkf-radius-media);
  color: var(--hkf-night-text);
  font-family: var(--hkf-font-body);
  margin: 50px 0;
  padding: 50px 20px;
}

.hkf-home :focus-visible {
  outline: 3px solid var(--hkf-yellow);
  outline-offset: 2px;
}

.hkf-home .hkf-home__inner {
  margin: 0 auto;
  max-width: 620px;
  text-align: center;
}

.hkf-home .hkf-home__title {
  color: var(--hkf-paper);
  font-family: var(--hkf-font-display);
  font-size: clamp(28px, 3.5vw, 36px);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.15;
  margin: 0 0 10px;
}

.hkf-home .hkf-home__subtitle {
  color: var(--hkf-night-muted);
  font-size: 1rem;
  line-height: 1.5;
  margin: 0 0 30px;
}

/* ---------------------------------------------------------------------------
 * Visuel d'accroche
 *
 * Partagé par les deux blocs, d'où un nom à lui plutôt qu'un `__élément` de
 * l'un ou de l'autre.
 *
 * Le rond est porté par un **conteneur**, pas par l'image. Mesuré sur un thème
 * d'essai : `.conteneur img { width: 100% }` (0,2,1) étirait le cercle sur
 * toute la largeur, et un `border-radius: 0 !important` sur les images le
 * rendait carré — qu'aucune spécificité ne peut battre. Le masque posé sur un
 * élément que le thème ne cible pas règle les deux d'un coup : l'image peut
 * alors être habillée n'importe comment, elle reste découpée en rond.
 * ------------------------------------------------------------------------ */

.hkf-visuel.hkf-visuel {
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  display: block;
  margin: 0 auto 30px;
  max-width: 100%;
  overflow: hidden;
  width: 180px;
}

.hkf-visuel.hkf-visuel img {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.hkf-home .hkf-home__label {
  color: var(--hkf-night-text);
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.hkf-home .hkf-home__field {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.hkf-home .hkf-home__field input {
  background: var(--hkf-paper);
  border: 1px solid transparent;
  border-radius: var(--hkf-radius-field);
  color: var(--hkf-ink);
  font-family: var(--hkf-font-display);
  font-size: 1.5rem;
  font-weight: 600;
  padding: 14px 20px;
  text-align: center;
  width: 140px;
}

.hkf-home .hkf-home__unit {
  color: var(--hkf-night-muted);
}

/* Sur fond noir, le bouton d'appel est jaune : c'est là, et seulement là, que
   l'accent de marque tient le contraste (14,8:1). */
.hkf-home .hkf-home__cta {
  background: var(--hkf-yellow);
  border: 0;
  border-radius: var(--hkf-radius-pill);
  color: var(--hkf-ink);
  cursor: pointer;
  font-family: var(--hkf-font-body);
  font-size: 1rem;
  font-weight: 600;
  padding: 14px 30px;
  text-decoration: none;
  transition: box-shadow 160ms ease, transform 120ms ease;
  white-space: nowrap;
}

.hkf-home .hkf-home__cta:hover {
  box-shadow: var(--hkf-shadow);
  color: var(--hkf-ink);
}

.hkf-home .hkf-home__cta:active {
  transform: scale(0.99);
}

.hkf-home .hkf-home__note {
  border-top: 1px solid var(--hkf-night-line);
  color: var(--hkf-night-muted);
  font-size: 0.8125rem;
  line-height: 1.5;
  margin: 30px auto 0;
  max-width: 420px;
  padding-top: 20px;
}

.hkf-home .hkf-home__note a {
  color: var(--hkf-night-text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.hkf-home .hkf-home__note a:hover {
  color: var(--hkf-paper);
}

@media (max-width: 480px) {
  .hkf-home {
    margin: 30px 0;
    padding: 30px 20px;
  }

  .hkf-visuel.hkf-visuel {
    margin-bottom: 20px;
    width: 140px;
  }

  /* Le champ garde son unité à côté de lui — la masquer ferait disparaître
     une information — et le bouton passe seul sur la ligne du dessous. */
  .hkf-home .hkf-home__field {
    display: grid;
    grid-template-columns: 1fr auto;
  }

  .hkf-home .hkf-home__field input {
    width: 100%;
  }

  .hkf-home .hkf-home__unit {
    text-align: left;
  }

  .hkf-home .hkf-home__cta {
    grid-column: 1 / -1;
    width: 100%;
  }
}

/* ---------------------------------------------------------------------------
 * Bloc d'accroche (teaser.tpl)
 *
 * Même famille que le bloc home, en plus court : il ne pose pas de question,
 * il renvoie. Il peut atterrir dans une colonne étroite comme en pleine
 * largeur — d'où le fond noir plutôt qu'une bordure, qui le tient dans les
 * deux cas.
 * ------------------------------------------------------------------------ */

.hkf-teaser {
  --hkf-ink: #000000;
  --hkf-paper: #ffffff;
  --hkf-yellow: #ffd51d;
  --hkf-night-text: #c9c9c4;
  --hkf-night-muted: #8a8a84;
  --hkf-radius-pill: 50px;
  --hkf-radius-media: 10px;
  --hkf-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.5);
  --hkf-font-body: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  --hkf-font-display: "Coolvetica", "Archivo", var(--hkf-font-body);

  background: var(--hkf-ink);
  border: 0;
  border-radius: var(--hkf-radius-media);
  color: var(--hkf-night-text);
  font-family: var(--hkf-font-body);
  padding: 30px 20px;
  text-align: center;
}

.hkf-teaser :focus-visible {
  outline: 3px solid var(--hkf-yellow);
  outline-offset: 2px;
}

.hkf-teaser .hkf-teaser__title {
  color: var(--hkf-paper);
  font-family: var(--hkf-font-display);
  font-size: clamp(22px, 2.6vw, 28px);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.15;
  margin: 0 0 8px;
}

.hkf-teaser .hkf-teaser__subtitle {
  color: var(--hkf-night-muted);
  font-size: 0.9375rem;
  line-height: 1.5;
  margin: 0 0 20px;
}

.hkf-teaser .hkf-teaser__cta {
  background: var(--hkf-yellow);
  border: 0;
  border-radius: var(--hkf-radius-pill);
  color: var(--hkf-ink);
  display: inline-block;
  font-family: var(--hkf-font-body);
  font-size: 1rem;
  font-weight: 600;
  padding: 14px 30px;
  text-decoration: none;
  transition: box-shadow 160ms ease;
}

.hkf-teaser .hkf-teaser__cta:hover {
  box-shadow: var(--hkf-shadow);
  color: var(--hkf-ink);
}

@media (prefers-reduced-motion: reduce) {
  .hkf-home *,
  .hkf-home *::before,
  .hkf-home *::after,
  .hkf-teaser *,
  .hkf-teaser *::before,
  .hkf-teaser *::after {
    transition-duration: 0.01ms !important;
  }
}
