/* ==========================================================
   Invito di matrimonio — mobile first
   ========================================================== */
:root {
  --cream: #f6f1e9;
  --cream-2: #efe7da;
  --ink: #3a3f36;
  --muted: #7b8074;
  --sage: #8a9a82;
  --sage-dark: #5d6e57;
  --gold: #b08d57;
  --blush: #e9d8cf;
  --line: rgba(58, 63, 54, .18);
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Jost', system-ui, -apple-system, sans-serif;
  --script: 'Pinyon Script', cursive;
  --pad: clamp(20px, 6vw, 48px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.locked { overflow: hidden; height: 100svh; }
img, svg { max-width: 100%; }
a { color: inherit; }

.script { font-family: var(--script); font-weight: 400; line-height: 1.05; }
.eyebrow {
  font-family: var(--sans);
  font-size: .72rem;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 .8rem;
}
.h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.9rem, 7.5vw, 2.8rem);
  line-height: 1.15;
  margin: 0 0 1.2rem;
}
.lead { font-size: clamp(1.1rem, 4.4vw, 1.35rem); font-style: italic; color: #4c5247; margin: 0 auto; max-width: 34ch; }
.lead--sm { font-size: 1.05rem; font-style: normal; font-family: var(--sans); font-weight: 300; max-width: 38ch; }
.lead--sm strong { font-weight: 500; color: var(--sage-dark); }

.divider { width: 160px; height: 16px; color: var(--gold); display: block; margin: 1.2rem auto; }

/* ---------- Sezioni ---------- */
.section { padding: clamp(64px, 14vw, 110px) var(--pad); max-width: 820px; margin: 0 auto; }
.section--center { text-align: center; }
.section--tint {
  max-width: none;
  background: var(--cream-2);
}
.section--tint > * { max-width: 720px; margin-left: auto; margin-right: auto; }

/* ---------- Splash ---------- */
.splash {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background:
    radial-gradient(circle at 20% 10%, rgba(176,141,87,.12), transparent 50%),
    radial-gradient(circle at 80% 90%, rgba(138,154,130,.18), transparent 55%),
    var(--cream);
  text-align: center;
  padding: var(--pad);
  transition: opacity .9s ease, visibility .9s ease, transform .9s ease;
}
.no-js .splash { display: none; }
.splash.is-open { opacity: 0; visibility: hidden; transform: scale(1.04); }
.splash__inner { display: flex; flex-direction: column; align-items: center; gap: 1.2rem; }
.splash__names { font-size: clamp(3.4rem, 17vw, 5.4rem); margin: 0 0 .8rem; color: var(--sage-dark); }
.splash__names span { color: var(--gold); font-size: .6em; padding: 0 .1em; }

/* ---------- Bottoni ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  font-family: var(--sans);
  font-size: .78rem; letter-spacing: .22em; text-transform: uppercase; font-weight: 500;
  text-decoration: none;
  padding: 1rem 1.8rem;
  min-height: 48px;
  border-radius: 999px;
  border: 1px solid var(--sage-dark);
  cursor: pointer;
  transition: background .25s, color .25s, transform .15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); }
.btn--solid { background: var(--sage-dark); color: #fff; }
.btn--solid:hover { background: #4b5a46; }
.btn--ghost { background: transparent; color: var(--sage-dark); }
.btn--ghost:hover { background: var(--sage-dark); color: #fff; }
.btn--wa { background: #25a057; border-color: #25a057; }
.btn--wa:hover { background: #1e8847; }
.btn--mail { background: var(--sage-dark); border-color: var(--sage-dark); }
.btn--mail:hover { background: #4b5a46; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid; place-items: center;
  text-align: center;
  padding: 80px var(--pad) 100px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(233,216,207,.7), transparent 60%),
    var(--cream);
}
.hero__sprig {
  position: absolute; bottom: -20px;
  width: clamp(110px, 32vw, 190px); height: clamp(200px, 58vw, 340px);
  color: var(--sage); opacity: .55;
  pointer-events: none;
}
.hero__sprig--l { left: -18px; transform: rotate(12deg); transform-origin: bottom center; }
.hero__sprig--r { right: -18px; transform: rotate(-12deg) scaleX(-1); transform-origin: bottom center; }
.hero__content { position: relative; z-index: 1; }
.hero__names { font-size: clamp(3.8rem, 20vw, 6.5rem); margin: 0; color: var(--sage-dark); }
.hero__names .amp { display: block; font-size: .5em; color: var(--gold); margin: -.05em 0; }
.hero__lead { font-style: italic; font-size: 1.3rem; margin: .2rem 0 1rem; }
.hero__date {
  font-family: var(--sans); font-weight: 400;
  letter-spacing: .26em; text-transform: uppercase; font-size: .85rem; margin: 0 0 .4rem;
}
.hero__place { font-style: italic; color: var(--muted); margin: 0; }
.scroll-cue {
  position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%);
  width: 26px; height: 42px; border: 1px solid var(--sage-dark); border-radius: 14px; opacity: .7;
}
.scroll-cue span {
  position: absolute; top: 8px; left: 50%; width: 3px; height: 8px; margin-left: -1.5px;
  background: var(--sage-dark); border-radius: 2px; animation: cue 1.8s infinite;
}
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

.signature { font-size: 2.6rem; color: var(--sage-dark); margin: 1.6rem 0 0; }

/* ---------- Countdown ---------- */
.countdown {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  margin: 1.6rem auto 2rem; max-width: 460px;
}
.cd {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 4px 12px;
}
.cd b { display: block; font-family: var(--serif); font-weight: 500; font-size: clamp(1.8rem, 9vw, 2.6rem); line-height: 1; color: var(--sage-dark); font-variant-numeric: tabular-nums; }
.cd span { font-family: var(--sans); font-size: .62rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.countdown--done { display: block; font-size: 1.6rem; font-style: italic; color: var(--sage-dark); }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 2rem 0 0; padding: 0 0 0 0; position: relative; }
.timeline::before {
  content: ''; position: absolute; left: 76px; top: 8px; bottom: 8px; width: 1px; background: var(--line);
}
.timeline li { display: grid; grid-template-columns: 62px 1fr; gap: 28px; padding: 0 0 2rem; position: relative; }
.timeline li::after {
  content: ''; position: absolute; left: 72px; top: 8px; width: 9px; height: 9px;
  border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px var(--cream);
}
.timeline time { font-family: var(--sans); font-size: .9rem; letter-spacing: .08em; color: var(--gold); padding-top: 2px; text-align: right; }
.timeline h3 { margin: 0 0 .2rem; font-weight: 600; font-size: 1.3rem; }
.timeline p { margin: 0; color: var(--muted); font-size: 1rem; }

/* ---------- Luoghi ---------- */
#luoghi { position: relative; overflow: hidden; }
#luoghi .luogo-background-img {
  position: absolute; inset: 0; z-index: 0;
  max-width: none; margin: 0;
  pointer-events: none;
  filter: blur(5px); opacity: 1;
  transform: scale(1.08);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-image: url('../img/villa-loreto-2.avif');
}
#luoghi > :not(.luogo-background-img) { position: relative; z-index: 1; }
#luoghi .section--center {
  width: fit-content;
  padding: 1rem 1.7rem .2rem;
  background: rgba(246, 241, 233, .9);
  border-radius: 18px;
  box-shadow: 0 10px 28px rgba(58, 63, 54, .16);
}
#luoghi .section--center .eyebrow { margin-bottom: .35rem; }
#luoghi .section--center .h2 { margin-bottom: .45rem; }

/* ---------- Cards / info ---------- */
.cards { display: grid; gap: 18px; margin: 2rem auto 0; }
.section--tint > .cards { max-width: 420px; }
.card {
  background: var(--cream); border: 1px solid var(--line); border-radius: 20px;
  padding: 28px 22px; text-align: center;
}
#luoghi .card { background: rgba(246, 241, 233, .9); }
.card h3, .info h3 { font-weight: 600; font-size: 1.4rem; margin: 0 0 .5rem; }
.card p { margin: 0 0 1.3rem; color: var(--muted); }

.info-grid { display: grid; gap: 14px; margin-top: 2rem; }
.info { border-top: 1px solid var(--line); padding: 1.2rem 0 .4rem; text-align: center; }
.info h3 { color: var(--sage-dark); font-style: italic; }
.info p { margin: 0 auto; max-width: 34ch; color: #555b4f; font-size: 1.02rem; }
.info__pay { max-width: 42ch; }
.info__copy {
  display: block;
  width: 100%;
  margin: .35rem auto 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  white-space: nowrap;
}
.info__copy:hover,
.info__copy:focus-visible {
  color: var(--sage-dark);
  text-decoration: underline;
  text-underline-offset: .18em;
}
.info__copy.is-copied { color: var(--sage-dark); }
.info__iban {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: .78rem;
  letter-spacing: .03em;
}

/* ---------- Form ---------- */
.form { margin: 2rem auto 0; max-width: 520px; text-align: left; }
.field { margin: 0 0 1.4rem; border: 0; padding: 0; min-width: 0; }
.field label, .field legend {
  display: block; padding: 0;
  font-family: var(--sans); font-size: .72rem; letter-spacing: .2em; text-transform: uppercase;
  color: var(--sage-dark); margin-bottom: .5rem; font-weight: 500;
}
.field label em { text-transform: none; letter-spacing: 0; font-family: var(--serif); color: var(--muted); font-size: .95rem; }
input[type=text], input[type=number], textarea {
  width: 100%;
  font: inherit; font-size: 16px; /* evita lo zoom su iOS */
  color: var(--ink);
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  -webkit-appearance: none; appearance: none;
}
textarea { resize: vertical; min-height: 96px; }
textarea:disabled { opacity: .4; cursor: not-allowed; }
input:focus, textarea:focus { border-color: var(--sage-dark); box-shadow: 0 0 0 3px rgba(93,110,87,.15); }
.field.invalid input[type=text], .field.invalid textarea { border-color: #b4483c; }
.err { display: none; color: #b4483c; font-family: var(--sans); font-size: .8rem; margin-top: .4rem; }
.field.invalid .err { display: block; }

.choice { display: grid; gap: 10px; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice label {
  margin: 0; text-transform: none; letter-spacing: 0;
  font-family: var(--serif); font-size: 1.15rem; font-weight: 500; color: var(--ink);
  border: 1px solid var(--line); border-radius: 12px; background: var(--cream);
  padding: 14px 16px; cursor: pointer; text-align: center;
  transition: all .2s;
}
.choice input:checked + label { background: var(--sage-dark); border-color: var(--sage-dark); color: #fff; }
.choice input:focus-visible + label { box-shadow: 0 0 0 3px rgba(93,110,87,.3); }
.choice input:disabled + label { opacity: .4; cursor: not-allowed; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stepper { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; border: 1px solid var(--line); border-radius: 12px; background: var(--cream); overflow: hidden; }
.stepper button {
  height: 50px; border: 0; background: transparent; font-size: 1.4rem; color: var(--sage-dark); cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.stepper button:active { background: var(--cream-2); }
.stepper input { border: 0; border-radius: 0; text-align: center; padding: 14px 0; background: transparent; -moz-appearance: textfield; appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; appearance: none; margin: 0; }
.stepper input:focus { box-shadow: none; }

.extra[hidden] { display: none; }

.guest-rows { display: grid; gap: 12px; }
.guest {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 16px 6px;
}
.guest__title {
  margin: 0 0 .85rem;
  font-family: var(--sans);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold);
}
.guest .field { margin-bottom: .85rem; }
.guest input[readonly] {
  color: var(--ink);
  background: var(--cream-2);
  border-color: transparent;
}
.guest__hint {
  display: block;
  margin-top: .4rem;
  font-family: var(--sans);
  font-size: .8rem;
  color: var(--muted);
}
.guest__allergy[hidden] { display: none; }

.switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin: 0 0 .85rem;
  cursor: pointer;
}
.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.switch__track {
  position: relative;
  flex: none;
  width: 42px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--cream-2);
  transition: background .2s, border-color .2s;
}
.switch__track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(58, 63, 54, .18);
  transition: transform .2s;
}
.switch input:checked + .switch__track {
  background: var(--sage-dark);
  border-color: var(--sage-dark);
}
.switch input:checked + .switch__track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch__track { box-shadow: 0 0 0 3px rgba(93, 110, 87, .3); }
.switch__text {
  font-family: var(--sans);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--sage-dark);
}
.form__send { display: grid; gap: 10px; }
.form__send .btn { width: 100%; }
.hint { font-family: var(--sans); font-size: .78rem; color: var(--muted); text-align: center; margin: 1rem 0 0; }

/* ---------- Footer ---------- */
.footer { padding: 70px var(--pad) calc(60px + env(safe-area-inset-bottom)); background: var(--sage-dark); color: #f3efe6; }
.footer .divider { color: var(--gold); }
.footer__names { font-size: 3.2rem; margin: 0; }
.footer__date { font-family: var(--sans); letter-spacing: .3em; font-size: .85rem; margin: .6rem 0 1.4rem; }
.footer__small { font-style: italic; opacity: .85; margin: 0; }
.footer__credits { font-size: .8rem; margin-top: 2rem; text-align: center; opacity: .7; }
.footer__credits span { color: var(--gold); }
.footer__credits a { color: inherit; text-decoration: none; }
.footer__credits a:hover { text-decoration: underline; }

/* ---------- Reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .9s ease, transform .9s ease; }
.js .reveal.in { opacity: 1; transform: none; }

@media (min-width: 640px) {
  .info-grid { grid-template-columns: 1fr 1fr; gap: 20px 40px; }
  .choice { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 800px) {
  .timeline::before { left: 50%; transform: translateX(-50%); }
  .timeline li { grid-template-columns: 1fr 1fr; column-gap: 56px; }
  .timeline li::after { left: 50%; transform: translateX(-50%); }
}

/* ---------- Menu ---------- */
.site-nav {
  position: fixed;
  z-index: 120;
  top: max(16px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
}
html.js body:has(#splash) .site-nav { visibility: hidden; pointer-events: none; }
.site-nav__btn {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(246, 241, 233, .94);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.site-nav__bars,
.site-nav__bars::before,
.site-nav__bars::after {
  display: block;
  width: 18px; height: 1.5px;
  background: var(--sage-dark);
  border-radius: 1px;
}
.site-nav__bars { position: relative; }
.site-nav__bars::before,
.site-nav__bars::after {
  content: '';
  position: absolute; left: 0;
  transition: transform .2s ease, top .2s ease;
}
.site-nav__bars::before { top: -6px; }
.site-nav__bars::after { top: 6px; }
.site-nav__btn[aria-expanded="true"] .site-nav__bars { background: transparent; }
.site-nav__btn[aria-expanded="true"] .site-nav__bars::before { top: 0; transform: rotate(45deg); }
.site-nav__btn[aria-expanded="true"] .site-nav__bars::after { top: 0; transform: rotate(-45deg); }
.site-nav__panel {
  position: absolute; top: 58px; right: 0;
  min-width: 210px;
  display: flex; flex-direction: column;
  padding: .35rem;
  background: rgba(246, 241, 233, .96);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(58, 63, 54, .16);
}
.site-nav__panel[hidden] { display: none; }
.site-nav__panel a {
  font-family: var(--sans);
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--sage-dark);
  padding: .9rem 1.05rem;
  border-radius: 12px;
}
.site-nav__panel a[aria-current="page"] { background: var(--cream-2); color: var(--ink); }
.site-nav__panel a:hover { background: var(--cream-2); }

/* ---------- Pagine del giorno (/menu, /foto-e-video) ---------- */
.day-page { min-height: 100svh; display: flex; flex-direction: column; }
.day {
  flex: 1;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: calc(clamp(76px, 14vw, 104px) + env(safe-area-inset-top)) var(--pad) clamp(48px, 10vw, 80px);
  text-align: center;
}
.day__names { font-size: clamp(2.8rem, 12vw, 4.2rem); margin: 0; color: var(--sage-dark); }
.day__names span { color: var(--gold); font-size: .6em; padding: 0 .12em; }
.day__panel { display: none; }
html.day-pending .day__panel { display: none; }
html.no-js.day-pending .day__panel--wait { display: block; }
html.day-wait .day__panel--wait,
html.day-open .day__panel--open,
html.day-after .day__panel--after { display: block; }
.day__panel .h2 { margin-bottom: .8rem; }
.day__panel .lead { margin-bottom: 0; }
.courses { list-style: none; margin: 2rem 0 0; padding: 0; }
.courses > li { padding: 1.15rem 0; border-top: 1px solid var(--line); }
.courses > li:last-child { border-bottom: 1px solid var(--line); }
.courses h2 {
  margin: 0 0 .25rem;
  font-family: var(--sans);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--gold);
}
.courses ul {
  list-style: none;
  margin: .45rem 0 0;
  padding: 0;
}
.courses li li {
  padding: .28rem 0;
  border: 0;
  font-size: 1.2rem;
}
.courses li li::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 .65rem .14rem 0;
  border: 1px solid var(--gold);
  transform: rotate(45deg);
  vertical-align: middle;
}
.day__cta { margin-top: 2rem; }
.day__cta .btn { width: 100%; max-width: 420px; }
.day__back {
  display: inline-block;
  margin-top: 2.2rem;
  font-family: var(--sans);
  font-size: .72rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--sage-dark);
}
.day__back:hover { text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .scroll-cue span { animation: none; }
  .splash, .switch__track, .switch__track::after, .site-nav__bars::before, .site-nav__bars::after { transition: none; }
}
