/* ==========================================================================
   Emily & James — shared design system
   Serif throughout. Large/prominent elements uppercase, supporting text
   sentence case. One solid background colour, white text over it.
   ========================================================================== */

/* ===========================================================================
   THE PALETTE — everything about the colour scheme lives in this one block.
   Change a value here and it updates every page, including /login and /admin.
   =========================================================================== */

:root {
  /* The page background. One solid colour across the whole site. */
  --bg: rgb(114, 156, 248);

  /* Text drawn on --bg. */
  --ink: #ffffff;            /* headings, names, nav, body copy   */
  --ink-soft: rgba(255, 255, 255, 0.86);  /* dates, descriptions, labels */
  --ink-faint: rgba(255, 255, 255, 0.68); /* the quietest text           */

  /* Text drawn ON TOP of a solid --ink block (filled buttons, skip link).
     A deeper shade of the background so it stays readable on white — the
     background colour itself is too light here (3.5:1). */
  --on-ink: rgb(45, 74, 150);

  /* Hairlines: borders, underlines, the little divider rules. */
  --rule: rgba(255, 255, 255, 0.42);

  /* Input boxes, checkbox rows, the "did you mean" buttons. Translucent
     white so they sit on the background rather than fighting it. */
  --field: rgba(255, 255, 255, 0.17);
  --field-hover: rgba(255, 255, 255, 0.28);
  --field-border: rgba(255, 255, 255, 0.55);

  /* ---- Type ---- */
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia,
           "Times New Roman", Times, serif;

  /* ---- Spacing ---- */
  --measure: 62ch;                      /* how wide a paragraph gets    */
  --page-max: 1100px;                   /* how wide the whole page gets */
  --gap: clamp(3.5rem, 9vw, 7.5rem);    /* space between big sections   */
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }

a { color: inherit; }

:where(a, button, input, summary):focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
  z-index: 10;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: var(--on-ink);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
}

/* --- Layout ------------------------------------------------------------- */

.wrap {
  width: min(100% - 2.5rem, var(--page-max));
  margin-inline: auto;
}

/* Also usable on its own, without .wrap, so it carries its own centring. */
.wrap--narrow {
  width: min(100% - 2.5rem, 720px);
  margin-inline: auto;
}

main { padding-bottom: var(--gap); }

section + section { margin-top: var(--gap); }

/* --- Navigation --------------------------------------------------------- */

.site-nav {
  padding: 2rem 0 1.25rem;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(1.25rem, 4vw, 3rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.78rem;
  text-decoration: none;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid transparent;
  transition: border-color 120ms ease-in-out;
}

.site-nav a:hover { border-bottom-color: var(--ink); }

.site-nav a[aria-current="page"] {
  border-bottom-color: var(--ink);
}

/* --- Typography --------------------------------------------------------- */

h1, h2, h3 {
  font-weight: 400;
  margin: 0;
  line-height: 1.12;
}

/* Large, prominent — uppercase */
.display {
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: clamp(2.6rem, 1.1rem + 6.4vw, 6rem);
  line-height: 1.02;
  text-align: center;
}

.page-title {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: clamp(1.8rem, 1.2rem + 2.2vw, 3rem);
  text-align: center;
  margin-bottom: 1.25rem;
}

.section-title {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: clamp(1.1rem, 1rem + 0.5vw, 1.35rem);
  margin-bottom: 0.85rem;
}

/* Smaller supporting text — sentence case */
.lede,
.meta,
.note {
  font-size: clamp(1.02rem, 0.98rem + 0.2vw, 1.2rem);
  color: var(--ink-soft);
}

.meta {
  text-align: center;
  font-style: italic;
  letter-spacing: 0.02em;
  margin: 1.5rem auto 0;
}

.note {
  font-size: 0.95rem;
}

p { margin: 0 0 1.1rem; max-width: var(--measure); }

.centered { text-align: center; }
.centered p { margin-inline: auto; }

.rule {
  width: 64px;
  height: 1px;
  border: 0;
  background: var(--rule);
  margin: var(--gap) auto;
}

.rule--tight { margin: 2.5rem auto; }

/* --- Buttons ------------------------------------------------------------ */

.btn {
  display: inline-block;
  font-family: inherit;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  text-decoration: none;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--ink);
  padding: 1rem 2.25rem;
  cursor: pointer;
  transition: background-color 140ms ease-in-out, color 140ms ease-in-out;
}

.btn:hover:not(:disabled) {
  background: var(--ink);
  color: var(--on-ink);
}

.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn--solid {
  background: var(--ink);
  color: var(--on-ink);
}
.btn--solid:hover:not(:disabled) {
  background: transparent;
  color: var(--ink);
}

.btn--quiet {
  border-color: transparent;
  text-decoration: underline;
  text-underline-offset: 4px;
  padding: 0.6rem 0.5rem;
  letter-spacing: 0.12em;
}
.btn--quiet:hover:not(:disabled) {
  background: transparent;
  color: var(--ink);
}

/* --- Home --------------------------------------------------------------- */

.hero {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.names { margin-top: clamp(2.5rem, 6vw, 4.5rem); }

.couple-photo {
  width: min(100%, 460px);
  aspect-ratio: 4 / 5;
  object-fit: cover;
  margin-inline: auto;
}

.welcome { margin-top: 2.75rem; }
.welcome p { margin-inline: auto; }

.cta { margin-top: 2.5rem; }

/* --- Content lists ------------------------------------------------------ */

.stack > * + * { margin-top: 2.75rem; }

.airports {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.25rem;
}

.airports li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.9rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--rule);
}

.airports .code {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 1.05rem;
  min-width: 3.5em;
}

.airports .name { color: var(--ink-soft); }

.airports .distance {
  margin-left: auto;
  font-size: 0.92rem;
  color: var(--ink-soft);
  font-style: italic;
}

.lodging { display: grid; gap: 2.25rem; }

.lodging h3 { margin-bottom: 0.4rem; }

.lodging p { margin-bottom: 0; }

.coming-soon {
  text-align: center;
  padding: clamp(3rem, 8vw, 5rem) 0;
}

.coming-soon .kicker {
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

/* --- RSVP / Regrets form ------------------------------------------------ */

.panel {
  border: 1px solid var(--rule);
  padding: clamp(1.5rem, 5vw, 2.75rem);
  margin-top: 2.5rem;
}

.field { display: grid; gap: 0.6rem; }

label {
  font-size: 0.95rem;
  color: var(--ink-soft);
}

input[type="text"],
input[type="password"] {
  font-family: inherit;
  font-size: 1.05rem;
  color: var(--ink);
  background: var(--field);
  border: 1px solid var(--field-border);
  border-radius: 0;
  padding: 0.85rem 1rem;
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
}

input[type="text"]::placeholder,
input[type="password"]::placeholder { color: var(--ink-faint); }

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  margin-top: 1.5rem;
}

.choices {
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.choices button {
  font-family: inherit;
  font-size: 1.05rem;
  text-align: left;
  width: 100%;
  color: var(--ink);
  background: var(--field);
  border: 1px solid var(--field-border);
  padding: 0.95rem 1.1rem;
  cursor: pointer;
}

.choices button:hover {
  border-color: var(--ink);
  background: var(--field-hover);
}

.people {
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.person {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.8rem 1rem;
  background: var(--field);
  border: 1px solid var(--field-border);
  cursor: pointer;
}

.person:hover { background: var(--field-hover); }

.person input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: #ffffff;
  flex: none;
  cursor: pointer;
}

.person .who { font-size: 1.05rem; }

.person .flag {
  margin-left: auto;
  font-size: 0.82rem;
  font-style: italic;
  color: var(--ink-soft);
}

.status-msg {
  margin-top: 1.25rem;
  font-size: 0.98rem;
  color: var(--ink-soft);
  min-height: 1.5em;
}

.status-msg[data-tone="error"] {
  color: #6d1f2e;
  font-style: normal;
}

.confirmation {
  text-align: center;
  padding: 1rem 0;
}

.confirmation .tick {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.75rem;
}

[hidden] { display: none !important; }

/* --- Login gate --------------------------------------------------------- */

.login-shell {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 2.5rem 1.25rem;
}

.login-card {
  width: min(100%, 440px);
  text-align: center;
}

/* Sized so "EMILY & JAMES" stays on one line inside the card at every width. */
.login-mark {
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-size: clamp(1.75rem, 1.05rem + 3.1vw, 2.75rem);
  line-height: 1.05;
}

.login-date {
  margin: 1rem 0 0;
  font-size: 0.98rem;
  font-style: italic;
  color: var(--ink-soft);
}

.login-hint {
  margin: 0 0 2rem;
  font-size: 0.98rem;
  color: var(--ink-soft);
  max-width: none;
}

.login-form {
  display: grid;
  gap: 1.25rem;
  text-align: left;
}

.login-form .field { gap: 0.45rem; }

.login-form label {
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

.login-submit {
  width: 100%;
  margin-top: 0.5rem;
}

.login-error {
  margin: 0;
  padding: 0.85rem 1rem;
  background: #f0dfe2;
  border-left: 3px solid #7a2437;
  color: #5d1a27;
  font-size: 0.92rem;
  max-width: none;
}

/* --- Footer ------------------------------------------------------------- */

.site-footer {
  text-align: center;
  padding: var(--gap) 0 3rem;
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* Overrides the 62ch measure on `p`, which would anchor this left. */
.site-footer p {
  max-width: none;
  margin: 0;
}

/* --- Admin -------------------------------------------------------------- */

.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.5rem;
  font-size: 0.95rem;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

.admin-table th {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--ink-soft);
  white-space: nowrap;
}

.admin-table tr.party-start td,
.admin-table tr.party-start th { border-top: 2px solid var(--rule); }

.admin-scroll { overflow-x: auto; }

.pill {
  display: inline-block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 0.25rem 0.7rem;
  border: 1px solid var(--rule);
  white-space: nowrap;
}

.pill--declined { background: #7a2437; color: #fff; border-color: #7a2437; }
.pill--attending { background: #24503a; color: #fff; border-color: #24503a; }
.pill--no_response { color: var(--ink-soft); }

.tally {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2.5rem;
  margin-top: 1.5rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.tally div { display: grid; gap: 0.15rem; }

.tally .n { font-size: 1.6rem; line-height: 1; }

.tally .k {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.7rem;
  color: var(--ink-soft);
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01ms !important; }
}
