/* WWC Donate Popup. Change --wwcd-accent in Settings → Donation Popup. */
.wwcd {
  --wwcd-accent: #1d3557;
  --wwcd-ink: #1b1f24;
  --wwcd-muted: #5b6470;
  --wwcd-line: #d5dae1;
  --wwcd-bg: #ffffff;
  --wwcd-soft: #f3f5f8;
  --wwcd-error: #b3261e;
  --wwcd-radius: 10px;
  box-sizing: border-box;
  max-width: 460px;
  margin: 0 auto;
  background: var(--wwcd-bg);
  color: var(--wwcd-ink);
  font-size: 16px;
  line-height: 1.45;
  text-align: left;
  overflow: hidden;
}
.wwcd *, .wwcd *::before, .wwcd *::after { box-sizing: border-box; }
.wwcd-main { padding: 32px 28px 28px; }

/* Two-column layout: image + text panel on the left, form on the right */
.wwcd--split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  max-width: 920px;
  border-radius: 12px;
}
.wwcd-side {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 100%;
  background-color: var(--wwcd-panel, var(--wwcd-accent));
  background-size: cover;
  background-position: center;
  color: #fff;
}
.wwcd-side::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.78) 0%, rgba(0,0,0,.35) 45%, rgba(0,0,0,0) 75%);
}
.wwcd--no-image .wwcd-side { align-items: center; }
.wwcd--no-image .wwcd-side::before { display: none; }
.wwcd-side-copy { position: relative; padding: 36px 32px; }
.wwcd .wwcd-side-title {
  text-wrap: balance;
  margin: 0 0 10px;
  padding: 0;
  font-size: 25px;
  line-height: 1.2;
  font-weight: 700;
  color: #fff;
}
.wwcd-side-text { font-size: 16px; line-height: 1.5; color: rgba(255,255,255,.92); }
.wwcd-side-text p { margin: 0 0 10px; padding: 0; }
.wwcd-side-text p:last-child { margin-bottom: 0; }
.wwcd-side-text a { color: #fff; text-decoration: underline; }
.wwcd--split .wwcd-main { padding: 36px 32px 28px; }

/* Tablet: narrow the panel */
@media (max-width: 860px) {
  .wwcd--split { grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); }
  .wwcd .wwcd-side-title { font-size: 23px; }
  .wwcd-side-copy { padding: 28px 22px; }
}

/* Phone: panel becomes a banner on top, heading only */
@media (max-width: 680px) {
  .wwcd--split { grid-template-columns: 1fr; max-width: 460px; }
  .wwcd-side { min-height: 170px; }
  .wwcd--no-image .wwcd-side { min-height: 0; }
  .wwcd-side-copy { padding: 20px 16px; }
  .wwcd .wwcd-side-title { font-size: 21px; margin: 0; }
  .wwcd-side .wwcd-side-text { display: none; }
  .wwcd--no-image .wwcd-side .wwcd-side-text { display: block; margin-top: 6px; font-size: 14px; }
}

.wwcd-step { display: none; }
.wwcd-step.is-active { display: block; animation: wwcd-in .2s ease-out; }
@keyframes wwcd-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .wwcd-step.is-active { animation: none; } }

.wwcd .wwcd-heading {
  text-wrap: balance;
  margin: 0 0 8px;
  padding: 0;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 700;
  color: var(--wwcd-ink);
}
.wwcd .wwcd-heading:focus { outline: none; }
.wwcd .wwcd-sub { margin: 0 0 20px; padding: 0; color: var(--wwcd-muted); font-size: 15px; }

/* Frequency toggle */
.wwcd-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin-bottom: 16px;
  background: var(--wwcd-soft);
  border-radius: var(--wwcd-radius);
}
.wwcd-toggle button {
  appearance: none;
  border: 0;
  border-radius: calc(var(--wwcd-radius) - 3px);
  padding: 11px 8px;
  background: transparent;
  color: var(--wwcd-muted);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.wwcd-toggle button.is-selected { background: var(--wwcd-accent); color: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.wwcd-heart { color: #e63946; margin-right: 2px; }
.wwcd-toggle button.is-selected .wwcd-heart { color: #fff; }

/* Amounts */
.wwcd-amounts { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 10px; margin-bottom: 10px; }
.wwcd-amounts[hidden] { display: none; }
.wwcd-amt {
  appearance: none;
  border: 2px solid var(--wwcd-line);
  border-radius: var(--wwcd-radius);
  padding: 14px 6px;
  min-height: 56px;
  background: #fff;
  color: var(--wwcd-ink);
  font: inherit;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.wwcd-amt small { font-size: 13px; font-weight: 500; opacity: .75; margin-left: 1px; }
.wwcd-amt:hover { border-color: var(--wwcd-accent); }
.wwcd-amt.is-selected { border-color: var(--wwcd-accent); background: var(--wwcd-accent); color: #fff; }

/* Custom amount */
.wwcd-custom {
  display: flex;
  align-items: center;
  border: 2px solid var(--wwcd-line);
  border-radius: var(--wwcd-radius);
  margin: 0 0 18px;
  padding: 0 14px;
  background: #fff;
  cursor: text;
}
.wwcd-custom.is-selected, .wwcd-custom:focus-within { border-color: var(--wwcd-accent); }
.wwcd-currency, .wwcd-code { color: var(--wwcd-muted); font-weight: 600; }
.wwcd .wwcd-custom-input {
  flex: 1;
  min-width: 0;
  border: 0 !important;
  outline: none;
  box-shadow: none !important;
  padding: 14px 8px !important;
  margin: 0 !important;
  line-height: 1.3 !important;
  height: auto !important;
  background: transparent !important;
  font: inherit;
  font-size: 18px;
  font-weight: 600;
  color: var(--wwcd-ink);
}

/* Checkboxes + reveals */
.wwcd-check { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 10px; font-size: 15px; cursor: pointer; }
.wwcd-check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--wwcd-accent); flex: none; }
.wwcd-reveal { margin: 0 0 14px 28px; }
.wwcd-reveal[hidden] { display: none; }

/* Inputs */
.wwcd input[type=text], .wwcd input[type=email], .wwcd input[type=tel], .wwcd select {
  display: block;
  width: 100%;
  margin: 0 0 10px;
  padding: 12px 14px;
  border: 1px solid var(--wwcd-line);
  border-radius: 8px;
  background: #fff;
  color: var(--wwcd-ink);
  font: inherit;
  font-size: 16px; /* prevents iOS zoom */
  line-height: 1.3;
  height: auto;
}
.wwcd input:focus, .wwcd select:focus { border-color: var(--wwcd-accent); outline: 2px solid color-mix(in srgb, var(--wwcd-accent) 25%, transparent); outline-offset: 0; }
.wwcd .is-invalid { border-color: var(--wwcd-error) !important; }
.wwcd-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wwcd-reveal .wwcd-row { grid-template-columns: 9.5em 1fr; }
.wwcd-hp { position: absolute !important; left: -9999px !important; width: 1px !important; height: 1px !important; opacity: 0; }

/* Buttons */
.wwcd-btn {
  appearance: none;
  display: block;
  width: 100%;
  margin: 8px 0 0;
  padding: 16px 20px;
  border: 0;
  border-radius: var(--wwcd-radius);
  background: var(--wwcd-accent);
  color: #fff;
  font: inherit;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: filter .15s, transform .05s;
}
.wwcd-btn:hover { filter: brightness(1.12); }
.wwcd-btn:active { transform: translateY(1px); }
.wwcd-btn:disabled { opacity: .7; cursor: progress; }
.wwcd-btn.is-busy::after {
  content: "";
  display: inline-block;
  width: 14px; height: 14px;
  margin-left: 10px;
  vertical-align: -2px;
  border: 2px solid rgba(255,255,255,.5);
  border-top-color: #fff;
  border-radius: 50%;
  animation: wwcd-spin .7s linear infinite;
}
@keyframes wwcd-spin { to { transform: rotate(360deg); } }

.wwcd-back {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  margin: 0 0 14px;
  color: var(--wwcd-muted);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.wwcd-back:hover { color: var(--wwcd-accent); text-decoration: underline; }
.wwcd-link { display: block; margin-top: 14px; text-align: center; font-size: 14px; color: var(--wwcd-accent); text-decoration: underline; }

.wwcd button:focus-visible, .wwcd a:focus-visible { outline: 3px solid var(--wwcd-accent); outline-offset: 2px; }

.wwcd-error { margin: 6px 0 0; padding: 10px 12px; border-radius: 8px; background: #fdecea; color: var(--wwcd-error); font-size: 14px; }
.wwcd-error[hidden] { display: none; }
.wwcd-secure { margin: 12px 0 0; text-align: center; font-size: 13px; color: var(--wwcd-muted); }

/* Thank you */
.wwcd-step[data-step="3"] { text-align: center; padding: 12px 0; }
.wwcd-done-icon {
  width: 64px; height: 64px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--wwcd-accent);
  color: #fff;
  font-size: 32px;
  line-height: 64px;
  font-weight: 700;
}
.wwcd-ref { font-size: 13px; color: var(--wwcd-muted); word-break: break-all; }

.wwcd .screen-reader-text { position: absolute !important; clip: rect(1px,1px,1px,1px); width: 1px; height: 1px; overflow: hidden; }

@media (max-width: 480px) {
  .wwcd .wwcd-main { padding: 24px 16px 20px; }
  .wwcd .wwcd-heading { font-size: 21px; }
  .wwcd-row { grid-template-columns: 1fr; gap: 0; }
  .wwcd-reveal { margin-left: 0; }
  .wwcd-reveal .wwcd-row { grid-template-columns: 1fr; }
}

/* While Blackbaud Checkout is open, drop the Divi popup beneath its overlay. */
body.wwcd-paying .area-outer-wrap,
body.wwcd-paying .da-overlay { z-index: 9000 !important; }

/* "Show the whole photo" panel: photo on top, text below on the accent colour */
.wwcd-side--whole {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
}
.wwcd-side--whole::before { display: none; }
.wwcd .wwcd-side-img {
  display: block;
  width: 100%;
  height: auto;
  max-width: none;
  margin: 0;
  border-radius: 0;
}
.wwcd-side--whole .wwcd-side-copy {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 28px 32px 32px;
}
@media (max-width: 860px) {
  .wwcd-side--whole .wwcd-side-copy { padding: 22px 22px 24px; }
}
@media (max-width: 680px) {
  .wwcd-side--whole { min-height: 0; }
  .wwcd-side--whole .wwcd-side-copy { padding: 14px 16px 16px; }
}

/* "Fill the panel" photo: a real <img> behind the text (no CSS url(), so nothing can be injected) */
.wwcd-side--cover { overflow: hidden; }
.wwcd .wwcd-side-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  object-fit: cover;
  object-position: center;
  z-index: 0;
}
.wwcd-side--cover::before { z-index: 1; }
.wwcd-side--cover .wwcd-side-copy { z-index: 2; }

/* Bot check (Turnstile) */
.wwcd-turnstile { margin: 4px 0 6px; }
.wwcd-turnstile:empty { margin: 0; }

/* Payment outcome still being confirmed */
.wwcd-step.is-confirming .wwcd-done-icon { background: #b7791f; font-family: Georgia, serif; font-style: italic; }

/* Online Express form inside the popup */
.wwcd--olx .wwcd-main { min-width: 0; }
.wwcd-olx { width: 100%; max-width: 100%; overflow-x: hidden; }
.wwcd-olx #bbox-root { width: 100%; max-width: 100%; }
.wwcd-olx iframe, .wwcd-olx img { max-width: 100%; }

/* Long Online Express form: fixed-height popup, only the form side scrolls (CAMH-style),
   so the photo panel no longer stretches with the form. */
.wwcd--olx.wwcd--split {
  height: min(88vh, 720px);
  grid-template-rows: 100%;
}
.wwcd--olx.wwcd--split .wwcd-side { min-height: 0; height: 100%; overflow: hidden; }
.wwcd--olx.wwcd--split .wwcd-main {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
/* Fade at the bottom hints that the form continues */
.wwcd--olx.wwcd--split .wwcd-main::after {
  content: "";
  position: sticky;
  bottom: -28px;
  display: block;
  height: 48px;
  margin: -20px -32px -28px;
  background: linear-gradient(to bottom, rgba(255,255,255,0), var(--wwcd-bg) 85%);
  pointer-events: none;
}

/* Phones: stacked layout, the popup scrolls normally */
@media (max-width: 680px) {
  .wwcd--olx.wwcd--split { height: auto; grid-template-rows: auto; }
  .wwcd--olx.wwcd--split .wwcd-side { height: auto; }
  .wwcd--olx.wwcd--split .wwcd-main { height: auto; overflow: visible; }
  .wwcd--olx.wwcd--split .wwcd-main::after { display: none; }
}

/* ---- Page layout: [wwc_donate layout="page"] on the donate page ------------------
   Same format as the popup: a fixed-height card that fits the screen, the Online
   Express form scrolls inside it, and the photo panel stays put on the left. */
.wwcd--page {
  max-width: none;              /* the Divi row sets the width */
  border-radius: 0;             /* square, like the homepage photo tiles */
  box-shadow: 0 12px 40px rgba(0, 0, 0, .28);
  font-family: 'Open Sans', Helvetica, Arial, sans-serif;
}
.wwcd--page .wwcd-side, .wwcd--page .wwcd-main { border-radius: 0; }
/* Headings in the homepage style: Open Sans bold, uppercase, WWC red */
.wwcd--page .wwcd-heading {
  font-family: 'Open Sans', Helvetica, Arial, sans-serif;
  font-weight: 700;
  font-size: 26px;
  text-transform: uppercase;
  color: #9e1723;
  letter-spacing: 0;
}
.wwcd--page .wwcd-sub { font-size: 17px; color: #2c2e35; font-weight: 500; }
.wwcd--page .wwcd-side-title { font-family: 'Open Sans', Helvetica, Arial, sans-serif; font-weight: 700; font-size: 26px; }
.wwcd--page .wwcd-side-text { font-size: 17px; font-weight: 500; }
@media (max-width: 860px) { .wwcd--page .wwcd-side-title { font-size: 22px; } }
.wwcd--page.wwcd--split { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); }
.wwcd--page.wwcd--olx.wwcd--split {
  /* fits under a typical fixed site header, never taller than 720px */
  height: clamp(560px, calc(100vh - 150px), 720px);
}
.wwcd--page.wwcd--olx.wwcd--split .wwcd-main { padding: 40px 40px 28px; }
@media (max-width: 680px) {
  .wwcd--page.wwcd--split { grid-template-columns: 1fr; }
  .wwcd--page.wwcd--olx.wwcd--split { height: auto; }
  .wwcd--page.wwcd--olx.wwcd--split .wwcd-main { padding: 24px 16px 20px; }
}

/* Popup shown on the donate page itself: points to the form on the page */
.wwcd--redirect { max-width: 460px; border-radius: 12px; text-align: center; }
.wwcd--redirect .wwcd-goto { display: inline-block; width: auto; text-decoration: none; }

/* Page layout: message sits right under the photo, not low in the navy area */
.wwcd--page .wwcd-side--whole .wwcd-side-copy { justify-content: flex-start; padding-top: 30px; }

/* ---- Inside a Popups for Divi popup -----------------------------------------------
   The card itself is the popup: Divi's white popup box is made transparent, and the
   card is centred on screen at a fixed size, with the close button on its corner.
   Clicks outside the card still reach Popups for Divi's overlay, so they close it. */
.area-outer-wrap:has(.wwcd--split:not(.wwcd--page)),
.area-outer-wrap:has(.wwcd--redirect) {
  --wwcd-pw: min(1040px, calc(100vw - 48px));
  --wwcd-ph: clamp(480px, calc(100vh - 120px), 640px);
  position: fixed !important;
  top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
  width: 100vw !important; max-width: none !important;
  height: 100vh !important; height: 100dvh !important; max-height: none !important;
  margin: 0 !important; padding: 0 !important; transform: none !important;
  display: flex !important; align-items: center !important; justify-content: center !important;
  background: transparent !important;
  pointer-events: none;
}
.area-outer-wrap:has(.wwcd--redirect) { --wwcd-pw: min(460px, calc(100vw - 32px)); --wwcd-ph: auto; }
.et_pb_section.popup:has(.wwcd--split:not(.wwcd--page)),
.et_pb_section.popup:has(.wwcd--redirect) {
  background: transparent !important; background-image: none !important;
  box-shadow: none !important; border: 0 !important; padding: 0 !important;
  width: auto !important; max-width: none !important; min-width: 0 !important;
  height: auto !important; max-height: none !important; min-height: 0 !important;
  overflow: visible !important; margin: 0 !important;
  pointer-events: auto;
}
.et_pb_section.popup:has(.wwcd--split:not(.wwcd--page)) .et_pb_row,
.et_pb_section.popup:has(.wwcd--split:not(.wwcd--page)) .et_pb_column,
.et_pb_section.popup:has(.wwcd--split:not(.wwcd--page)) .et_pb_module,
.et_pb_section.popup:has(.wwcd--redirect) .et_pb_row,
.et_pb_section.popup:has(.wwcd--redirect) .et_pb_column,
.et_pb_section.popup:has(.wwcd--redirect) .et_pb_module {
  padding: 0 !important; margin: 0 !important;
  width: auto !important; max-width: none !important; min-height: 0 !important;
  background: transparent !important; box-shadow: none !important; border: 0 !important;
}
/* the card */
.wwcd.wwcd--split:not(.wwcd--page) {
  width: min(1040px, calc(100vw - 48px));
  max-width: none;
  border-radius: 12px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .45);
}
.area-outer-wrap .wwcd.wwcd--split:not(.wwcd--page) { width: var(--wwcd-pw); }
.wwcd.wwcd--olx.wwcd--split:not(.wwcd--page) { height: clamp(480px, calc(100vh - 120px), 640px); }
.area-outer-wrap .wwcd.wwcd--olx.wwcd--split:not(.wwcd--page) { height: var(--wwcd-ph); }
.wwcd--split:not(.wwcd--page) .wwcd-side { border-radius: 12px 0 0 12px; }
.wwcd--split:not(.wwcd--page) .wwcd-main { border-radius: 0 12px 12px 0; }
.area-outer-wrap .wwcd.wwcd--redirect { width: var(--wwcd-pw); box-shadow: 0 24px 70px rgba(0, 0, 0, .45); }
/* close button on the card's top-right corner */
.area-outer-wrap:has(.wwcd--split:not(.wwcd--page)) .da-close-wrap,
.area-outer-wrap:has(.wwcd--redirect) .da-close-wrap {
  position: absolute !important;
  top: 50% !important; left: 50% !important; right: auto !important; bottom: auto !important;
  width: var(--wwcd-pw) !important; height: var(--wwcd-ph) !important;
  transform: translate(-50%, -50%) !important;
  pointer-events: none;
}
.area-outer-wrap:has(.wwcd--redirect) .da-close-wrap { height: 220px !important; }
.area-outer-wrap:has(.wwcd--split:not(.wwcd--page)) .da-close,
.area-outer-wrap:has(.wwcd--redirect) .da-close {
  pointer-events: auto;
  position: absolute !important;
  top: 10px !important; right: 10px !important; left: auto !important; bottom: auto !important;
  z-index: 5;
}

/* Phones: same popup shape: full-height card, photo banner on top, form scrolls inside */
@media (max-width: 680px) {
  .area-outer-wrap:has(.wwcd--split:not(.wwcd--page)) {
    --wwcd-pw: calc(100vw - 24px);
    --wwcd-ph: calc(100vh - 24px);
  }
  @supports (height: 100dvh) {
    .area-outer-wrap:has(.wwcd--split:not(.wwcd--page)) { --wwcd-ph: calc(100dvh - 24px); }
  }
  .area-outer-wrap .wwcd.wwcd--olx.wwcd--split:not(.wwcd--page) {
    height: var(--wwcd-ph);
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }
  .area-outer-wrap .wwcd--olx.wwcd--split:not(.wwcd--page) .wwcd-side { height: auto; border-radius: 12px 12px 0 0; }
  /* show the whole group photo (no cropping); keep the heading compact under it */
  .area-outer-wrap .wwcd--olx.wwcd--split:not(.wwcd--page) .wwcd-side-img { width: 100%; height: auto; max-height: none; object-fit: contain; }
  .area-outer-wrap .wwcd--olx.wwcd--split:not(.wwcd--page) .wwcd-side-copy { padding: 12px 16px 14px; }
  .area-outer-wrap .wwcd--olx.wwcd--split:not(.wwcd--page) .wwcd-side-title { font-size: 18px; line-height: 1.25; }
  .area-outer-wrap .wwcd--olx.wwcd--split:not(.wwcd--page) .wwcd-main {
    height: auto; min-height: 0; overflow-y: auto; border-radius: 0 0 12px 12px;
  }
}
