/* ============================================================
   Love Fest — Clara & Philipp
   A quiet, typographic system: off-white ground, black text,
   0.75px rules, underlined links. No pills, no cards, no fills,
   no rounded corners.
   ============================================================ */

:root {
  --paper: #faf9f6;
  --ink: #000000;
  --ink-soft: #55554f;
  --link: #00829d;
  --link-hover: #e7776e;
  --rule: rgba(0, 0, 0, 1);
  --rule-w: 0.75px;
  /* Field underlines sit apart from the black section dividers. */
  --field-rule: #bdbdb8;
  --error: #c0392b;

  --font: "Fraunces", "Iowan Old Style", Georgia, serif;

  --measure: 46rem;      /* the reading column */
  --gap: clamp(2.5rem, 6vw, 5rem);
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-optical-sizing: auto;
  font-variation-settings: "SOFT" 0, "WONK" 0;
  min-height: 100vh;
}

/* Nothing in this design is rounded. */
input, select, textarea, button, img, table, fieldset, details {
  border-radius: 0;
}

/* ---------- typography ---------- */

h1, h2, h3, h4, legend {
  font-family: var(--font);
  font-weight: 600;
  font-style: italic;
  line-height: 1.2;
  color: var(--ink);
  margin: 0 0 0.6em;
  text-wrap: balance;
}

h1 { font-size: clamp(1.9rem, 4.5vw, 2.6rem); }
h2 { font-size: clamp(1.45rem, 3vw, 1.8rem); }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

ul, ol { padding-left: 1.15rem; margin: 0 0 1em; }
li { margin-bottom: 0.35em; }

strong { font-weight: 600; }
em { font-style: italic; }

small { font-size: 0.875rem; }

/* ---------- links: the only interactive treatment ---------- */

a,
.btn,
button.btn {
  color: var(--link);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  text-decoration-thickness: from-font;
  background: none;
  border: 0;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  transition: color 0.1s ease;
}

a:hover,
a:focus-visible,
.btn:hover,
.btn:focus-visible,
button.btn:hover,
button.btn:focus-visible {
  color: var(--link-hover);
}

/* Buttons are links with a little more air around them. */
.btn { display: inline-block; }
.btn-large { font-size: 1.125rem; }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1.75rem;
  margin-top: 1.75rem;
}
.actions-centred { justify-content: center; }

/* ---------- rules and layout ---------- */

hr,
.rule {
  border: 0;
  border-top: var(--rule-w) solid var(--rule);
  margin: var(--gap) 0;
}

.page {
  max-width: var(--measure);
  margin: 0 auto;
  padding: clamp(2.5rem, 7vw, 5rem) clamp(1.25rem, 5vw, 2rem)
           clamp(3rem, 8vw, 6rem);
}

/* Every section is preceded by a hairline. Form sections live in two
   places — directly in the form and inside the attending block — so the
   rule is set on all of them and removed from the very first. */
.section + .section,
.section + .rule,
.form-section {
  border-top: var(--rule-w) solid var(--rule);
  margin-top: var(--gap);
  padding-top: var(--gap);
}

#rsvp-form > .form-section:first-of-type {
  border-top: 0;
  padding-top: 0;
}

/* The panel already draws a rule beneath itself. */
details + .section { padding-top: 0; }

.hidden { display: none !important; }
.js .js-hidden { display: none !important; }

/* ---------- masthead ---------- */

.masthead {
  text-align: center;
  padding-bottom: var(--gap);
}

.masthead-art {
  display: block;
  width: min(100%, 525px);
  height: auto;
  margin: 0 auto 1.75rem;
}

.masthead-line {
  font-size: clamp(1rem, 2.2vw, 1.15rem);
  font-style: italic;
  max-width: 34rem;
  margin: 0 auto;
  text-wrap: balance;
}

/* The wordmark alone, used at the top of inner pages. */
.wordmark {
  display: block;
  width: min(60%, 210px);
  height: auto;
  margin: 0 auto 1.5rem;
}

.page-head {
  text-align: center;
  padding-bottom: var(--gap);
  border-bottom: var(--rule-w) solid var(--rule);
}
.page-head h1 { margin-bottom: 0.25rem; }
.page-head .sub { color: var(--ink-soft); margin: 0; }
.back-link { display: inline-block; margin-bottom: 1.5rem; }

/* ---------- tables: horizontal rules only ---------- */

.table-scroll { overflow-x: auto; margin: 1.5rem 0; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.97rem;
}

th, td {
  text-align: left;
  padding: 0.6rem 1.25rem 0.6rem 0;
  border-bottom: var(--rule-w) solid var(--rule);
  vertical-align: top;
}

thead th {
  font-weight: 600;
  font-style: italic;
  white-space: nowrap;
}

tbody tr:last-child td { border-bottom: 0; }

.num,
.nowrap { white-space: nowrap; }

/* ---------- definition lists ---------- */

.summary { margin: 1.5rem 0; }
.summary-row {
  display: grid;
  grid-template-columns: 12rem 1fr;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: var(--rule-w) solid var(--rule);
}
.summary-row:last-child { border-bottom: 0; }
.summary dt { font-weight: 600; margin: 0; }
.summary dd { margin: 0; }

@media (max-width: 560px) {
  .summary-row { grid-template-columns: 1fr; gap: 0.15rem; }
}

/* ---------- expandable panel ---------- */

details {
  border-top: var(--rule-w) solid var(--rule);
  border-bottom: var(--rule-w) solid var(--rule);
  margin: 0 0 var(--gap);
}

summary {
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  font-style: italic;
  font-size: 1.15rem;
  color: var(--link);
  padding: 1rem 0;
  text-align: center;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}
summary::-webkit-details-marker { display: none; }
summary:hover { color: var(--link-hover); }

.details-body { padding: 0 0 1.5rem; }
.details-body h3 { margin-top: 1.75rem; }
.details-body h4 { margin-top: 1.25rem; margin-bottom: 0.3rem; }

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

.field { margin-bottom: 1.5rem; }

label,
.field-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="password"],
input[type="search"],
select,
textarea {
  width: 100%;
  font-family: var(--font);
  font-size: 1rem;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--field-rule);
  padding: 0.45rem 0;
}

::placeholder {
  color: var(--field-rule);
  opacity: 1;
}

input:focus,
select:focus,
textarea:focus {
  outline: 0;
  border-bottom-width: 2px;
  border-bottom-color: var(--link);
}

textarea { resize: vertical; }

.hint {
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin: 0.35rem 0 0;
}

.req { color: var(--link); font-weight: 600; }

.field-error {
  color: var(--error);
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0.35rem 0 0;
}

.form-banner {
  border-top: var(--rule-w) solid var(--error);
  border-bottom: var(--rule-w) solid var(--error);
  color: var(--error);
  font-weight: 600;
  padding: 0.75rem 0;
  margin: 0 0 var(--gap);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 1.5rem;
}

/* choices: a plain control and its label, nothing more */

.choice {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  font-weight: 400;
  margin-bottom: 0.5rem;
  cursor: pointer;
}
.choice input { margin: 0; accent-color: var(--link); flex: none; }
.choice:hover { color: var(--link-hover); }

.choice-row { display: flex; flex-wrap: wrap; gap: 1.75rem; }
.choice-row .choice { margin-bottom: 0; }

.choice-stack { margin-top: 0.5rem; }

.choice-detail {
  display: block;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

fieldset {
  border: 0;
  border-top: var(--rule-w) solid var(--rule);
  padding: 1.25rem 0 0;
  margin: 1.75rem 0 0;
}
legend { padding: 0 0.75rem 0 0; font-size: 1rem; }

.step {
  font-style: normal;
  font-weight: 400;
  color: var(--ink-soft);
  margin-right: 0.6rem;
}

.optional {
  font-style: normal;
  font-weight: 400;
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin-left: 0.5rem;
}

.total-line {
  font-size: 1.25rem;
  font-weight: 600;
  font-style: italic;
}

.form-submit {
  margin-top: var(--gap);
  padding-top: var(--gap);
  border-top: var(--rule-w) solid var(--rule);
}

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- the edit code ---------- */

.edit-code-block {
  margin: var(--gap) 0;
  padding: 1.5rem 0;
  border-top: var(--rule-w) solid var(--rule);
  border-bottom: var(--rule-w) solid var(--rule);
}
.edit-code {
  font-size: clamp(1.8rem, 5vw, 2.4rem);
  font-weight: 600;
  font-style: italic;
  margin: 0.25rem 0 0.5rem;
}
.code-input {
  font-size: 1.5rem;
  font-weight: 600;
}

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

.site-footer {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 1.5rem clamp(1.25rem, 5vw, 2rem) 3rem;
  border-top: var(--rule-w) solid var(--rule);
  color: var(--ink-soft);
  font-size: 0.9rem;
}

/* ---------- dashboard ---------- */

.dashboard { max-width: 78rem; }

.dash-head {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 1.5rem;
  border-bottom: var(--rule-w) solid var(--rule);
}
.dash-head h1 { margin: 0; }
.dash-actions { display: flex; gap: 1.75rem; align-items: baseline; }

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 2rem;
  padding: 2rem 0;
  border-bottom: var(--rule-w) solid var(--rule);
}
.stat-value {
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 600;
  font-style: italic;
  line-height: 1;
  margin: 0 0 0.35rem;
}
.stat-label { margin: 0; font-weight: 600; }
.stat-sub { margin: 0.15rem 0 0; color: var(--ink-soft); font-size: 0.9rem; }

.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
  gap: var(--gap);
  padding: var(--gap) 0;
  border-bottom: var(--rule-w) solid var(--rule);
}
.dash-block h3 { margin-bottom: 0.75rem; }

.count-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  padding: 0.45rem 0;
  border-bottom: var(--rule-w) solid var(--rule);
}
.count-row:last-child { border-bottom: 0; }
.count-row .n { font-weight: 600; font-variant-numeric: tabular-nums; }

.note-list { list-style: none; padding: 0; margin: 0; }
.note-list li {
  padding: 0.45rem 0;
  border-bottom: var(--rule-w) solid var(--rule);
}
.note-list li:last-child { border-bottom: 0; }

.table-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: baseline;
  justify-content: space-between;
  padding-top: var(--gap);
}
.table-controls h2 { margin: 0; }
.table-controls input,
.table-controls select { width: auto; min-width: 12rem; }

.row-toggle {
  font-weight: 600;
  color: var(--link);
  margin-right: 0.4rem;
  text-decoration: none;
}
.row-toggle:hover { color: var(--link-hover); }

.row-email { display: block; color: var(--ink-soft); font-size: 0.85rem; }

.reg-detail td { padding-bottom: 1.25rem; }
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 0.5rem 2rem;
  margin: 0;
}
.detail-grid dt { font-weight: 600; }
.detail-grid dd { margin: 0 0 0.5rem; }

.is-declined td { color: var(--ink-soft); }

/* ---------- narrow screens ---------- */

@media (max-width: 640px) {
  .dash-head, .table-controls { flex-direction: column; align-items: stretch; }
  .actions { gap: 1.25rem; }
}


/* ============================================================
   The stay table
   Three columns that need very different amounts of room: a short
   label, a date that reads best over two lines, and a sentence.
   ============================================================ */

.stay-table { table-layout: fixed; }
.stay-table th:nth-child(1), .stay-table .stay-len   { width: 5.5rem; }
.stay-table th:nth-child(2), .stay-table .stay-dates { width: 12rem; }
.stay-table th:nth-child(3), .stay-table .stay-note  { width: auto; }

.stay-table .stay-len { white-space: nowrap; font-weight: 600; }
.stay-table td { padding-top: 0.9rem; padding-bottom: 0.9rem; }

/* The date reads better broken after the dash than wrapped at whatever
   word happens to fall at the column edge. */
.stay-table .stay-dates .d-from,
.stay-table .stay-dates .d-to { white-space: nowrap; }
.stay-table .stay-dates .d-to { display: block; }

@media (max-width: 700px) {
  /* Three columns cannot share a phone screen without one of them being
     squeezed to a word per line, so each row becomes its own block. */
  .stay-table,
  .stay-table tbody,
  .stay-table tr,
  .stay-table td { display: block; width: auto; }

  .stay-table thead { display: none; }

  .stay-table tr {
    padding: 1.1rem 0;
    border-bottom: var(--rule-w) solid var(--rule);
  }
  .stay-table tr:last-child { border-bottom: 0; }

  .stay-table td {
    border-bottom: 0;
    padding: 0;
  }
  .stay-table .stay-len {
    font-size: 1.15rem;
    font-style: italic;
    margin-bottom: 0.15rem;
  }
  .stay-table .stay-dates {
    color: var(--ink-soft);
    margin-bottom: 0.4rem;
  }
  /* full width here, so the date fits on one line */
  .stay-table .stay-dates .d-to { display: inline; }
}

/* ============================================================
   Motion
   The page settles in once; the panel fades its contents in when
   opened. Both are skipped when the reader prefers less movement.
   ============================================================ */

@keyframes fol-rise {
  from { opacity: 0; transform: translateY(0.6rem); }
  to   { opacity: 1; transform: none; }
}

@keyframes fol-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@media (prefers-reduced-motion: no-preference) {
  /* The lockup arrives first, then the line under it, then the links,
     then everything below the fold. */
  .landing .masthead-art  { animation: fol-rise 0.9s ease-out both; }
  .landing .masthead-line { animation: fol-rise 0.7s 0.55s ease-out both; }
  .landing .masthead .actions { animation: fol-rise 0.7s 0.85s ease-out both; }
  .landing > details,
  .landing > .section { animation: fol-fade 0.6s 1.1s ease-out both; }

  details[open] .details-body { animation: fol-rise 0.35s ease-out; }
}

/* ---------- language switch ---------- */

.lang-switch {
  max-width: var(--measure);
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 3rem) clamp(1.25rem, 5vw, 2rem) 0;
  text-align: center;
  font-size: 0.95rem;
}

/* The switch already provides the space above the masthead. */
.lang-switch + .page { padding-top: clamp(1.5rem, 4vw, 2.5rem); }

.lang-switch a { font-weight: 600; }

.lang-current {
  font-weight: 600;
  color: var(--ink);
}

.lang-sep {
  color: var(--ink-soft);
  padding: 0 0.5rem;
}

/* The dashboard runs wider than the reading column. */
.page-admin .lang-switch { display: none; }

/* Dashboard row actions. The controls are links, like everything else that
   does something; only the spacing between them is new. */
.inline-form { display: inline; }

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 1rem;
}

.removed-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

/* The email status line, under the dashboard header. */
.mail-status {
  margin: 0 0 1.5rem;
  padding-top: 0.75rem;
  border-top: var(--rule-w) solid var(--rule);
}

.mail-status code { font-size: 0.9em; }

/* Off, or failing: full-strength ink so it is not read as a footnote. */
.mail-status.is-alert { color: var(--ink); }
