/* =================================================================
   BOSHOFF TROUE — RSVP Page Styles
   ================================================================= */

/* ── Page wrapper (full-width maroon panel) ──────────────────────── */
.rsvp-page {
  background-color: var(--wedding-maroon);
  color: var(--wedding-cream);
  padding: clamp(80px, 12vh, 160px) 40px clamp(80px, 12vh, 160px);
  box-sizing: border-box;
  /* Break out of the parent container to span the viewport, same as
     the Inligting page sections. */
  width: calc(100vw - var(--scrollbar-width)) !important;
  max-width: calc(100vw - var(--scrollbar-width)) !important;
  margin-left: calc(-50vw + 50% + var(--scrollbar-width) / 2) !important;
  margin-right: calc(-50vw + 50% + var(--scrollbar-width) / 2) !important;
}

.rsvp-page-inner {
  max-width: 760px;
  margin: 0 auto;
}

.rsvp-page-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(36px, 5vw, 60px);
  font-weight: 400;
  line-height: 1.15;
  color: var(--wedding-cream);
  margin: 0 0 clamp(48px, 8vh, 80px);
}

/* ── Form layout ─────────────────────────────────────────────────── */
.rsvp-form {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.rsvp-field {
  display: flex;
  flex-direction: column;
}

.rsvp-label {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--wedding-cream);
  margin-bottom: 16px;
  display: block;
}

.rsvp-label-hint {
  font-weight: 400;
  opacity: 0.85;
}

/* ── Text inputs (underline-only style) ──────────────────────────── */
/* Selector + !important override Blocksy's parent-theme input box. */
.rsvp-page input.rsvp-input {
  background: transparent !important;
  border: none !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.4) !important;
  color: var(--wedding-cream);
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  padding: 10px 0;
  outline: none;
  width: 100%;
  /* iOS Safari + Blocksy force a default rounded box on inputs. */
  -webkit-appearance: none;
  appearance: none;
  border-radius: 0 !important;
  box-shadow: none !important;
  transition: border-color 0.2s;
}

.rsvp-page input.rsvp-input:focus {
  border-bottom-color: var(--wedding-cream) !important;
  box-shadow: none !important;
  outline: none;
}

/* Override the browser's yellow autofill background which would look
   wrong on the maroon panel. */
.rsvp-input:-webkit-autofill,
.rsvp-input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--wedding-cream);
  -webkit-box-shadow: 0 0 0 1000px var(--wedding-maroon) inset;
  transition: background-color 5000s ease-in-out 0s;
}

/* ── Sal jy bywoon? — radio buttons styled as toggle pills ───────── */
/* Grid with 1fr 1fr forces equal-width columns regardless of label
   text length — flex: 1 wasn't holding because Blocksy applies a
   conflicting width on <label> elements. */
.rsvp-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  max-width: 460px;
}

.rsvp-radio {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.rsvp-toggle-option {
  /* Wrapper so the grid only sees two items (not four including the
     absolutely-positioned radio inputs). */
  display: block;
}

.rsvp-toggle-btn {
  display: block;
  width: 100%;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--wedding-maroon);
  background-color: var(--wedding-cream);
  padding: 16px 24px;
  border: 1px solid var(--wedding-cream);
  cursor: pointer;
  user-select: none;
  text-align: center;
  box-sizing: border-box;
  transition: background-color 0.2s, color 0.2s;
}

/* Once the user has picked an option, the unselected one becomes
   outlined so the choice is visually clear. JS adds .has-selection
   on the wrapper after the first click. */
.rsvp-toggle.has-selection .rsvp-toggle-option .rsvp-radio:not(:checked) + .rsvp-toggle-btn {
  background-color: transparent;
  color: var(--wedding-cream);
}

.rsvp-toggle-btn:hover {
  opacity: 0.9;
}

/* Keyboard focus ring for accessibility (the actual radio is
   visually hidden). */
.rsvp-radio:focus-visible + .rsvp-toggle-btn {
  outline: 2px solid var(--wedding-cream);
  outline-offset: 3px;
}

/* ── Submit button ───────────────────────────────────────────────── */
/* Selector + !important override Blocksy's parent-theme button styles
   which were leaving the button as text-only with a blue hover. */
.rsvp-page button.rsvp-submit-btn {
  align-self: flex-start;
  display: inline-block;
  margin-top: 16px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--wedding-maroon) !important;
  background-color: var(--wedding-cream) !important;
  padding: 16px 48px;
  border: none !important;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 0 !important;
  box-shadow: none !important;
  transition: opacity 0.2s;
}

.rsvp-page button.rsvp-submit-btn:hover,
.rsvp-page button.rsvp-submit-btn:focus {
  background-color: var(--wedding-cream) !important;
  color: var(--wedding-maroon) !important;
  opacity: 0.9;
  outline: none;
}

.rsvp-page button.rsvp-submit-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ── Inline error message (shown if submission fails) ────────────── */
.rsvp-error {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--wedding-cream);
  background-color: rgba(255, 100, 100, 0.12);
  border: 1px solid rgba(255, 180, 180, 0.5);
  padding: 12px 16px;
  margin: 0;
}

/* ── Thank-you state (shown after submit) ────────────────────────── */
/* JS adds .is-submitted onto .rsvp-page-inner. We hide the title and
   the form via CSS rather than the HTML [hidden] attribute because
   Blocksy overrides [hidden] on <form> elements. */
.rsvp-page-inner.is-submitted .rsvp-page-title,
.rsvp-page-inner.is-submitted .rsvp-form {
  display: none !important;
}

.rsvp-thankyou-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(32px, 4.5vw, 48px);
  font-weight: 400;
  color: var(--wedding-cream);
  margin: 0;
}

/* ── WordPress/Blocksy spacing overrides (mirrors inligting.css) ─── */
.page-template-template-rsvp .entry-content,
.page-template-template-rsvp .entry-content.is-layout-constrained {
  padding: 0 !important;
  max-width: 100% !important;
}

.page-template-template-rsvp .site-main {
  padding: 0;
}

.page-template-template-rsvp .entry-content > *,
.page-template-template-rsvp .entry-content > *:first-child,
.page-template-template-rsvp .entry-content > *:last-child {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  margin-block-start: 0 !important;
  margin-block-end: 0 !important;
}

.page-template-template-rsvp .ct-container,
.page-template-template-rsvp .ct-container-full {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

.page-template-template-rsvp article.post,
.page-template-template-rsvp article.page {
  margin: 0;
  padding: 0;
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .rsvp-page {
    padding: clamp(50px, 10vh, 100px) 24px clamp(60px, 10vh, 100px);
  }

  /* At 36px the long word "teenwoordigheid" is wider than the
     content area on narrow phones; the browser falls back to a
     mid-word break (e.g. "teenwoordighei | d"). Smaller clamp gives
     it room to fit on one line. */
  .rsvp-page-title {
    font-size: clamp(28px, 8vw, 40px);
  }

  .rsvp-form {
    gap: 36px;
  }

  .rsvp-toggle {
    gap: 12px;
    max-width: 100%;
  }

  .rsvp-toggle-btn {
    padding: 14px 12px;
  }

  .rsvp-submit-btn {
    align-self: stretch;
    text-align: center;
    padding: 16px;
  }
}
