/* ============================================================
   IMPERIAL DOG & CAT — base commune de l'accueil + bandeau « guide de choix »
   Base de home-v2.css (polices, variables, remises à zéro, titrage, boutons)
   et section du guide de choix, sorties de home-v2.css pour que les autres pages,
   qui reprennent le bandeau du guide en bas de page (layouts/layout-both-columns.tpl),
   n'aient plus à charger toute la feuille de l'accueil.
   Chargée : sur l'accueil juste avant home-v2.css (index.tpl), ailleurs par
   _partials/head.tpl (sauf tunnel, questionnaire et ses résultats).
   Rangée dans site-v2/ pour être synchronisée avec la préprod, mais indépendante
   des interrupteurs du site v2 : l'accueil en a toujours besoin.
   Toutes les règles sont préfixées par .home-v2.
   ============================================================ */

/* ---------- Polices auto-hébergées (sous-ensemble latin) ---------- */

@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("../fonts/fraunces-latin-var.woff2") format("woff2");
}

.home-v2 {
  /* ---- Couleurs ---- */
  --hv2-cream:      #FBF7EF;
  --hv2-sand:       #F3EADA;
  --hv2-sand-deep:  #EADFCB;
  --hv2-ink:        #332720;
  --hv2-ink-soft:   #6B5B4E;
  --hv2-clay:       #B05315;
  --hv2-clay-ink:   #A1480F;
  --hv2-clay-dark:  #8F4210;
  --hv2-night:      #271E18;
  --hv2-night-deep: #1F1813;
  --hv2-night-soft: #C9BCAE;
  --hv2-line:       #E2D6C2;

  /* ---- Typographie ---- */
  --hv2-serif: "Fraunces", Georgia, "Times New Roman", serif;
  --hv2-sans:  "Karla", "Helvetica Neue", Arial, sans-serif;
  --hv2-script: "Great Vibes", "Snell Roundhand", "Segoe Script", cursive;

  /* Ombre légère des titres de section (pas d'ombre lourde) */
  --hv2-title-shadow: 0 1px 2px rgba(51, 39, 32, 0.16);

  /* ---- Rythme fluide ---- */
  --hv2-gutter:  clamp(20px, 5vw, 72px);
  --hv2-section: clamp(56px, 7vw, 96px);

  background: var(--hv2-cream);
  color: var(--hv2-ink);
  font-family: var(--hv2-sans);
  font-size: clamp(0.9375rem, 0.88rem + 0.22vw, 1.0625rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.home-v2 *,
.home-v2 *::before,
.home-v2 *::after { box-sizing: border-box; }

/* Neutralise les styles d'éléments du thème (h1 noir, p figé à 16px #666,
   marges Bootstrap). Spécificité (0,0,1) comme ceux du thème : ces règles
   gagnent par l'ordre de chargement, et les classes .home-v2__* passent devant. */
:where(.home-v2) h1,
:where(.home-v2) h2,
:where(.home-v2) h3,
:where(.home-v2) h4 {
  font-family: inherit;
  line-height: inherit;
  color: inherit;
}

:where(.home-v2) p {
  margin-block: 1em;
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
}

/* Liens texte uniquement : les boutons gèrent leurs propres couleurs.
   Le :not() porte aussi la spécificité au-dessus du a:hover / a:focus du thème. */
.home-v2 a:not(.home-v2__btn) { color: var(--hv2-clay-ink); }
.home-v2 a:not(.home-v2__btn):hover { color: var(--hv2-clay-dark); }

/* Le thème supprime le contour de focus (a:focus { outline: none }) */
.home-v2 a:focus-visible {
  outline: 2px solid var(--hv2-clay);
  outline-offset: 3px;
}

/* Les images sont des placeholders nommés : tant que le fichier
   n'existe pas, le bloc sable + le texte alt tiennent la place. */
.home-v2 img {
  display: block;
  max-width: 100%;
  background-color: var(--hv2-sand-deep);
  color: var(--hv2-ink-soft);
  font-family: var(--hv2-sans);
  font-size: 11px;
  line-height: 1.35;
}

.home-v2__shell {
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: var(--hv2-gutter);
}

.home-v2__sr {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- Titrage commun ---------- */

.home-v2__eyebrow {
  margin: 0;
  font-family: var(--hv2-sans);
  font-size: clamp(0.875rem, 0.75rem + 0.45vw, 1.125rem);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--hv2-clay-ink);
  text-shadow: var(--hv2-title-shadow);
}

.home-v2__title {
  margin: 0;
  font-family: var(--hv2-serif);
  font-size: clamp(1.75rem, 1.1rem + 2.6vw, 2.75rem);
  font-weight: 500;
  line-height: 1.14;
  letter-spacing: -0.015em;
  text-wrap: balance;
  text-shadow: var(--hv2-title-shadow);
}

.home-v2__title em { font-style: normal; color: var(--hv2-clay); }

.home-v2__heading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  margin-bottom: clamp(32px, 4vw, 56px);
}

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

.home-v2__btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 48px;
  padding: 12px 20px;
  border: 1px solid transparent;
  border-radius: 2px;
  font-family: var(--hv2-sans);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  line-height: 1.2;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color .22s ease, color .22s ease, border-color .22s ease;
}

/* Préfixe .home-v2 : passe devant le a:focus { color: #FFC600 } du thème */
.home-v2 .home-v2__btn--solid { background: var(--hv2-clay); color: #FFF8F0; }
.home-v2 .home-v2__btn--solid:hover { background: var(--hv2-clay-dark); color: #FFF8F0; }

.home-v2 .home-v2__btn--ghost { border-color: #C0AC92; color: var(--hv2-ink); }
.home-v2 .home-v2__btn--ghost:hover { border-color: var(--hv2-clay); color: var(--hv2-clay-ink); }

.home-v2 .home-v2__btn--light { background: #FFF8F0; color: var(--hv2-ink); }
.home-v2 .home-v2__btn--light:hover { background: #FFFFFF; color: var(--hv2-clay-ink); }

.home-v2__btn svg { flex: none; }

/* ============================================================
   GUIDE DE CHOIX (ajout hors maquette, à valider par le client)
   Bandeau vers le questionnaire (home/guide.tpl). Motif : la patte du badge,
   terracotta à 7 %, en fond répété (décor).
   ============================================================ */

.home-v2__guide {
  background: var(--hv2-cream) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='%23B05315' fill-opacity='0.07'%3E%3Cg transform='translate(30 34) rotate(-14)'%3E%3Cellipse cy='6.5' rx='11.5' ry='8.6'/%3E%3Cellipse cx='-12' cy='-4.8' rx='4.3' ry='5.5'/%3E%3Cellipse cx='-4.2' cy='-10.2' rx='4.3' ry='5.8'/%3E%3Cellipse cx='4.2' cy='-10.2' rx='4.3' ry='5.8'/%3E%3Cellipse cx='12' cy='-4.8' rx='4.3' ry='5.5'/%3E%3C/g%3E%3Cg transform='translate(88 90) rotate(12)'%3E%3Cellipse cy='6.5' rx='11.5' ry='8.6'/%3E%3Cellipse cx='-12' cy='-4.8' rx='4.3' ry='5.5'/%3E%3Cellipse cx='-4.2' cy='-10.2' rx='4.3' ry='5.8'/%3E%3Cellipse cx='4.2' cy='-10.2' rx='4.3' ry='5.8'/%3E%3Cellipse cx='12' cy='-4.8' rx='4.3' ry='5.5'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat center / 120px 120px;
  border-bottom: 1px solid var(--hv2-line);
  padding-block: clamp(36px, 5vw, 56px);
}

/* Repris en bas des autres pages (layout-both-columns.tpl) : filet au-dessus, après le contenu */
.home-v2--guide-seul .home-v2__guide { border-top: 1px solid var(--hv2-line); }

/* Mobile : empilé et centré. Dès 768 px : photo | texte | bouton sur une ligne */
.home-v2__guide-inner {
  display: grid;
  justify-items: center;
  gap: 16px;
  text-align: center;
}

.home-v2__guide-photo {
  position: relative;
  display: block;
  width: 96px;
  height: 96px;
  padding: 3px;
  border: 2px solid var(--hv2-clay);
  border-radius: 50%;
  background: var(--hv2-cream);
}

.home-v2__guide-photo picture { display: block; width: 100%; height: 100%; }

.home-v2__guide-photo img {
  width: 100%;
  height: 100% !important; /* custom.css : img { height: auto !important } */
  border-radius: 50%;
  object-fit: cover;
}

/* Le chat est posé sur le chien et apparaît en fondu enchaîné : cycle de 14 s, chien 6 s,
   transition 1 s, chat 6 s, transition 1 s (changement toutes les 7 s). Photo décorative
   (alt vide) : le fondu est permis. Animations réduites : le chien seul. */
.home-v2__guide-photo-alt {
  position: absolute;
  inset: 3px;
  width: auto !important;
  height: auto !important;
  opacity: 0;
}

@keyframes hv2-guide-swap {
  0%, 43%  { opacity: 0; }
  50%, 93% { opacity: 1; }
  100%     { opacity: 0; }
}

@media (prefers-reduced-motion: no-preference) {
  .home-v2__guide-photo-alt { animation: hv2-guide-swap 14s ease-in-out infinite; }
}

.home-v2__guide-title {
  margin: 0;
  font-family: var(--hv2-serif);
  font-size: clamp(1.375rem, 1.1rem + 1.1vw, 1.875rem);
  font-weight: 500;
  line-height: 1.2;
  text-wrap: balance;
}

.home-v2__guide-text p {
  margin: 6px 0 0;
  color: var(--hv2-ink-soft);
  text-wrap: pretty;
}

@media (min-width: 768px) {
  .home-v2__guide-inner {
    grid-template-columns: auto 1fr auto;
    align-items: center;
    justify-items: start;
    gap: clamp(20px, 3vw, 40px);
    max-width: 1080px;
    text-align: left;
  }
}
