/* Styled to match the printed invitation: ink line art on white, dusty
   rose flowers, sage leaves, pale blue accents and gold antlers.
   Colours are the invitation's own. Only the dark pink is dark enough for
   text (5.4:1) and the dark green for field borders (3.1:1); the lighter
   ones are decoration only (WCAG AA: 4.5:1 for text, 3:1 for borders). */

:root {
  color-scheme: light;

  --paper: #fcfcfc;       /* same white as the invite artwork, so the hero blends in */
  --card: #ffffff;
  --ink: #292828;         /* invite lettering */
  --muted: #5d5a57;       /* 6.7:1 */
  --rose: #b77f79;        /* invite light pink, decoration only */
  --rose-ink: #965853;    /* invite dark pink, 5.4:1: text, links, buttons */
  --rose-dark: #7d4844;   /* a shade darker, for hover */
  --sage-light: #aab5a1;  /* invite light green, decoration only */
  --sage: #87957a;        /* invite dark green, 3.1:1: field borders, selected state */
  --sage-soft: #e8eae5;
  --blue: #aabbc0;        /* invite light blue, decoration only */
  --blue-soft: #eceff0;
  --gold: #d9c8a9;        /* invite antler yellow: dividers, accents */
  --gold-soft: #f3efe7;
  --line: #e4e0d9;
  --error: #a3322b;       /* 6.6:1 */
  --focus: rgba(150, 88, 83, 0.45);

  --caps: "Cormorant SC", "Cormorant Garamond", Georgia, serif;
  --body: "EB Garamond", Garamond, Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1.125rem/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: 34rem;
  margin: 0 auto;
  padding: 0 1rem;
}
#page-reply { padding-bottom: 3rem; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

a { color: var(--rose-ink); text-underline-offset: 0.18em; }
a:hover { color: var(--rose-dark); }

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

/* ---------------------------------------------------------------- hero */

.hero {
  margin: 0 -1rem;          /* full-bleed on phones */
  min-height: 100svh;       /* the invitation is a page of its own */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-bottom: 1.5rem;
  text-align: center;
}
.hero[hidden] { display: none; }

.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  margin-top: 0.5rem;
  font-size: 1rem;
}
.invite {
  display: block;
  width: 100%;
  max-width: 30rem;
  height: auto;
  margin: 0 auto;
}
.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 9rem;
  min-height: 2.9rem;
  margin-top: 0.5rem;
  padding: 0.4rem 1.75rem;
  border-radius: 999px;
  background: var(--rose-ink);
  color: #fff;
  font: 600 1.2rem/1 var(--caps);
  letter-spacing: 0.16em;
  text-decoration: none;
}
.cta:hover { background: var(--rose-dark); color: #fff; }

.divider {
  display: block;
  width: min(15rem, 65%);
  height: auto;
  margin: 1rem auto 0.5rem;
}

/* ------------------------------------------------------------ sections */

section { margin-top: 1rem; text-align: center; }

h2 {
  margin: 0.5rem 0 1.25rem;
  font: 600 2.25rem/1.2 var(--caps);
  color: var(--ink);
}

h3 {
  margin: 2rem 0 0.75rem;
  font: 600 1.15rem/1.3 var(--caps);
  letter-spacing: 0.14em;
  color: var(--rose-ink);
}

.status { text-align: center; color: var(--muted); margin-top: 2rem; }

.facts { margin: 0; }
.facts > div { margin-bottom: 1.25rem; }
.facts dt {
  font: 600 0.95rem/1.3 var(--caps);
  letter-spacing: 0.16em;
  color: var(--rose-ink);
}
.facts dd { margin: 0.15rem 0 0; }
.venue-name { display: block; font-weight: 600; }
.venue-address { display: block; color: var(--muted); }

.calendar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin: 1.5rem 0 0;
}
.calendar a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.35rem 1.1rem;
  border: 1px solid var(--sage);
  border-radius: 999px;
  color: var(--ink);
  font-size: 1rem;
  text-decoration: none;
}
.calendar a:hover { background: var(--sage-soft); }

#info-block { margin-top: 1rem; }

/* "The day": same italic serif as "Please reply by…" */
#details h2 {
  font: italic 400 2.4rem/1.2 var(--body);
  letter-spacing: 0;
}

/* ---------------------------------------------------------------- RSVP */

.emblem {
  display: block;
  width: 9rem;   /* the antlers make it wide, so a little bigger than before */
  height: auto;
  margin: 2.5rem auto 0;
}
#rsvp h2 { margin-top: 0.25rem; }
#deadline-note { color: var(--muted); font-style: italic; margin-top: -0.5rem; }

.step { text-align: left; }
.step > h3, .step > p { text-align: center; }

.script-title {
  font: 600 1.9rem/1.2 var(--caps);
  letter-spacing: 0;
  color: var(--ink);
}

label {
  display: block;
  margin: 1rem 0 0.3rem;
  font-weight: 600;
  font-size: 1.05rem;
}
.optional { font-weight: 400; color: var(--muted); font-style: italic; }

input:not([type=radio]), select, textarea {
  display: block;
  width: 100%;
  min-height: 3rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--sage);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
  font: inherit;          /* 18px, so iOS doesn't zoom on focus */
}
input:not([type=radio]):focus, select:focus, textarea:focus {
  outline: 3px solid var(--focus);
  outline-offset: 0;
  border-color: var(--rose-ink);
}
textarea { resize: vertical; }
select {
  appearance: none;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%2387957a' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
}
[aria-invalid="true"] { border-color: var(--error) !important; outline: 2px solid var(--error) !important; }

button {
  min-height: 3rem;
  margin-top: 1.25rem;
  padding: 0.5rem 1.4rem;
  border: 1px solid var(--sage);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
button:hover { background: var(--sage-soft); }
button.primary {
  display: block;
  width: 100%;
  border-color: var(--rose-ink);
  background: var(--rose-ink);
  color: #fff;
  font: 600 1.25rem/1 var(--caps);
  letter-spacing: 0.12em;
}
button.primary:hover { background: var(--rose-dark); }
button:disabled { opacity: 0.65; cursor: progress; }
button.link {
  display: block;
  min-height: 2.75rem;
  margin: 0.5rem auto 0;
  border: 0;
  padding: 0.5rem;
  background: none;
  color: var(--rose-ink);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

/* One card per guest */
fieldset {
  margin: 1.5rem 0 0;
  padding: 0.9rem 0.9rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  box-shadow: 0 1px 3px rgba(41, 40, 40, 0.05);
}
legend {
  padding: 0 0.5rem;
  font: 600 1.25rem/1.2 var(--caps);
  letter-spacing: 0.08em;
}
fieldset.extras { background: var(--blue-soft); border-color: var(--blue); }

.attending { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.25rem; }
.choice-radio {
  flex: 1 1 8rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
  min-height: 3rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--sage);
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 500;
  white-space: nowrap;   /* if both don't fit side by side, they stack instead */
  cursor: pointer;
}
.choice-radio input { width: 1.2rem; height: 1.2rem; margin: 0; accent-color: var(--sage); }
.choice-radio:has(input:checked) { background: var(--sage-soft); border-color: var(--sage); box-shadow: inset 0 0 0 1px var(--sage); }
.choice-radio:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }

.meals { margin-top: 0.25rem; }

/* "Which invite is yours?" */
.choose-list { list-style: none; padding: 0; margin: 0; }
.choice {
  display: block;
  width: 100%;
  margin-top: 0.75rem;
  padding: 0.8rem 1.2rem;
  border-radius: 16px;
  text-align: left;
}
.choice strong { display: block; font: 600 1.15rem/1.3 var(--caps); letter-spacing: 0.06em; }
.choice span { display: block; color: var(--muted); }

.note { color: var(--muted); white-space: pre-line; }
.note.warn { color: var(--rose-ink); margin: 0.3rem 0 0; font-size: 1rem; }
.warn-box {
  padding: 0.8rem 1rem;
  border-left: 3px solid var(--gold);
  border-radius: 0 10px 10px 0;
  background: var(--gold-soft);
  color: var(--ink);
  text-align: left !important;
}
.error { color: var(--error); font-weight: 600; text-align: center; }
.field-error { margin: 0.3rem 0 0; font-size: 1rem; text-align: left; }

/* Answer summaries */
.summary { list-style: none; padding: 0; margin: 0.5rem 0 1rem; }
.summary li {
  margin-bottom: 0.6rem;
  padding: 0.7rem 1rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--sage-light);
  border-radius: 0 12px 12px 0;
  background: var(--card);
}
.meal-line { display: block; color: var(--muted); }
#done-extras, #review-extras { text-align: center; }
#done-contact { text-align: center; font-style: italic; }

/* ---------------------------------------------------------------- footer */

.footer { margin-top: 3rem; text-align: center; }
.footer img { width: 8rem; height: auto; opacity: 0.9; }
