/* ---------------------------------------------------------------
   Wedding site — design tokens.
   Change these six colours and the whole site changes with them.
   --------------------------------------------------------------- */
:root {
  --sand: #f6f1ea;
  --sand-deep: #ece3d7;
  --ink: #2f2a26;
  --ink-soft: #6d6259;
  --accent: #9c6f52;
  --accent-deep: #7d5540;
  --white: #fffdfa;
  --line: rgba(47, 42, 38, 0.12);

  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --wrap: 68rem;
  --radius: 14px;
  --shadow: 0 10px 40px rgba(47, 42, 38, 0.08);
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--sans);
  font-weight: 300;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--sand);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.15; margin: 0 0 0.5em; }
p { margin: 0 0 1rem; }
a { color: var(--accent-deep); }
img { max-width: 100%; display: block; }

.skip-link {
  position: absolute; left: -9999px; top: 0; background: var(--ink); color: var(--white);
  padding: 0.75rem 1rem; z-index: 100;
}
.skip-link:focus { left: 0; }

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

/* ------------------------------ header ------------------------------ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0.9rem clamp(1rem, 4vw, 3rem);
  background: rgba(246, 241, 234, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand {
  font-family: var(--serif); font-size: 1.35rem; letter-spacing: 0.06em;
  text-decoration: none; color: var(--ink);
}
.brand span { color: var(--accent); }
.site-nav { display: flex; gap: 1.4rem; align-items: center; }
.site-nav a {
  text-decoration: none; color: var(--ink-soft); font-size: 0.85rem;
  letter-spacing: 0.09em; text-transform: uppercase;
}
.site-nav a:hover { color: var(--accent-deep); }
.nav-cta {
  border: 1px solid var(--accent); border-radius: 999px;
  padding: 0.4rem 1.1rem; color: var(--accent-deep) !important;
}
.nav-cta:hover { background: var(--accent); color: var(--white) !important; }

.nav-toggle {
  display: none; flex-direction: column; gap: 5px; background: none;
  border: 0; cursor: pointer; padding: 0.5rem;
}
.nav-toggle span { width: 24px; height: 2px; background: var(--ink); transition: 0.2s; }

@media (max-width: 780px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: absolute; inset: 100% 0 auto 0; flex-direction: column; align-items: flex-start;
    gap: 0.9rem; padding: 1.4rem clamp(1rem, 4vw, 3rem) 2rem;
    background: var(--sand); border-bottom: 1px solid var(--line);
    display: none;
  }
  .site-nav.open { display: flex; }
}

/* ------------------------------- hero ------------------------------- */
.hero {
  position: relative;
  /* A framed photo rather than a full-bleed screen. */
  max-width: 68rem;
  margin: clamp(1rem, 3vw, 2.25rem) auto 0;
  border-radius: clamp(12px, 2vw, 20px);
  overflow: hidden;
  min-height: min(64vh, 560px);
  display: grid;
  /* names at the top, the middle left clear for us, buttons at the foot */
  grid-template-rows: auto;
  align-items: start;
  text-align: center;
  padding: clamp(1.75rem, 5vw, 3rem) 1.25rem clamp(1.75rem, 4vw, 2.5rem);
  color: var(--white);
  background: var(--ink);
  box-shadow: var(--shadow);
  isolation: isolate;
}

/* The photo itself. */
.hero-media { position: absolute; inset: 0; z-index: -2; display: block; }
.hero-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  /* Keeps the two of us in frame when the viewport crops the photo. */
  object-position: var(--hero-focus, 45% 58%);
}

/* Scrim: dark at the top and bottom so the type stays readable over the leaves. */
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(20, 26, 18, 0.62) 0%, rgba(20, 26, 18, 0.34) 34%,
                            rgba(20, 26, 18, 0.12) 62%, rgba(20, 26, 18, 0.28) 100%);
}

.hero-inner { max-width: 46rem; margin-inline: auto; }

/* Countdown and calls to action live under the photo, on the page itself. */
.hero-below {
  text-align: center;
  padding: clamp(1.75rem, 4vw, 2.5rem) 1.25rem clamp(0.5rem, 2vw, 1rem);
}
.hero-eyebrow {
  text-transform: uppercase; letter-spacing: 0.4em; font-size: 0.72rem;
  color: rgba(255, 253, 250, 0.85); margin-bottom: 1.25rem;
  text-shadow: 0 1px 12px rgba(20, 26, 18, 0.6);
}
.hero-names {
  font-size: clamp(2.4rem, 8vw, 4.6rem); margin: 0 0 0.6rem;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 0 0.35em;
  text-shadow: 0 2px 28px rgba(20, 26, 18, 0.55);
}
.hero-names .amp { color: #f0d9b8; font-style: italic; }
.hero-date {
  font-family: var(--serif); font-size: clamp(1.15rem, 3vw, 1.6rem); margin-bottom: 0.3rem;
  text-shadow: 0 1px 16px rgba(20, 26, 18, 0.6);
}
.hero-place {
  color: rgba(255, 253, 250, 0.82); letter-spacing: 0.2em; text-transform: uppercase;
  font-size: 0.75rem; text-shadow: 0 1px 14px rgba(20, 26, 18, 0.6);
}

.countdown {
  display: flex; justify-content: center; gap: clamp(0.75rem, 4vw, 2.5rem);
  margin: 0 0 1.75rem;
}
.countdown-unit { display: flex; flex-direction: column; align-items: center; min-width: 3.5rem; }
.countdown-unit span {
  font-family: var(--serif); font-size: clamp(1.5rem, 4vw, 2.2rem); line-height: 1;
  font-variant-numeric: tabular-nums;
}
.countdown-unit small {
  text-transform: uppercase; letter-spacing: 0.18em; font-size: 0.62rem;
  color: var(--ink-soft); margin-top: 0.5rem;
}
.countdown.is-past { font-family: var(--serif); font-size: 1.4rem; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; }
/* Portrait screens crop the photo hard: nudge the focus so we stay centred,
   and shrink the buttons so they don't sit on top of us. */
@media (max-width: 560px) {
  .hero {
    --hero-focus: 38% 55%;
    min-height: min(72vh, 520px);
    margin-inline: 0.75rem;
  }
  .hero::before {
    background:
      linear-gradient(180deg, rgba(20, 26, 18, 0.66) 0%, rgba(20, 26, 18, 0.38) 36%,
                              rgba(20, 26, 18, 0.14) 66%, rgba(20, 26, 18, 0.3) 100%);
  }
  .hero-actions .btn { padding: 0.7rem 1.1rem; font-size: 0.7rem; letter-spacing: 0.1em; }
  .btn-long { display: none; }
  .btn-short { display: inline; }
}

@media (prefers-reduced-motion: reduce) { /* Portrait screens crop the photo hard: nudge the focus so we stay centred,
   and shrink the buttons so they don't sit on top of us. */
@media (max-width: 560px) {
  .hero {
    --hero-focus: 38% 55%;
    min-height: min(72vh, 520px);
    margin-inline: 0.75rem;
  }
  .hero::before {
    background:
      linear-gradient(180deg, rgba(20, 26, 18, 0.66) 0%, rgba(20, 26, 18, 0.38) 36%,
                              rgba(20, 26, 18, 0.14) 66%, rgba(20, 26, 18, 0.3) 100%);
  }
  .hero-actions .btn { padding: 0.7rem 1.1rem; font-size: 0.7rem; letter-spacing: 0.1em; }
  .btn-long { display: none; }
  .btn-short { display: inline; }
}

.hero-scroll { animation: none; } }

/* ------------------------------ buttons ----------------------------- */
.btn {
  display: inline-block; text-decoration: none; cursor: pointer;
  font-family: var(--sans); font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase;
  padding: 0.85rem 1.6rem; border-radius: 999px; border: 1px solid var(--accent);
  transition: background 0.2s, color 0.2s, transform 0.2s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: var(--white); }
.btn-primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.btn-ghost { background: transparent; color: var(--accent-deep); }
.btn-ghost:hover { background: rgba(156, 111, 82, 0.1); }
.btn-small { padding: 0.5rem 1rem; font-size: 0.7rem; }

.hero .btn-primary {
  background: var(--white); color: var(--ink); border-color: var(--white);
}
.hero .btn-primary:hover { background: #f0d9b8; border-color: #f0d9b8; }
.hero .btn-ghost {
  color: var(--white); border-color: rgba(255, 253, 250, 0.6);
  background: rgba(20, 26, 18, 0.22);
  backdrop-filter: blur(4px);
}
.hero .btn-ghost:hover { background: rgba(255, 253, 250, 0.18); border-color: var(--white); }
.btn-block { width: 100%; }
.btn-short { display: none; }

/* ----------------------------- sections ----------------------------- */
.section { padding: clamp(3.5rem, 9vw, 6.5rem) clamp(1.25rem, 5vw, 3rem); }
.section > * { max-width: var(--wrap); margin-inline: auto; }
.section-alt { background: var(--white); }
.section-narrow > * { max-width: 40rem; }
.section-centered { text-align: center; }
.section-title {
  text-align: center; font-size: clamp(1.9rem, 5vw, 2.9rem); margin-bottom: 2.5rem;
}
.section-title::after {
  content: ""; display: block; width: 3rem; height: 1px;
  background: var(--accent); margin: 1rem auto 0;
}
.page-title { font-size: clamp(2rem, 6vw, 3rem); text-align: center; }
.page-lead { color: var(--ink-soft); text-align: center; margin-bottom: 2.5rem; }

/* ----------------------------- timeline ----------------------------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before {
  content: ""; position: absolute; left: 6px; top: 0.6rem; bottom: 0.6rem;
  width: 1px; background: var(--line);
}
.timeline-item { position: relative; padding-left: 2.5rem; margin-bottom: 2.5rem; }
.timeline-item::before {
  content: ""; position: absolute; left: 0; top: 0.55rem;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--sand); border: 2px solid var(--accent);
}
.timeline-date {
  display: block; text-transform: uppercase; letter-spacing: 0.2em;
  font-size: 0.7rem; color: var(--accent); margin-bottom: 0.3rem;
}
.timeline-item h3 { font-size: 1.5rem; }
.timeline-item p { color: var(--ink-soft); margin: 0; }

/* ----------------------------- schedule ----------------------------- */
.schedule { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); }
.schedule-item {
  display: flex; gap: 1rem; align-items: flex-start;
  background: var(--sand); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.25rem;
}
.section-alt .schedule-item { background: var(--sand); }
.schedule-icon { font-size: 1.5rem; line-height: 1.4; }
.schedule-time {
  font-family: var(--serif); font-size: 1.05rem; color: var(--accent);
  margin: 0 0 0.15rem; letter-spacing: 0.05em;
}
.schedule-item h3 { font-size: 1.2rem; margin-bottom: 0.25rem; }
.schedule-item p { margin: 0; color: var(--ink-soft); font-size: 0.92rem; }
.dress-code {
  margin-top: 2rem; text-align: center; color: var(--ink-soft);
  border-top: 1px solid var(--line); padding-top: 1.5rem;
}

/* ------------------------------ venues ------------------------------ */
.venues, .cards { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); }
.venue-card, .card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.75rem; box-shadow: var(--shadow);
}
.section-alt .card { background: var(--sand); }
.venue-kind {
  text-transform: uppercase; letter-spacing: 0.24em; font-size: 0.66rem;
  color: var(--accent); margin-bottom: 0.6rem;
}
.venue-card h3, .card h3 { font-size: 1.6rem; }
.venue-address { font-size: 0.95rem; margin-bottom: 0.5rem; }
.venue-notes { color: var(--ink-soft); font-size: 0.9rem; }

/* ------------------------------ gallery ----------------------------- */
.gallery { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.gallery-item { margin: 0; overflow: hidden; border-radius: var(--radius); background: var(--sand-deep); }
.gallery-item img {
  width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 3;
  transition: transform 0.5s ease;
}
.gallery-item:hover img { transform: scale(1.04); }

/* ------------------------------- party ------------------------------ */
.party { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); text-align: center; }
.party-name { font-family: var(--serif); font-size: 1.35rem; margin: 0; }
.party-role {
  text-transform: uppercase; letter-spacing: 0.16em; font-size: 0.68rem;
  color: var(--ink-soft); margin: 0.2rem 0 0;
}

/* -------------------------------- faq ------------------------------- */
.faq { max-width: 44rem; }
.faq-item { border-bottom: 1px solid var(--line); padding: 1rem 0; }
.faq-item summary {
  cursor: pointer; font-family: var(--serif); font-size: 1.25rem; list-style: none;
  display: flex; justify-content: space-between; gap: 1rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; color: var(--accent); font-size: 1.4rem; line-height: 1; }
.faq-item[open] summary::after { content: "–"; }
.faq-item p { margin: 0.75rem 0 0; color: var(--ink-soft); }

/* ------------------------------- forms ------------------------------ */
.section-cta { text-align: center; background: var(--sand-deep); }
.section-cta h2 { font-size: clamp(1.8rem, 5vw, 2.6rem); }

.rsvp-form { display: grid; gap: 1.4rem; }
.field { display: grid; gap: 0.4rem; border: 0; padding: 0; margin: 0; }
.field label, .field legend {
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--ink-soft);
}
.field input[type="text"], .field input[type="email"], .field input[type="number"], .field textarea {
  font-family: var(--sans); font-size: 1rem; color: var(--ink);
  background: var(--white); border: 1px solid var(--line);
  border-radius: 10px; padding: 0.8rem 0.9rem; width: 100%;
}
.field textarea { resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(156, 111, 82, 0.15); }
.field-error { color: #a33a2a; font-size: 0.85rem; margin: 0; }
.alert { border-radius: 10px; padding: 0.9rem 1rem; }
.alert-error { background: #fbe9e6; color: #a33a2a; }

.choice-group { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 0.3rem; }
.choice, .checkbox { display: flex; align-items: center; gap: 0.6rem; cursor: pointer; }
.choice {
  border: 1px solid var(--line); border-radius: 999px; padding: 0.65rem 1.2rem;
  background: var(--white); font-size: 0.95rem;
}
.choice:has(input:checked) { border-color: var(--accent); background: rgba(156, 111, 82, 0.08); }
.checkbox { font-size: 0.95rem; }
.attending-only { display: grid; gap: 1.4rem; }
.attending-only[hidden] { display: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.thanks-mark { font-size: 3rem; margin-bottom: 0.5rem; }
.thanks-note { margin-top: 2.5rem; font-size: 0.9rem; color: var(--ink-soft); }

/* ------------------------------- footer ----------------------------- */
.site-footer {
  text-align: center; padding: 3.5rem 1.5rem 3rem;
  background: var(--ink); color: var(--sand);
}
.site-footer a { color: var(--sand); }
.footer-names { font-family: var(--serif); font-size: 2rem; margin-bottom: 0.3rem; }
.footer-date, .footer-hashtag, .footer-contact { color: rgba(246, 241, 234, 0.72); font-size: 0.9rem; margin-bottom: 0.3rem; }
.footer-hashtag { letter-spacing: 0.16em; text-transform: uppercase; font-size: 0.72rem; }
.footer-legal { font-size: 0.72rem; color: rgba(246, 241, 234, 0.45); margin-top: 1.5rem; }

/* ------------------------------- admin ------------------------------ */
.admin { padding: 2rem clamp(1rem, 4vw, 3rem) 4rem; max-width: 100rem; margin-inline: auto; }
.admin-header { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; }
.admin-header h1 { font-size: 2rem; margin: 0; }
.admin-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.stats { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); margin: 2rem 0; }
.stat {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.2rem; text-align: center;
}
.stat-value { display: block; font-family: var(--serif); font-size: 2.2rem; line-height: 1; }
.stat-label { text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.65rem; color: var(--ink-soft); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.admin-table { border-collapse: collapse; width: 100%; font-size: 0.87rem; }
.admin-table th, .admin-table td { padding: 0.7rem 0.9rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.admin-table th { background: var(--sand-deep); font-weight: 500; white-space: nowrap; }
.admin-table .row-no { color: var(--ink-soft); }
.cell-message { max-width: 22rem; }
.admin-empty { margin-top: 2rem; color: var(--ink-soft); }

@media print {
  .site-header, .site-footer, .admin-actions, .hero-actions { display: none; }
  body { background: #fff; }
  /* Never let the scroll-reveal hide content on paper. */
  .js-enabled .section { opacity: 1 !important; transform: none !important; }
}

/* --------------------- scroll reveal (JS-enhanced) ------------------- */
@media (prefers-reduced-motion: no-preference) {
  .section { opacity: 1; }
  .js-enabled .section { opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease, transform 0.7s ease; }
  .js-enabled .section.is-visible { opacity: 1; transform: none; }
}
