/* ---------------------------------------------------------------------------
   THEME. Change these values to restyle the whole page.
   Sampled directly from the Canva site (Kelly & Adrien): cream #F8F4EA,
   terracotta #C6846C, dark olive #3E4030.

   --c-accent-deep is the one knob that matters. It is the terracotta used for
   text, buttons and selected chips. Set to #C6846C it matches the Canva site
   exactly, at 2.76:1 against the cream - below the 4.5:1 WCAG asks for, so
   small labels get hard to read on a phone in daylight. Set it to #A05A40
   instead and you get 4.74:1: the same colour family, noticeably darker, and
   legible. One line, revert whenever.
   --------------------------------------------------------------------------- */

:root {
  /* Palette */
  --c-ink: #3e4030;          /* dark olive - body text, headings   9.65:1 */
  --c-paper: #f8f4ea;        /* cream - page background                   */
  --c-stone: #575849;        /* secondary text, hairlines          6.60:1 */
  --c-accent: #c6846c;       /* terracotta - panels, rules, focus rings   */
  --c-accent-deep: #c6846c;  /* text, buttons, chips - see the note above */
  --c-error: #8c3b2a;        /* errors only; kept dark so they stay read  */

  /* Typefaces. Luxurious Script is the exact face used on the Canva site.
     Their NewIconSerif, TTHoves and Liberteen are Canva-licensed and cannot
     be redistributed: Instrument Serif stands in for the display serif, set
     in caps with wide tracking to match its treatment there. */
  --f-script: "Luxurious Script", cursive;
  --f-display: "Instrument Serif", Georgia, serif;
  --f-body: "Karla", system-ui, sans-serif;

  --radius: 2px;
}

/* Fonts are bundled with the image: no CDN, no third-party request. --------- */
@font-face {
  font-family: "Luxurious Script";
  src: url("/fonts/luxurious-script-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("/fonts/instrument-serif-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Karla";
  src: url("/fonts/karla-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Karla";
  src: url("/fonts/karla-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

/* Base --------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
button, input, textarea { font: inherit; color: inherit; }

body {
  background: var(--c-paper);
  color: var(--c-ink);
  font-family: var(--f-body);
  font-size: clamp(1.02rem, 3.6vw, 1.1rem);
  line-height: 1.65;
}

.wrap {
  width: 100%;
  max-width: 40rem;
  margin-inline: auto;
  padding: clamp(2.5rem, 9vw, 4.5rem) clamp(1.25rem, 5vw, 2.5rem);
  min-height: 100svh;
}

h1 {
  font-family: var(--f-display);
  font-size: clamp(1.75rem, 7vw, 2.4rem);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

/* The couple's names, in the same script as the Canva site. */
.wordmark {
  font-family: var(--f-script);
  font-size: clamp(2.6rem, 11vw, 3.6rem);
  line-height: 1;
  color: var(--c-accent-deep);
  text-align: center;
  margin-bottom: 0.35rem;
}
.wordmark + .eyebrow {
  justify-content: center;
  margin-bottom: 2.75rem;
}
.wordmark + .eyebrow::after { display: none; }

.eyebrow {
  font-size: 0.76rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--c-accent-deep);
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 2.25rem;
}
.eyebrow::after {
  content: "";
  flex: 1;
  height: 1px;
  background: currentColor;
  opacity: 0.35;
}

.muted { color: var(--c-stone); }
.spaced { margin-top: 2rem; }
.hidden { display: none !important; }

/* Form --------------------------------------------------------------------- */
.field { margin: 1.75rem 0 1.5rem; }
.field > label {
  display: block;
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--c-stone);
  margin-bottom: 0.5rem;
}

input[type="text"], textarea {
  width: 100%;
  max-width: 24rem;
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--c-stone) 45%, transparent);
  border-radius: var(--radius);
  padding: 0.7rem 0.85rem;
}
textarea { max-width: none; min-height: 6.5rem; resize: vertical; }

.btn {
  display: inline-block;
  background: var(--c-accent-deep);
  color: var(--c-paper);
  border: 1px solid var(--c-accent-deep);
  border-radius: var(--radius);
  padding: 0.85rem 1.9rem;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}
.btn:hover { background: transparent; color: var(--c-accent-deep); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.btn--ghost {
  background: transparent;
  color: var(--c-ink);
  border-color: var(--c-stone);
  margin-left: 0.5rem;
}
.btn--ghost:hover { background: var(--c-ink); color: var(--c-paper); border-color: var(--c-ink); }

/* Guest blocks -------------------------------------------------------------- */
#guests { margin-top: 2rem; }

.guest {
  border: 1px solid color-mix(in srgb, var(--c-stone) 30%, transparent);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.guest__name { font-weight: 700; margin-bottom: 0.85rem; }
.guest__name input { margin-top: 0.5rem; }

.choice { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.choice + .choice { margin-top: 0.9rem; }
.choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.choice label {
  border: 1px solid color-mix(in srgb, var(--c-stone) 45%, transparent);
  border-radius: var(--radius);
  padding: 0.45rem 1.1rem;
  cursor: pointer;
  font-size: 0.92rem;
}
.choice input:checked + label {
  background: var(--c-accent-deep);
  color: var(--c-paper);
  border-color: var(--c-accent-deep);
}
.choice input:focus-visible + label {
  outline: 2px solid var(--c-accent);
  outline-offset: 2px;
}

.guest .field { margin: 0.9rem 0 0; }
.guest .field input { max-width: none; }

/* Disambiguation ------------------------------------------------------------ */
.choices { display: grid; gap: 0.75rem; margin: 1.75rem 0; }
.choices button {
  text-align: left;
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--c-stone) 45%, transparent);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  cursor: pointer;
  font-weight: 700;
}
.choices button:hover { border-color: var(--c-ink); }

/* Feedback ------------------------------------------------------------------ */
.notice {
  border-left: 3px solid var(--c-accent);
  padding: 0.75rem 0 0.75rem 1rem;
  margin-top: 1.5rem;
}
.notice--error { border-left-color: var(--c-error); color: var(--c-error); }

.contact { margin-top: 4rem; font-size: 0.9rem; }

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

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

/* Distinguishes the menu choices from the presence choices, which otherwise
   look identical at a glance. */
.sublabel {
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--c-stone);
  margin-bottom: 0.5rem;
}
.menu-block { margin-top: 1.1rem; }
.choice + .choice { margin-top: 0.75rem; }

/* --- v2: recap, guest-list page ------------------------------------------- */
.wrap--wide { max-width: 52rem; }

.sublabel--soft {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  font-size: 0.88rem;
  margin-bottom: 0.6rem;
}

.recap { list-style: none; padding: 0; margin: 1.5rem 0; }
.recap li {
  padding: 0.7rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--c-stone) 25%, transparent);
}
.recap li:last-child { border-bottom: none; }

.editlink {
  display: inline-block;
  margin-top: 0.5rem;
  word-break: break-all;
  color: var(--c-accent-deep);
}

.stats { margin-bottom: 1.5rem; }

.toolbar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}
.toolbar .btn--ghost { margin-left: 0; }

.row {
  border: 1px solid color-mix(in srgb, var(--c-stone) 28%, transparent);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin-bottom: 0.85rem;
}
.row--answered { border-left: 3px solid var(--c-accent); }

.row__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}
.badge {
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--c-stone);
  white-space: nowrap;
}
.badge--on { color: var(--c-accent-deep); }

.row__meta {
  color: var(--c-stone);
  font-size: 0.9rem;
  margin-top: 0.3rem;
}
.row__answer {
  margin: 0.75rem 0 0;
  padding-left: 1.1rem;
  font-size: 0.9rem;
  color: var(--c-stone);
}
.row__note {
  margin-top: 0.5rem;
  font-style: italic;
  font-size: 0.9rem;
  color: var(--c-stone);
}

.row__actions {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-top: 0.9rem;
}
.linkbtn {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--c-accent-deep);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.linkbtn--danger { color: var(--c-error); }

#ed-names { min-height: 8rem; }
#ed-seats { max-width: 8rem; }

/* Buttons that sit side by side must wrap cleanly on a narrow screen. */
.spaced {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
}
.spaced .btn--ghost { margin-left: 0; }

/* --- guest-list filters ---------------------------------------------------- */
.filters { margin-bottom: 1.5rem; }
.filters input[type="search"] {
  width: 100%;
  max-width: none;
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--c-stone) 45%, transparent);
  border-radius: var(--radius);
  padding: 0.7rem 0.85rem;
  margin-bottom: 0.85rem;
}
.filters .choice { margin-bottom: 0.6rem; }
.filter-count { font-size: 0.88rem; margin-bottom: 1rem; }
