/* Wedding RSVP — one stylesheet, no framework. */

:root {
  --ink: #23201c;
  --ink-soft: #6b635a;
  --paper: #faf7f2;
  --card: #ffffff;
  --line: #e4ddd2;
  --accent: #6b7f6e;
  --accent-dark: #55664f;
  --error: #9b3b2f;
  --success: #3f6b4a;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(35, 32, 28, 0.05), 0 8px 24px rgba(35, 32, 28, 0.06);
  --serif: ui-serif, Georgia, "Times New Roman", serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
}

/* ---------------------------------------------------------------- header */

.site-header {
  text-align: center;
  padding: 2.5rem 1rem 1rem;
}

.site-title {
  display: block;
  font-family: var(--serif);
  font-size: clamp(1.9rem, 6vw, 2.8rem);
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
}

.site-date {
  margin: 0.25rem 0 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 1.25rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.nav-link {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 0.35rem 0;
  border-bottom: 2px solid transparent;
}

.nav-link:hover { color: var(--ink); }

.nav-link.is-current {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

.nav-link--muted { margin-left: auto; opacity: 0.7; }

/* ------------------------------------------------------------------ main */

.site-main {
  max-width: 46rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

body.bare .site-main { max-width: 30rem; }
body.bare .site-header { padding-bottom: 0; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
}

.card--narrow { padding: 2rem; }

h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.75rem;
  margin: 0 0 0.75rem;
}

h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.3rem;
  margin: 2rem 0 0.5rem;
}

h3 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin: 1.75rem 0 0.5rem;
}

.lede { font-size: 1.05rem; color: var(--ink-soft); margin-top: 0; }
.muted { color: var(--ink-soft); }
.small { font-size: 0.875rem; }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

a { color: var(--accent-dark); }

.page-head {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: baseline;
  justify-content: space-between;
}

.page-head h1 { margin-bottom: 0; }

/* ----------------------------------------------------------------- forms */

.stack { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 1.25rem; }
.stack label { font-weight: 600; font-size: 0.95rem; }

input[type="text"],
input[type="search"],
input[type="password"],
input[type="date"],
select {
  width: 100%;
  font: inherit;
  padding: 0.7rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

input:focus-visible,
select:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  padding: 0.7rem 1.4rem;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}

.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-dark); }

.btn--ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}
.btn--ghost:hover { background: var(--paper); }
.btn--block { display: block; width: 100%; }

/* "or" rule between the code form and the game link on the code page */
.or-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.75rem 0 1rem;
  color: var(--ink-soft);
  font-size: 0.875rem;
}
.or-divider::before,
.or-divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }

.form-actions { margin-top: 1.5rem; }

.field { margin-top: 1rem; }
.field label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 0.3rem; }
.field-label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 0.4rem; }

.checkbox { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; }
.checkbox input { width: auto; }

/* --------------------------------------------------------------- alerts */

.alert {
  padding: 0.8rem 1rem;
  border-radius: 8px;
  border: 1px solid;
  margin: 1rem 0;
}

.alert--error { background: #fdf1ef; border-color: #f0cfc9; color: var(--error); }
.alert--success { background: #eef5ef; border-color: #cfe1d3; color: var(--success); }
.alert--info { background: #f4f1ea; border-color: var(--line); color: var(--ink-soft); }

/* ------------------------------------------------------- find invitation */

.household-list { list-style: none; padding: 0; margin: 1.25rem 0 0; }
.household-list li { margin-bottom: 0.5rem; }

.household-button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font: inherit;
  text-align: left;
  padding: 0.9rem 1rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.household-button:hover { border-color: var(--accent); background: var(--paper); }
.household-name { font-weight: 600; }
.household-count { color: var(--ink-soft); font-size: 0.875rem; white-space: nowrap; }

.results { margin-top: 1rem; }

/* ------------------------------------------------------------ rsvp form */

.rsvp-form { margin-top: 1.5rem; }

.guest {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin: 0 0 1rem;
  background: var(--paper);
}

.guest[disabled] { opacity: 0.85; }

.guest-head { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.guest-name { font-family: var(--serif); font-weight: 400; font-size: 1.25rem; margin: 0; }
.guest-name-label { font-weight: 600; font-size: 0.9rem; }
.guest-name-input { max-width: 22rem; }

.tag {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink-soft);
}

.attending { margin-top: 1rem; }

.radio-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }

.radio {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.9rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}

.radio:has(input:checked) { border-color: var(--accent); background: #eef2ee; }
.radio input { accent-color: var(--accent); }

.meals { margin-top: 1rem; padding-top: 1rem; border-top: 1px dashed var(--line); }
.meals[hidden] { display: none; }

/* ------------------------------------------------ invitation codes */

/* The code the guest types on the way in — big, spaced, unmistakable. */
.code-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.25rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
}

.code-input::placeholder {
  letter-spacing: 0.12em;
  opacity: 0.35;
  text-transform: uppercase;
}

.invite-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  white-space: nowrap;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0.1rem 0.4rem;
}

.invite-code--large {
  display: inline-block;
  font-size: 1.35rem;
  padding: 0.35rem 0.7rem;
  margin-top: 0.25rem;
}

.code-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.25rem 0 0.5rem;
  padding: 1rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.search-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.search-row input[type="search"] {
  flex: 1 1 16rem;
  width: auto;
}

/* ------------------------------------------- guest list management */

.button-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
}

.checks .checkbox { font-weight: 400; }

.invite-row {
  display: grid;
  gap: 0.6rem;
  padding: 1rem 0;
  border-top: 1px solid var(--line);
}

.invite-row h3 { margin: 0; }

.dish-row {
  display: grid;
  grid-template-columns: 2fr 3fr 5rem;
  gap: 0.5rem 0.75rem;
  align-items: end;
  padding: 0.75rem 0;
  border-top: 1px solid var(--line);
}

.dish-row .button-row { grid-column: 1 / -1; justify-content: flex-end; }

@media (max-width: 640px) {
  .dish-row { grid-template-columns: 1fr; }
}

.danger-zone {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

/* ----------------------------------------------- parts of the day */

.part {
  margin-top: 1rem;
  padding: 1rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.part-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 0.9rem;
}

.part-name {
  font-family: var(--serif);
  font-size: 1.1rem;
}

.part-when {
  font-size: 0.85rem;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.part-blurb {
  margin: 0.25rem 0 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.part .radio-row { margin-top: 0.75rem; }

.part-section {
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
}

.part-section:last-of-type { border-bottom: 0; margin-bottom: 0; }
.part-section h2 { margin-top: 0; }

.venue-map {
  display: block;
  width: 100%;
  height: auto;
  margin: 1rem 0 1.5rem;
  border-radius: 6px;
}

/* ----------------------------------------------------------------- admin */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.stat {
  display: flex;
  flex-direction: column;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.stat-value { font-family: var(--serif); font-size: 2rem; line-height: 1.1; }
.stat-label { font-size: 0.875rem; color: var(--ink-soft); margin-top: 0.25rem; }
.stat-hint { font-size: 0.75rem; color: var(--ink-soft); opacity: 0.8; }

.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }

.chip {
  font-size: 0.85rem;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink-soft);
}

.chip.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }

.table-wrap { overflow-x: auto; margin-top: 1rem; }

table { width: 100%; border-collapse: collapse; font-size: 0.925rem; }
th, td { text-align: left; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--line); }
th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); }
tbody tr:hover { background: var(--paper); }

/* ---------------------------------------------------------------- prose */

.prose h2:first-of-type { margin-top: 1.5rem; }
.prose address { font-style: normal; line-height: 1.7; }
.spaced li { margin-bottom: 0.5rem; }

.timeline { list-style: none; padding: 0; margin: 1.5rem 0 0; }

.timeline li {
  display: flex;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
}

.timeline .time {
  flex: 0 0 5.5rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
}

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

.site-footer {
  text-align: center;
  padding: 2rem 1rem 3rem;
  color: var(--ink-soft);
  font-size: 0.85rem;
  border-top: 1px solid var(--line);
}

@media (max-width: 480px) {
  body { font-size: 16px; }
  .card { padding: 1.25rem; }
  .radio-row { flex-direction: column; align-items: stretch; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
