/* ---------------------------------------------------------------------------
   Theme: change these to retheme the whole site.
   The fonts are system fonts so nothing extra downloads on a weak connection.
   To use a web font, add its <link> to the HTML and put its name first here.
--------------------------------------------------------------------------- */
:root {
  --color-paper: #faf6ef;       /* page background */
  --color-surface: #fffdf9;     /* cards and inputs */
  --color-ink: #33291f;         /* main text */
  --color-muted: #6b5e51;       /* secondary text */
  --color-line: #e2d7c5;        /* hairlines */
  --color-field: #8c7e6e;       /* input borders */
  --color-accent: #84452f;      /* buttons, links, selected answers */
  --color-accent-ink: #fffdf9;  /* text on the accent color */
  --color-accent-soft: #f4e8df; /* soft highlight */
  --color-error: #a11d1d;

  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --radius: 6px;
  --tap: 3rem; /* minimum height of anything tappable */
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--color-paper);
  color: var(--color-ink);
  font: 1.0625rem/1.55 var(--font-body);
}

h1, h2, h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.2;
}
h2 { font-size: 1.875rem; }
h2:focus { outline: none; } /* focused by script only, to move screen readers along */
h3 { font-size: 1.25rem; }

p { margin: 0 0 1rem; }

a { color: var(--color-accent); text-underline-offset: 0.15em; }

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

.muted { color: var(--color-muted); }

/* --- Page shell ---------------------------------------------------------- */
.page {
  width: 100%;
  max-width: 34rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}
.page--wide { max-width: 60rem; }

.site-header {
  margin-bottom: 1.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-line);
  text-align: center;
}
.site-header a {
  color: inherit;
  font-family: var(--font-display);
  font-size: 1.125rem;
  text-decoration: none;
}

.view > h2 { margin-bottom: 0.5rem; }
.view > h2 + p { color: var(--color-muted); }

/* --- Landing page -------------------------------------------------------- */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: 2rem 1.5rem;
  text-align: center;
}
.hero__frame {
  width: 100%;
  max-width: 32rem;
  padding: 3.5rem 1.5rem;
  border: 1px solid var(--color-line);
  outline: 1px solid var(--color-line);
  outline-offset: 5px;
}
.hero h1 { font-size: clamp(2.5rem, 12vw, 4rem); }
.hero h1 em {
  display: block;
  margin: 0.15em 0;
  color: var(--color-accent);
  font-size: 0.7em;
}
.eyebrow {
  margin-bottom: 1.75rem;
  color: var(--color-muted);
  font-size: 0.8125rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.hero__date {
  margin: 2rem 0 0.25rem;
  font-family: var(--font-display);
  font-size: 1.375rem;
}
.hero__venue { margin-bottom: 2.25rem; color: var(--color-muted); }

/* --- Buttons ------------------------------------------------------------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  padding: 0.5rem 1.75rem;
  border: 1px solid var(--color-accent);
  border-radius: var(--radius);
  background: var(--color-accent);
  color: var(--color-accent-ink);
  font: inherit;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.button--large { min-height: 3.5rem; min-width: 13rem; font-size: 1.125rem; }
.button--block { width: 100%; }
.button--quiet { background: transparent; color: var(--color-accent); }
.button:disabled { opacity: 0.6; cursor: progress; }

/* --- Forms --------------------------------------------------------------- */
.field { margin-bottom: 1.125rem; }
.field label, .field__label {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 600;
}
.field__hint { font-weight: 400; color: var(--color-muted); }

input[type="text"], input[type="email"], input[type="password"], select, textarea {
  display: block;
  width: 100%;
  min-height: var(--tap);
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--color-field);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: inherit;
  font: inherit;
  font-size: max(1rem, 16px); /* below 16px, iOS zooms the page on focus */
}
textarea { min-height: 6rem; resize: vertical; }

fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }

/* A card per guest. */
.card {
  margin-bottom: 1.125rem;
  padding: 1.125rem 1rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  background: var(--color-surface);
}
.card legend {
  float: left; /* keeps the legend inside the card's padding */
  width: 100%;
  margin-bottom: 0.75rem;
  padding: 0;
  font-family: var(--font-display);
  font-size: 1.3125rem;
}
.card legend + * { clear: both; }

/* Yes/no answers: real radios, drawn as two large buttons. */
.choice-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.choice { position: relative; }
.choice input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.choice span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: var(--tap);
  padding: 0.375rem 0.5rem;
  border: 1px solid var(--color-field);
  border-radius: var(--radius);
  font-size: 0.9375rem;
  line-height: 1.25;
  text-align: center;
}
.choice input:checked + span {
  border-color: var(--color-accent);
  background: var(--color-accent);
  color: var(--color-accent-ink);
  font-weight: 600;
}
.choice input:focus-visible + span {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

.guest-details { margin-top: 1rem; }
.guest-details .field:last-child { margin-bottom: 0; }

/* The honeypot: off-screen for people, still present for bots. */
.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* --- Messages ------------------------------------------------------------ */
.message {
  margin: 0 0 1.125rem;
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--color-accent);
  border-radius: var(--radius);
  background: var(--color-accent-soft);
}
.message--error { border-left-color: var(--color-error); color: var(--color-error); }
.message ul { margin: 0; padding-left: 1.125rem; }
.message:empty { display: none; }

/* Same-name household choices. */
.choices { display: grid; gap: 0.625rem; margin: 0 0 1.25rem; padding: 0; list-style: none; }
.choices .button { width: 100%; }

/* Confirmation summary. */
.summary { margin: 0 0 1.25rem; }
.summary dt { font-weight: 600; }
.summary dd {
  margin: 0 0 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--color-line);
  overflow-wrap: anywhere;
  white-space: pre-line;
}
.stack { display: grid; gap: 0.625rem; }

/* --- Admin --------------------------------------------------------------- */
.admin-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.admin-bar__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.625rem;
  margin: 0 0 2rem;
}
.tile {
  padding: 0.875rem 0.75rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  background: var(--color-surface);
}
.tile dt { color: var(--color-muted); font-size: 0.875rem; }
.tile dd {
  margin: 0;
  font-family: var(--font-display);
  font-size: 2.25rem;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.panels { display: grid; gap: 2rem; }
@media (min-width: 44rem) {
  .panels { grid-template-columns: 1fr 1fr; align-items: start; }
}

.panel h3 { margin-bottom: 0.5rem; }

table { width: 100%; border-collapse: collapse; }
th, td {
  padding: 0.5rem 0.75rem 0.5rem 0;
  border-bottom: 1px solid var(--color-line);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}
th { color: var(--color-muted); font-size: 0.875rem; font-weight: 600; }
td.number, th.number {
  padding-right: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.plain-list { margin: 0; padding: 0; list-style: none; }
.plain-list li { padding: 0.5rem 0; border-bottom: 1px solid var(--color-line); }
