/* =========================================================
   Faire-part digital · Bat Mitzvah d'Ella Saada
   Le carton = image vectorielle du PDF (identique).
   Cette feuille n'habille que la couche interactive ajoutée.
   ========================================================= */

/* Vraies polices du carton (fournies par la graphiste) */
@font-face {
  font-family: "Gosford";
  src: url("../fonts/gosford-regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Gosford";
  src: url("../fonts/gosford-semibold.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Hadhelia";
  src: url("../fonts/hadhelia.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}

:root {
  /* Couleurs échantillonnées au pixel près depuis le PDF (OKLCH) */
  --terracotta:      #BA562F; /* calé EXACTEMENT sur la terracotta des images (jointures invisibles) */
  --terracotta-deep: oklch(0.515 0.140 40);
  --rust:            oklch(0.552 0.146 40);
  --cream:           oklch(0.952 0.028 66);
  --ivory:           oklch(0.945 0.032 62);
  --ink:             oklch(0.49 0.095 44);

  --f-display: "Gosford", "Marcellus", serif;
  --f-body: "EB Garamond", Georgia, serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --content: min(92vw, 34rem);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--f-body);
  background: var(--terracotta);
  color: var(--cream);
  line-height: 1.65;
  font-size: clamp(1.02rem, 0.95rem + 0.4vw, 1.16rem);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
::selection { background: var(--cream); color: var(--terracotta); }

/* ===== Navigation collante ===== */
.topnav {
  position: sticky; top: 0; z-index: 50;
  background: var(--terracotta);
  box-shadow: 0 2px 16px oklch(0.42 0.115 39 / 0.30);
}
.topnav ul {
  list-style: none; display: flex; justify-content: center; align-items: center;
  gap: clamp(0.3rem, 2.4vw, 1.4rem);
  max-width: 760px; margin: 0 auto; padding: 0.7rem 0.55rem;
  overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none;
}
.topnav ul::-webkit-scrollbar { display: none; }
.topnav a {
  font-family: "Mulish", sans-serif; text-transform: uppercase; letter-spacing: 0.08em;
  font-size: clamp(0.6rem, 2.3vw, 0.78rem);
  color: oklch(0.952 0.028 66 / 0.82); text-decoration: none; white-space: nowrap;
  transition: color 0.3s var(--ease-out);
}
.topnav a:hover, .topnav a:focus-visible { color: var(--cream); outline: none; }

.inv-body { position: relative; }
.sec-anchor { position: absolute; left: 0; width: 1px; height: 1px; pointer-events: none; }
.sec-anchor, #top, #rsvp { scroll-margin-top: 58px; }

/* ===== Le faire-part (image identique au PDF) ===== */
.invitation, .closing {
  width: min(100%, 760px);
  margin: 0 auto;
  overflow: hidden; /* clippe les franges claires de bord (artefacts WebP) sur les côtés */
}
.inv-part { width: calc(100% + 4px); height: auto; display: block; margin-left: -2px; }

/* Lien cliquable transparent posé sur la signature « Designed by AIRELLE » (bande beige du bas) */
.closing { position: relative; }
.credit-link {
  position: absolute;
  left: 30%; width: 40%;   /* centré horizontalement sur la signature */
  top: 87%; height: 13%;   /* dans la bande beige inférieure */
  display: block;
  border-radius: 8px;
  -webkit-tap-highlight-color: transparent;
}
.credit-link:focus-visible {
  outline: 2px solid var(--terracotta);
  outline-offset: 2px;
}

/* Liens cliquables transparents sur l'email et le téléphone du Mas (image Réservations) */
.resa-link {
  position: absolute;
  display: block;
  z-index: 3;
  border-radius: 6px;
  -webkit-tap-highlight-color: transparent;
}
.resa-link:focus-visible { outline: 2px solid var(--cream); outline-offset: 2px; }

/* Compte à rebours sous le logo (entre couverture et corps du faire-part) */
.cover-countdown {
  background: var(--terracotta);
  text-align: center;
  padding: clamp(0.6rem, 2vw, 1.2rem) 1rem clamp(2rem, 6vw, 3rem);
  margin: -2px 0; /* chevauche couverture + corps pour masquer les franges horizontales */
  position: relative;
  z-index: 2;
}
.cc__label {
  font-family: var(--f-display);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  font-size: clamp(0.62rem, 2.4vw, 0.76rem);
  color: oklch(0.952 0.028 66 / 0.7);
  margin-bottom: 1rem;
}
.cover-countdown .countdown { margin: 0; }

/* ===== Faire-part en HTML réel (fond motif + carte semi-transparente + texte) ===== */
.announce {
  width: min(100%, 760px);
  margin: 0 auto;
  background: var(--terracotta) url("../img/sunburst.jpg") center top / cover;
  text-align: center;
  padding: clamp(2.6rem, 9vw, 5rem) clamp(1rem, 4vw, 2rem) clamp(2.4rem, 8vw, 4.5rem);
}
.announce__card {
  width: min(88%, 31rem);
  margin: 0 auto;
  background: oklch(0.952 0.028 66 / 0.82);
  border: 1px solid oklch(0.571 0.142 40 / 0.65);
  padding: clamp(2rem, 7vw, 3.4rem) clamp(1.4rem, 5vw, 2.4rem);
}
.announce__lede {
  font-family: "Gosford", serif;
  color: var(--terracotta);
  font-size: clamp(1.15rem, 4.4vw, 1.75rem);
  line-height: 1.5;
}
.announce__lede--after { margin-top: 0.4rem; }
.announce__title {
  font-family: "Gosford", serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: clamp(1.55rem, 5.8vw, 2.35rem);
  color: var(--terracotta);
  margin: clamp(1rem, 3.5vw, 1.6rem) 0 0.2rem;
}
.announce__name {
  font-family: "Hadhelia", cursive;
  font-size: clamp(3.6rem, 19vw, 8.5rem);
  line-height: 0.85;
  color: var(--terracotta);
  margin-top: clamp(0.6rem, 2.5vw, 1.2rem);
}

/* ===== Soirée en HTML réel (fond paisley + panneau terracotta + texte crème) ===== */
.soiree {
  container-type: inline-size;
  width: min(100%, 760px);
  margin: 0 auto;
}
.soiree__frame {
  background: url("../img/paisley.jpg") center / cover;
  padding: 14.3cqw; /* cadre paisley épais = 14% de chaque côté (exact carton) */
}
.soiree__panel {
  background: #BE541A; /* couleur exacte du panneau du PDF */
  border: 1px solid oklch(0.952 0.028 66 / 0.4);
  padding: 11cqw 9cqw 17cqw;
  text-align: center;
  color: #E9C69E;
}
/* Tailles proportionnelles à la largeur (cqw) = identiques au carton à toute taille */
.soiree__title {
  margin: 0 0 6cqw;
  line-height: 0;
}
.soiree__title img {
  width: 20.8cqw; /* « Soirée » = wordmark exact du PDF (glyphes swash) */
  height: auto;
  display: block;
  margin: 0 auto;
}
.soiree__intro {
  font-family: "Gosford", serif;
  font-size: 3.51cqw;
  line-height: 1.45;
}
.soiree__lead {
  display: block;
  font-size: 4.02cqw;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.35em;
}
.soiree__when {
  font-family: "Gosford", serif;
  font-size: 3.51cqw;
  line-height: 1.45;
  margin: 5.5cqw 0 0;
}
.soiree__date { text-transform: uppercase; letter-spacing: 0.04em; }
.soiree__where {
  font-style: normal;
  font-family: "Gosford", serif;
  font-size: 3.51cqw;
  line-height: 1.45;
  margin-top: 5.5cqw;
}
.soiree__map { color: inherit; text-decoration: none; transition: opacity 0.25s var(--ease-out); }
.soiree__map:hover, .soiree__map:focus-visible { text-decoration: underline; text-underline-offset: 0.25em; outline: none; }

/* ===== Shabbat Souccot en HTML réel (fond sable + volutes) ===== */
.shabbat {
  container-type: inline-size;
  width: min(100%, 760px);
  margin: 0 auto;
  position: relative;
}
.shabbat__bg { width: 100%; height: auto; display: block; }
.shabbat__ov { position: absolute; inset: 0; }
/* texte positionné en absolu aux coordonnées exactes du PDF (sur le fond extrait) */
.sh {
  position: absolute;
  transform: translateX(-50%);
  margin: 0;
  text-align: center;
  font-family: "Gosford", serif;
  line-height: 1.45;
  width: max-content;
}
.sh-title { left: 64%; width: 55.8cqw; }
.sh-title img { width: 100%; height: auto; display: block; }
.sh-body { left: 64.5%; color: #BC5630; font-size: 3.51cqw; }
.sh-times { left: 54.4%; color: #DD8D46; font-size: 3.51cqw; }
.shabbat .up { text-transform: uppercase; }
address.sh-body { font-style: normal; }
.sh-map { color: inherit; text-decoration: none; }
.sh-map:hover, .sh-map:focus-visible { text-decoration: underline; text-underline-offset: 0.2em; outline: none; }

/* ===== Couche interactive : informations & réponse ===== */
.practical {
  width: min(100%, 760px);
  margin: 0 auto -2px;
  background: var(--terracotta);
  padding: clamp(2.4rem, 8vw, 4rem) clamp(1.2rem, 5vw, 2.4rem) clamp(3rem, 9vw, 4.5rem);
  text-align: center;
  position: relative;
  z-index: 2;
}
.eyebrow {
  font-family: var(--f-display);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  font-size: clamp(0.66rem, 2.4vw, 0.8rem);
  color: oklch(0.952 0.028 66 / 0.72);
}

/* Compte à rebours */
.countdown {
  display: flex;
  justify-content: center;
  gap: clamp(0.8rem, 4vw, 1.8rem);
  margin: 1.4rem 0 clamp(2.2rem, 7vw, 3rem);
  color: var(--cream);
}
.cd__unit { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; min-width: clamp(2.8rem, 13vw, 4rem); }
.cd__num { font-family: var(--f-display); font-size: clamp(2.1rem, 9vw, 3.2rem); line-height: 1; font-variant-numeric: tabular-nums; }
.cd__lab { font-family: var(--f-display); font-size: clamp(0.58rem, 2.2vw, 0.7rem); letter-spacing: 0.16em; text-transform: uppercase; color: oklch(0.952 0.028 66 / 0.72); }

/* Boutons d'action */
.acts {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  max-width: 30rem;
  margin: 0 auto;
  text-align: left;
}
.act {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.95rem 1.1rem;
  background: var(--cream);
  border-radius: 12px;
  text-decoration: none;
  color: var(--rust);
  transition: transform 0.45s var(--ease-out), box-shadow 0.45s var(--ease-out);
}
.act:hover, .act:focus-visible { transform: translateY(-2px); box-shadow: 0 12px 26px oklch(0.42 0.115 39 / 0.28); outline: none; }
.act svg { width: 22px; height: 22px; flex: none; fill: none; stroke: var(--terracotta); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.act span { display: flex; flex-direction: column; gap: 0.12rem; min-width: 0; }
.act strong { font-family: var(--f-display); font-weight: 400; letter-spacing: 0.04em; font-size: clamp(0.95rem, 2.7vw, 1.08rem); }
.act small { color: var(--ink); font-size: clamp(0.78rem, 2.3vw, 0.9rem); opacity: 0.85; }

/* ===== RSVP ===== */
.rsvp { margin-top: clamp(2.6rem, 9vw, 4rem); }
.rsvp__line { font-family: "Hadhelia", cursive; font-size: clamp(2.6rem, 10vw, 4rem); line-height: 1.1; color: var(--cream); }
.rsvp__sub { margin-top: 0.5rem; font-style: italic; color: oklch(0.952 0.028 66 / 0.9); }

.rsvp-form {
  /* police dédiée au formulaire : sans-serif lisible (plutôt que le serif d'affichage) */
  font-family: "Mulish", sans-serif;
  --f-display: "Mulish", sans-serif;
  --f-body: "Mulish", sans-serif;
  width: min(100%, 30rem);
  margin: clamp(1.8rem, 6vw, 2.4rem) auto 0;
  text-align: center;
  background: var(--cream);
  border-radius: 12px;
  padding: clamp(1.5rem, 5vw, 2.3rem);
  box-shadow: 0 22px 54px oklch(0.42 0.115 39 / 0.22);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.field { display: flex; flex-direction: column; gap: 0.5rem; }
.field__label { font-family: var(--f-display); letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.78rem; color: var(--rust); }
.field__opt { text-transform: none; letter-spacing: 0; font-style: italic; font-family: var(--f-body); opacity: 0.7; }
.field__input {
  width: 100%; padding: 0.8em 1em;
  font-family: var(--f-body); font-size: 1.02rem; color: var(--ink);
  background: oklch(0.985 0.012 70); border: 1px solid oklch(0.571 0.142 40 / 0.35); border-radius: 7px;
  text-align: center;
  transition: border-color 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}
.field__input::placeholder { color: oklch(0.49 0.095 44 / 0.5); }
.field__input:focus { outline: none; border-color: var(--terracotta); box-shadow: 0 0 0 3px oklch(0.571 0.142 40 / 0.14); }
.field__input--area { resize: vertical; min-height: 3.4rem; line-height: 1.5; text-align: left; }

.event { border: 0; border-top: 1px solid oklch(0.571 0.142 40 / 0.18); padding: 1.4rem 0 0; margin: 0; display: flex; flex-direction: column; gap: 0.95rem; }
.event__title { font-family: var(--f-display); letter-spacing: 0.1em; text-transform: uppercase; font-size: 0.98rem; color: var(--rust); }
.event__date { display: block; margin-top: 0.2rem; font-family: var(--f-body); font-style: italic; letter-spacing: 0; text-transform: none; font-size: 0.92rem; color: oklch(0.49 0.095 44 / 0.78); }

.toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.toggle__input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.toggle__btn {
  display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 0.8em 0.9em; border: 1px solid oklch(0.571 0.142 40 / 0.4); border-radius: 999px;
  font-family: var(--f-display); letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.78rem;
  color: var(--rust); cursor: pointer;
  transition: background-color 0.3s var(--ease-out), color 0.3s var(--ease-out), border-color 0.3s var(--ease-out);
}
.toggle__btn:hover { background: oklch(0.571 0.142 40 / 0.06); }
.toggle__input:checked + .toggle__btn { background: var(--terracotta); border-color: var(--terracotta); color: var(--cream); }
.toggle__input:focus-visible + .toggle__btn { outline: 2px solid var(--terracotta); outline-offset: 2px; }

.count { display: flex; flex-direction: column; align-items: center; gap: 0.9rem; }
.counts { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(1rem, 5vw, 2.2rem); }
.count-group { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.count__label { font-family: var(--f-display); letter-spacing: 0.1em; text-transform: uppercase; font-size: 0.72rem; color: oklch(0.49 0.095 44 / 0.8); }
.reveal-in { animation: cd-in 0.45s var(--ease-out); }
@keyframes cd-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }

.stepper { display: inline-flex; align-items: center; width: fit-content; background: oklch(0.985 0.012 70); border: 1px solid oklch(0.571 0.142 40 / 0.4); border-radius: 999px; overflow: hidden; transition: border-color 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out); }
.stepper:focus-within { border-color: var(--terracotta); box-shadow: 0 0 0 3px oklch(0.571 0.142 40 / 0.14); }
.stepper__btn { width: 2.7rem; height: 2.7rem; border: 0; background: transparent; color: var(--rust); font-family: var(--f-display); font-size: 1.45rem; line-height: 1; cursor: pointer; transition: background-color 0.25s var(--ease-out); }
.stepper__btn:hover { background: oklch(0.571 0.142 40 / 0.09); }
.stepper__input { width: 3rem; text-align: center; border: 0; background: transparent; font-family: var(--f-display); font-size: 1.15rem; color: var(--ink); appearance: textfield; -moz-appearance: textfield; }
.stepper__input::-webkit-outer-spin-button, .stepper__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper__input:focus { outline: none; }

.nights { display: flex; flex-direction: column; gap: 0.55rem; padding-top: 0.4rem; }
.nights__opts { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; }
.check { display: inline-flex; align-items: center; gap: 0.5rem; cursor: pointer; font-size: 0.92rem; color: var(--ink); padding: 0.5em 0.85em; border: 1px solid oklch(0.571 0.142 40 / 0.28); border-radius: 999px; transition: border-color 0.25s var(--ease-out); }
.check:hover { border-color: oklch(0.571 0.142 40 / 0.5); }
.check input { accent-color: var(--terracotta); width: 1.05rem; height: 1.05rem; }

.form__error { color: oklch(0.52 0.17 32); font-style: italic; font-size: 0.92rem; margin: -0.4rem 0 0; }

/* Boutons génériques */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  padding: 0.9em 1.6em; font-family: var(--f-display); font-size: clamp(0.78rem, 2.4vw, 0.92rem);
  letter-spacing: 0.16em; text-transform: uppercase; text-decoration: none; border-radius: 999px;
  border: 1px solid transparent; cursor: pointer;
  transition: transform 0.5s var(--ease-out), background-color 0.4s var(--ease-out);
}
.btn:hover, .btn:focus-visible { transform: translateY(-2px); }
.btn:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.btn--block { width: 100%; }
.btn--solid { background: var(--terracotta); color: var(--cream); border-color: var(--terracotta); }
.btn--solid:hover { background: var(--terracotta-deep); }
.btn--light { background: var(--terracotta); color: var(--cream); border-color: var(--terracotta); }
.btn--light:hover { background: var(--terracotta-deep); }

/* État de remerciement */
.rsvp-thanks { width: min(100%, 30rem); margin: clamp(1.8rem, 6vw, 2.4rem) auto 0; text-align: center; }
.rsvp-thanks__title { font-family: var(--f-display); font-size: clamp(2rem, 8vw, 2.8rem); line-height: 1; color: var(--cream); }
.rsvp-thanks__msg { margin-top: 0.4rem; font-size: clamp(1.05rem, 3vw, 1.2rem); color: oklch(0.952 0.028 66 / 0.92); }
.rsvp-thanks__extra { margin-top: 1.4rem; display: flex; flex-direction: column; gap: 0.8rem; text-align: left; }

.signoff {
  margin-top: clamp(2.4rem, 8vw, 3.4rem);
  font-family: var(--f-display);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: clamp(0.95rem, 3.4vw, 1.3rem);
  color: oklch(0.952 0.028 66 / 0.85);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
