/* ============================================================
   Luisa & Tom — Sicily 2027
   Editorial direction (ref: Spots Travel)
   Warm cream base · brown ink · deep forest-green accent
   Cormorant (Moneta-style display) + Inter Tight (body/labels)
   ============================================================ */

/* ------------------------------------------------------------
   To use the real Kalice (licensed — free for personal use from
   margotleveque.com): drop the files into a /fonts folder, then
   uncomment the block below and put "Kalice" first in --serif.

   @font-face {
     font-family: "Kalice";
     src: url("fonts/Kalice-Regular.woff2") format("woff2");
     font-weight: 400; font-style: normal; font-display: swap;
   }
   @font-face {
     font-family: "Kalice";
     src: url("fonts/Kalice-Italic.woff2") format("woff2");
     font-weight: 400; font-style: italic; font-display: swap;
   }
   ------------------------------------------------------------ */

:root {
  --ivory:      #fef9eb;  /* warm cream base */
  --ivory-deep: #f4ecd6;  /* deeper cream — alt panels / photo fill */
  --ink:        #33292a;  /* warm near-black text */
  --ink-soft:   #6f5f52;  /* muted brown text */
  --sage:       #0a4a34;  /* accent — forest green */
  --sage-deep:  #023a29;  /* deep accent */
  --sage-light: #cadbc2;  /* soft green — tints / on-dark */
  --shadow-green: #011c14; /* dark tonal green — button offset shadow */
  --line:       #e6dcc4;  /* warm hairlines */

  --maxw: 1180px;
  --gut: clamp(1.25rem, 5vw, 4rem);

  --br-1: 4px;
  --br-2: 10px;
  --br-3: 18px;
  --pill: 999px;

  --serif: "Cormorant", Georgia, "Times New Roman", serif;
  --sans:  "Inter Tight", "Helvetica Neue", Helvetica, system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }   /* attribute must beat display rules */

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

::selection { background: var(--sage-deep); color: var(--ivory); }

/* ---------- Shared type devices ---------- */
.eyebrow {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--sage-deep);
  margin: 0;
}

.wordmark {
  font-family: var(--sans);
  font-weight: 500;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  font-size: 0.82rem;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.rule { height: 1px; background: var(--line); border: 0; }
.rule--short { width: 46px; margin: 1.1rem auto; }

/* ---------- Buttons ---------- */
.btn {
  font-family: var(--sans);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 1.9em;
  border-radius: 4px;
  border: 1.5px solid transparent;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--shadow-green);
  transition: transform .18s ease, box-shadow .18s ease,
              background .25s ease, color .25s ease, border-color .25s ease;
}
.btn:hover  { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--shadow-green); }
.btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--shadow-green); }

.btn--solid {
  background: var(--sage-deep);
  color: var(--ivory);
  border-color: var(--sage-deep);
}
.btn--solid:hover {
  background: color-mix(in srgb, var(--sage-deep) 84%, #000);
  border-color: color-mix(in srgb, var(--sage-deep) 84%, #000);
}
.btn--ghost {
  background: var(--ivory);
  color: var(--sage-deep);
  border-color: var(--sage-deep);
}
.btn--ghost:hover { background: var(--sage-deep); color: var(--ivory); border-color: var(--sage-deep); }

.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }
.btn-row--center { justify-content: center; }

/* Hero CTAs — friendlier sentence-case, prominent primary */
.hero__cta { margin-top: 1.5rem; }
.hero__cta .btn {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  font-size: 0.92rem;
  min-height: 50px;
}
.hero__cta .btn--cta { font-size: 1rem; }

/* "Add to calendar" caption + compact icon buttons */
.cal { display: flex; flex-direction: column; align-items: center; gap: 0.55rem; }
.cal__label {
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.cal__btns { display: flex; gap: 0.6rem; }
.btn--icon { width: 46px; min-height: 46px; padding: 0; }
.btn--icon svg { display: block; }
/* Diagonal "opens in a new tab" arrow inside the primary CTA */
.btn__arrow { width: 0.95em; height: 0.95em; margin-left: 0.5em; flex: none; }

/* Visible focus for keyboard users */
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--sage-deep);
  outline-offset: 3px;
}

/* ============================================================
   PASSWORD GATE
   ============================================================ */
.gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: var(--ivory);
}
.gate__inner { width: 100%; max-width: 30rem; text-align: center; }
.gate__names {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.6rem, 9vw, 4rem);
  line-height: 1;
  margin: 0.5rem 0 0;
  font-variation-settings: "opsz" 72;
}
.gate__hint {
  display: block;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin-bottom: 1.1rem;
}
.gate__form { display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; }
.gate__input {
  font-family: var(--sans);
  font-size: 1rem;
  min-height: 46px;
  padding: 0 1rem;
  min-width: 12rem;
  flex: 1 1 12rem;
  border: 1px solid var(--line);
  border-radius: var(--br-2);
  background: #fff;
  color: var(--ink);
}
.gate__input:focus { outline: none; border-color: var(--sage-deep); }
.gate__error { color: #9a3b2f; font-style: italic; margin-top: 1rem; }

/* ============================================================
   HERO  (centered — reads like an invitation)
   ============================================================ */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.15rem;
  max-width: 48rem;
  margin: 0 auto;
  padding: clamp(2.5rem, 8vw, 5.5rem) var(--gut) clamp(2rem, 6vw, 4rem);
}
.hero__names {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.9rem, 9vw, 5.25rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin: 0.2rem 0 0.5rem;
  max-width: 15ch;
}
.hero__amp { font-style: normal; font-weight: 400; color: var(--sage-deep); }
.hero__intro {
  font-family: var(--sans);
  font-size: clamp(1.02rem, 2.2vw, 1.2rem);
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 36ch;
  margin: 0.2rem auto 0.4rem;
}

/* ---------- Photo placeholders ---------- */
.photo {
  position: relative;
  background: var(--ivory-deep);
  border: 1px solid var(--line);
  border-radius: var(--br-3);
  overflow: hidden;
  margin: 0;
}
.photo--tall { aspect-ratio: 4 / 5; }
.photo--wide { aspect-ratio: 3 / 2; }
.photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
}
/* When a real image is present, drop the placeholder frame + fill */
.photo:not(.photo--polaroid):has(img) { background: none; }
.photo:has(img)::after { display: none; }
.photo__cap {
  position: absolute;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  white-space: nowrap;
}
.photo::after {   /* subtle inner frame line */
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: calc(var(--br-3) - 8px);
  pointer-events: none;
}

/* ---------- Polaroid ---------- */
.photo--polaroid {
  background: #fefefe;   /* bright near-white */
  border: 0;
  border-radius: 2px;
  aspect-ratio: auto;                 /* height follows the photo + frame */
  padding: 14px 14px 52px;            /* classic thick bottom lip */
  box-shadow: 0 16px 34px rgba(28, 20, 12, 0.22);
  transform: rotate(-2.5deg);
  transition: transform .4s ease, box-shadow .4s ease;
  width: 100%;
  max-width: 16rem;
  margin: 1.4rem auto 0.5rem;
  cursor: zoom-in;
}
.photo--polaroid img {
  position: static;                   /* flow inside the padded frame */
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center 35%;
  border-radius: 0;
}
.photo--polaroid::after { display: none; }   /* no inner frame line */
.photo--polaroid:hover {
  transform: rotate(0deg);
  box-shadow: 0 22px 44px rgba(28, 20, 12, 0.26);
}

/* ---------- Photo deck (swipe to browse, tap to enlarge) ---------- */
.deck {
  display: grid;
  justify-items: center;
  align-items: start;
  width: min(16rem, 78vw);
  margin: 1.4rem auto 0.5rem;
  touch-action: pan-y;            /* let the page scroll vertically; we handle horizontal */
}
.deck__card {
  grid-area: 1 / 1;              /* every card stacks in the same cell */
  width: 100%;
  max-width: none;
  margin: 0;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  will-change: transform;
  transform: rotate(-2.5deg);
  box-shadow: none;                     /* stacked cards must not each cast a shadow */
  touch-action: none;                   /* a finger on a card is for swiping only — never scrolls the page */
}
.deck__card:active { cursor: grabbing; }
.deck__card img { pointer-events: none; -webkit-user-drag: none; }
/* Only the front card lifts off the page — avoids 29 shadows compounding */
.deck__card:hover { box-shadow: none; }
.deck__card--front,
.deck__card--front:hover { box-shadow: 0 14px 30px rgba(28, 20, 12, 0.20); }
/* Invisible; reserves the pile's height so the space never condenses */
.deck__spacer {
  grid-area: 1 / 1;
  width: 100%;
  padding: 14px 14px 52px;
  visibility: hidden;
  pointer-events: none;
}
.deck__spacer::before { content: ""; display: block; aspect-ratio: 4 / 5; }
/* Refresh control shown once every photo has been swiped */
.deck__reset {
  grid-area: 1 / 1;
  align-self: center;
  justify-self: center;
  z-index: 60;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: var(--sage-deep);
}
.deck__reset svg {
  box-sizing: content-box;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0.85rem;
  border: 1.5px solid var(--sage-deep);
  border-radius: var(--pill);
  box-shadow: 2px 2px 0 var(--shadow-green);
  transition: transform .35s ease, box-shadow .18s ease;
}
.deck__reset:hover svg  { transform: rotate(-120deg); box-shadow: 1px 1px 0 var(--shadow-green); }
.deck__reset:active svg { transform: rotate(-300deg); box-shadow: 0 0 0 var(--shadow-green); }
.deck__reset span {
  font-family: var(--sans);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

/* ---------- Feature (full-width Baglio image) ---------- */
.feature {
  position: relative;
  width: 100%;
  margin: 0;
  aspect-ratio: 16 / 9;
  max-height: 80vh;
  overflow: hidden;
  background: var(--ivory-deep);
}
.feature img { width: 100%; height: 100%; object-fit: cover; }
.feature__cap {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 1.1rem;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-align: center;
  white-space: nowrap;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.55);
}

/* ============================================================
   INTRO STATEMENT
   ============================================================ */
.statement {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 4rem) var(--gut);
  border-top: 1px solid var(--line);
}
.statement__lead {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.5rem, 3.6vw, 2.4rem);
  line-height: 1.32;
  max-width: 22ch;
  margin: 0;
}
.statement__lead em { font-style: italic; color: var(--sage-deep); }

/* ============================================================
   SECTIONS (shared)
   ============================================================ */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(2.5rem, 7vw, 5rem) var(--gut);
  border-top: 1px solid var(--line);
}
.section__head { margin-bottom: clamp(1.5rem, 4vw, 2.5rem); }
.section__title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.9rem, 4.5vw, 3rem);
  line-height: 1.05;
  margin: 0.5rem 0 0;
}
.footnote {
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink-soft);
  margin-top: 2rem;
}
/* On the tiled band, sit the subtext on a soft cream halo so it stays legible
   without a hard plate edge against the pattern */
.band__inner .footnote {
  display: inline-block;
  background: radial-gradient(ellipse at center,
              var(--ivory) 50%, rgba(254, 249, 235, 0) 78%);
  padding: 1rem 2.75rem;
  max-width: 52ch;
}

/* ---------- Tiled band (the weekend fold) ---------- */
.band { width: 100%; }
.band--tiles {
  background-color: var(--ivory);
  /* Sicilian / Maltese majolica nod — soft tone-on-tone quatrefoil lattice, kept faint for legibility */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23a9986f' stroke-width='1' stroke-opacity='0.14'%3E%3Ccircle cx='0' cy='0' r='32'/%3E%3Ccircle cx='64' cy='0' r='32'/%3E%3Ccircle cx='0' cy='64' r='32'/%3E%3Ccircle cx='64' cy='64' r='32'/%3E%3Ccircle cx='32' cy='32' r='32'/%3E%3C/g%3E%3Cg fill='%23a9986f' fill-opacity='0.12'%3E%3Ccircle cx='26' cy='32' r='2.6'/%3E%3Ccircle cx='38' cy='32' r='2.6'/%3E%3Ccircle cx='32' cy='26' r='2.6'/%3E%3Ccircle cx='32' cy='38' r='2.6'/%3E%3Ccircle cx='0' cy='0' r='2'/%3E%3Ccircle cx='64' cy='0' r='2'/%3E%3Ccircle cx='0' cy='64' r='2'/%3E%3Ccircle cx='64' cy='64' r='2'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 72px 72px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.band__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(2.75rem, 8vw, 5.5rem) var(--gut) clamp(1.75rem, 4.5vw, 3rem);
  text-align: center;
}

/* ---------- Agenda — 50 / 50 (Friday · Saturday) ---------- */
.agenda {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.25rem;
  margin-top: clamp(1.5rem, 4vw, 2.5rem);
}
.agenda__col { padding: 0.5rem 1rem; }
.agenda__when {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--sage-deep);
  margin: 0 0 0.9rem;
}
.agenda__what {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.2rem, 5.5vw, 3.4rem);
  line-height: 1.05;
  margin: 0;
}

/* ---------- Split (travel) ---------- */
.split { display: grid; grid-template-columns: 1fr; gap: 2rem; }
.split__name {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.6rem;
  margin: 0 0 0.5rem;
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}
.split__name span {
  font-family: var(--sans);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--sage-deep);
  border: 1px solid var(--line);
  padding: 0.2em 0.5em;
}
.split__col p { margin: 0; color: var(--ink-soft); }
.pullquote {
  margin: clamp(2rem, 5vw, 3rem) 0 0;
  padding: 1.6rem 0 0;
  border-top: 1px solid var(--line);
}
.pullquote p {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.3rem, 3vw, 1.9rem);
  line-height: 1.35;
  margin: 0;
  max-width: 28ch;
}

/* ---------- Stay (index list) ---------- */
.section--stay { display: grid; grid-template-columns: 1fr; gap: clamp(1.5rem, 4vw, 3rem); }
.stay__intro p { color: var(--ink-soft); max-width: 40ch; margin: 1rem 0 0; }
.index { list-style: none; margin: 0; padding: 0; }
.index__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 1rem 0;
  border-top: 1px solid var(--line);
}
.index__row:last-child { border-bottom: 1px solid var(--line); }
.index__name { font-family: var(--serif); font-size: 1.3rem; }
.index__meta {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-align: right;
  white-space: nowrap;
}

/* ---------- FAQ ---------- */
.faqs { display: grid; grid-template-columns: 1fr; gap: 0; }
.faq { padding: 1.5rem 0; border-top: 1px solid var(--line); }
.faq:last-child { border-bottom: 1px solid var(--line); }
.faq__q { font-family: var(--serif); font-weight: 400; font-size: 1.3rem; margin: 0 0 0.4rem; }
.faq__a { margin: 0; color: var(--ink-soft); max-width: 60ch; }

/* ============================================================
   CLOSING / RSVP
   ============================================================ */
.closing {
  text-align: center;
  max-width: 46rem;
  margin: 0 auto;
  padding: clamp(3.5rem, 9vw, 6.5rem) var(--gut);
  border-top: 1px solid var(--line);
}
.closing__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  line-height: 1.05;
  margin: 0.6rem 0 1rem;
}
.closing__body { color: var(--ink-soft); max-width: 44ch; margin: 0 auto; }

.colophon {
  text-align: center;
  padding: clamp(2.5rem, 6vw, 4rem) var(--gut) 3.5rem;
  border-top: 1px solid var(--sage-deep);
  background: var(--sage-deep);
  color: var(--ivory);
}
.colophon .eyebrow { color: var(--sage-light); }
.wordmark--footer {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.9rem, 4vw, 2.5rem);
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--ivory);
  margin: 0 0 0.7rem;
}

/* ============================================================
   LIGHTBOX  (tap the polaroid to enlarge)
   ============================================================ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6vw;
  background: color-mix(in srgb, var(--ink) 84%, transparent);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  touch-action: none;   /* we handle horizontal swipes */
  animation: fade-in .3s ease both;
}
.lightbox__img {
  position: relative;
  z-index: 1;
  width: auto;
  height: auto;
  max-width: min(90vw, 620px);
  max-height: 86vh;
  object-fit: contain;
  background: #fefefe;
  padding: 16px 16px 56px;   /* enlarged polaroid frame */
  border-radius: 2px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  user-select: none;
  -webkit-user-select: none;
}
.lightbox__close,
.lightbox__nav {
  position: fixed;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--pill);
  background: var(--ivory);
  color: var(--ink);
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}
.lightbox__close {
  top: 1.1rem;
  right: 1.3rem;
  width: 2.7rem;
  height: 2.7rem;
  font-size: 1.5rem;
}
.lightbox__nav {
  top: 50%;
  transform: translateY(-50%);
  width: 3rem;
  height: 3rem;
  font-size: 1.7rem;
}
.lightbox__nav--prev { left: 1rem; }
.lightbox__nav--next { right: 1rem; }
.lightbox__count {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%);
  z-index: 2;
  margin: 0;
  color: var(--ivory);
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
}

/* ============================================================
   MOTION  (one restrained reveal)
   ============================================================ */
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

#site:not([hidden]) { animation: fade-in 1.2s ease both; }
.reveal { opacity: 0; }
.reveal.is-in { animation: fade-up 0.8s cubic-bezier(.2,.7,.2,1) both; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  #site:not([hidden]), .reveal, .reveal.is-in { animation: none; opacity: 1; transform: none; }
}

/* ============================================================
   RESPONSIVE  (mobile-first; enhancements up)
   ============================================================ */

/* Tablet+ */
@media (min-width: 720px) {
  .split { grid-template-columns: 1fr 1fr; gap: 3rem; }
  .agenda { grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 3.5rem); }
  .faqs { grid-template-columns: 1fr 1fr; column-gap: 3rem; }
  .faq { border-top: 1px solid var(--line); }
}

/* Desktop */
@media (min-width: 960px) {
  .section--stay { grid-template-columns: 0.9fr 1.1fr; align-items: start; }
}
