/* =====================================================================
   Thelma & Mathéo — papier et encre.
   Écrit en mobile d'abord : tout se valide à 375 px, le desktop vient après.
   ===================================================================== */

:root {
  --papier:       #f4efe3;
  --papier-creux: #ebe3d2;
  --encre:        #23201c;
  --encre-douce:  #5f584d;
  --filet:        rgba(35, 32, 28, .16);
  --filet-fort:   rgba(35, 32, 28, .38);
  --sauge:        #7d8b78;

  --serif: 'Cormorant Garamond', Cormorant, Garamond, 'Times New Roman', serif;

  --marge: 1.6rem;
  --rythme: 1.75rem;
}

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

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

body {
  margin: 0;
  background: var(--papier);
  color: var(--encre);
  font-family: var(--serif);
  font-size: 1.125rem;
  font-weight: 400;
  line-height: 1.62;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* Le grain du papier. Un bruit SVG, assez discret pour qu'on le sente sans le voir. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23g)' opacity='.14'/%3E%3C/svg%3E");
}

body > * { position: relative; z-index: 1; }

img { max-width: 100%; height: auto; display: block; }

/* Lien d'évitement : visible seulement au clavier. */
.saut {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: .7rem 1rem;
  background: var(--encre);
  color: var(--papier);
  text-decoration: none;
}
.saut:focus { left: 0; z-index: 10; }

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

:where(a, button, input, [tabindex]):focus-visible {
  outline: 2px solid var(--encre);
  outline-offset: 3px;
}

/* ====================== OUVERTURE ====================== */

.ouverture {
  padding: 4.5rem var(--marge) 3rem;
  text-align: center;
}

.sur-titre {
  margin: 0 0 1.6rem;
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--encre-douce);
}

h1 {
  margin: 0;
  font-size: clamp(2.9rem, 13vw, 4.6rem);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: .01em;
}

.date {
  margin: 1.5rem 0 0;
  font-size: 1.25rem;
  font-style: italic;
  font-weight: 300;
  color: var(--encre-douce);
}

.lieu-court {
  margin: .3rem 0 0;
  font-size: .8rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--encre-douce);
}

/* La bande de photomaton : un objet posé sur la table, pas une image de site. */
.bande {
  margin: 3.4rem auto 0;
  width: min(46vw, 196px);
  transform: rotate(-1.6deg);
  filter: drop-shadow(0 10px 18px rgba(35, 32, 28, .17));
}

.bande img {
  width: 100%;
  border: 5px solid #fdfbf6;
  border-bottom-width: 14px;   /* la marge blanche du bas, comme sur une vraie bande */
}

/* ====================== SECTIONS ====================== */

.section {
  max-width: 34rem;
  margin: 0 auto;
  padding: 3.6rem var(--marge);
}

.section--mot { padding-top: 2.4rem; }

.titre-section {
  margin: 0 0 2.2rem;
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--encre-douce);
  text-align: center;
}

.filet {
  width: 4.5rem;
  height: 0;
  margin: 0 auto;
  border: 0;
  border-top: 1px solid var(--filet-fort);
}

.mot p {
  margin: 0 0 var(--rythme);
  font-size: 1.32rem;
  font-weight: 300;
  line-height: 1.6;
  text-align: center;
}
.mot p:last-child { margin-bottom: 0; }

/* ====================== LES TROIS JOURS ====================== */

.jours {
  margin: 0;
  padding: 0;
  list-style: none;
}

.jour {
  padding: 1.9rem 0;
  border-top: 1px solid var(--filet);
}
.jour:first-child { border-top: 0; padding-top: 0; }

.jour__entete {
  display: flex;
  align-items: baseline;
  gap: .55rem;
  margin-bottom: .5rem;
}

.jour__nom {
  font-size: 1.55rem;
  font-weight: 300;
}

.jour__date {
  font-size: .78rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--encre-douce);
}

.jour__titre {
  margin: 0 0 .5rem;
  font-size: 1.05rem;
  font-style: italic;
  color: var(--sauge);
}

.jour__texte { margin: 0; font-weight: 300; }

.jour__heure {
  margin: .7rem 0 0;
  font-size: .88rem;
  color: var(--encre-douce);
}

/* ====================== LE LIEU ====================== */

.lieu__nom {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 300;
  text-align: center;
}

.lieu__adresse {
  margin: .4rem 0 1.8rem;
  font-size: .95rem;
  color: var(--encre-douce);
  text-align: center;
}

.lieu p { margin: 0 0 1.25rem; font-weight: 300; }

.lieu__bloc {
  margin-top: 1.8rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--filet);
}

.lieu__etiquette {
  display: block;
  margin-bottom: .45rem;
  font-size: .74rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--encre-douce);
}

.lieu__carte {
  display: inline-block;
  margin-top: .3rem;
  color: var(--encre);
  text-underline-offset: .35em;
  text-decoration-thickness: 1px;
}

/* ====================== FORMULAIRE ====================== */

.section--rsvp { max-width: 30rem; }

.rsvp__intro {
  margin: 0 0 .9rem;
  font-weight: 300;
  text-align: center;
}

.rsvp__avant {
  margin: 0 0 2.6rem;
  font-size: .95rem;
  font-style: italic;
  color: var(--encre-douce);
  text-align: center;
}

.formulaire { margin: 0; }

.champ {
  margin: 0 0 1.9rem;
  padding: 0;
  border: 0;
}

.champ label,
.champ legend {
  display: block;
  margin-bottom: .5rem;
  padding: 0;
  font-size: .76rem;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--encre-douce);
}

/* Des champs à filet, pas des boîtes : on écrit sur la ligne. */
.champ input[type="text"],
.champ input[type="email"],
.champ input[type="number"] {
  width: 100%;
  padding: .45rem .1rem .55rem;
  border: 0;
  border-bottom: 1px solid var(--filet-fort);
  border-radius: 0;
  background: transparent;
  color: var(--encre);
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 300;
  transition: border-color .2s ease;
}

.champ input:focus {
  outline: 0;
  border-bottom-color: var(--encre);
  border-bottom-width: 2px;
  padding-bottom: calc(.55rem - 1px);
}

.champ input[aria-invalid="true"] { border-bottom-color: #a4443a; }

.aide {
  display: block;
  margin-top: .5rem;
  font-size: .88rem;
  font-style: italic;
  color: var(--encre-douce);
}

.erreur-champ {
  display: block;
  margin-top: .5rem;
  font-size: .9rem;
  color: #a4443a;
}

/* Les deux réponses possibles. */
.choix { display: grid; gap: .7rem; }

.choix input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choix label {
  margin: 0;
  padding: .95rem 1rem;
  border: 1px solid var(--filet-fort);
  color: var(--encre);
  font-size: 1.05rem;
  font-weight: 300;
  letter-spacing: 0;
  text-transform: none;
  text-align: center;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}

.choix label:hover { background: var(--papier-creux); }

.choix input:checked + label {
  background: var(--encre);
  border-color: var(--encre);
  color: var(--papier);
}

.choix input:focus-visible + label {
  outline: 2px solid var(--encre);
  outline-offset: 3px;
}

.bouton {
  display: block;
  width: 100%;
  margin-top: 2.4rem;
  padding: 1rem 1.5rem;
  border: 1px solid var(--encre);
  border-radius: 0;
  background: transparent;
  color: var(--encre);
  font-family: var(--serif);
  font-size: .82rem;
  font-weight: 500;
  letter-spacing: .28em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease;
}

.bouton:hover:not(:disabled) { background: var(--encre); color: var(--papier); }
.bouton:disabled { opacity: .45; cursor: progress; }

.etat {
  margin: 1.1rem 0 0;
  min-height: 1.5rem;
  font-size: .95rem;
  color: #a4443a;
  text-align: center;
}

.merci {
  padding: 1rem 0;
  font-size: 1.28rem;
  font-weight: 300;
  line-height: 1.55;
  text-align: center;
}

.merci__demo {
  margin-top: 1.4rem;
  font-size: .82rem;
  font-style: italic;
  letter-spacing: .06em;
  color: var(--encre-douce);
}

/* ====================== PIED ====================== */

.pied {
  max-width: 34rem;
  margin: 0 auto;
  padding: 3rem var(--marge) 4rem;
  border-top: 1px solid var(--filet);
  text-align: center;
}

.pied__contact { margin: 0; font-size: .95rem; color: var(--encre-douce); }
.pied__contact a { color: inherit; text-underline-offset: .3em; }

.pied__signature {
  margin: 1.5rem 0 0;
  font-size: 1.5rem;
  font-weight: 300;
  font-style: italic;
}

/* Les trous du contenu, tant qu'ils ne sont pas bouchés. Ça se voit, c'est fait pour. */
.a-completer {
  padding: .1em .3em;
  background: rgba(196, 154, 42, .2);
  color: var(--encre);
  font-style: italic;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/* ====================== APPARITIONS ====================== */

.apparait {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .9s ease, transform .9s ease;
}
.apparait.vu { opacity: 1; transform: none; }

/* ====================== GRANDS ÉCRANS ====================== */

@media (min-width: 48rem) {
  body { font-size: 1.2rem; }
  .ouverture { padding-top: 6.5rem; }
  .bande { width: 232px; margin-top: 4.2rem; }
  .section { padding: 5rem var(--marge); }
  .jour__entete { gap: .8rem; }
}

@media (min-width: 64rem) {
  .ouverture { padding-top: 8rem; }
  .bande { width: 250px; }
  .section { padding: 6rem var(--marge); }
}

/* ====================== PRÉFÉRENCES ====================== */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
  .apparait { opacity: 1; transform: none; }
}

@media print {
  body::before, .saut, .formulaire { display: none; }
  body { background: #fff; }
}
