/* =========================================================
   Base: layout + components. Every colour/font comes from a
   CSS variable; the theme files only redefine those (plus a
   handful of theme-specific decorations).
   ========================================================= */

:root {
  --font-display: serif;
  --font-body: sans-serif;
  --font-accent: var(--font-display);

  --bg: #fff;
  --bg-alt: #f6f6f6;
  --surface: #fff;
  --text: #222;
  --text-muted: #666;
  --primary: #333;
  --primary-contrast: #fff;
  --accent: #888;
  --accent-2: #aaa;
  --border: rgba(0,0,0,.12);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 10px 30px rgba(0,0,0,.08);
  --header-h: 72px;
  --max: 1120px;
  --max-narrow: 760px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
p { margin: 0 0 1em; }
h1, h2, h3, h4 { margin: 0 0 .5em; font-family: var(--font-display); font-weight: 500; line-height: 1.15; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.amp { font-family: var(--font-accent); font-style: italic; font-weight: 400; }

.container { width: min(var(--max), 100% - 2.5rem); margin-inline: auto; position: relative; z-index: 1; }
.container--narrow { max-width: var(--max-narrow); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0 clamp(1rem, 3vw, 2.5rem);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, box-shadow .3s;
}
.site-header.is-scrolled { border-bottom-color: var(--border); box-shadow: 0 4px 24px rgba(0,0,0,.05); }
.brand { display: flex; flex-direction: column; line-height: 1; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand__names { font-family: var(--font-display); font-size: 1.5rem; letter-spacing: .04em; }
.brand__date { font-size: .72rem; letter-spacing: .18em; color: var(--text-muted); margin-top: .3rem; }

.site-nav { display: flex; gap: clamp(.6rem, 1.6vw, 1.4rem); align-items: center; }
.site-nav a { font-size: .92rem; color: var(--text); letter-spacing: .02em; padding: .3rem 0; border-bottom: 2px solid transparent; white-space: nowrap; }
.site-nav a:hover { text-decoration: none; border-bottom-color: var(--accent); }
.site-nav .nav-cta { padding: .45rem 1rem; border-radius: 999px; background: var(--primary); color: var(--primary-contrast); border: none; }
.site-nav .nav-cta:hover { filter: brightness(1.08); }

.controls { display: flex; align-items: center; gap: .5rem; }

/* pickers */
.picker { position: relative; }
.picker__btn {
  display: inline-flex; align-items: center; gap: .45rem;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 999px;
  padding: .4rem .8rem; font-size: .85rem; line-height: 1;
}
.picker__btn:hover { border-color: var(--accent); }
.picker__menu {
  position: absolute; right: 0; top: calc(100% + .5rem); min-width: 220px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); padding: .35rem; z-index: 60;
  opacity: 0; transform: translateY(-6px); pointer-events: none; transition: .18s;
}
.picker.is-open .picker__menu { opacity: 1; transform: none; pointer-events: auto; }
.picker__menu li {
  display: grid; grid-template-columns: auto 1fr; column-gap: .6rem; align-items: center;
  padding: .5rem .6rem; border-radius: 6px; cursor: pointer; font-size: .92rem;
}
.picker__menu li small { grid-column: 2; font-size: .74rem; color: var(--text-muted); }
.picker__menu li:hover, .picker__menu li[aria-selected="true"] { background: var(--bg-alt); }
.picker__menu li[aria-selected="true"] { font-weight: 600; }
.picker--lang .picker__menu li { grid-template-columns: 1fr; }

.swatch { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border); display: inline-block; }
.swatch--fiori { background: conic-gradient(#e9a97e 0 33%, #7a7d45 0 66%, #e5a4a0 0); }
.swatch--maiolica { background: conic-gradient(#1f3a93 0 50%, #f2c744 0 75%, #fff 0); }
.swatch--cartolina { background: conic-gradient(#e8672c 0 40%, #155e63 0 75%, #f3e3c3 0); }
.swatch--ulivo { background: conic-gradient(#344632 0 45%, #c39a48 0 75%, #f7f3eb 0); }
.swatch--collina { background: conic-gradient(#2f4a32 0 45%, #c4a06a 0 70%, #c9d8e0 0); }
.swatch--current { background: conic-gradient(var(--primary) 0 50%, var(--accent) 0 80%, var(--bg-alt) 0); }

.burger { display: none; width: 42px; height: 42px; border: 1px solid var(--border); border-radius: 50%; background: var(--surface); padding: 0; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.burger span { width: 18px; height: 2px; background: var(--text); transition: .2s; border-radius: 2px; }
.nav-open .burger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-open .burger span:nth-child(2) { opacity: 0; }
.nav-open .burger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 1000px) {
  .site-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow);
    padding: .5rem 1rem 1rem;
    display: none;
  }
  .nav-open .site-nav { display: flex; }
  .site-nav a { padding: .8rem .25rem; border-bottom: 1px solid var(--border); font-size: 1rem; }
  .site-nav .nav-cta { margin-top: .8rem; text-align: center; }
  .burger { display: flex; }
  .picker__label { display: none; }
  .picker--lang .picker__label { display: inline; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .8rem 1.6rem; border-radius: 999px; border: 1.5px solid transparent;
  font-size: .95rem; font-weight: 600; letter-spacing: .03em; line-height: 1;
  transition: transform .15s, box-shadow .15s, background .15s, color .15s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn--primary { background: var(--primary); color: var(--primary-contrast); box-shadow: 0 6px 18px color-mix(in srgb, var(--primary) 30%, transparent); }
.btn--ghost { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn--ghost:hover { background: var(--primary); color: var(--primary-contrast); }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .6; pointer-events: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: min(calc(100vh - var(--header-h)), 860px);
  display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: 2rem;
  width: min(var(--max), 100% - 2.5rem); margin-inline: auto; padding: 3rem 0 4rem;
  isolation: isolate;
}
.hero__deco { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.hero__inner { position: relative; z-index: 2; }
.hero__kicker { font-family: var(--font-accent); font-size: clamp(1.4rem, 2.6vw, 2rem); color: var(--accent); margin: 0 0 .2em; }
.hero__names { font-family: var(--font-display); font-size: clamp(3.4rem, 9vw, 7rem); line-height: .95; margin: 0 0 .25em; display: flex; flex-wrap: wrap; gap: 0 .25em; align-items: baseline; }
.hero__names .amp { font-size: .6em; color: var(--accent); }
.hero__date { font-size: clamp(1.15rem, 2vw, 1.5rem); margin: 0; font-family: var(--font-display); letter-spacing: .02em; }
.hero__place { color: var(--text-muted); letter-spacing: .14em; text-transform: uppercase; font-size: .8rem; margin: .3rem 0 2rem; }
.hero__cta { margin-top: 1.8rem; }

.countdown { display: inline-block; }
.countdown__title { font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--text-muted); margin: 0 0 .5rem; }
.countdown__grid { display: flex; gap: 1.2rem; }
.countdown__grid div { display: flex; flex-direction: column; align-items: center; min-width: 3.4rem; }
.countdown__grid b { font-family: var(--font-display); font-size: clamp(1.8rem, 3vw, 2.4rem); font-weight: 500; line-height: 1; color: var(--primary); }
.countdown__grid span { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); margin-top: .3rem; }

.hero__polaroid { position: relative; z-index: 1; display: flex; justify-content: center; }
.hero__cover { display: none; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; text-align: center; padding-top: 2rem; min-height: 0; }
  .hero__names { justify-content: center; }
  .countdown__grid { justify-content: center; }
  .hero__polaroid { order: -1; margin-bottom: 1rem; }
}

/* ---------- Photo frames (polaroid default) ---------- */
.frame {
  --tilt: 0deg;
  background: var(--surface); padding: .8rem .8rem 1rem; box-shadow: var(--shadow);
  transform: rotate(var(--tilt)); transition: transform .3s;
  max-width: 340px; width: 100%;
}
.frame:hover { transform: rotate(0deg) scale(1.02); }
.frame img { width: 100%; aspect-ratio: 4 / 3.6; object-fit: cover; }
.frame__caption { display: block; text-align: center; font-family: var(--font-accent); font-size: 1.25rem; margin-top: .7rem; color: var(--text); line-height: 1.2; }
.frame--hero { max-width: 380px; --tilt: 3deg; }
.frame--tilt-l { --tilt: -3deg; }
.frame--tilt-r { --tilt: 2.5deg; }

/* ---------- Sections ---------- */
.section { position: relative; padding: clamp(4rem, 8vw, 7rem) 0; isolation: isolate; }
.section__deco { position: absolute; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.section__title { font-size: clamp(2.2rem, 5vw, 3.6rem); text-align: center; margin-bottom: .6em; }
.section__subtitle { font-size: clamp(1.6rem, 3vw, 2.2rem); text-align: center; margin: 2.5rem 0 1.2rem; }
.section__lead { text-align: center; max-width: 720px; margin: 0 auto 2rem; color: var(--text-muted); font-size: 1.08rem; }

/* decorative svgs: hidden unless the theme enables them */
.deco { position: absolute; display: none; width: 160px; height: 160px; }
[data-theme="fiori"] .deco--fiori,
[data-theme="maiolica"] .deco--maiolica,
[data-theme="cartolina"] .deco--cartolina,
[data-theme="ulivo"] .deco--ulivo { display: block; }

/* ---------- Story ---------- */
.quote { margin: 0 auto 2rem; max-width: 720px; text-align: center; }
.quote__text { font-family: var(--font-display); font-style: italic; font-size: clamp(1.3rem, 2.6vw, 1.8rem); line-height: 1.35; margin: 0 0 .4em; }
.quote__by { font-style: normal; font-size: .85rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); }
.story__text { max-width: 720px; margin: 0 auto; }
.story__list { margin: 1rem 0 1.4rem; display: grid; gap: .7rem; }
.story__list li { display: grid; grid-template-columns: 2rem 1fr; gap: .6rem; align-items: start; padding: .8rem 1rem; background: var(--surface); border-radius: var(--radius-sm); border: 1px solid var(--border); }
.story__icon { font-size: 1.3rem; line-height: 1.3; }
.story__outro { text-align: center; font-size: 1.1rem; }
.story__outro strong { display: block; font-family: var(--font-display); font-size: clamp(1.6rem, 3.4vw, 2.4rem); letter-spacing: .04em; color: var(--primary); margin-top: .3rem; }

.timeline { display: grid; grid-template-columns: repeat(2, 1fr); gap: 3rem 2rem; max-width: 900px; margin: 0 auto; position: relative; }
.timeline__item { display: flex; justify-content: center; }
.timeline__item:nth-child(odd) { justify-content: flex-end; padding-right: 1rem; }
.timeline__item:nth-child(even) { justify-content: flex-start; padding-left: 1rem; margin-top: 3rem; }
.timeline__item--last { grid-column: 1 / -1; justify-content: center !important; padding: 0 !important; }
.timeline .frame { max-width: 320px; }
.timeline__item--last .frame { max-width: 380px; }
@media (max-width: 640px) {
  .timeline { grid-template-columns: 1fr; gap: 2rem; }
  .timeline__item, .timeline__item:nth-child(odd), .timeline__item:nth-child(even) { justify-content: center; padding: 0; margin-top: 0; }
}

/* ---------- Cards ---------- */
.cards { display: grid; gap: 1.5rem; }
.cards--2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); max-width: 900px; margin-inline: auto; }
.cards--3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.8rem; box-shadow: var(--shadow); position: relative; }
.card__eyebrow { display: block; font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); margin-bottom: .4rem; font-weight: 600; }
.card__title { font-size: 1.6rem; margin-bottom: .3em; }
.card__meta { color: var(--text-muted); font-size: .95rem; }
.card__icon { font-size: 1.8rem; display: block; margin-bottom: .6rem; line-height: 1; }
.card .btn { margin-top: .6rem; }
.card--venue { text-align: center; }
.card--info { text-align: center; }
.card .big { font-family: var(--font-display); font-size: 2rem; color: var(--primary); margin: 0; }
.card .ps { font-size: .9rem; color: var(--text-muted); margin-bottom: 0; }
.plain-list li { padding: .3rem 0; }

.day__date { text-align: center; font-family: var(--font-display); font-size: clamp(1.3rem, 2.5vw, 1.8rem); margin: -1rem 0 2.2rem; color: var(--accent); }
.day__calendar { text-align: center; margin: 2.2rem 0 0; }

/* hotel card */
.card--hotel { display: grid; grid-template-columns: 1fr auto auto; gap: 1.5rem; align-items: center; margin: 1.6rem 0; }
.card--hotel .card__title { margin-bottom: .1em; }
.promo { display: flex; flex-direction: column; align-items: center; text-align: center; padding: .6rem 1rem; border: 1.5px dashed var(--accent); border-radius: var(--radius-sm); }
.promo__label { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--text-muted); }
.promo__code { font-family: var(--font-display); font-size: 1.7rem; letter-spacing: .12em; color: var(--primary); line-height: 1.1; }
.promo__note { font-size: .75rem; color: var(--text-muted); max-width: 190px; }
@media (max-width: 720px) { .card--hotel { grid-template-columns: 1fr; text-align: center; } }

/* ---------- RSVP form ---------- */
.rsvp { display: grid; gap: 1.2rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(1.4rem, 4vw, 2.5rem); box-shadow: var(--shadow); }
.field { display: grid; gap: .4rem; border: 0; padding: 0; margin: 0; min-width: 0; }
.field label, .field legend { font-size: .9rem; font-weight: 600; letter-spacing: .01em; }
.field label small, .field legend small { font-weight: 400; color: var(--text-muted); }
.field input[type="text"], .field input[type="email"], .field input[type="number"], .field textarea {
  width: 100%; font: inherit; padding: .75rem .9rem; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text); transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.field textarea { resize: vertical; }
.field--small input { max-width: 160px; }
.field--radio { display: block; }
.field--radio legend { margin-bottom: .5rem; }
.radio { display: inline-flex; align-items: center; gap: .45rem; margin: 0 1.2rem .4rem 0; cursor: pointer; font-weight: 400 !important; }
.radio input { accent-color: var(--primary); width: 1.1rem; height: 1.1rem; }
.rsvp__details, .rsvp__kids { display: grid; gap: 1.2rem; }
.rsvp__kids { padding: 1rem; border-radius: var(--radius-sm); background: var(--bg-alt); }
.is-hidden { display: none !important; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.rsvp__status { margin: 0; text-align: center; min-height: 1.5em; font-size: .95rem; }
.rsvp__status.is-success { color: var(--primary); font-weight: 600; }
.rsvp__status.is-error { color: #b3261e; }

/* ---------- Explore ---------- */
.explore__block { margin-top: 1rem; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; max-width: 800px; margin: 0 auto; }
.chip { display: flex; flex-direction: column; align-items: center; }
.chip a { display: inline-block; padding: .55rem 1.1rem; border: 1.5px solid var(--primary); border-radius: 999px; color: var(--primary); font-weight: 600; font-size: .95rem; }
.chip a:hover { background: var(--primary); color: var(--primary-contrast); text-decoration: none; }
.chip__note { font-size: .72rem; color: var(--text-muted); margin-top: .25rem; max-width: 220px; text-align: center; }

.places { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.2rem; max-width: 1000px; margin: 0 auto; }
.places__group { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem 1.4rem; box-shadow: var(--shadow); }
.places__town { font-size: 1.35rem; margin: 0 0 .5rem; color: var(--primary); }
.places__list { display: grid; gap: .2rem; }
.place { display: grid; grid-template-columns: 1fr auto; column-gap: .6rem; align-items: baseline; padding: .4rem 0; border-bottom: 1px dashed var(--border); }
.place:last-child { border-bottom: 0; }
.place__name { color: var(--text); font-weight: 500; }
.place__area { grid-column: 1; font-size: .8rem; color: var(--text-muted); }
.place__price { grid-column: 2; grid-row: 1 / span 2; font-size: .85rem; letter-spacing: .05em; color: var(--accent); font-weight: 600; }
.explore__block--masserie .prose { max-width: 720px; margin: 0 auto 1.6rem; text-align: center; color: var(--text-muted); }
.explore__block--masserie .places { max-width: 760px; }

.legend { max-width: 520px; margin: 2.5rem auto 0; padding: 1rem 1.4rem; border: 1.5px dashed var(--border); border-radius: var(--radius-sm); font-size: .9rem; }
.legend h4 { margin: 0 0 .4rem; font-size: 1.1rem; }
.legend ul { display: grid; grid-template-columns: repeat(2, 1fr); gap: .25rem .8rem; }
.legend b { display: inline-block; min-width: 3.2em; color: var(--accent); }
@media (max-width: 480px) { .legend ul { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */
.site-footer { text-align: center; padding: 4rem 1.5rem 3rem; background: var(--primary); color: var(--primary-contrast); }
.footer__icon { width: 28px; height: 28px; fill: var(--accent); margin: 0 auto .6rem; display: block; }
.footer__names { font-family: var(--font-display); font-size: 2.2rem; margin: 0 0 .2em; }
.footer__date { margin: 0 0 .6em; letter-spacing: .12em; text-transform: uppercase; font-size: .78rem; opacity: .85; }
.footer__made { margin: 0; font-size: .85rem; opacity: .7; font-style: italic; }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
.section.reveal { transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}
