/* ==========================================================================
   Mona + Martin — 08.10.27 — Marrakech
   Palette reprise du faire-part : fond terracotta, encre beige, quelques
   touches d'encre noire. Azeret Mono pour le texte, Helvetica Bold pour les
   titres d'affiche.
   ========================================================================== */

:root {
  /* Terracotta et beige relevés sur le faire-part. */
  --terracotta: #a24327;
  --beige: #e5bfa1;

  --bg: var(--terracotta);   /* fond des pages */
  --ink: var(--beige);       /* encre courante sur le fond */
  --ink-soft: var(--beige);  /* encre des grands aplats typographiques */
  --paper: var(--beige);     /* aplats pleins : boutons, surlignages */

  /* Encre noire du faire-part : réservée à quelques accents. */
  --accent: #232121;

  --mono: "Azeret Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --arabic: "Noto Kufi Arabic", "Noto Sans Arabic", "Geeza Pro", "Segoe UI", sans-serif;
  --display: "Helvetica Neue", Helvetica, Arial, "Liberation Sans", sans-serif;

  /* Marge des pages (haut, gauche, droite) */
  --gutter: 50px;

  /* Largeur du canevas des pages intérieures, marges comprises : 1200px de
     contenu (la référence d'origine) + 2 × --gutter. */
  --page-width: 1300px;

  /* Unité d'échelle : 1 % de la largeur du conteneur, plafonnée à la valeur
     du canevas d'origine (1200px + 10 %). Les pages occupent toute la largeur
     de l'écran, mais la typo cesse de grossir au-delà : sans ce plafond,
     l'affiche déborderait en hauteur sur un écran large. */
  --u: min(1cqw, 11.2px);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 17.6px;
  line-height: 1.6;          /* 25.6px — valeur d'origine */
  font-weight: 400;
}

a { color: inherit; }

/* Les pages occupent toute la largeur de l'écran, bordées par --gutter.
   Le canevas porte le container-query : les tailles d'affiche sont exprimées
   en var(--u) pour conserver les proportions d'origine. */
.canvas {
  width: 100%;
  margin: 0;
  container-type: inline-size;
}

/* --------------------------------------------------------------------------
   Blocs typographiques de l'affiche
   -------------------------------------------------------------------------- */

.display {
  font-family: var(--display);
  font-weight: 700;
  line-height: 0.85;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--ink-soft);
}

.display--names {
  font-size: calc(7.61 * var(--u));        /* 91px sur 1200 */
  color: var(--ink);
  white-space: nowrap;
}

/* Le « + » d'Helvetica s'aligne sur l'axe mathématique, nettement plus bas que
   le milieu des capitales : on le remonte pour le centrer entre la ligne de
   base et le haut des lettres. */
.display--names .plus {
  display: inline-block;
  vertical-align: baseline;
  transform: translateY(-0.075em);
}

.display--date {
  font-size: calc(18.59 * var(--u));       /* 223px sur 1200 */
  letter-spacing: -0.02em;
}

/* Bloc monospace indenté en escalier (comme l'affiche d'origine) */
.stack {
  margin: 0;
  font-family: var(--mono);
  list-style: none;
  padding: 0;
}

/* white-space:pre est porté par le li : sur le ul, les retours à la ligne du
   source HTML créeraient des lignes vides entre les éléments. */
.stack li {
  white-space: pre;
  padding-left: calc(var(--i, 0) * 1ch);
}

.stack--date {
  font-size: calc(2.75 * var(--u));        /* 33px sur 1200 */
  line-height: 1.13;         /* 34px */
  margin-top: calc(1.4 * var(--u));
}

.stack--corner {
  font-size: calc(1.46 * var(--u));        /* 17.6px sur 1200 */
  line-height: 1.7;
  text-align: left;
}

.stack--birth {
  font-size: calc(1.46 * var(--u));
  line-height: 1.8;
}

/* La ligne d'encre noire (D08 M05 Y20) passe en gras, comme sur le faire-part. */
.stack--birth .accent { font-weight: 600; }

.stack--coords {
  font-size: calc(1.29 * var(--u));        /* 15.4px sur 1200 */
  line-height: 1.56;
}

.stack--coords li {
  display: grid;
  grid-template-columns: 2ch 12ch 1fr;
  gap: 0 1ch;
  padding-left: 0;
}

.stack--coords .geo { padding-left: calc(var(--i, 0) * 1ch); }

/* --------------------------------------------------------------------------
   Page 1 — affiche
   -------------------------------------------------------------------------- */

.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: calc(3 * var(--u));
  padding: var(--gutter) var(--gutter) calc(3 * var(--u));
}

.hero__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: calc(4 * var(--u));
}

.hero__mid {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(5 * var(--u));
}

.hero__bottom .display--date { margin-left: calc(2 * var(--u)); }

/* L'écart est un minimum : space-between colle déjà les coordonnées au bord
   droit. Une valeur basse évite que la ligne déborde en pleine largeur. */
.hero__bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: calc(1 * var(--u));
}

/* Bouton principal — aplat beige, texte terracotta, mono 24px */
.btn {
  display: inline-block;
  background: var(--paper);
  color: var(--bg);
  font-family: var(--mono);
  font-size: calc(2.01 * var(--u));  /* 24px sur 1200 */
  line-height: 1;
  text-decoration: none;
  text-align: center;
  padding: calc(1.75 * var(--u)) calc(3 * var(--u));
  border: 0;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.btn:hover,
.btn:focus-visible {
  background: var(--accent);
  color: var(--paper);
  outline: none;
}

/* --------------------------------------------------------------------------
   Pages intérieures (RSVP, logements)
   -------------------------------------------------------------------------- */

/* Contrairement à l'affiche, qui reste en pleine largeur, les pages
   intérieures se centrent dès que l'écran dépasse --page-width. */
.page.canvas {
  width: min(100%, var(--page-width));
  margin: 0 auto;
}

.page {
  padding: var(--gutter) var(--gutter) 96px;
}

.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px 32px;
  margin-bottom: 56px;
}

.masthead .display--names { font-size: calc(3.96 * var(--u)); }

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  font-size: 15.4px;
  letter-spacing: 0.02em;
}

.nav a { white-space: nowrap; }

.nav a { text-decoration: none; border-bottom: 2px solid transparent; padding-bottom: 2px; }
.nav a:hover,
.nav a[aria-current="page"] { border-bottom-color: var(--ink); }

.prose { max-width: 932px; }
.prose p { margin: 0 0 25.6px; }
.prose ul { margin: 0 0 25.6px; padding-left: 3ch; }
.prose li { margin: 0; }
.prose a { text-decoration: underline; text-underline-offset: 3px; }
.prose strong { font-weight: 600; }

/* Journée du programme (08 10 27 / 09 10 27) — surlignée en beige pour bien
   montrer que la fête se déroule sur deux jours. */
.schedule__day {
  display: inline-block;
  margin: 0 0 14px;
  padding: 4px 12px;
  background: var(--paper);
  color: var(--bg);
  font-weight: 600;
  letter-spacing: 0.08em;
}

.schedule + .schedule__day { margin-top: 40px; }

.schedule {
  margin: 0 0 32px;
  padding: 0;
  list-style: none;
}

.schedule li { margin-bottom: 25.6px; }
.schedule li:last-child { margin-bottom: 0; }

/* --------------------------------------------------------------------------
   Formulaire — mise en page d'origine, repeinte aux couleurs du faire-part
   (champ à filet beige 3px, fond terracotta, bouton beige/texte terracotta)
   -------------------------------------------------------------------------- */

.form {
  max-width: 932px;
  margin-top: 56px;
}

.field { margin-bottom: 28px; }

.field .label,
.fieldset > legend {
  display: block;
  font-size: 15.4px;
  line-height: 18.7px;
  margin-bottom: 6px;
  padding: 0;
}

.req { margin-left: 0.5ch; }

/* Intitulé chapeautant un groupe de sous-champs (dates, effectifs) */
.field > .label + .grid-2 { margin-top: 10px; }

::placeholder { color: var(--ink); opacity: 0.45; }

.field input[type="text"],
.field input[type="date"],
.field input[type="number"],
.field input[type="email"],
.field select,
.field textarea {
  width: 100%;
  font-family: var(--mono);
  font-size: 17.6px;
  line-height: 22px;
  color: var(--ink);
  background: transparent;
  border: 3px solid var(--ink);
  border-radius: 0;
  padding: 8px 10px;
  appearance: none;
}

.field textarea {
  min-height: 92px;
  resize: vertical;
}

.field select {
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%),
                    linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: right 18px center, right 12px center;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 36px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 3px solid var(--paper);
  outline-offset: -6px;
}

.fieldset {
  border: 0;
  margin: 0 0 28px;
  padding: 0;
}

.choices { display: flex; flex-direction: column; gap: 6px; }
.choices--inline { flex-direction: row; gap: 32px; }

.choice {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 17.6px;
}

.choice input {
  appearance: none;
  width: 15px;
  height: 15px;
  margin: 0;
  border: 2px solid var(--ink);
  border-radius: 50%;
  display: grid;
  place-content: center;
  cursor: pointer;
  flex: none;
}

.choice input::after {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  transform: scale(0);
  background: var(--ink);
}

.choice input:checked::after { transform: scale(1); }
.choice input:focus-visible { outline: 2px solid var(--paper); outline-offset: 2px; }

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.submit {
  width: 100%;
  background: var(--paper);
  color: var(--bg);
  font-family: var(--mono);
  font-size: 17.6px;
  line-height: 22px;
  border: 0;
  border-radius: 0;
  padding: 11px 20px;
  cursor: pointer;
}

.submit:hover,
.submit:focus-visible {
  background: var(--accent);
  color: var(--paper);
  outline: none;
}

/* Champ anti-spam (honeypot Netlify) */
.hp { position: absolute; left: -9999px; }

/* Blocs révélés conditionnellement */
[data-reveal][hidden] { display: none; }

/* --------------------------------------------------------------------------
   Touches d'encre noire — reprises du faire-part
   -------------------------------------------------------------------------- */

.accent { color: var(--accent); }

/* « مراكش » : Azeret Mono n'a pas d'alphabet arabe, d'où la pile dédiée. */
.arabic {
  font-family: var(--arabic);
  direction: rtl;
  unicode-bidi: isolate;
}

/* --------------------------------------------------------------------------
   Logements
   -------------------------------------------------------------------------- */

.lodgings {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 932px;
}

.lodging {
  border-top: 3px solid var(--ink);
  padding: 20px 0;
  display: grid;
  grid-template-columns: 3ch 1fr auto;
  gap: 0 1ch;
  align-items: baseline;
}

.lodging:last-child { border-bottom: 3px solid var(--ink); }
.lodging__name { font-size: 22px; line-height: 1.4; }
.lodging__meta { font-size: 15.4px; line-height: 1.6; grid-column: 2 / -1; }
.lodging__meta a { text-decoration: underline; text-underline-offset: 3px; }
.lodging__tag { font-size: 15.4px; white-space: nowrap; }

/* --------------------------------------------------------------------------
   Pied de page commun
   -------------------------------------------------------------------------- */

.colophon {
  margin-top: 88px;
  padding-top: 32px;
}

.colophon .display--names { font-size: calc(7.61 * var(--u)); margin-bottom: calc(2 * var(--u)); }

/* --------------------------------------------------------------------------
   Mobile — l'affiche reprend la composition verticale de l'original
   -------------------------------------------------------------------------- */

@media (max-width: 760px) {
  :root { --gutter: 20px; }


  .hero {
    grid-template-rows: auto 1fr auto;
    gap: 21cqw;
    padding: var(--gutter) var(--gutter) 6cqw;
  }

  /* stretch (et non flex-start) : le bloc titre occupe toute la largeur
     utile, sans quoi il se réduit à la largeur du titre et le reliquat
     s'accumule à droite. */
  .hero__top { flex-direction: column; align-items: stretch; gap: 8cqw; }
  .hero__mid { gap: 12cqw; }
  /* Sur téléphone, la date du mariage passe au-dessus des villes. */
  .hero__bottom { flex-direction: column; align-items: stretch; gap: 10cqw; }
  .hero__bottom .display--date { order: 1; }
  .hero__bottom .stack--coords { order: 2; }

  /* Le rappel « 08 10 27 / 16 h 30 / مراكش » ferait doublon avec l'en-tête :
     sur téléphone, la première vue reste lisible sans lui. */
  .stack--corner { display: none; }

  /* Sur mobile, MONA+MARTIN occupe toute la largeur entre les deux marges.
     À taille fixe il restait du mou à droite (le texte est ferré à gauche) :
     la marge droite était plus large que la gauche. 13.2cqw est le corps qui
     fait tenir « MONA+MARTIN » pile dans la largeur utile — 100cqw est déjà
     la boîte de contenu, marges déduites — en Helvetica/Arial, interlettrage
     compris, à un cheveu près ; text-align:center répartit ce reliquat de
     part et d'autre pour que les deux bords restent identiques. */
  .hero .display--names {
    font-size: 13.2cqw;
    text-align: center;
  }
  .display--date { font-size: 29.5cqw; line-height: 0.8; }

  /* Respiration entre MONA+MARTIN et « VENDREDI HUIT ». */
  .stack--date { font-size: 5.72cqw; margin-top: 7cqw; }
  .stack--birth { font-size: 3.74cqw; }
  .stack--coords { font-size: 3.3cqw; }
  .stack--coords li { grid-template-columns: 2ch 10ch 1fr; }

  /* Aplat beige plus généreux. */
  .btn { font-size: 5.1cqw; padding: 7cqw 6cqw; width: 100%; }

  .masthead { margin-bottom: 40px; }
  .nav { flex-direction: column; gap: 10px; font-size: 14.3px; }
  .masthead .display--names { font-size: 12.1cqw; }
  .colophon .display--names { font-size: 12.6cqw; }

  .grid-2 { grid-template-columns: 1fr; }
  .choices--inline { gap: 24px; }
  .lodging { grid-template-columns: 3ch 1fr; }
  .lodging__tag { grid-column: 2; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
