/* =========================================================
   Laurea di Paola Dato — invito
   Palette ispirata all'invito cartaceo: avorio · bordeaux · oro · oliva
   ========================================================= */

:root {
  --cream:        #f7f2e7;
  --cream-soft:   #f1e9d8;
  --cream-deep:   #ece2cd;
  --bordeaux:     #6e1b2c;
  --bordeaux-dk:  #571320;
  --gold:         #bd9a4e;
  --gold-lt:      #d8bd7e;
  --olive:        #6e7a43;
  --olive-deep:   #4f5a2e;
  --ink:          #2a2724;
  --ink-soft:     #5b544b;

  --serif:  "Cormorant Garamond", Georgia, serif;
  --caps:   "Cinzel", Georgia, serif;
  --script: "Pinyon Script", "Cormorant Garamond", cursive;

  --maxw: 620px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--serif);
  color: var(--ink);
  background:
    radial-gradient(120% 90% at 50% 0%, var(--cream) 0%, var(--cream-soft) 55%, var(--cream-deep) 100%);
  min-height: 100svh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Texture grana carta */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ===================== Layout ===================== */
.invitation {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  padding: clamp(1rem, 4vw, 3rem);
}

.card {
  position: relative;
  width: 100%;
  max-width: var(--maxw);
  margin: clamp(1.5rem, 6vw, 4rem) 0 1rem;
  padding: clamp(2.4rem, 7vw, 4rem) clamp(1.5rem, 6vw, 3.5rem);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.5), rgba(255,255,255,0.15));
  border: 1px solid rgba(189, 154, 78, 0.55);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.6) inset,
    0 30px 70px -40px rgba(87, 19, 32, 0.45),
    0 8px 24px -18px rgba(42, 39, 36, 0.4);
}

/* Doppia cornice oro */
.card::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(189, 154, 78, 0.45);
  pointer-events: none;
}

.card__inner {
  position: relative;
  text-align: center;
}

/* Angoli decorativi */
.corner {
  position: absolute;
  width: 26px;
  height: 26px;
  z-index: 3;
  border-color: var(--gold);
  border-style: solid;
  border-width: 0;
}
.corner--tl { top: 16px;    left: 16px;    border-top-width: 2px;    border-left-width: 2px; }
.corner--tr { top: 16px;    right: 16px;   border-top-width: 2px;    border-right-width: 2px; }
.corner--bl { bottom: 16px; left: 16px;    border-bottom-width: 2px; border-left-width: 2px; }
.corner--br { bottom: 16px; right: 16px;   border-bottom-width: 2px; border-right-width: 2px; }

/* ===================== Testi ===================== */
.eyebrow {
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.1rem, 3.5vw, 1.5rem);
  color: var(--bordeaux);
  letter-spacing: 0.02em;
}

.name {
  font-family: var(--script);
  font-weight: 400;
  color: var(--bordeaux);
  font-size: clamp(4rem, 19vw, 7.5rem);
  line-height: 0.9;
  margin: 0.1em 0 0.15em;
  text-shadow: 0 2px 0 rgba(255,255,255,0.5);
}

.subtitle {
  font-family: var(--caps);
  font-weight: 500;
  font-size: clamp(0.85rem, 3.2vw, 1.2rem);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink);
  padding-left: 0.32em;
}

.invite-text {
  font-style: italic;
  font-size: clamp(1.15rem, 4.4vw, 1.7rem);
  color: var(--bordeaux);
  margin: 1.6rem 0 0.4rem;
}

/* Separatori oro con rombo */
.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  margin: 1.4rem auto;
  max-width: 320px;
}
.divider--sm { max-width: 200px; margin: 1.2rem auto; }
.divider__line {
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.divider__diamond {
  color: var(--gold);
  font-size: 0.7rem;
  line-height: 1;
}

/* Motivo SVG */
.motif {
  margin: 0.6rem auto 0.4rem;
  max-width: 320px;
}
.motif svg { width: 100%; height: auto; display: block; }

/* Dettagli evento */
.details { margin: 0.6rem 0 1.4rem; }
.venue {
  font-family: var(--caps);
  font-weight: 600;
  font-size: clamp(1.4rem, 5.5vw, 2.1rem);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding-left: 0.18em;
  color: var(--ink);
}
.address {
  font-size: clamp(1.05rem, 3.6vw, 1.3rem);
  color: var(--ink-soft);
  margin-top: 0.5rem;
}
.datetime {
  font-weight: 600;
  font-size: clamp(1.15rem, 4.2vw, 1.5rem);
  color: var(--bordeaux);
  margin-top: 0.9rem;
  display: flex;
  gap: 0.7rem;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}
.datetime .dot { color: var(--gold); }

/* ===================== Conto alla rovescia ===================== */
.countdown {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: clamp(0.4rem, 2vw, 1rem);
  margin: 0.6rem auto 1.8rem;
}
.cd-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: clamp(48px, 14vw, 64px);
}
.cd-num {
  font-family: var(--caps);
  font-weight: 600;
  font-size: clamp(1.5rem, 6vw, 2.2rem);
  color: var(--bordeaux);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.cd-lab {
  font-size: clamp(0.6rem, 2.4vw, 0.72rem);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 0.3rem;
}
.cd-sep {
  font-family: var(--caps);
  font-size: clamp(1.3rem, 5vw, 1.9rem);
  color: var(--gold);
  line-height: 1.4;
}

/* ===================== Call to action ===================== */
.cta {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.4rem;
  padding: 0.85rem 1.9rem;
  font-family: var(--caps);
  font-size: clamp(0.8rem, 3vw, 0.95rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--cream);
  background: linear-gradient(180deg, var(--bordeaux), var(--bordeaux-dk));
  border: 1px solid var(--gold);
  border-radius: 999px;
  box-shadow: 0 12px 26px -14px rgba(87, 19, 32, 0.8);
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}
.cta__icon { width: 1.25em; height: 1.25em; }
.cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px -12px rgba(87, 19, 32, 0.85), 0 0 0 3px rgba(189,154,78,0.25);
}
.cta:active { transform: translateY(0); }

.footnote {
  margin-top: 1.3rem;
  font-style: italic;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

/* ===================== Footer ===================== */
.page-footer {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 1.5rem 1rem 2.5rem;
  font-style: italic;
  font-size: 1.05rem;
  color: var(--ink-soft);
}

/* ===================== Animazioni d'ingresso ===================== */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}
.card__inner .reveal:nth-child(1)  { animation-delay: 0.10s; }
.card__inner .reveal:nth-child(2)  { animation-delay: 0.22s; }
.card__inner .reveal:nth-child(3)  { animation-delay: 0.34s; }
.card__inner .reveal:nth-child(4)  { animation-delay: 0.46s; }
.card__inner .reveal:nth-child(5)  { animation-delay: 0.58s; }
.card__inner .reveal:nth-child(6)  { animation-delay: 0.70s; }
.card__inner .reveal:nth-child(7)  { animation-delay: 0.82s; }
.card__inner .reveal:nth-child(8)  { animation-delay: 0.94s; }
.card__inner .reveal:nth-child(9)  { animation-delay: 1.06s; }
.card__inner .reveal:nth-child(10) { animation-delay: 1.18s; }
.card__inner .reveal:nth-child(11) { animation-delay: 1.30s; }

@keyframes rise {
  to { opacity: 1; transform: translateY(0); }
}

/* Lieve oscillazione del nappino */
.cap__tassel,
.cap__cord {
  transform-box: fill-box;
  transform-origin: 208px 90px;
  animation: sway 4.5s ease-in-out infinite;
}
@keyframes sway {
  0%, 100% { transform: rotate(0deg); }
  50%      { transform: rotate(4deg); }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { animation: none; opacity: 1; transform: none; }
  .cap__tassel, .cap__cord { animation: none; }
  html { scroll-behavior: auto; }
}

/* =========================================================
   Sezioni sotto l'invito: RSVP e Lista regali
   ========================================================= */
.block {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  padding: clamp(0.5rem, 4vw, 1.5rem) clamp(1rem, 4vw, 3rem);
  scroll-margin-top: 1.5rem;
}

.panel {
  width: 100%;
  max-width: var(--maxw);
  padding: clamp(1.8rem, 6vw, 3rem) clamp(1.4rem, 5vw, 2.6rem);
  text-align: center;
  background: linear-gradient(180deg, rgba(255,255,255,0.55), rgba(255,255,255,0.2));
  border: 1px solid rgba(189, 154, 78, 0.5);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.6) inset,
    0 24px 60px -42px rgba(87, 19, 32, 0.4);
}

.panel__title {
  font-family: var(--caps);
  font-weight: 600;
  font-size: clamp(1.3rem, 5vw, 1.9rem);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding-left: 0.16em;
  color: var(--ink);
}
.panel__sub {
  font-style: italic;
  font-size: clamp(1.05rem, 3.6vw, 1.25rem);
  color: var(--ink-soft);
  margin-bottom: 1.8rem;
}

/* ---------- Form ---------- */
.form { text-align: left; }
.field { margin-bottom: 1.3rem; }

.field label,
.field__label {
  display: block;
  margin-bottom: 0.5rem;
  font-family: var(--caps);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.field label em { font-style: italic; text-transform: none; letter-spacing: 0; }
.muted { color: var(--gold); font-weight: 400; }

input[type="text"],
input[type="tel"],
select,
textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  font-family: var(--serif);
  font-size: 1.1rem;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(189, 154, 78, 0.55);
  border-radius: 8px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
textarea { resize: vertical; min-height: 2.8rem; }
input::placeholder, textarea::placeholder { color: #a89e8c; }

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--bordeaux);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(189, 154, 78, 0.22);
}

/* ---------- Scelta Sì / No ---------- */
.choice { display: flex; gap: 0.8rem; flex-wrap: wrap; }
.choice__opt { flex: 1 1 0; min-width: 140px; cursor: pointer; }
.choice__opt input { position: absolute; opacity: 0; pointer-events: none; }
.choice__opt span {
  display: block;
  text-align: center;
  padding: 0.85rem 1rem;
  font-family: var(--serif);
  font-size: 1.1rem;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(189, 154, 78, 0.55);
  border-radius: 999px;
  transition: all 0.2s ease;
}
.choice__opt input:checked + span {
  background: linear-gradient(180deg, var(--bordeaux), var(--bordeaux-dk));
  color: var(--cream);
  border-color: var(--bordeaux);
  box-shadow: 0 8px 18px -12px rgba(87,19,32,0.8);
}
.choice__opt input:focus-visible + span { box-shadow: 0 0 0 3px rgba(189,154,78,0.3); }

/* ---------- Accompagnatori ---------- */
.companions { display: flex; flex-direction: column; gap: 0.7rem; margin-bottom: 1.3rem; }
.comp-row {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
  animation: rise 0.4s ease both;
}
.comp-row .comp-name { flex: 1 1 180px; }
.seg { display: inline-flex; border: 1px solid rgba(189,154,78,0.55); border-radius: 999px; overflow: hidden; }
.seg label { margin: 0; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span {
  display: block;
  padding: 0.55rem 0.95rem;
  font-family: var(--serif);
  font-size: 0.98rem;
  color: var(--ink-soft);
  transition: all 0.2s ease;
}
.seg input:checked + span { background: var(--olive); color: #fff; }

/* ---------- CTA a piena larghezza ---------- */
.cta--full { display: flex; width: 100%; justify-content: center; margin-top: 0.4rem; }
.cta[disabled] { opacity: 0.6; pointer-events: none; }

.form-status {
  margin-top: 0.9rem;
  text-align: center;
  font-style: italic;
  min-height: 1.2em;
  color: var(--bordeaux);
}

/* ---------- Ringraziamento ---------- */
.thanks { text-align: center; padding: 1rem 0; animation: rise 0.6s ease both; }
.thanks__icon { font-size: 3rem; line-height: 1; }
.thanks__title {
  font-family: var(--script);
  font-weight: 400;
  font-size: clamp(2.4rem, 9vw, 3.4rem);
  color: var(--bordeaux);
  margin: 0.2rem 0;
}
.thanks p { font-size: 1.2rem; color: var(--ink-soft); }

/* ---------- Lista regali ---------- */
.gifts__note { font-style: italic; font-size: 1.2rem; color: var(--ink-soft); line-height: 1.7; }

/* ---------- Link WhatsApp ---------- */
.wa-link { color: var(--bordeaux); text-decoration: underline; text-underline-offset: 2px; }
.wa-link:hover { color: var(--bordeaux-dk); }

/* ---------- Rivelazione allo scroll ---------- */
.reveal-on-scroll { opacity: 0; transform: translateY(22px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal-on-scroll.is-visible { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .reveal-on-scroll { opacity: 1; transform: none; transition: none; }
  .comp-row, .thanks { animation: none; }
}

/* =========================================================
   Navigazione (menù in alto, su tutte le pagine)
   ========================================================= */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: center;
  background: rgba(247, 242, 231, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(189, 154, 78, 0.3);
}
.nav__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(0.7rem, 4vw, 2rem);
  list-style: none;
  margin: 0;
  padding: 0.85rem 1rem;
}
.nav__links a {
  font-family: var(--caps);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-decoration: none;
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.nav__links a:hover { color: var(--bordeaux); }
.nav__links a.is-active { color: var(--bordeaux); border-bottom-color: var(--gold); }

/* Bottone "carica le foto" che sostituisce il countdown a conto finito */
.countdown--done { display: flex; justify-content: center; }
.cta--countdown { text-decoration: none; }

/* =========================================================
   Pagina Foto
   ========================================================= */
.photo-drop {
  border: 2px dashed rgba(189, 154, 78, 0.6);
  border-radius: 14px;
  padding: clamp(2rem, 8vw, 3.5rem) 1.5rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.4);
}
.photo-drop__icon { font-size: 3.2rem; line-height: 1; }
.photo-drop__title {
  font-family: var(--caps);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  font-size: 1rem;
  margin: 0.9rem 0 0.5rem;
}
.photo-drop__sub { color: var(--ink-soft); font-style: italic; line-height: 1.6; }

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.6rem;
  margin-top: 1.5rem;
}
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }

/* Link discreto "Area riservata" nel footer */
.footer-admin { margin-top: 0.7rem; }
.footer-admin a {
  font-family: var(--caps);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-decoration: none;
  opacity: 0.65;
  transition: color 0.2s ease, opacity 0.2s ease;
}
.footer-admin a:hover { color: var(--bordeaux); opacity: 1; }
