/* RSVP page. Patterns shared across steps: red section labels, 500-weight subtitles, outlined
   secondary buttons, red-filled segmented toggles, and actions aligned to the right edge. */

/* Page layout: introduction column on the left, the step workspace on the right. */
.rsvp-page .header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--paper);
}
.rsvp-layout {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: clamp(3rem, 8vw, 9rem);
  margin: 0 var(--gutter);
  padding: clamp(2rem, 6vh, 5rem) 0 5rem;
  max-width: 1400px;
}
.rsvp-heading {
  align-self: start;
  position: sticky;
  top: 180px;
}
.rsvp-heading h1 {
  margin: 1.3rem 0 1.5rem;
}
.rsvp-heading .intro {
  max-width: 28rem;
}
.rsvp-date {
  margin-top: 2rem;
  color: var(--muted);
}
.rsvp-deadline {
  margin-top: 1.75rem;
  padding: 0.9rem 0 0;
  border-top: 1px solid var(--line);
  max-width: 24rem;
}
.rsvp-deadline .eyebrow {
  color: var(--red);
  margin-bottom: 0.3rem;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
}
.rsvp-deadline p:not(.eyebrow) {
  color: var(--muted);
}
.rsvp-reminder.rsvp-cal-line {
  margin-top: 0.6rem;
}
.rsvp-reminder[hidden] {
  display: none;
}
.rsvp-workspace {
  min-width: 0;
  max-width: 650px;
  width: 100%;
}
.rsvp-workspace [hidden] {
  display: none !important;
}

/* Step bar: number and label on one line; the current step is red and underlined. */
.rsvp-steps {
  display: flex;
  list-style: none;
  margin: 0 0 2.5rem;
  padding: 0;
  gap: 1rem;
  counter-reset: step;
  border-bottom: 1px solid var(--line);
}
.rsvp-steps li {
  flex: 1;
  counter-increment: step;
  padding: 0 0 0.8rem;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.rsvp-steps li::before {
  content: "0" counter(step);
  display: inline;
  margin: 0 0.5rem 0 0;
}
.rsvp-steps [aria-current="step"] {
  color: var(--red);
  border-color: var(--red);
}
.rsvp-notice {
  margin: 0 0 1.75rem;
  padding: 1rem;
  background: #eee5dc;
  border-left: 2px solid var(--red);
}
.rsvp-status {
  color: var(--red);
  margin-top: 1.5rem;
}
.rsvp-status:empty {
  display: none;
}

/* Headings, labels and help text. Headings take focus on each step change for screen readers. */
.rsvp-workspace h2 {
  margin: 0 0 1.5rem;
}
.rsvp-workspace h2[tabindex="-1"]:focus {
  outline: none;
}
.rsvp-workspace :where(label:not(.rsvp-choice)),
.rsvp-workspace legend {
  display: block;
  margin-bottom: 0.6rem;
}
.rsvp-workspace .rsvp-subtitle {
  display: block;
  margin: 0 0 0.3rem;
  color: var(--ink);
}
.rsvp-workspace label.rsvp-subtitle {
  margin-bottom: 0.4rem;
}

/* A field label that follows another field gets a clear gap above it. */
.rsvp-workspace :is(input, textarea, select) + label.rsvp-subtitle {
  margin-top: 1.5rem;
}
.rsvp-help {
  margin: 0.55rem 0 1.5rem;
  color: var(--muted);
}
.rsvp-required {
  color: var(--red);
  margin-left: 0.2em;
}
.rsvp-optional {
  color: var(--muted);
  font-weight: 400;
}
.rsvp-required-key {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  margin: 0 0 0.6rem;
  text-align: right;
  color: var(--muted);
}
.rsvp-required-legend {
  margin-left: auto;
}

/* Fields. Text fields show focus with a darker border; buttons and checkboxes keep the red outline. */
.rsvp-workspace input:not([type="radio"]):not([type="checkbox"]),
.rsvp-workspace textarea {
  display: block;
  width: 100%;
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid #b9b2a7;
  border-radius: 0;
  padding: 0.85rem 1rem;
  color: var(--ink);
  box-sizing: border-box;
  min-height: 48px;
}
.rsvp-workspace textarea {
  resize: vertical;
  min-height: 90px;
}
.rsvp-workspace input::placeholder {
  color: var(--muted);
  opacity: 0.75;
}
.rsvp-workspace .rsvp-followup input[type="date"] {
  display: inline-block;
  width: auto;
  min-height: 40px;
  padding: 0.35rem 0.7rem;
}
.rsvp-workspace select {
  appearance: none;
  -webkit-appearance: none;
  min-height: 40px;
  min-width: 3.6rem;
  padding: 0.35rem 1.7rem 0.35rem 0.7rem;
  border: 1px solid #b9b2a7;
  border-radius: 0;
  color: var(--ink);
  cursor: pointer;
  background-color: rgba(255, 255, 255, 0.35);
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position:
    calc(100% - 14px) 52%,
    calc(100% - 10px) 52%;
  background-size: 4px 4px;
  background-repeat: no-repeat;
}
.rsvp-workspace input:focus-visible,
.rsvp-workspace button:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}
.rsvp-workspace input:not([type="radio"]):not([type="checkbox"]):focus-visible,
.rsvp-workspace textarea:focus-visible,
.rsvp-workspace select:focus-visible {
  outline: none;
  border-color: var(--ink);
}

/* Buttons and action rows: secondary link first, the primary button at the right edge. */
.rsvp-workspace .button {
  cursor: pointer;
  justify-content: center;
}
.rsvp-primary {
  min-width: 180px;
}
.rsvp-workspace button:disabled {
  opacity: 0.6;
  cursor: wait;
}
.rsvp-text-button {
  border: 0;
  background: none;
  color: var(--red);
  padding: 0.6rem 0;
  min-height: 44px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.rsvp-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}
.rsvp-actions-end {
  justify-content: flex-end;
}
.rsvp-help + .rsvp-actions-end {
  margin-top: 1rem;
}

/* Step 1: search results are outlined buttons, like the site's RSVP button. */
.rsvp-results {
  display: grid;
  gap: 0.7rem;
  margin-bottom: 2rem;
}
.rsvp-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  padding: 1rem;
  border: 1px solid #b98e82;
  background: rgba(247, 244, 237, 0.94);
  color: var(--red);
  cursor: pointer;
}
.rsvp-result:hover {
  background: #eee5dc;
  border-color: var(--red);
  color: var(--red);
}

/* Step 2: three equal sections, each bounded by a dark rule with the same header pattern. */
.rsvp-response-form {
  margin-top: 1.5rem;
}
.rsvp-section {
  border-top: 1px solid var(--ink);
  padding-top: 1.1rem;
}
.rsvp-section + .rsvp-section {
  margin-top: 3.5rem;
}
.rsvp-section-label {
  color: var(--red);
  margin: 0 0 0.9rem;
}
.rsvp-workspace .rsvp-section h2 {
  margin: 0 0 0.35rem;
}
.rsvp-section-caption {
  margin: 0 0 1.4rem;
}
.rsvp-response-form > .rsvp-actions {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  gap: 0.75rem 1.5rem;
  justify-content: flex-end;
}

/* Guests: one collapsible panel per person. */
.rsvp-guest-list {
  border-top: 1px solid var(--line);
}
.rsvp-guest-disclosure {
  border-bottom: 1px solid var(--line);
}
.rsvp-guest-heading {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem 1rem;
  padding: 1.2rem 0;
  align-items: center;
  min-height: 64px;
}
.rsvp-guest-heading::after {
  grid-column: 2;
  grid-row: 1/3;
  align-self: center;
  color: var(--muted);
}
.rsvp-guest-status {
  grid-column: 1;
  color: var(--muted);
}
.rsvp-guest-disclosure[data-complete="true"] .rsvp-guest-status {
  color: var(--red);
}
.rsvp-guest-disclosure[open] .rsvp-guest-heading {
  padding-bottom: 1rem;
}
.rsvp-guest {
  border: 0;
  margin: 0;
  padding: 0 0 1.6rem;
  min-width: 0;
}
.rsvp-options {
  border: 0;
  padding: 0;
  margin: 0 0 1.35rem;
  min-width: 0;
}
.rsvp-guest-details,
.rsvp-shared-fields {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
.rsvp-options legend {
  padding: 0;
}
.rsvp-notes {
  display: grid;
  gap: 1.1rem;
}

/* Checkbox choices (languages, weekend plans). */
.rsvp-choice {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  border: 1px solid var(--line);
  padding: 0.8rem;
  cursor: pointer;
  min-height: 48px;
  box-sizing: border-box;
}
.rsvp-choice:has(input:checked) {
  border-color: var(--red);
  background: #b4322508;
  color: var(--red);
}
.rsvp-choice input {
  accent-color: var(--red);
  width: 17px;
  height: 17px;
  margin: 0;
}
.rsvp-language-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.25rem;
  margin: 0;
}
.rsvp-language-options .rsvp-choice {
  border: 0;
  background: none;
  padding: 0.45rem 0;
  min-height: 40px;
}
.rsvp-other-language {
  margin-top: 0.7rem;
}
.rsvp-event-list {
  display: grid;
}
.rsvp-event-list .rsvp-choice {
  border: 0;
  background: none;
  padding: 0.1rem 0;
  min-height: 34px;
}
.rsvp-event-list .rsvp-choice:has(input:checked) {
  background: none;
}
.rsvp-event-list .rsvp-event-locked {
  color: var(--muted);
  cursor: default;
}

/* Segmented toggles: Yes/No questions and accept/decline. Hidden radio, red fill when chosen. */
.rsvp-toggle {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
}
.rsvp-workspace .rsvp-toggle-option {
  position: relative;
  display: grid;
  margin: 0;
  place-items: center;
  min-width: 62px;
  min-height: 38px;
  padding: 0 0.9rem;
  cursor: pointer;
  color: var(--muted);
  box-sizing: border-box;
}
.rsvp-toggle-option + .rsvp-toggle-option {
  border-left: 1px solid var(--line);
}
.rsvp-toggle-option input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}
.rsvp-toggle-option:has(input:checked) {
  background: var(--red);
  color: var(--paper);
}
.rsvp-toggle-option:has(input:focus-visible) {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}
.rsvp-attendance {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin: 0;
  border: 1px solid var(--line);
}
.rsvp-attendance .rsvp-choice {
  position: relative;
  justify-content: center;
  min-height: 42px;
  margin: 0;
  padding: 0 0.9rem;
  border: 0;
  color: var(--muted);
  background: none;
}
.rsvp-attendance .rsvp-choice + .rsvp-choice {
  border-left: 1px solid var(--line);
}
.rsvp-attendance .rsvp-choice input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}
.rsvp-attendance .rsvp-choice:has(input:checked) {
  background: var(--red);
  color: var(--paper);
}
.rsvp-attendance .rsvp-choice:has(input:focus-visible) {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

/* Travel & family: a one-line question with its toggle; the follow-up appears only after "Yes". */
.rsvp-question-list {
  border-top: 1px solid var(--line);
}
.rsvp-question {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.7rem 1.5rem;
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--line);
}
.rsvp-workspace .rsvp-question .rsvp-subtitle {
  margin: 0;
}
.rsvp-followup {
  grid-column: 1/-1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1rem;
}
.rsvp-followup .rsvp-help {
  flex-basis: 100%;
  margin: 0;
}
.rsvp-workspace .rsvp-mini-label {
  display: inline;
  margin: 0;
  color: var(--muted);
}
.rsvp-inline-fields {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1.75rem;
}
.rsvp-mini {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}
.rsvp-ages {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

/* Step 3: saved status above the heading, check at the heading's right edge, then the summary. */
.rsvp-saved-label {
  color: var(--red);
  margin: 0 0 0.6rem;
}
.rsvp-workspace h2.rsvp-thanks {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.rsvp-confirm-icon {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 1.9em;
  height: 1.9em;
  margin-left: 0;
  vertical-align: 0;
  border: 1px solid var(--red);
  color: var(--red);
  border-radius: 50%;
  font: 400 0.45em/1 var(--sans);
}
.rsvp-summary {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
}
.rsvp-summary li {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}
.rsvp-summary span {
  color: var(--ink);
}
.rsvp-summary .rsvp-summary-status {
  color: var(--red);
}
.rsvp-summary-detail {
  flex-basis: 100%;
  color: var(--muted);
}
.rsvp-summary-message {
  white-space: pre-line;
  overflow-wrap: anywhere;
}

/* Calendar line (deadline reminder and saved events): icon and lead, then Google | Apple / Outlook
   as one small outlined pair. Several Google events open as a row of small outlined buttons. */
.rsvp-cal-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.6rem;
  margin: 1.25rem 0 0;
  color: var(--muted);
}
.rsvp-cal-intro {
  margin: 0 0 0.5rem;
  justify-content: flex-end;
}
.rsvp-cal-lead {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
.rsvp-cal-line .rsvp-cal-lead {
  color: var(--ink);
}
.rsvp-cal-line .calendar:before {
  width: 12px;
  height: 12px;
}
.rsvp-cal-line a,
.rsvp-cal-line button {
  color: var(--red);
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.rsvp-cal-line [aria-hidden] {
  color: var(--muted);
}
.rsvp-cal-line [hidden] {
  display: none;
}
.rsvp-cal-links {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1px solid #b98e82;
  background: rgba(247, 244, 237, 0.94);
}
.rsvp-cal-links > [aria-hidden] {
  display: none;
}
.rsvp-cal-events {
  flex-basis: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.15rem;
}
.rsvp-cal-intro .rsvp-cal-events {
  justify-content: flex-end;
}
.rsvp-cal-line .rsvp-cal-links > a,
.rsvp-cal-line .rsvp-cal-links > button,
.rsvp-cal-line .rsvp-cal-events > a {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 0.55rem;
  text-decoration: none;
  color: var(--red);
  box-sizing: border-box;
}
.rsvp-cal-line .rsvp-cal-links > * + * {
  border-left: 1px solid #b98e82;
}
.rsvp-cal-line .rsvp-cal-events > a {
  border: 1px solid #b98e82;
  background: rgba(247, 244, 237, 0.94);
}
.rsvp-cal-line .rsvp-cal-links > a:hover,
.rsvp-cal-line .rsvp-cal-links > button:hover,
.rsvp-cal-line .rsvp-cal-events > a:hover,
.rsvp-cal-links > [aria-expanded="true"] {
  background: #eee5dc;
}
.rsvp-cal-links:has(:hover),
.rsvp-cal-line .rsvp-cal-events > a:hover {
  border-color: var(--red);
}
.rsvp-cal-line a:focus-visible,
.rsvp-cal-line button:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

/* Responsive. */

@media (max-width: 800px) {
  .rsvp-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding-top: 2rem;
  }
  .rsvp-heading {
    position: static;
  }
  .rsvp-date {
    margin-top: 1rem;
  }
  .rsvp-steps {
    margin-bottom: 2rem;
  }
  .rsvp-page .header {
    position: relative;
  }
  .rsvp-workspace {
    max-width: none;
  }
  .rsvp-primary {
    width: 100%;
  }
  /* Phones: the primary button spans the width with its link centred below. */
  .rsvp-actions-end {
    flex-direction: column-reverse;
    align-items: stretch;
    text-align: center;
  }
}

@media (max-width: 480px) {
  /* Only the current step keeps its label; the others show their number (labels stay readable to screen readers). */
  .rsvp-steps {
    gap: 1.5rem;
  }
  .rsvp-steps li {
    flex: 0 0 auto;
  }
  .rsvp-steps li:not([aria-current]) {
    font-size: 0;
  }
  .rsvp-steps li:not([aria-current])::before {
    font-size: 0.8125rem;
    margin: 0;
  }
}

@media (max-width: 420px) {
  .rsvp-attendance .rsvp-choice {
    padding: 0 0.5rem;
    text-align: center;
  }
}
