/* Scoped under #rtv-donation-form so Webflow styles don't collide.
   Visual tokens from Figma (cream / ink / caper); layout unchanged. */

/* Self-hosted rather than fetched from fonts.googleapis.com: that import is
   render-blocking, needs allowlisting if Webflow ever adds a CSP, and sends
   every donor's IP to a third party on a page collecting personal data behind
   a consent checkbox. Paths are relative to this stylesheet, so they resolve
   under whatever ASSET_BASE_URL it is served from. */
@font-face {
  font-family: "Cabin";
  src: url("./fonts/Cabin-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("./fonts/IBMPlexSans-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("./fonts/IBMPlexSans-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("./fonts/IBMPlexSans-Italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

#rtv-donation-form {
  --rtv-cream: #fff9ec;
  --rtv-text: #0c3c49;
  --rtv-ink: #00282c;
  --rtv-ink-muted: rgba(0, 40, 44, 0.6);
  --rtv-border: rgba(12, 60, 73, 0.15);
  --rtv-caper: #d3ecb2;
  --rtv-font-body: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --rtv-font-display: "Cabin", Georgia, serif;

  max-width: 480px;
  margin: 0 auto;
  font-family: var(--rtv-font-body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--rtv-text);
  box-sizing: border-box;
}

#rtv-donation-form *,
#rtv-donation-form *::before,
#rtv-donation-form *::after {
  box-sizing: border-box;
}

#rtv-donation-form .rtv-screen {
  background: #fff9ec;
  padding: 48px 48px 40px;
  border-radius: 24px;
  box-sizing: border-box;
}

#rtv-donation-form .rtv-row {
  margin-bottom: 16px;
}
/* The last row is the screen's action button: its trailing margin only added
   dead space between the form and whatever the page puts below it. */
#rtv-donation-form .rtv-screen > .rtv-row:last-child {
  margin-bottom: 0;
}
/* Turnstile renders a fixed-width (~300px) iframe; center it under the
   full-width Continue button instead of leaving it flush left. */
#rtv-donation-form #rtv-turnstile {
  display: flex;
  justify-content: center;
}

#rtv-donation-form .rtv-title {
  margin: 0 0 24px;
  font-family: var(--rtv-font-display);
  font-weight: 500;
  font-size: 32px;
  line-height: 1.3;
  letter-spacing: -0.32px;
  color: var(--rtv-text);
}

#rtv-donation-form .rtv-section-label {
  display: block;
  margin: 0 0 8px;
  font-family: var(--rtv-font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--rtv-text);
}

#rtv-donation-form label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
  color: var(--rtv-text);
}

#rtv-donation-form input[type="text"],
#rtv-donation-form input[type="email"],
#rtv-donation-form input[type="tel"],
#rtv-donation-form input[type="number"],
#rtv-donation-form select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--rtv-border);
  border-radius: 4px;
  font-family: var(--rtv-font-body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--rtv-ink);
  background: var(--rtv-cream);
}

/* Native selects ignore the padding/line-height metrics above and render at
   the OS control height, so they sat shorter than the text inputs beside
   them. appearance:none makes them honor the shared box metrics; that also
   drops the native arrow, so draw our own chevron. */
#rtv-donation-form select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%230c3c49' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

#rtv-donation-form input::placeholder {
  color: var(--rtv-ink-muted);
}

#rtv-donation-form input:focus,
#rtv-donation-form select:focus {
  outline: 2px solid var(--rtv-ink);
  outline-offset: 1px;
}

#rtv-donation-form input + input {
  margin-top: 8px;
}

#rtv-donation-form .rtv-two-col {
  display: flex;
  gap: 12px;
}
#rtv-donation-form .rtv-two-col > div {
  flex: 1;
  min-width: 0;
}

#rtv-donation-form .rtv-freq-toggle {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
/* Amount tiles: always two per row (2 + 2 with four presets), never 3 + 1. */
#rtv-donation-form .rtv-presets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

#rtv-donation-form .rtv-toggle,
#rtv-donation-form .rtv-preset {
  /* No native button chrome anywhere (iOS in particular restyles <button>
     unless appearance is cleared), and longhand background-color so nothing
     else in the shorthand can be reset by a host-page rule. */
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
  padding: 10px 0;
  border: 1px solid var(--rtv-border);
  border-radius: 4px;
  background-color: var(--rtv-cream);
  background-image: none;
  color: var(--rtv-ink);
  font-family: var(--rtv-font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
#rtv-donation-form .rtv-toggle {
  flex: 1;
  min-width: 30%;
}

/* Selected state, styled off the class AND the aria-pressed attribute the
   script sets alongside it: the attribute selectors are more specific than
   any class-only rule the host page could add. */
#rtv-donation-form .rtv-selected,
#rtv-donation-form .rtv-toggle[aria-pressed="true"],
#rtv-donation-form .rtv-preset[aria-pressed="true"] {
  border-color: transparent;
  background-color: var(--rtv-ink);
  color: #fff;
  font-weight: 400;
}

/* Host-page defence — do not drop the !important flags.
   Webflow sites ship a blanket nav reset whose selector list ends in a bare
   element selector, e.g. on raisingthevillage.org:

     .w-nav-link:hover, ..., .w-button:hover, button:hover, a:hover {
       background-color: inherit !important;
       color: inherit !important;
       border-color: inherit !important;
     }

   That claims every button in this widget, and an author !important outranks
   specificity, so no amount of scoping on our side wins it — the colours have
   to be restated as !important too. The damage is worst on touch, where :hover
   sticks to the last tapped element: the amount tile a donor had just chosen
   kept resolving `inherit` to a transparent fill and the parent's text colour,
   so it showed as a bare outline instead of the filled selected state, and the
   Donate button lost its green. Each hovered state below is simply its resting
   state restated; genuine hover feedback stays on .rtv-primary as a filter,
   which the host rule cannot reach. */
#rtv-donation-form .rtv-toggle:hover,
#rtv-donation-form .rtv-preset:hover {
  background-color: var(--rtv-cream) !important;
  border-color: var(--rtv-border) !important;
  color: var(--rtv-ink) !important;
}
#rtv-donation-form .rtv-selected:hover,
#rtv-donation-form .rtv-toggle[aria-pressed="true"]:hover,
#rtv-donation-form .rtv-preset[aria-pressed="true"]:hover {
  background-color: var(--rtv-ink) !important;
  border-color: transparent !important;
  color: #fff !important;
}
#rtv-donation-form .rtv-back:hover {
  background-color: transparent !important;
  color: var(--rtv-ink) !important;
}
#rtv-donation-form .rtv-tooltip-trigger:hover {
  background-color: var(--rtv-cream) !important;
  border-color: var(--rtv-border) !important;
  color: #0c3c49 !important;
}
.rtv-modal-close:hover {
  background-color: transparent !important;
  color: #00282c !important;
}

#rtv-donation-form .rtv-primary {
  width: 100%;
  padding: 12px 24px;
  border: 1px solid var(--rtv-caper);
  border-radius: 100px;
  background: var(--rtv-caper);
  color: var(--rtv-ink);
  font-family: var(--rtv-font-body);
  font-size: 17px;
  font-weight: 500;
  cursor: pointer;
}

#rtv-donation-form .rtv-primary:hover {
  background-color: var(--rtv-caper) !important;
  border-color: var(--rtv-caper) !important;
  color: var(--rtv-ink) !important;
  filter: brightness(0.97);
}
#rtv-donation-form .rtv-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  filter: none;
}

#rtv-donation-form .rtv-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 4px;
}
#rtv-donation-form .rtv-checkbox label {
  font-weight: 400;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 14px;
  margin-bottom: 0;
  color: var(--rtv-ink);
}

#rtv-donation-form .rtv-checkbox input {
  margin: 3px 0 0;
  flex-shrink: 0;
  accent-color: var(--rtv-ink);
}

/* Error / notice sit under the card: centered with breathing room so they
   read as part of the form rather than stray page text. */
#rtv-donation-form .rtv-error,
#rtv-donation-form .rtv-notice {
  font-size: 14px;
  text-align: center;
  margin: 0;
  padding: 16px 24px 0;
}
#rtv-donation-form .rtv-error {
  color: #9b1c1c;
}
#rtv-donation-form .rtv-notice {
  color: var(--rtv-text);
}
#rtv-donation-form #rtv-payment-element {
  margin: 16px 0;
}

/* Custom amount with in-field currency suffix (deck Screen 1). */
#rtv-donation-form .rtv-amount-wrap {
  position: relative;
}
#rtv-donation-form .rtv-amount-wrap input {
  padding-right: 60px;
}
#rtv-donation-form .rtv-currency-suffix {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--rtv-ink-muted);
  font-size: 14px;
  font-weight: 500;
  pointer-events: none;
}

/* Tax-deductibility note under the amounts; the region toggle does the switching. */
#rtv-donation-form .rtv-tax-note {
  font-size: 13px;
  font-style: italic;
  color: var(--rtv-ink);
  margin: 0 0 16px;
}

/* Back link on screens 2-4. */
#rtv-donation-form .rtv-back {
  display: inline-block;
  margin: 0 0 32px;
  padding: 0;
  background: none;
  border: none;
  color: var(--rtv-ink);
  font-family: var(--rtv-font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

/* "?" tooltips (org + fee checkboxes). Hover or keyboard focus shows them. */
#rtv-donation-form .rtv-tooltip {
  position: relative;
  display: inline-block;
}
#rtv-donation-form .rtv-tooltip-trigger {
  width: 18px;
  height: 18px;
  padding: 0;
  border: 1px solid var(--rtv-border);
  border-radius: 50%;
  background: var(--rtv-cream);
  color: var(--rtv-ink-muted);
  font-family: var(--rtv-font-body);
  font-size: 12px;
  line-height: 1;
  cursor: help;
}
#rtv-donation-form .rtv-tooltip-text {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  width: 240px;
  padding: 8px 10px;
  border-radius: 4px;
  background: var(--rtv-ink);
  color: var(--rtv-cream);
  font-size: 12px;
  font-weight: 400;
  z-index: 10;
}
#rtv-donation-form .rtv-tooltip:hover .rtv-tooltip-text,
#rtv-donation-form .rtv-tooltip:focus-within .rtv-tooltip-text {
  display: block;
}

/* Consent checkbox: smaller legal text. */
#rtv-donation-form .rtv-consent label {
  font-size: 13px;
  line-height: 1.4;
}
#rtv-donation-form .rtv-consent a {
  color: var(--rtv-ink);
  font-weight: 500;
}

/* Payment screen totals. */
#rtv-donation-form .rtv-total-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 15px;
  color: var(--rtv-text);
}
#rtv-donation-form .rtv-total-row.rtv-total {
  font-size: 17px;
  border-top: 1px solid var(--rtv-border);
  padding-top: 8px;
  margin-bottom: 16px;
}
#rtv-donation-form #rtv-payment-loading {
  color: var(--rtv-ink-muted);
  font-size: 14px;
}

/* Modal mode ([data-rtv-donate] triggers). */
.rtv-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
}
.rtv-modal-overlay.rtv-open {
  display: block;
}
.rtv-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 40, 44, 0.45);
}
.rtv-modal {
  position: relative;
  max-width: 520px;
  margin: 5vh auto;
  max-height: 90vh;
  overflow-y: auto;
  background: #fff9ec;
  border-radius: 24px;
  padding: 32px 24px 24px;
  box-sizing: border-box;
  color: #0c3c49;
  font-family: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
}
.rtv-modal-close {
  position: absolute;
  top: 8px;
  right: 12px;
  padding: 4px 8px;
  border: none;
  background: none;
  font-size: 22px;
  line-height: 1;
  color: #00282c;
  cursor: pointer;
}

/* Optional content panel ([data-rtv-donate][data-rtv-panel] triggers). The
   panel column exists in every overlay but stays collapsed until a panel is
   actually mounted. */
.rtv-modal-panel {
  display: none;
}
.rtv-modal--wide {
  max-width: 1100px;
  width: calc(100% - 32px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 480px;
  gap: 32px;
}
.rtv-modal--wide .rtv-modal-panel {
  display: block;
  min-width: 0;
  /* Grid items stretch to the row by default, so when the form column grew
     (Stripe's card form expanding) the panel grew with it and its content
     drifted down the column, leaving a gap under the image. Keep the panel
     at its own height, anchored to the top. */
  align-self: start;
}
/* In the two-column modal a tall form must scroll inside its own (right)
   column, not scroll the whole dialog and drag the panel off-screen. Cap
   each column at the modal's inner height (90vh minus 32px top / 24px
   bottom padding) and let it scroll itself; the modal then never exceeds
   90vh, so its own overflow-y:auto never engages. */
.rtv-modal--wide .rtv-modal-panel,
.rtv-modal--wide .rtv-modal-body {
  max-height: calc(90vh - 56px);
  overflow-y: auto;
}
/* RTV hides the source block in their page with an inline style or a class;
   !important in a stylesheet beats both, so one rule un-hides it here and the
   script never has to touch their element's style attribute. */
.rtv-modal-panel > .rtv-modal-panel-content {
  display: block !important;
}
.rtv-modal-panel img {
  max-width: 100%;
  height: auto;
  display: block;
}
/* Put this class on the panel's source Div Block in Webflow (instead of an
   inline style or a Webflow "Display: none" setting) to keep it hidden in the
   page. The mounted-state rule above un-hides it with !important. */
.rtv-panel-source {
  display: none;
}
/* Styling for the sample campaign panel in docs/webflow/modal-with-image.html.
   Real panels are styled in Webflow; these rules only dress the reference
   markup so the test embed looks presentable out of the box. */
.rtv-panel-demo img {
  border-radius: 16px;
  margin-bottom: 20px;
}
.rtv-panel-demo h2 {
  margin: 0 0 12px;
  font-size: 26px;
  line-height: 1.25;
}
.rtv-panel-demo p {
  margin: 0 0 16px;
  font-size: 15px;
  line-height: 1.5;
}
.rtv-panel-demo a {
  color: inherit;
  font-weight: 600;
}

/* Focus targets for the per-screen headings: announced, never seen. */
#rtv-donation-form .rtv-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Visible focus ring on the programmatically focused headings. */
#rtv-donation-form .rtv-screen h2:focus-visible,
#rtv-donation-form button:focus-visible {
  outline: 2px solid var(--rtv-ink);
  outline-offset: 2px;
}

/* Phones. The stylesheet had no breakpoints at all: 48px of padding on each
   side plus a non-wrapping two-column row left roughly 110px per field on a
   375px screen, and the modal touched both edges. */
@media (max-width: 480px) {
  #rtv-donation-form .rtv-screen {
    padding: 24px 16px;
    border-radius: 16px;
  }
  #rtv-donation-form .rtv-title {
    font-size: 26px;
    margin-bottom: 16px;
  }
  #rtv-donation-form .rtv-two-col {
    flex-direction: column;
    gap: 0;
  }
  #rtv-donation-form .rtv-two-col > div + div {
    margin-top: 16px;
  }
  #rtv-donation-form .rtv-toggle {
    min-width: calc(50% - 4px);
  }
  #rtv-donation-form .rtv-back {
    margin-bottom: 20px;
  }
  #rtv-donation-form .rtv-tooltip-text {
    width: min(240px, 70vw);
  }
  .rtv-modal {
    margin: 0;
    min-height: 100%;
    max-height: none;
    border-radius: 0;
    padding: 56px 16px 32px;
  }
  .rtv-modal-overlay.rtv-open {
    overflow-y: auto;
  }
}

/* Below the two-column threshold the panel is dropped entirely: phones and
   portrait tablets get the form only, in the plain single-column modal. */
@media (max-width: 899px) {
  .rtv-modal--wide {
    max-width: 520px;
    display: block;
  }
  .rtv-modal--wide .rtv-modal-panel {
    display: none;
  }
  /* Single column again: back to the plain modal's whole-dialog scrolling,
     no nested scroll region. */
  .rtv-modal--wide .rtv-modal-body {
    max-height: none;
    overflow-y: visible;
  }
}
