/* "Pedder Road is calling us home." - high-end stationery, mobile-first. */

@font-face {
  font-family: "EB Garamond";
  src: url("/fonts/ebgaramond-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --cream: #f7f3ea;
  --ink: #3b342b;
  --gold: #a6884c;
  --gold-dark: #8f7440;
  --hairline: rgba(166, 136, 76, 0.4);
  --error: #9b3d2f;
  --field-border: rgba(59, 52, 43, 0.28);
  --max: 33rem;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--cream);
  color: var(--ink);
  font-family: "EB Garamond", Georgia, "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.page {
  max-width: var(--max);
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

/* --- Masthead ------------------------------------------------------------ */

.masthead {
  text-align: center;
  margin-bottom: 2.75rem;
}

.headline {
  font-weight: 500;
  font-size: 2.25rem;
  line-height: 1.15;
  letter-spacing: 0.005em;
  margin: 0 0 1rem;
}

.subline {
  font-size: 1.0625rem;
  letter-spacing: 0.04em;
  color: rgba(59, 52, 43, 0.82);
  margin: 0;
}

/* --- Form ---------------------------------------------------------------- */

.field {
  margin-bottom: 1.75rem;
}

/* fieldset defaults to min-inline-size: min-content, which can push past a
   narrow viewport; reset so radio groups shrink with the column. */
fieldset.field {
  min-inline-size: 0;
  padding: 0.75rem 0.9rem 0.9rem;
  border: 1px solid var(--field-border);
  border-radius: 3px;
}

.field-label,
.field-legend {
  display: block;
  font-size: 1.0625rem;
  margin: 0 0 0.55rem;
  padding: 0;
  border: 0;
}

/* Text-like inputs. 16px minimum to stop iOS zoom-on-focus. */
input[type="text"],
input[type="tel"],
input[type="number"],
textarea {
  width: 100%;
  font-family: inherit;
  font-size: 16px;
  color: var(--ink);
  background: #fffdf8;
  border: 1px solid var(--field-border);
  border-radius: 3px;
  padding: 0.7rem 0.8rem;
  transition: border-color 0.15s ease;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(166, 136, 76, 0.18);
}

textarea {
  min-height: 5.5rem;
  resize: vertical;
}

/* Radio groups rendered as understated bordered rows. */
.options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.option {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  border: 1px solid var(--field-border);
  border-radius: 3px;
  padding: 0.65rem 0.8rem;
  background: #fffdf8;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.option input[type="radio"] {
  accent-color: var(--gold);
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  flex: 0 0 auto;
}

.option:has(input:checked) {
  border-color: var(--gold);
  background: rgba(166, 136, 76, 0.08);
}

.option-text {
  font-size: 16px;
}

/* Subtle note shown only while its adjacent option is selected. */
.option-note {
  display: none;
  font-size: 0.95rem;
  font-style: italic;
  color: var(--gold-dark);
  padding: 0.1rem 0.2rem 0.2rem;
}

.option:has(input:checked) + .option-note {
  display: block;
}

.other-wrap {
  margin-top: 0.6rem;
}

.field-error {
  display: block;
  color: var(--error);
  font-size: 0.95rem;
  margin-top: 0.4rem;
}

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

.btn-gold {
  display: block;
  width: 100%;
  font-family: inherit;
  font-size: 1.15rem;
  letter-spacing: 0.03em;
  color: #fffdf8;
  background: var(--gold);
  border: none;
  border-radius: 3px;
  padding: 0.85rem 1rem;
  margin-top: 0.5rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-gold:hover {
  background: var(--gold-dark);
}

.btn-gold:disabled {
  opacity: 0.6;
  cursor: default;
}

.btn-quiet {
  font-family: inherit;
  font-size: 1rem;
  color: var(--gold-dark);
  background: none;
  border: 1px solid var(--hairline);
  border-radius: 3px;
  padding: 0.7rem 1rem;
  cursor: pointer;
}

/* --- Banners, errors, confirmation -------------------------------------- */

.update-banner {
  border: 1px solid var(--hairline);
  background: rgba(166, 136, 76, 0.07);
  border-radius: 3px;
  padding: 1rem 1.1rem;
  margin-bottom: 2rem;
  text-align: center;
}

.update-banner p {
  margin: 0;
}

.form-error {
  color: var(--error);
  border: 1px solid rgba(155, 61, 47, 0.4);
  background: rgba(155, 61, 47, 0.06);
  border-radius: 3px;
  padding: 0.9rem 1rem;
  margin: 1.5rem 0 0;
}

.form-error a {
  color: var(--error);
}

.confirm {
  text-align: center;
}

.confirm-message {
  font-size: 1.5rem;
  line-height: 1.35;
  margin: 1rem 0 2.5rem;
}

.section {
  margin-top: 2.5rem;
}

.hairline {
  border: none;
  border-top: 1px solid var(--hairline);
  margin: 2.5rem 0;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 500;
  margin: 0 0 0.5rem;
}

.section-copy {
  margin: 0 0 0.75rem;
  color: rgba(59, 52, 43, 0.9);
}

/* Understated gold text links, not buttons. */
.text-link {
  color: var(--gold-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.share-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.share-actions a,
.share-actions button {
  text-align: center;
}

/* --- Toast --------------------------------------------------------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 2rem;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--cream);
  padding: 0.7rem 1.2rem;
  border-radius: 3px;
  font-size: 1rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  z-index: 10;
}

.toast[hidden] {
  display: none;
}

[hidden] {
  display: none !important;
}

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

/* Slightly larger headline on comfortable screens. */
@media (min-width: 480px) {
  .headline {
    font-size: 2.6rem;
  }
}

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

.admin-page {
  max-width: 68rem;
}

.admin-title {
  font-weight: 500;
  font-size: 1.75rem;
  margin: 0 0 1.5rem;
}

.login-card {
  max-width: 22rem;
  margin: 3rem auto;
}

.summary {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 2.5rem;
  border: 1px solid var(--hairline);
  border-radius: 3px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}

.stat-num {
  font-size: 1.9rem;
  line-height: 1;
}

.stat-label {
  font-size: 0.95rem;
  color: rgba(59, 52, 43, 0.75);
}

.dietary-list {
  font-size: 1rem;
}

.admin-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.admin-controls label {
  font-size: 1rem;
}

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--field-border);
  border-radius: 3px;
}

table.rsvps {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.98rem;
}

table.rsvps th,
table.rsvps td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid rgba(59, 52, 43, 0.12);
  vertical-align: top;
  white-space: nowrap;
}

table.rsvps td.wrap {
  white-space: normal;
  min-width: 14rem;
}

table.rsvps thead th {
  background: rgba(166, 136, 76, 0.09);
  font-weight: 500;
}

tr.is-test {
  opacity: 0.55;
}

.row-actions {
  display: flex;
  gap: 0.4rem;
}

.mini-btn {
  font-family: inherit;
  font-size: 0.85rem;
  padding: 0.3rem 0.55rem;
  border: 1px solid var(--field-border);
  border-radius: 3px;
  background: #fffdf8;
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
}

.mini-btn.danger {
  color: var(--error);
  border-color: rgba(155, 61, 47, 0.4);
}

.link-btn {
  background: none;
  border: none;
  color: var(--gold-dark);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0;
  text-decoration: underline;
}
