/* Erica & Edwin: wedding site.
   Built phone first. Each wider breakpoint adds to the layout below it. */

/* Palette drawn from the wedding inspiration board */
:root {
  --midnight: #232532;   /* deepest navy: header, footer, ink on light */
  --navy: #373e61;       /* blue */
  --accent: #642f35;     /* red: buttons, links and accents */
  --burgundy: #642f35;   /* roses and velvet: highlights, claimed states */
  --sage: #757b73;       /* foliage: secondary text, success */
  --ivory: #ffffff;      /* page background */
  --blush: #f3e7df;      /* soft rose: panels and hero wash */
  --gold: #b27a01;       /* golden brown: small labels, hairlines, ornaments and highlights */
  --card: #ffffff;       /* paper */
  --line: #e4ddcf;
  --keyline: rgba(117, 123, 115, 0.34);   /* the thin inner rule on cards and the hero */
  --muted: #6d6a72;
  --error: #8f2a2a;
  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --sans: "Jost", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 9.5rem; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--midnight);
  background: var(--ivory);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.05; margin: 0; }
h1 { font-size: clamp(2.6rem, 13vw, 7.5rem); letter-spacing: -0.01em; }
/* Headings are set in spaced capitals, like the names in the top bar. Gift names stay in normal case. */
h2 { font-size: clamp(1.9rem, 7.5vw, 3rem); font-style: normal; text-transform: uppercase; letter-spacing: 0.08em; line-height: 1.1; }
.card > h3, .faq h3 { text-transform: uppercase; letter-spacing: 0.1em; font-size: 1.3rem; }
h3 { font-size: 1.55rem; margin-bottom: 0.5rem; }
p { margin: 0 0 1rem; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.label {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--burgundy);
}

em.amp { font-style: italic; color: var(--gold); padding: 0 0.08em; }
.strong { font-weight: 500; }
.muted { color: var(--muted); }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 6px 18px -16px rgba(35, 37, 50, 0.5);
}
.topbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.3rem 1.1rem 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}
.brand {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--midnight);
  text-decoration: none;
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  min-height: 44px;
}
.brand svg, .brand img { width: 36px; height: 36px; flex: none; color: var(--burgundy); }
.brand .amp { color: var(--burgundy); font-style: italic; text-transform: none; padding: 0 0.1em; }

.nav {
  display: flex;
  gap: 1.25rem;
  justify-content: center;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  flex: none;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--midnight);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.nav a:hover, .nav a:focus-visible { color: var(--burgundy); border-color: var(--gold); outline: none; }

/* ---------- Hero: the photo fills the screen; names sit near the top, like a save-the-date ---------- */
.hero {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  min-height: calc(100vh - 92px);
  min-height: calc(100svh - 92px);
  padding: 3rem 1.25rem;
  color: var(--midnight);
  background: linear-gradient(180deg, var(--blush), var(--ivory));
}
/* With a photo: no tint over the picture, only a soft shade behind the centered words so they stay readable. */
.hero.has-photo {
  color: #fff;
  background:
    radial-gradient(ellipse 70% 55% at 50% 50%, rgba(20, 22, 30, 0.38), rgba(20, 22, 30, 0.12) 65%, rgba(20, 22, 30, 0) 100%),
    var(--hero-img) center / cover no-repeat;
}
.hero.has-photo .hero-inner { text-shadow: 0 1px 18px rgba(0, 0, 0, 0.35); }
.hero-inner { max-width: 900px; width: 100%; }
.hero-kicker { font-family: var(--serif); font-size: clamp(1.1rem, 4vw, 1.45rem); letter-spacing: 0.02em; margin: 0 0 clamp(1rem, 3vh, 1.8rem); }
.hero-names { font-family: var(--serif); font-weight: 400; font-size: clamp(2.8rem, 11vw, 6.2rem); letter-spacing: 0.01em; line-height: 1.05; margin: 0; }
.hero-names .amp { font-style: normal; color: inherit; padding: 0 0.05em; }
/* Countdown: four numbers with small labels, under the date */
.countdown { display: flex; justify-content: center; gap: clamp(0.6rem, 4vw, 2.2rem); margin: clamp(1.2rem, 3.5vh, 2rem) auto 0; }
.cd-unit { display: flex; flex-direction: column; align-items: center; min-width: 3.6rem; }
.cd-num { font-family: var(--serif); font-size: clamp(1.9rem, 7vw, 3rem); font-weight: 400; line-height: 1; font-variant-numeric: tabular-nums; }
.cd-label { font-size: 0.66rem; letter-spacing: 0.22em; text-transform: uppercase; margin-top: 0.45rem; opacity: 0.9; }
.cd-today { font-family: var(--serif); font-style: italic; font-size: clamp(1.4rem, 5vw, 2rem); margin: 0; }
.cd-unit + .cd-unit { border-left: 1px solid currentColor; padding-left: clamp(0.6rem, 4vw, 2.2rem); border-color: rgba(255, 255, 255, 0.45); }
.hero:not(.has-photo) .cd-unit + .cd-unit { border-color: var(--line); }
/* RSVP sits under the date: white outline on a photo, navy without one */
.hero-rsvp { margin-top: clamp(1.4rem, 4vh, 2.2rem); min-width: 11rem; }
.hero.has-photo .hero-rsvp { background: #fff; color: var(--midnight); border: 1px solid #fff; text-shadow: none; box-shadow: 0 6px 20px -8px rgba(0, 0, 0, 0.45); }
.hero.has-photo .hero-rsvp:hover { background: var(--ivory); }
.hero-date { font-family: var(--serif); font-size: clamp(1rem, 3.6vw, 1.3rem); font-weight: 500; letter-spacing: 0.12em; margin: clamp(1.4rem, 4.5vh, 2.6rem) 0 0; }

/* ---------- Welcome: date, venue and RSVP, just below the photo ---------- */
.welcome { text-align: center; max-width: 760px; margin: 0 auto; padding: clamp(3rem, 8vw, 4.5rem) 1.25rem clamp(1rem, 4vw, 2rem); }
.welcome .lede { margin-top: 0.8rem; }
.welcome-intro { margin: 1rem auto 0; max-width: 36rem; }
.lede { font-family: var(--serif); font-size: clamp(1.4rem, 5.5vw, 2rem); font-style: italic; margin-top: 0.4rem; line-height: 1.3; }
.venue { color: var(--muted); margin-top: 0.4rem; }
.hero-actions { display: flex; flex-direction: column; gap: 0.9rem; margin-top: 2rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0.95rem 2rem;
  font: 500 0.75rem var(--sans);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ivory);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 0;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.btn:hover, .btn:focus-visible { background: transparent; color: var(--accent); outline: none; }
.btn:disabled { opacity: 0.6; cursor: wait; }
.btn.ghost { background: transparent; color: var(--midnight); border-color: var(--midnight); }
.btn.ghost:hover { background: var(--midnight); color: var(--ivory); }
.btn.small { min-height: 46px; padding: 0.75rem 1.2rem; font-size: 0.68rem; }
.btn.block { width: 100%; }
.btn.burgundy { background: var(--burgundy); border-color: var(--burgundy); }
.btn.burgundy:hover { color: var(--burgundy); }
.btn.submit { width: 100%; }

/* ---------- Sections ---------- */
.section { max-width: 1120px; margin: 0 auto; padding: 3.75rem 1.1rem; }
.section-head { text-align: center; margin-bottom: 2.5rem; }
.section-head .label { display: block; margin-bottom: 0.8rem; color: var(--burgundy); }
.section-head h2::after {
  content: "";
  display: block;
  width: 64px;
  height: 1px;
  margin: 1rem auto 0;
  background: var(--gold);
}
.section-head p { color: var(--muted); max-width: 40rem; margin: 1rem auto 0; }

/* Paper cards with an inner keyline, like a printed invitation */
.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  padding: 1.4rem;
  box-shadow: 0 1px 0 rgba(100, 47, 53, 0.04), 0 18px 30px -26px rgba(35, 37, 50, 0.5);
}
.card::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid var(--keyline);
  pointer-events: none;
}
.card > * { position: relative; }

.two-col { display: grid; gap: 1.75rem; grid-template-columns: 1fr; }

/* Story */
.story-body p { font-family: var(--serif); font-size: 1.25rem; line-height: 1.7; color: var(--midnight); }
.story-body p:first-child::first-letter {
  font-size: 3.6em;
  float: left;
  line-height: 0.9;
  padding: 0.08em 0.1em 0 0;
  color: var(--burgundy);
}

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.2rem;
  align-items: baseline;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
}
.timeline li:last-child { border-bottom: 0; }
.time { font-family: var(--serif); font-size: 1.4rem; color: var(--burgundy); font-variant-numeric: lining-nums; }
.prose p { color: var(--muted); }
.prose p:last-child { margin-bottom: 0; }

/* ---------- Questions: tap a question to show its answer ---------- */
.faq { margin-top: 2rem; }
.faq h3 { margin-bottom: 0.6rem; }
.faq-list { border-top: 1px solid var(--line); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 56px;
  padding: 0.85rem 0.15rem;
  cursor: pointer;
  list-style: none;
  font-family: var(--serif);
  font-size: clamp(1.15rem, 4.6vw, 1.4rem);
  line-height: 1.25;
  color: var(--midnight);
  -webkit-tap-highlight-color: transparent;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:hover .faq-q { color: var(--burgundy); }
.faq-item summary:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
/* A chevron that points down when closed and up when open */
.faq-icon {
  flex: none;
  width: 11px;
  height: 11px;
  margin: 0 0.35rem 0.3rem;
  border-right: 1.5px solid var(--burgundy);
  border-bottom: 1.5px solid var(--burgundy);
  transform: rotate(45deg);
  transition: transform 0.2s ease, margin 0.2s ease;
}
.faq-item[open] .faq-icon { transform: rotate(-135deg); margin-bottom: -0.3rem; }
.faq-a { padding: 0 0.15rem 1.1rem; color: var(--muted); }
.faq-a p { margin: 0; }

/* ---------- Forms ---------- */
.form { display: grid; gap: 1.2rem; max-width: 680px; margin: 0 auto; }
label { display: grid; gap: 0.45rem; font-size: 0.95rem; color: var(--midnight); }
input, select, textarea {
  width: 100%;
  min-height: 50px;
  font: inherit;
  font-size: 16px; /* 16px stops iOS from zooming into fields */
  padding: 0.8rem 0.95rem;
  color: var(--midnight);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
}
input[type="file"] { min-height: 0; padding: 0.7rem; background: var(--ivory); font-size: 0.95rem; }
select {
  background-image: linear-gradient(45deg, transparent 50%, var(--accent) 50%),
    linear-gradient(135deg, var(--accent) 50%, transparent 50%);
  background-position: calc(100% - 20px) 55%, calc(100% - 14px) 55%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 2.4rem;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: var(--gold); }

fieldset { border: 0; margin: 0; padding: 0; }
legend { font-family: var(--serif); font-size: 1.5rem; margin-bottom: 0.75rem; padding: 0; }

.choices { display: grid; gap: 0.7rem; grid-template-columns: 1fr; }
label.choice {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 56px;
  padding: 0.9rem 1.1rem;
  background: #fff;
  border: 1px solid var(--line);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
label.choice:has(input:checked) { border-color: var(--accent); background: var(--blush); }
/* Radios and checkboxes keep their native look (the rule above strips it for text fields). */
input[type="radio"], input[type="checkbox"] { -webkit-appearance: auto; appearance: auto; width: 18px; min-height: 18px; height: 18px; margin: 0; padding: 0; accent-color: var(--accent); flex: none; }

.grid-fields { display: grid; gap: 1.2rem; }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.status { min-height: 1.5em; margin: 0; font-size: 0.95rem; }
.status.ok { color: var(--sage); }
.status.error { color: var(--error); }
.notice {
  max-width: 680px;
  margin: 0 auto 2rem;
  padding: 1.1rem 1.3rem;
  background: var(--blush);
  border-left: 3px solid var(--burgundy);
}

/* ---------- Registry ---------- */
.gift-grid { display: grid; gap: 1.4rem; grid-template-columns: 1fr; }
.gift { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); box-shadow: 0 18px 30px -28px rgba(35, 37, 50, 0.6); }
.gift img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--blush); }
.gift-body { display: flex; flex-direction: column; gap: 0.5rem; padding: 1.2rem 1.2rem 1.4rem; flex: 1; }
.gift-body p { margin: 0; color: var(--muted); font-size: 0.97rem; }
.gift-body .meta { color: var(--sage); font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; }
.gift-body .meta.claimed { color: var(--burgundy); }
.gift-body h3 { font-size: 1.6rem; }
.gift.claimed { opacity: 0.6; }
.link {
  color: var(--accent);
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  border-bottom: 1px solid var(--gold);
  align-self: flex-start;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.claim { display: flex; flex-direction: column; gap: 0.6rem; margin-top: auto; padding-top: 0.5rem; }
.claim input { flex: 1; }

/* ---------- Guestbook notes ---------- */
.guest-list { display: grid; gap: 1.4rem; margin-top: 2.5rem; grid-template-columns: 1fr; }
.note { background: #fff; border: 1px solid var(--line); border-top: 2px solid var(--burgundy); padding: 1.4rem; }
.note p:first-child { font-family: var(--serif); font-style: italic; font-size: 1.3rem; line-height: 1.5; color: var(--midnight); }
.note .sign { margin: 0.9rem 0 0; font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }

/* ---------- Footer ---------- */
.footer {
  background: var(--midnight);
  color: var(--ivory);
  text-align: center;
  padding: 3.5rem 1.25rem 3rem;
}
.footer svg, .footer img { width: 60px; height: 60px; margin: 0 auto 1rem; display: block; color: var(--blush); }
.footer p { margin: 0.25rem 0 0; font-family: var(--serif); font-size: 1.4rem; font-style: italic; }
.footer .label { color: rgba(255, 255, 255, 0.78); }

/* ---------- Wider phones and tablets ---------- */
@media (min-width: 560px) {
  .choices { grid-template-columns: 1fr 1fr; }
  .grid-fields.two { grid-template-columns: 1fr 1fr; }
  .gift-grid { grid-template-columns: 1fr 1fr; }
  .hero-actions { flex-direction: row; justify-content: center; }
  .hero-actions .btn { flex: 0 0 auto; }
  .btn.submit { width: auto; }
  .card { padding: 2rem; }
}

@media (min-width: 720px) {
  .guest-list { grid-template-columns: 1fr 1fr; }
}

/* ---------- Desktop ---------- */
@media (min-width: 820px) {
  .two-col { grid-template-columns: 1fr 1fr; gap: 2.5rem; }
  .timeline li { grid-template-columns: 8rem 1fr; gap: 1.2rem; }
  .section { padding: 5.5rem 1.5rem; }
  .card { padding: 2.5rem; }
  h3 { font-size: 1.6rem; }
}

@media (min-width: 960px) {
  html { scroll-padding-top: 7rem; }
  .topbar-inner { padding: 0.6rem 1.5rem 0.1rem; }
  .brand { font-size: 1.6rem; }
  .nav { gap: 2.25rem; overflow: visible; }
  .gift-grid { grid-template-columns: repeat(3, 1fr); }
  .gift-body h3 { font-size: 1.7rem; }
}

/* Small phones: tighter gutters so the hero and forms keep their room */
@media (max-width: 379px) {
  .hero, .welcome { padding-left: 0.9rem; padding-right: 0.9rem; }
  .section { padding-left: 0.9rem; padding-right: 0.9rem; }
  .card { padding: 1.15rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* RSVP: note after the family size is filled in from the guest list */
.party-hint { font-size: 0.9rem; margin: 0.25rem 0 0; }

/* Registry: category buttons and sort menu */
.registry-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.8rem 1.2rem; margin: 0 auto 1.6rem; }
.cat-chips { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.cat-chip {
  font: inherit;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  padding: 0.5rem 1rem;
  min-height: 40px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--midnight);
  cursor: pointer;
}
.cat-chip:hover { border-color: var(--gold); }
.cat-chip[aria-pressed="true"] { background: var(--midnight); border-color: var(--midnight); color: var(--ivory); }
.registry-sort { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; color: var(--muted); white-space: nowrap; }
.registry-sort select { width: auto; min-width: 11rem; }
.gift-cat { display: inline-block; font-size: 0.68rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--burgundy); margin-bottom: 0.35rem; }
@media (max-width: 559px) {
  .registry-sort { width: 100%; }
  .registry-sort select { flex: 1; min-width: 0; }
}

/* Venue map: fills the venue card, with a directions button underneath */
.venue-map { margin: 1rem 0 1.25rem; display: grid; gap: 0.75rem; justify-items: start; }
.venue-map iframe { width: 100%; aspect-ratio: 4 / 3; border: 1px solid var(--line); background: var(--blush); display: block; }
@media (max-width: 559px) {
  .venue-map iframe { aspect-ratio: 1 / 1; }
  .venue-map .btn { width: 100%; }
}

/* RSVP thank-you: covers the form, then fades away */
#rsvp-form { position: relative; }
.rsvp-thanks {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 2rem 1.5rem;
  text-align: center;
  background: linear-gradient(180deg, var(--blush), var(--card));
  border: 1px solid var(--line);
  opacity: 0;
  transform: scale(0.98);
  transition: opacity 0.6s ease, transform 0.6s ease;
  cursor: pointer;
}
.rsvp-thanks.show { opacity: 1; transform: none; }
.rsvp-thanks:focus { outline: none; }
.rsvp-thanks h3 { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: clamp(2rem, 7vw, 2.8rem); text-transform: none; letter-spacing: 0; margin: 0.2rem 0 0; color: var(--midnight); }
.rsvp-thanks p { font-size: clamp(1.05rem, 3.8vw, 1.25rem); max-width: 26rem; margin: 0; color: var(--midnight); }
.rsvp-thanks small { color: var(--muted); font-size: 0.78rem; margin-top: 0.6rem; }
.rsvp-thanks .ornament { display: flex; align-items: center; gap: 0.75rem; width: min(220px, 60%); margin: 0.6rem auto 0; }
.rsvp-thanks .ornament::before, .rsvp-thanks .ornament::after { content: ""; flex: 1; height: 1px; background: var(--gold); opacity: 0.6; }
.rsvp-thanks .ornament i { width: 7px; height: 7px; border: 1px solid var(--burgundy); transform: rotate(45deg); }
@media (prefers-reduced-motion: reduce) { .rsvp-thanks { transition: none; } }
