/* ═══════════════════════════════════════════
   Niccolò's 18th Birthday — stylesheet
   Redesign "invito di lusso classico"
   Palette: crema · sabbia · tortora · cammello · bruno
   Font: EB Garamond (titoli) · Jost (etichette e testi)
   ═══════════════════════════════════════════ */

:root {
  --cream:  #f7f2e9;   /* fondo pagina */
  --paper:  #fbf8f1;   /* carta chiara (hero card, campi) */
  --sand:   #eee6d6;   /* bande di sezione alternate */
  --taupe:  #cbbda6;   /* filetti e bordi */
  --camel:  #9c7e56;   /* accento caldo: ornamenti, link, etichette */
  --ink:    #32291d;   /* testo principale, bruno scuro */
  --ink-soft: #7a6c58; /* testo secondario */

  --font-serif: "EB Garamond", Georgia, serif;
  --font-sans:  "Jost", "Helvetica Neue", sans-serif;

  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 300;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--camel); color: var(--paper); }

/* ornamenti line-art */
.ornament {
  display: block;
  width: 140px;
  height: 30px;
  margin: 0 auto;
  color: var(--camel);
}

/* ═══════════ Hero — partecipazione ═══════════ */

.hero {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: clamp(1.2rem, 4vw, 3rem);
  /* spazio riservato all'indicatore "scorri": la card non lo tocca mai */
  padding-bottom: 7.5rem;
  position: relative;
}

.hero__card {
  position: relative;
  width: min(720px, 100%);
  background: var(--paper);
  padding: clamp(3.2rem, 9vw, 5.5rem) clamp(1.6rem, 6vw, 4.5rem);
  text-align: center;
  box-shadow: 0 30px 70px -50px rgba(50, 41, 29, .4);
}

/* doppia cornice incisa */
.hero__frame {
  position: absolute;
  inset: 14px;
  border: 1px solid var(--taupe);
  outline: 1px solid var(--taupe);
  outline-offset: 4px;
  pointer-events: none;
}

.hero__corner {
  position: absolute;
  width: clamp(54px, 9vw, 84px);
  height: clamp(54px, 9vw, 84px);
  color: var(--camel);
}

.hero__corner--tl { top: 26px; left: 26px; }
.hero__corner--tr { top: 26px; right: 26px; transform: scaleX(-1); }
.hero__corner--bl { bottom: 26px; left: 26px; transform: scaleY(-1); }
.hero__corner--br { bottom: 26px; right: 26px; transform: scale(-1); }

.hero__inner { position: relative; }

.hero__eyebrow {
  font-size: .74rem;
  font-weight: 400;
  letter-spacing: .5em;
  text-indent: .5em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 2.4rem;
}

.hero__title {
  font-family: var(--font-serif);
  font-weight: 500;
  line-height: 1.05;
  display: flex;
  flex-direction: column;
  gap: .2rem;
}

.hero__title-name,
.hero__title-word {
  font-size: clamp(1.9rem, 5.5vw, 3rem);
  font-style: italic;
  font-weight: 500;
  letter-spacing: .04em;
}

.hero__title-num {
  font-size: clamp(4.6rem, 15vw, 8rem);
  font-weight: 600;
  letter-spacing: .02em;
  line-height: 1;
  color: var(--ink);
}

.hero__title-num sup {
  font-size: .3em;
  font-weight: 500;
  font-style: italic;
}

.hero__ornament { margin: 2rem auto 2.2rem; }

.hero__date {
  font-size: clamp(.85rem, 2.2vw, 1rem);
  font-weight: 400;
  letter-spacing: .32em;
  text-indent: .32em;
  text-transform: uppercase;
  color: var(--ink);
}

.hero__place {
  margin-top: .7rem;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--camel);
}

/* nota di chiarezza sulle date */
.hero__note {
  margin: 2.2rem auto 0;
  max-width: 380px;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.02rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

/* indicatore di scroll — statico e centrato */
.hero__scroll {
  position: absolute;
  bottom: 1.6rem;
  left: 0;
  right: 0;
  margin-inline: auto;
  width: max-content;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .55rem;
  text-decoration: none;
}

.hero__scroll-text {
  font-size: .66rem;
  letter-spacing: .4em;
  text-indent: .4em;
  text-transform: uppercase;
  color: var(--ink-soft);
  transition: color .3s;
}

.hero__scroll-line {
  width: 1px;
  height: 36px;
  background: var(--taupe);
  transition: background .3s;
}

.hero__scroll:hover .hero__scroll-text { color: var(--camel); }
.hero__scroll:hover .hero__scroll-line { background: var(--camel); }

/* ═══════════ Sezioni ═══════════ */

.section {
  padding: clamp(4.5rem, 11vw, 7.5rem) 1.5rem;
  text-align: center;
}

.section--band { background: var(--sand); }

.section__eyebrow {
  font-size: .7rem;
  font-weight: 400;
  letter-spacing: .48em;
  text-indent: .48em;
  text-transform: uppercase;
  color: var(--camel);
  margin-bottom: .9rem;
}

.section__title {
  font-family: var(--font-serif);
  font-size: clamp(2.1rem, 5.5vw, 3rem);
  font-weight: 500;
  letter-spacing: .03em;
  margin-bottom: 2.6rem;
}

.section__sub {
  max-width: 460px;
  margin: -1.5rem auto 2.4rem;
  color: var(--ink-soft);
}

/* dissolvenza delicata all'ingresso */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 1s var(--ease-out), transform 1s var(--ease-out);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ═══════════ Dettagli — colonne con filetti ═══════════ */

.details {
  display: grid;
  grid-template-columns: 1fr 1px 1fr 1px 1fr;
  align-items: start;
  gap: clamp(1.4rem, 4vw, 3rem);
  max-width: 980px;
  margin: 0 auto;
}

.details__rule {
  width: 1px;
  height: 100%;
  min-height: 120px;
  background: var(--taupe);
  justify-self: center;
}

.details__label {
  font-size: .7rem;
  font-weight: 400;
  letter-spacing: .38em;
  text-indent: .38em;
  text-transform: uppercase;
  color: var(--camel);
  margin-bottom: 1.2rem;
}

.details__big {
  font-family: var(--font-serif);
  font-size: clamp(1.7rem, 3.5vw, 2.1rem);
  font-weight: 500;
  margin-bottom: .35rem;
}

.details__text { color: var(--ink-soft); }

.details__fine {
  margin-top: .9rem;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: .95rem;
  color: var(--ink-soft);
}

.details__dress {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  margin-top: .55rem;
}

/* "donne / uomini": corsivo minuto, subordinato all'etichetta "Dress code" */
.details__dress span {
  display: block;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: .98rem;
  font-weight: 400;
  color: var(--ink-soft);
  margin-bottom: -.05rem;
}

.details__link,
.text-link {
  display: inline-block;
  margin-top: 1rem;
  font-size: .78rem;
  font-weight: 400;
  letter-spacing: .22em;
  text-indent: .22em;
  text-transform: uppercase;
  color: var(--camel);
  text-decoration: none;
  padding-bottom: .25rem;
  transition: color .3s, border-color .3s;
}

.details__link:hover { color: var(--ink); }

.text-link { border-bottom: 1px solid var(--taupe); margin-top: 1.6rem; }
.text-link:hover { color: var(--ink); border-color: var(--camel); }

/* ═══════════ Mappa ═══════════ */

.section--map .map {
  max-width: 860px;
  margin: 0 auto;
  border: 1px solid var(--taupe);
  padding: 8px;
  background: var(--paper);
  aspect-ratio: 16 / 9;
}

.map iframe {
  width: 100%;
  height: 100%;
  border: 0;
  filter: sepia(.28) saturate(.8) contrast(.98);
  transition: filter .5s;
}

.map:hover iframe { filter: sepia(.05) saturate(.95); }

/* ═══════════ RSVP — modulo di cancelleria ═══════════ */

.section--rsvp .rsvp,
.section--rsvp .rsvp__success {
  max-width: 520px;
  margin-inline: auto;
}

.rsvp {
  display: grid;
  gap: 1.9rem;
  text-align: left;
}

/* display:grid vincerebbe sull'attributo hidden dopo l'invio */
.rsvp[hidden] { display: none; }

.rsvp__field { display: flex; flex-direction: column; gap: .4rem; }

.rsvp__field label {
  font-size: .68rem;
  font-weight: 400;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.rsvp__field input,
.rsvp__field textarea {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--taupe);
  border-radius: 0;
  padding: .55rem .1rem;
  outline: none;
  transition: border-color .35s;
  resize: vertical;
}

.rsvp__field input::placeholder,
.rsvp__field textarea::placeholder {
  color: var(--taupe);
  font-style: italic;
}

.rsvp__field input:focus,
.rsvp__field textarea:focus { border-color: var(--camel); }

.rsvp__submit {
  justify-self: center;
  margin-top: .6rem;
  font-family: var(--font-sans);
  font-size: .78rem;
  font-weight: 400;
  letter-spacing: .32em;
  text-indent: .32em;
  text-transform: uppercase;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--ink);
  padding: 1rem 2.6rem;
  cursor: pointer;
  transition: background .35s, color .35s, border-color .35s;
}

.rsvp__submit:hover {
  background: var(--ink);
  color: var(--cream);
}

.rsvp__submit:disabled {
  opacity: .55;
  cursor: default;
  background: transparent;
  color: var(--ink);
}

.rsvp__error {
  text-align: center;
  font-size: .92rem;
  color: #9c4a3a; /* terracotta: visibile ma coerente con la palette */
}

.rsvp__success {
  padding: 2.6rem 1.5rem 1rem;
  animation: successIn .7s var(--ease-out) both;
}

@keyframes successIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

.rsvp__success-art {
  display: block;
  width: 96px;
  height: 72px;
  margin: 0 auto 1.4rem;
  color: var(--camel);
}

.rsvp__success-title {
  font-family: var(--font-serif);
  font-size: 1.7rem;
  font-weight: 500;
  margin-bottom: .4rem;
}

.rsvp__success-text { color: var(--ink-soft); }

/* ═══════════ Chiusura ═══════════ */

/* prosegue la fascia sabbia dell'RSVP fino al fondo della pagina */
.closing {
  background: var(--sand);
  padding: 0 1.5rem clamp(3rem, 8vw, 5rem);
  color: var(--camel);
}

/* ═══════════ Responsive & motion ═══════════ */

@media (max-width: 760px) {
  .details { grid-template-columns: 1fr; }

  /* i filetti verticali diventano rametti orizzontali */
  .details__rule {
    width: min(180px, 50vw);
    height: 1px;
    min-height: 0;
    margin: .6rem auto;
  }
}

@media (max-width: 560px) {
  .hero__corner--tl, .hero__corner--tr { display: none; }
  .hero__note { max-width: 250px; } /* non tocca i rametti d'angolo */
}

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