/* ===========================================================================
   WEDDING HUB — guest site
   Four themes, one stylesheet. Set data-theme on <html>; every colour below
   is a token, so a couple's whole look is one dropdown in the admin.
   =========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400&family=Inter:wght@300;400;500;600&display=swap');

/* ---------------------------------------------------------------- tokens -- */
:root {
  --font-display: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --step--1: clamp(0.82rem, 0.78rem + 0.18vw, 0.92rem);
  --step-0:  clamp(1rem, 0.95rem + 0.25vw, 1.12rem);
  --step-1:  clamp(1.25rem, 1.1rem + 0.7vw, 1.6rem);
  --step-2:  clamp(1.7rem, 1.4rem + 1.4vw, 2.6rem);
  --step-3:  clamp(2.4rem, 1.7rem + 3.2vw, 4.5rem);
  --step-4:  clamp(3rem, 1.8rem + 5.6vw, 7rem);

  --space: clamp(1.25rem, 0.9rem + 1.6vw, 2.5rem);
  --section-y: clamp(4rem, 2.5rem + 6vw, 9rem);
  --measure: 62ch;
  --radius: 3px;
  --shadow-soft: 0 1px 2px rgb(0 0 0 / 4%), 0 8px 28px -12px rgb(0 0 0 / 14%);
  --shadow-lift: 0 2px 6px rgb(0 0 0 / 6%), 0 18px 48px -18px rgb(0 0 0 / 22%);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* Ivory & Sage — the default. Understated, modern, works for most couples. */
:root, [data-theme='ivory-sage'] {
  --bg: #fbf9f4;  --bg-alt: #f4f1e8;  --card: #ffffff;
  --ink: #2b2f29; --muted: #666c62;   --line: #e2ddd0;
  --accent: #63755a; --accent-ink: #ffffff; --accent-soft: #edf0e8;
  --scrim: 18, 22, 17;
}
[data-theme='blush-gold'] {
  --bg: #fdf8f6;  --bg-alt: #f8ece7;  --card: #ffffff;
  --ink: #362527; --muted: #74605f;   --line: #eedcd5;
  --accent: #9c6f45; --accent-ink: #ffffff; --accent-soft: #f6ebe1;
  --scrim: 40, 24, 22;
}
[data-theme='midnight-ink'] {
  --bg: #13161b;  --bg-alt: #1a1e25;  --card: #1c2129;
  --ink: #eeece6; --muted: #a4a9b2;   --line: #2c323b;
  --accent: #c6a052; --accent-ink: #14171c; --accent-soft: #232833;
  --scrim: 6, 8, 11;
}
[data-theme='coastal-linen'] {
  --bg: #f7f8f8;  --bg-alt: #eaeef0;  --card: #ffffff;
  --ink: #232e37; --muted: #5f6d79;   --line: #dbe2e5;
  --accent: #5c7f93; --accent-ink: #ffffff; --accent-soft: #e7eef1;
  --scrim: 16, 26, 33;
}

/* ------------------------------------------------------------------ base -- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  font-weight: 300;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.wrap { width: min(100% - 2.5rem, 68rem); margin-inline: auto; }
.wrap--narrow { width: min(100% - 2.5rem, 46rem); margin-inline: auto; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--accent); color: var(--accent-ink);
  padding: 0.75rem 1.25rem; font-size: var(--step--1);
}
.skip-link:focus { left: 0; }

/* --------------------------------------------------------------- display -- */
.display {
  font-family: var(--font-display);
  font-weight: 300;
  line-height: 1.04;
  letter-spacing: -0.015em;
  margin: 0;
}
.eyebrow {
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-weight: 500;
  color: var(--muted);
  margin: 0 0 1.25rem;
}
.lede { font-size: var(--step-1); font-family: var(--font-display); line-height: 1.45; color: var(--muted); }
.rule { width: 3.5rem; height: 1px; background: var(--accent); border: 0; margin: 1.75rem 0; }
.rule--center { margin-inline: auto; }

/* ------------------------------------------------------------------ hero -- */
.hero {
  position: relative;
  min-height: min(92svh, 54rem);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 6rem 1.5rem 4rem;
  overflow: hidden;
  isolation: isolate;
}
.hero__media {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%; object-fit: cover;
}
.hero::after {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(to bottom,
      rgb(var(--scrim) / 42%) 0%,
      rgb(var(--scrim) / 22%) 42%,
      rgb(var(--scrim) / 58%) 100%);
}
.hero--noimage { background: var(--bg-alt); }
.hero--noimage::after { background: none; }
.hero--noimage .hero__inner { color: var(--ink); text-shadow: none; }

.hero__inner { color: #fff; max-width: 46rem; text-shadow: 0 1px 30px rgb(var(--scrim) / 35%); }
.hero__names { font-size: var(--step-4); font-family: var(--font-display); font-weight: 300; line-height: 0.98; margin: 0; }
.hero__amp { display: block; font-style: italic; font-size: 0.42em; opacity: 0.85; margin: 0.35em 0; }
.hero__meta {
  margin-top: 2rem; font-size: var(--step--1);
  text-transform: uppercase; letter-spacing: 0.26em; font-weight: 400;
}
.hero__meta span + span::before { content: '·'; margin: 0 0.85em; opacity: 0.6; }

.countdown {
  margin-top: 2.75rem; display: inline-flex; gap: 0.6rem; align-items: baseline;
  font-family: var(--font-display); font-size: var(--step-1);
  border-top: 1px solid rgb(255 255 255 / 35%); padding-top: 1.25rem;
}
.hero--noimage .countdown { border-color: var(--line); }

/* --------------------------------------------------------------- section -- */
.section { padding-block: var(--section-y); }
.section--alt { background: var(--bg-alt); }
.section__head { max-width: var(--measure); margin-bottom: clamp(2rem, 4vw, 3.5rem); }
.section__head--center { margin-inline: auto; text-align: center; }
.section__title { font-size: var(--step-2); }
.prose { max-width: var(--measure); color: var(--muted); }
.prose p { margin: 0 0 1.15em; }
.prose p:last-child { margin-bottom: 0; }

/* -------------------------------------------------------------- schedule -- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before {
  content: ''; position: absolute; left: 0; top: 0.6rem; bottom: 0.6rem;
  width: 1px; background: var(--line);
}
.timeline__item { position: relative; padding: 0 0 2.5rem 2.25rem; }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__item::before {
  content: ''; position: absolute; left: -3.5px; top: 0.62rem;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 4px var(--bg);
}
.section--alt .timeline__item::before { box-shadow: 0 0 0 4px var(--bg-alt); }
.timeline__time {
  font-size: var(--step--1); text-transform: uppercase;
  letter-spacing: 0.16em; color: var(--accent); font-weight: 600;
}
.timeline__title { font-family: var(--font-display); font-size: var(--step-1); margin: 0.15rem 0 0.3rem; }
.timeline__desc { color: var(--muted); margin: 0; max-width: 44ch; }

/* ----------------------------------------------------------------- cards -- */
.grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); }
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: clamp(1.5rem, 3vw, 2.25rem);
}
.card__title { font-family: var(--font-display); font-size: var(--step-1); margin: 0 0 0.6rem; }
.card__body { color: var(--muted); margin: 0; white-space: pre-line; }
.card__link {
  display: inline-block; margin-top: 1.1rem; font-size: var(--step--1);
  text-transform: uppercase; letter-spacing: 0.14em; font-weight: 500;
  color: var(--accent); text-decoration: none;
  border-bottom: 1px solid currentColor; padding-bottom: 2px;
}
.card__link:hover { opacity: 0.7; }

/* --------------------------------------------------------------- buttons -- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
  font-family: var(--font-body); font-size: var(--step--1); font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.16em;
  padding: 1rem 2.1rem; border-radius: var(--radius);
  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink);
  cursor: pointer; text-decoration: none;
  transition: transform 180ms var(--ease), opacity 180ms var(--ease), background 180ms var(--ease);
}
.btn:hover { opacity: 0.88; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn--wide { width: 100%; }

/* ------------------------------------------------------------------ form -- */
.field { margin-bottom: 1.35rem; }
.field__label {
  display: block; font-size: var(--step--1); font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
  margin-bottom: 0.5rem;
}
.input, .select, .textarea {
  width: 100%; font-family: inherit; font-size: var(--step-0); font-weight: 300;
  color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0.85rem 1rem; transition: border-color 160ms var(--ease);
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); outline-offset: 1px; }
.textarea { min-height: 6.5rem; resize: vertical; }
.field__hint { font-size: var(--step--1); color: var(--muted); margin: 0.45rem 0 0; }

.rsvp-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: clamp(1.6rem, 4vw, 3rem);
  box-shadow: var(--shadow-soft);
}
.guest-row { border-top: 1px solid var(--line); padding-top: 1.5rem; margin-top: 1.5rem; }
.guest-row:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.guest-row__name { font-family: var(--font-display); font-size: var(--step-1); margin: 0 0 0.9rem; }

.choice { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.choice__opt { flex: 1 1 8rem; }
.choice__opt input { position: absolute; opacity: 0; pointer-events: none; }
.choice__opt span {
  display: block; text-align: center; cursor: pointer;
  padding: 0.8rem 1rem; border: 1px solid var(--line); border-radius: var(--radius);
  font-size: var(--step--1); letter-spacing: 0.08em; text-transform: uppercase;
  transition: all 160ms var(--ease);
}
.choice__opt input:checked + span {
  background: var(--accent); color: var(--accent-ink); border-color: var(--accent);
}
.choice__opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 3px; }
.choice__opt span:hover { border-color: var(--accent); }

.status-note {
  border-left: 2px solid var(--accent); background: var(--accent-soft);
  padding: 1rem 1.25rem; margin-bottom: 1.75rem; font-size: var(--step--1);
  color: var(--ink);
}

/* --------------------------------------------------------------- gallery -- */
.gallery { columns: 3 16rem; column-gap: 1rem; }
.gallery__item {
  break-inside: avoid; margin-bottom: 1rem; position: relative;
  border: 0; padding: 0; background: none; cursor: zoom-in; width: 100%;
  border-radius: var(--radius); overflow: hidden; display: block;
}
.gallery__item img {
  width: 100%; height: auto; transition: transform 500ms var(--ease), filter 300ms var(--ease);
  background: var(--bg-alt);
}
.gallery__item:hover img { transform: scale(1.03); filter: brightness(1.04); }
.gallery__cap {
  position: absolute; inset: auto 0 0 0; padding: 2.5rem 0.9rem 0.75rem;
  background: linear-gradient(to top, rgb(0 0 0 / 62%), transparent);
  color: #fff; font-size: var(--step--1); text-align: left;
  opacity: 0; transition: opacity 250ms var(--ease);
}
.gallery__item:hover .gallery__cap, .gallery__item:focus-visible .gallery__cap { opacity: 1; }

.lightbox {
  position: fixed; inset: 0; z-index: 60; display: none;
  background: rgb(8 8 10 / 92%); padding: 2rem;
  place-items: center; backdrop-filter: blur(4px);
}
.lightbox[open] { display: grid; }
.lightbox img { max-width: 100%; max-height: 82svh; object-fit: contain; }
.lightbox__cap { color: #d8d8d8; text-align: center; margin-top: 1rem; font-size: var(--step--1); }
.lightbox__close, .lightbox__nav {
  position: absolute; background: rgb(255 255 255 / 10%); border: 0; color: #fff;
  width: 3rem; height: 3rem; border-radius: 50%; cursor: pointer; font-size: 1.4rem;
  display: grid; place-items: center; transition: background 160ms var(--ease);
}
.lightbox__close:hover, .lightbox__nav:hover { background: rgb(255 255 255 / 22%); }
.lightbox__close { top: 1.25rem; right: 1.25rem; }
.lightbox__nav--prev { left: 1.25rem; top: 50%; transform: translateY(-50%); }
.lightbox__nav--next { right: 1.25rem; top: 50%; transform: translateY(-50%); }

/* ----------------------------------------------------------------- nav ----- */
.nav {
  position: sticky; top: 0; z-index: 40;
  background: rgb(from var(--bg) r g b / 88%);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms var(--ease);
}
@supports not (background: rgb(from white r g b / 50%)) { .nav { background: var(--bg); } }
.nav.is-stuck { border-bottom-color: var(--line); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.9rem 0; }
.nav__brand { font-family: var(--font-display); font-size: var(--step-1); text-decoration: none; white-space: nowrap; }
.nav__links { display: flex; gap: 1.75rem; list-style: none; margin: 0; padding: 0; }
.nav__links a {
  font-size: var(--step--1); text-transform: uppercase; letter-spacing: 0.14em;
  text-decoration: none; color: var(--muted); transition: color 160ms var(--ease);
}
.nav__links a:hover { color: var(--accent); }
@media (max-width: 46rem) { .nav__links { display: none; } }

/* --------------------------------------------------------------- footer -- */
.footer {
  padding: 3.5rem 0; border-top: 1px solid var(--line);
  text-align: center; color: var(--muted); font-size: var(--step--1);
}
.footer a { color: var(--muted); }
.footer__venue { font-family: var(--font-display); font-size: var(--step-1); color: var(--ink); display: block; margin-bottom: 0.5rem; }

/* --------------------------------------------------------------- toasts -- */
.wh-toasts { position: fixed; bottom: 1.25rem; left: 50%; transform: translateX(-50%); z-index: 90; display: grid; gap: 0.5rem; width: min(92vw, 26rem); }
.wh-toast {
  background: var(--ink); color: var(--bg); padding: 0.85rem 1.15rem;
  border-radius: var(--radius); font-size: var(--step--1); box-shadow: var(--shadow-lift);
  animation: toast-in 260ms var(--ease);
}
.wh-toast--error { background: #9b2c2c; color: #fff; }
.wh-toast--success { background: var(--accent); color: var(--accent-ink); }
.wh-toast.is-out { opacity: 0; transition: opacity 300ms; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ------------------------------------------------------------- utilities -- */
.center { text-align: center; }
.stack > * + * { margin-top: 1.25rem; }
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 700ms var(--ease), transform 700ms var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.empty { color: var(--muted); text-align: center; padding: 3rem 1rem; font-family: var(--font-display); font-size: var(--step-1); }

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

@media print {
  .nav, .lightbox, .btn, .wh-toasts { display: none !important; }
  body { background: #fff; color: #000; }
}
