/* =============================================================
   extra.css — à charger APRÈS assets/style.css
   1. Correctifs responsive (hero + bandeau défilant)
   2. Styles du formulaire de contact
   ============================================================= */

/* -------------------------------------------------------------
   1. BASE — plus aucun débordement horizontal sur mobile
   ------------------------------------------------------------- */
html { -webkit-text-size-adjust: 100%; }

html, body {
  max-width: 100%;
  overflow-x: hidden;
}

img, svg, video { max-width: 100%; height: auto; }

/* -------------------------------------------------------------
   2. HERO — hauteur fiable sur mobile
   100vh inclut la barre d'URL de Safari/Chrome mobile : le contenu
   se retrouve coupé. 100svh mesure la hauteur réellement visible.
   ------------------------------------------------------------- */
.hero {
  overflow: hidden;
  min-height: 100vh;              /* repli navigateurs anciens */
}

@supports (height: 100svh) {
  .hero { min-height: 100svh; }
}

.hero__inner {
  padding-top: clamp(6rem, 18vh, 10rem);
  padding-bottom: clamp(3rem, 8vh, 6rem);
}

.hero h1 {
  font-size: clamp(2.6rem, 12vw, 6.5rem);
  line-height: 1.03;
  overflow-wrap: break-word;
}

.hero__kicker,
.hero__sub { overflow-wrap: break-word; }

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .8rem;
}

/* -------------------------------------------------------------
   3. BANDEAU DÉFILANT (ticker)
   Défilement continu sans saut : la piste contient deux copies
   identiques du texte et se translate de -50%.
   ------------------------------------------------------------- */
.ticker {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.ticker__track {
  display: flex;
  flex-wrap: nowrap;
  width: max-content;
  min-width: 100%;
  will-change: transform;
  animation: df-ticker 30s linear infinite;
}

.ticker__track > span {
  flex: 0 0 auto;
  white-space: nowrap;
  padding-right: 6px;
}

@keyframes df-ticker {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}

/* -------------------------------------------------------------
   4. MOBILE — le bandeau passe sous le hero, sur toute la largeur
   ------------------------------------------------------------- */
@media (max-width: 768px) {
  .hero {
    min-height: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-bottom: 0;
  }

  @supports (height: 100svh) {
    .hero { min-height: 92svh; }
  }

  .hero__inner {
    flex: 1 1 auto;
    padding-top: clamp(5.5rem, 16vh, 8rem);
    padding-bottom: 2.5rem;
  }

  /* le bandeau sort du positionnement absolu et prend 100 % de la largeur */
  .ticker {
    position: static;
    inset: auto;
    margin-top: auto;
    width: 100%;
  }

  .ticker__track { animation-duration: 22s; }

  .hero h1 { font-size: clamp(2.5rem, 13vw, 4rem); }

  /* boutons pleine largeur, plus faciles à toucher */
  .hero__actions .btn,
  .page-header__actions .btn,
  .cta-band__actions .btn {
    flex: 1 1 100%;
    justify-content: center;
    text-align: center;
    min-height: 48px;
  }

  .page-header__actions,
  .cta-band__actions,
  .contact__actions {
    display: flex;
    flex-wrap: wrap;
    gap: .7rem;
  }
}

@media (max-width: 480px) {
  .hero__inner { padding-top: clamp(5rem, 14vh, 7rem); }
  .hero h1 { font-size: clamp(2.2rem, 12.5vw, 3.4rem); }
  .ticker__track > span { padding-right: 1em; }
}

/* Écrans courts en paysage : pas de hauteur imposée */
@media (max-height: 520px) and (orientation: landscape) {
  .hero { min-height: auto; }
  .hero__inner { padding-top: 6rem; padding-bottom: 2rem; }
}

@media (prefers-reduced-motion: reduce) {
  .ticker__track { animation: none; transform: none; }
}

/* -------------------------------------------------------------
   5. FORMULAIRE DE CONTACT
   ------------------------------------------------------------- */
.cform-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}

.cform-intro p { max-width: 42ch; }

.cform-aside {
  list-style: none;
  margin: 2.2rem 0 0;
  padding: 0;
  border-top: 1px solid var(--line, rgba(26, 22, 19, .14));
}

.cform-aside li {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  padding: .85rem 0;
  border-bottom: 1px solid var(--line, rgba(26, 22, 19, .14));
}

.cform-aside b {
  font-family: inherit;
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--stone, #6f665d);
}

.cform-aside span {
  font-size: .92rem;
  text-align: right;
  color: var(--ink, #1a1613);
}

.cform-direct {
  display: grid;
  gap: .7rem;
  margin-top: 2rem;
}

/* --- le bloc formulaire --- */
.cform-wrap {
  background: #fff;
  border: 1px solid var(--line, rgba(26, 22, 19, .14));
  border-radius: 2px;
  padding: clamp(1.4rem, 4vw, 2.6rem);
}

.cform-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem;
}

.cform-field { margin-bottom: 1.1rem; }

.cform-field label,
.cform-check label {
  display: block;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .74rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--stone, #6f665d);
  margin-bottom: .5rem;
}

.cform-field .req { color: #6b1212; }

.cform-field .opt {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  font-size: .72rem;
  opacity: .65;
}

.cform-field input,
.cform-field select,
.cform-field textarea {
  width: 100%;
  font: inherit;
  font-size: 1rem;               /* 16px minimum : évite le zoom auto sur iOS */
  color: var(--ink, #1a1613);
  background: var(--paper, #faf7f1);
  border: 1px solid var(--line, rgba(26, 22, 19, .18));
  border-radius: 2px;
  padding: .85rem .95rem;
  min-height: 48px;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.cform-field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236f665d' stroke-width='1.4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.6rem;
}

.cform-field textarea {
  min-height: 170px;
  resize: vertical;
  line-height: 1.6;
}

.cform-field input:focus,
.cform-field select:focus,
.cform-field textarea:focus {
  outline: none;
  background: #fff;
  border-color: #6b1212;
  box-shadow: 0 0 0 3px rgba(107, 18, 18, .12);
}

.cform-field input:focus-visible,
.cform-field select:focus-visible,
.cform-field textarea:focus-visible {
  outline: 2px solid #6b1212;
  outline-offset: 2px;
}

.cform-field.has-error input,
.cform-field.has-error select,
.cform-field.has-error textarea {
  border-color: #a12b1e;
  background: #fdf5f4;
}

.cform-err {
  margin: .45rem 0 0;
  font-size: .82rem;
  color: #a12b1e;
}

/* --- case à cocher --- */
.cform-check {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .7rem .8rem;
  align-items: start;
  margin: 1.4rem 0 1.8rem;
}

.cform-check input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: .15rem;
  accent-color: #6b1212;
  flex: 0 0 auto;
}

.cform-check label {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  font-size: .86rem;
  line-height: 1.55;
  margin: 0;
}

.cform-check .cform-err { grid-column: 1 / -1; }
.cform-check.has-error label { color: #a12b1e; }

/* --- envoi --- */
.cform-submit {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.4rem;
  border-top: 1px solid var(--line, rgba(26, 22, 19, .14));
  padding-top: 1.5rem;
}

.cform-submit .btn { min-height: 48px; }
.cform-submit .btn[disabled] { opacity: .55; pointer-events: none; }

.cform-note {
  margin: 0;
  font-size: .78rem;
  color: var(--stone, #6f665d);
}

/* --- messages --- */
.cform-alert {
  border-radius: 2px;
  padding: 1.1rem 1.3rem;
  margin-bottom: 1.6rem;
  border-left: 3px solid;
}

.cform-alert b {
  display: block;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.05rem;
  margin-bottom: .25rem;
}

.cform-alert p { margin: 0; font-size: .9rem; }

.cform-alert--ok {
  background: #f2f7f1;
  border-color: #3f7a4a;
  color: #24512c;
}

.cform-alert--ko {
  background: #fdf4f3;
  border-color: #a12b1e;
  color: #7d2418;
}

/* --- piège à robots : invisible sans display:none (les bots l'ignorent) --- */
.cform-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* --- responsive du formulaire --- */
@media (max-width: 900px) {
  .cform-layout { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 620px) {
  .cform-row { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .cform-submit { flex-direction: column; align-items: stretch; }
  .cform-submit .btn { width: 100%; justify-content: center; text-align: center; }
  .cform-note { text-align: center; }
}

/* -------------------------------------------------------------
   6. HEADER — toujours en crème opaque
   Le header transparent devenait illisible sur les photos claires
   du hero. On force l'état « scrollé » en permanence.
   ------------------------------------------------------------- */
body > header,
body > .nav,
body > .site-header,
header.nav,
header.header,
header.site-header {
  background: var(--cream, #f3efe6) !important;
  color: var(--ink, #1a1613) !important;
  border-bottom: 1px solid var(--line, rgba(26, 22, 19, .12));
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

/* Texte, liens et logo repassent en encre */
body > header a,
body > header span,
body > header b,
body > header strong,
body > header p,
body > header li,
body > header button:not(.btn) {
  color: var(--ink, #1a1613);
}

/* Icônes SVG (burger, flèches) : suivent la couleur du texte */
body > header svg {
  stroke: currentColor !important;
}
body > header svg[fill]:not([fill="none"]) {
  fill: currentColor !important;
}

/* Lien de la page courante : accent bordeaux plutôt que blanc */
body > header a.is-active,
body > header a[aria-current="page"],
body > header .is-active > a {
  color: #6b1212 !important;
}

/* Bouton fantôme dans le header : bordure sombre au lieu de blanche */
body > header .btn--ghost {
  color: var(--ink, #1a1613) !important;
  border-color: rgba(26, 22, 19, .3) !important;
}
body > header .btn--ghost:hover {
  background: rgba(26, 22, 19, .06) !important;
}

/* Panneau du menu mobile : même fond opaque */
body > header nav,
body > header .nav__panel,
body > header .nav__menu,
body > header .menu {
  background: var(--cream, #f3efe6);
}

/* -------------------------------------------------------------
   7. LISIBILITÉ SUR PHOTO DE FOND (hero + en-têtes de page)
   Une ombre portée seule ne suffit pas sur une photo claire.
   On pose un voile dégradé entre la photo et le texte : le
   contraste devient garanti quelle que soit l'image.
   Ajustez les trois variables ci-dessous pour doser.
   ------------------------------------------------------------- */
:root {
  --scrim-haut: .52;   /* sous le header */
  --scrim-milieu: .30; /* zone la plus claire */
  --scrim-bas: .72;    /* sous le titre et les boutons */
  --scrim-teinte: 24, 15, 13; /* noir chaud, cohérent avec le bordeaux */
}

.hero,
.page-header {
  position: relative;
  isolation: isolate;
}

.hero::after,
.page-header::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgba(var(--scrim-teinte), var(--scrim-haut))   0%,
    rgba(var(--scrim-teinte), var(--scrim-milieu)) 38%,
    rgba(var(--scrim-teinte), var(--scrim-bas))    100%
  );
}

/* Tout le contenu repasse au-dessus du voile */
.hero__inner,
.hero__grain,
.hero .ticker,
.page-header__inner {
  position: relative;
  z-index: 2;
}

/* Ombre de secours : rattrape les zones très claires ponctuelles */
.hero__kicker,
.hero h1,
.hero__sub,
.page-header .breadcrumb,
.page-header .eyebrow,
.page-header h1,
.page-header__sub {
  text-shadow: 0 1px 2px rgba(0, 0, 0, .45), 0 10px 34px rgba(0, 0, 0, .32);
}

/* Le bouton fantôme sur photo : bordure et texte pleinement opaques */
.hero__actions .btn--ghost,
.page-header__actions .btn--ghost {
  border-color: rgba(243, 239, 230, .75);
  color: #f3efe6;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .4);
}
.hero__actions .btn--ghost:hover,
.page-header__actions .btn--ghost:hover {
  background: rgba(243, 239, 230, .14);
  border-color: #f3efe6;
}

/* La photo doit toujours couvrir la zone, sans déformation */
.hero,
.page-header {
  background-size: cover;
  background-position: center 30%;
  background-repeat: no-repeat;
}

/* Contraste renforcé demandé par le système : on assombrit le voile */
@media (prefers-contrast: more) {
  :root {
    --scrim-haut: .68;
    --scrim-milieu: .52;
    --scrim-bas: .82;
  }
}
