/* ─────────────────────────────────────────────────────────
   Émotivance · Design system — Composants
   Primitives de la DA Dermato, en CSS natif.
   Dépend de tokens.css et base.css.
   ───────────────────────────────────────────────────────── */


/* ═══ Badge — pilule majuscules à point ═══════════════
   Sur-titre de section. Trois fonds selon la surface.     */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  /* Empêche l'étirement quand le badge est enfant direct d'une
     colonne flex, sans neutraliser un align-items: center parent. */
  width: max-content;
  max-width: 100%;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--accent-text);
  font-size: var(--t-xs);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  white-space: nowrap;
}
.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: var(--r-pill);
  background: var(--ornament);
  flex: none;
}
.badge--sand  { background: var(--primary-5); border: 1px solid color-mix(in srgb, var(--white) 60%, transparent); color: var(--ink-2); }
.badge--sand::before { background: var(--accent-text); }
.badge--solid { background: var(--accent); color: var(--accent-ink); }
.badge--plain { background: var(--white); color: var(--accent-text); }

/* Variante sans point — étiquette de format, durée, tag. */
.tag {
  display: inline-flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  padding: 5px 12px;
  border-radius: var(--r-pill);
  background: var(--primary-4);
  color: var(--accent-text);
  font-size: var(--t-sm);
  line-height: 1.4;
  white-space: nowrap;
}
.tag--white { background: var(--white); border: 1px solid var(--line-gold-soft); }
.tag--sand  { background: var(--surface); }


/* ═══ Bouton ══════════════════════════════════════════
   Signature du kit : pilule + pastille blanche circulaire
   dont l'icône pivote au survol.                          */

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 10px 20px 10px 10px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: var(--accent-ink);
  font-size: var(--t-sm);
  font-weight: 600;
  line-height: 1.4;
  text-align: left;
  transition:
    background-color var(--dur) var(--ease),
    color            var(--dur) var(--ease),
    border-color     var(--dur) var(--ease);
}
.btn:hover {
  background: var(--white);
  color: var(--accent-text);
  border-color: var(--ornament-deep);
}

.btn__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: var(--r-pill);
  background: var(--white);
  color: var(--accent-text);
  transition: transform var(--dur) var(--ease);
}
.btn:hover .btn__icon { transform: rotate(180deg); }
.btn__icon svg { width: 13px; height: 13px; }

/* Variantes de surface */
.btn--soft    { background: var(--surface); color: var(--ink); }
/* Sur une dalle bleu nuit, le bouton secondaire — bleu lui aussi — se
   confondrait : il devient un contour champagne à libellé champagne.
   Toujours du champagne sur du bleu, jamais l'inverse. */
.slab-ink .btn--soft,
.hm-manifest .btn--soft {
  background: transparent;
  border-color: var(--on-slab-ink);
  color: var(--on-slab-ink);
}
.slab-ink .btn--soft .btn__icon,
.hm-manifest .btn--soft .btn__icon,
.jr-letter .btn--soft .btn__icon { background: var(--white); color: var(--accent-text); }
.btn--soft:hover { background: var(--white); color: var(--accent-text); }
.btn--soft .btn__icon { background: var(--white); color: var(--accent-text); }
.btn--ivory   { background: var(--primary-4); color: var(--ink-2); }
.btn--white   { background: var(--white); color: var(--accent-text); }
.btn--white:hover { background: var(--accent); color: var(--accent-ink); }

/* Sans pastille — bouton plein simple */
.btn--plain { padding: 10px 20px; }

/* Contour seul — action secondaire dans une carte */
.btn--outline {
  padding: 6px 16px;
  background: transparent;
  border-width: 2px;
  border-color: var(--ornament-deep);
  color: var(--accent-text);
  font-weight: 500;
}
.btn--outline:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* Lien fléché, sans fond */
.btn--link {
  padding: 0;
  background: none;
  color: var(--accent-text);
  border: 0;
}
.btn--link:hover { background: none; color: var(--ink); border: 0; }

.btn--lg { font-size: var(--t-base); padding: 12px 24px 12px 12px; }
.btn--lg .btn__icon { width: 28px; height: 28px; }
.btn--lg.btn--plain { padding: 12px 26px; }

.btn[disabled] { opacity: 0.5; pointer-events: none; }

/* Bouton icône rond — flèches de carrousel, fermeture */
.btn-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--white);
  color: var(--ink);
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.btn-icon:hover { background: var(--accent); color: var(--accent-ink); }
.btn-icon svg { width: 18px; height: 18px; }


/* ═══ Carte ═══════════════════════════════════════════ */

.card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  padding: var(--sp-6);
  border-radius: var(--r-xl);
  background: var(--surface);
  border: 1px solid var(--line-gold);
}
.card--white { background: var(--white); }
.card--ivory { background: var(--primary-4); }
.card--flat  { border-color: transparent; }
.card--lg    { padding: var(--sp-7); border-radius: var(--r-2xl); }
.card--tight { padding: var(--sp-5); border-radius: var(--r-lg); }


/* ═══ Cartouche en verre ══════════════════════════════
   Réservé aux 7 photographies du site (décision 4).
   Se pose en absolu dans un .media.                       */

.glass {
  position: absolute;
  inset-inline: var(--sp-4);
  bottom: var(--sp-4);
  z-index: 2;
  padding: var(--sp-5);
  border-radius: var(--r-xl);
  background: var(--accent-40);
  border: 1px solid color-mix(in srgb, var(--white) 20%, transparent);
  color: var(--white);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
/* Sans backdrop-filter, on renforce le fond pour garder le contraste. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: var(--accent-75); }
}
.glass :is(h2, h3, h4, h5) { color: var(--white); }
.glass p { color: color-mix(in srgb, var(--white) 85%, transparent); }

/* Halo coloré qui remonte du bas de la photo — c'est lui qui
   rend le cartouche lisible quel que soit le cliché. */
.glow {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 45%;
  z-index: 1;
  pointer-events: none;
  /* Ce halo doit ASSOMBRIR le bas de la photographie pour que le
     cartouche blanc reste lisible : il est donc bleu nuit, jamais
     doré — un halo clair produirait l'effet inverse. */
  background: color-mix(in srgb, var(--primary-3) 65%, transparent);
  filter: blur(40px);
}


/* ═══ Média — cadre photo ═════════════════════════════ */

.media {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-2xl);
  background: var(--primary-5);
  /* Anneau champagne : il cerne la photographie sans jamais toucher
     au texte qu'elle porte. */
  box-shadow: inset 0 0 0 1px var(--line-gold);
}
.media img,
.media video { width: 100%; height: 100%; object-fit: cover; }

.media--21x9  { aspect-ratio: 21 / 9; }
.media--16x9  { aspect-ratio: 16 / 9; }
.media--4x5   { aspect-ratio: 4 / 5; }
.media--1x1   { aspect-ratio: 1 / 1; }
.media--round { border-radius: var(--r-pill); }

/* Emplacement en attente de photographie : affiche le brief de
   direction artistique plutôt qu'un aplat muet. À retirer une
   fois les 7 visuels livrés. */
.media--brief {
  background:
    repeating-linear-gradient(
      -45deg,
      var(--primary-5) 0 12px,
      color-mix(in srgb, var(--primary-1) 7%, var(--primary-5)) 12px 24px
    );
}
/* Posé en absolu — et non en grid item — pour qu'un <img> livré par le
   CMS puisse occuper le même cadre sans déplacer le brief. */
.media__brief {
  position: absolute;
  inset: auto var(--sp-5) var(--sp-5);
  max-width: 44ch;
  font-size: var(--t-sm);
  line-height: var(--lh-snug);
  color: var(--ink-3);
}

/* Quand un cartouche en verre occupe déjà le bas du cadre, le brief
   remonte en tête plutôt que de passer dessous. */
.media:has(.glass) .media__brief { inset: var(--sp-5) var(--sp-5) auto; }

/* Dans un médaillon rond, le brief se centre : posé en bas, il sortirait
   du disque et serait rogné en plein milieu d'un mot. */
.media--round .media__brief {
  inset: 0;
  display: grid;
  place-items: center;
  padding: 14%;
  font-size: var(--t-xs);
  text-align: center;
}

/* Le CMS pose l'URL sur l'attribut src : tant qu'elle est vide, l'image
   ne s'affiche pas et le brief tient la place. Dès qu'une photographie
   est fournie, le brief et la hachure s'effacent — aucun JS. */
.media > img:not([src]),
.media > img[src=""] { display: none; }

.media:has(> img[src]:not([src=""])) { background-image: none; }
.media:has(> img[src]:not([src=""])) .media__brief { display: none; }


/* ═══ Formes découpées ════════════════════════════════
   Coin inversé : le blanc de la barre se prolonge puis
   s'incurve. Reproduit en gradient, sans image.           */

.cutout {
  width: var(--cut);
  height: var(--cut);
  flex: none;
  pointer-events: none;
  --cutout-color: var(--white);
}
.cutout--l {
  background: radial-gradient(
    circle var(--cut) at 0 100%,
    transparent 0 var(--cut),
    var(--cutout-color) calc(var(--cut) + 0.5px)
  );
}
.cutout--r {
  background: radial-gradient(
    circle var(--cut) at 100% 100%,
    transparent 0 var(--cut),
    var(--cutout-color) calc(var(--cut) + 0.5px)
  );
}
/* Variantes retournées, pour une encoche montante (hero). */
.cutout--tl {
  background: radial-gradient(
    circle var(--cut) at 0 0,
    transparent 0 var(--cut),
    var(--cutout-color) calc(var(--cut) + 0.5px)
  );
}
.cutout--tr {
  background: radial-gradient(
    circle var(--cut) at 100% 0,
    transparent 0 var(--cut),
    var(--cutout-color) calc(var(--cut) + 0.5px)
  );
}

/* Encoche : demi-pilule qui déborde du bas d'une image. */
.notch {
  position: relative;
  z-index: 2;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-5) var(--sp-7) var(--sp-3);
  border-radius: var(--r-pill) var(--r-pill) 0 0;
  background: var(--primary-4);
  color: var(--ink);
  font-size: var(--t-sm);
  font-weight: 600;
}
.notch__wings { --cutout-color: var(--primary-4); }
.notch__wings .cutout { position: absolute; bottom: 0; }


/* ═══ Accordéon ═══════════════════════════════════════
   Ouverture par grid-template-rows : pas de calcul de
   hauteur en JS, transition fluide sur contenu variable.  */

.accordion { display: flex; flex-direction: column; gap: var(--sp-3); }

.accordion__item {
  border: 1px solid var(--line-gold);
  border-radius: var(--r-2xl);
  background: transparent;
  transition: background-color var(--dur) var(--ease);
}
.accordion__item.is-open { background: var(--primary-5); }

.accordion__toggle {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-5);
  width: 100%;
  padding: var(--sp-6);
  border: 0;
  background: none;
  text-align: left;
  color: var(--ink);
  font-family: var(--font-heading);
  font-size: var(--t-h4);
  line-height: var(--lh-heading);
}

.accordion__sign {
  flex: none;
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  border-radius: var(--r-pill);
  background: var(--white);
  color: var(--accent-text);
  transition: transform var(--dur-slow) var(--ease), background-color var(--dur) var(--ease);
}
.accordion__item.is-open .accordion__sign { transform: rotate(135deg); }
.accordion__sign svg { width: 20px; height: 20px; }

.accordion__panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--dur) var(--ease);
}
.accordion__item.is-open .accordion__panel { grid-template-rows: 1fr; }
.accordion__panel > div { overflow: hidden; }
.accordion__body { padding: 0 var(--sp-6) var(--sp-6); }


/* ═══ Pastille de bascule ═════════════════════════════
   Filtres du journal, ancres de /offres, choix du tunnel
   de réservation (type, format, jour, créneau).           */

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink);
  font-size: var(--t-sm);
  font-weight: 500;
  white-space: nowrap;
  transition:
    background-color var(--dur-fast) var(--ease),
    color            var(--dur-fast) var(--ease),
    border-color     var(--dur-fast) var(--ease);
}
.chip:hover { border-color: var(--ornament-deep); color: var(--ink); }
.chip.is-on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.chip[disabled] { opacity: 0.4; pointer-events: none; }

/* Pastille à deux lignes — « Premier échange / 30 min · gratuit » */
.chip--stacked {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 12px 20px;
  border-radius: var(--r-lg);
  text-align: left;
}
.chip__title { font-size: var(--t-md); font-weight: 600; }
.chip__note  { font-size: var(--t-xs); opacity: 0.75; }

/* Pastille jour — colonne dow + numéro */
.chip--day {
  flex-direction: column;
  gap: 2px;
  min-width: 56px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  text-align: center;
}
.chip--day .chip__dow { font-size: var(--t-xs); opacity: 0.7; }
.chip--day .chip__num { font-size: var(--t-lg); font-family: var(--font-heading); line-height: 1; }


/* ═══ Formulaire ══════════════════════════════════════ */

.field { display: flex; flex-direction: column; gap: var(--sp-3); }

.field__label {
  font-size: var(--t-sm);
  font-weight: 600;
  color: var(--ink-2);
}

.field__input,
.field__select,
.field__textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--ornament-deep);
  border-radius: var(--r-sm);
  background: var(--primary-4);
  color: var(--ink);
  font-size: var(--t-base);
  transition: border-color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
}
.field__textarea { min-height: 120px; resize: vertical; }
.field__select { appearance: none; cursor: pointer; }

.field__input::placeholder,
.field__textarea::placeholder { color: var(--ink-3); }

.field__input:focus-visible,
.field__select:focus-visible,
.field__textarea:focus-visible {
  outline: none;
  border-color: var(--accent);
  background: var(--white);
}

/* Case à cocher — carré arrondi, coche blanche sur bronze. */
.checkbox { display: flex; align-items: flex-start; gap: var(--sp-3); cursor: pointer; }
.checkbox input[type="checkbox"] {
  flex: none;
  appearance: none;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  border: 1px solid var(--ornament-deep);
  border-radius: 5px;
  background: var(--white);
  display: grid;
  place-items: center;
  transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.checkbox input[type="checkbox"]::after {
  content: "";
  width: 10px;
  height: 6px;
  border-inline-start: 2px solid var(--white);
  border-block-end: 2px solid var(--white);
  transform: rotate(-45deg) translate(1px, -1px);
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease);
}
.checkbox input[type="checkbox"]:checked { background: var(--accent); border-color: var(--accent); }
.checkbox input[type="checkbox"]:checked::after { opacity: 1; }
.checkbox span { font-size: var(--t-sm); line-height: var(--lh-snug); }

/* Message d'état sous un formulaire. */
.alert { padding: 10px 14px; border-radius: var(--r-sm); font-size: var(--t-sm); }
.alert--ok    { background: var(--ok-bg);    color: var(--ok); }
.alert--error { background: var(--error-bg); color: var(--error); }


/* ═══ Listes ══════════════════════════════════════════ */

/* Liste à coches — bénéfices, qualifications, formats. */
.check-list { display: flex; flex-direction: column; gap: var(--sp-4); list-style: none; }
.check-list li { display: flex; align-items: flex-start; gap: var(--sp-3); }
.check-list svg { flex: none; width: 22px; height: 22px; margin-top: 1px; color: var(--accent); }

/* Liste à médaillon — liste principale du bloc « approche ». */
.icon-list { display: flex; flex-direction: column; gap: var(--sp-5); list-style: none; }
.icon-list li { display: flex; align-items: center; gap: var(--sp-3); }
.icon-list .icon-list__badge {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r-pill);
  background: var(--white);
  color: var(--accent-text);
}
.icon-list .icon-list__badge svg { width: 22px; height: 22px; }
.icon-list span { font-size: var(--t-lg); font-weight: 600; color: var(--ink-2); }


/* ═══ Statistique ═════════════════════════════════════ */

.stat { display: flex; flex-direction: column; gap: var(--sp-1); }
.stat__value {
  font-family: var(--font-heading);
  font-size: var(--t-h3);
  line-height: 1;
  color: var(--ink);
  letter-spacing: var(--tracking-tight);
  font-variant-numeric: tabular-nums;
}
.stat__label {
  font-size: var(--t-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--ink-3);
}


/* ═══ Numéro d'étape ══════════════════════════════════
   Réservé aux séquences réelles : les 4 dimensions de la
   méthode, le déroulé minuté d'une séance, les 3 temps
   d'un accompagnement.                                    */

.step-num {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: var(--r-lg);
  background: var(--accent-10);
  color: var(--accent-text);
  font-family: var(--font-heading);
  font-size: var(--t-h4);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.step-num--xl {
  width: auto; height: auto;
  background: none;
  border-radius: 0;
  font-size: clamp(40px, 6vw + 10px, 80px);
}


/* ═══ Avatar ══════════════════════════════════════════ */

.avatar {
  width: 38px;
  height: 38px;
  border-radius: var(--r-pill);
  object-fit: cover;
  background: var(--primary-5);
}
.avatar--lg { width: 44px; height: 44px; }

.rating { display: inline-flex; gap: 2px; color: var(--ornament); }
.rating svg { width: 15px; height: 15px; }


/* ═══ Défilement de mots ══════════════════════════════
   Remplace les bandes d'images du kit (décision 4).
   Le conteneur porte le masque, la piste défile.          */

.marquee {
  position: relative;
  overflow: hidden;
  mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
}
.marquee__track {
  display: flex;
  align-items: center;
  width: max-content;
  animation: marquee-x 45s linear infinite;
}
/* L'espace de raccord vit dans chaque élément (pas en `gap`) : la piste fait
   ainsi exactement deux copies, et translateX(-50%) boucle sans saut.        */
.marquee__word {
  font-family: var(--font-heading);
  font-size: var(--t-h2);
  line-height: 1;
  color: var(--ink);
  letter-spacing: var(--tracking-tight);
  word-spacing: 0.3em;
  white-space: nowrap;
  padding-inline-end: var(--sp-8);
}
.marquee__word--muted { color: var(--ornament-deep); }

@keyframes marquee-x {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .marquee__track { animation: none; }
  .marquee { mask-image: none; -webkit-mask-image: none; }
}


/* ═══ Séparateur ══════════════════════════════════════ */

.rule { height: 1px; background: var(--line-gold); border: 0; }


/* ═══ Confort tactile ═════════════════════════════════
   Au doigt, toute commande fait au moins 44×44 (WCAG 2.5.5).
   Ciblé sur `pointer: coarse` : la densité reste inchangée
   à la souris, où la précision ne pose pas problème.       */

@media (pointer: coarse) {
  .btn,
  .btn--outline,
  .chip { min-height: 44px; }

  .btn-icon,
  .accordion__sign { width: 44px; height: 44px; }

  .checkbox input[type="checkbox"] { width: 26px; height: 26px; }

  /* Une case à cocher se coche aussi en touchant son libellé : la
     zone utile est celle du couple, pas celle du carré. */
  .checkbox { min-height: 44px; align-items: center; }
}


/* ═════════════════════════════════════════════════════
   Téléphone — < 600px

   Deux réglages seulement, mais ils portent sur tout le site :
   la pilule de sur-titre passe sur deux lignes au lieu d'être
   écrasée, et les cartes rendent au contenu la marge que leur
   rembourrage de bureau lui prenait.
   ───────────────────────────────────────────────────── */

@media (max-width: 599px) {
  /* `nowrap` était tenable tant qu'une pilule tenait sur une ligne.
     À 350px de large, « Quand le corps porte encore quelque chose »
     débordait de son propre rembourrage. */
  .badge,
  .tag {
    white-space: normal;
    text-wrap: balance;
    letter-spacing: 0.04em;
  }
  /* Une pilule qui passe sur deux lignes occupe toute la largeur
     disponible : son texte doit partir du point, sinon celui-ci
     reste seul à gauche d'un bloc centré. Les pilules courtes,
     elles, gardent leur largeur de contenu — le fer à gauche n'y
     change rien. */
  .badge { align-items: center; text-align: start; }
  .tag   { text-align: start; }

  /* 30 et 40px de rembourrage sur une carte de 350px : le texte
     n'avait plus que 270px. */
  .card       { padding: var(--sp-5); }
  .card--lg   { padding: var(--sp-5); border-radius: var(--r-xl); }
  .card--tight{ padding: var(--sp-4); }

  /* L'accordéon portait 30px de rembourrage de chaque côté : entre le
     numéro, le titre et le signe +, la ligne n'avait plus la place de
     tenir sur un seul niveau. */
  .accordion__toggle { padding: var(--sp-5) var(--sp-4); gap: var(--sp-3); }
  .accordion__body   { padding: 0 var(--sp-4) var(--sp-5); }
  .accordion__item   { border-radius: var(--r-xl); }

  .glass {
    inset-inline: var(--sp-3);
    bottom: var(--sp-3);
    padding: var(--sp-4);
  }
  .media__brief { inset: auto var(--sp-4) var(--sp-4); font-size: var(--t-xs); }
}
