/*
Theme Name: Central Texas Tails of Hope
Theme URI: https://centraltexastailsofhope.org/
Author: Central Texas Tails of Hope
Description: Block theme for Central Texas Tails of Hope. Presentation only — post types live in the ctxtoh-pets plugin, palettes in ctxtoh-seasonal-themes.
Requires at least: 6.6
Tested up to: 6.7
Requires PHP: 8.2
Version: 0.1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ctxtoh
Tags: block-theme, accessibility-ready, custom-colors, full-site-editing
*/

/* ==========================================================================
   Colour contract
   Every rule below uses only:
     --ctx-primary  --ctx-ink  --ctx-secondary  --ctx-secondary-on
     --ctx-tertiary --ctx-bg-alt --ctx-footer
   plus the four fixed neutrals #12212F #4A5A68 #C9D6DF #FFFFFF.
   A component needing anything else is a design question. Stop and ask.
   Palettes come from the ctxtoh-seasonal-themes plugin (assets/css/themes.css).
   ========================================================================== */

:root {
  --ctx-radius-pill: 999px;
  --ctx-radius-field: 14px;
  --ctx-radius-tile: 18px;
  --ctx-radius-card: 22px;
  --ctx-radius-feature: 26px;

  --ctx-shadow-card: 0 2px 16px rgb(12 33 51 / 9%);
  --ctx-shadow-float: 0 4px 22px rgb(12 33 51 / 18%);

  --ctx-gutter: 20px;
  --ctx-max: 1240px;
  --ctx-section-y: clamp(48px, 6vw, 76px);

  --ctx-target: 44px;   /* WCAG 2.2 AA minimum target */
  --ctx-control: 48px;  /* our own floor for buttons and fields */

  --ctx-header-h: 84px; /* synced by rail.js to the live header height for scroll-margin */
  --ctx-mobile-bar-h: 84px;

  --ctx-error: #C0392B; /* 5.6:1 on white — fixed, not themeable */

  --ctx-cta: #D62828;       /* 4.5:1 with white text — fixed, not themeable. */
  --ctx-cta-hover: #B71C1C; /* Reserved for primary conversion buttons (Donate, */
                            /* Give to the Building Fund), never the brand palette. */
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

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

html { scroll-behavior: smooth; }

/* A4: a focused element must never land under the sticky header. */
html,
:target { scroll-padding-top: calc(var(--ctx-header-h) + 16px); }

body {
  margin: 0;
  text-rendering: optimizespeed;
}

/* The mobile utility bar is fixed; reserve its height so nothing is covered. */
@media (width <= 1080px) {
  body { padding-bottom: var(--ctx-mobile-bar-h); }
}

img,
picture,
video { max-width: 100%; height: auto; }

p { text-wrap: pretty; }

:where(h1, h2, h3, h4) { text-wrap: balance; }

.ctx-lead {
  font-size: clamp(1.0625rem, 1.4vw, 1.1875rem);
  color: #4A5A68;
  max-width: 62ch;
}

/* Decorative only — never the sole label for anything. */
.ctx-eyebrow {
  font-family: var(--wp--preset--font-family--display), sans-serif;
  font-weight: 800;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ctx-ink);
  display: block;
  margin-bottom: 8px;
}

.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  background: #12212F;
  color: #FFFFFF;
  padding: 14px 22px;
  font-weight: 700;
  border-radius: 0 0 var(--ctx-radius-tile) 0;
}

.skip-link:focus {
  left: 0;
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */

.ctx-section {
  padding-block: var(--ctx-section-y);
  padding-inline: var(--ctx-gutter);
}

.ctx-section--alt { background: var(--ctx-bg-alt); }

.ctx-section--dark {
  background: var(--ctx-footer);
  color: #DCE7EE;
}

.ctx-section--dark :where(h1, h2, h3) { color: #FFFFFF; }

.ctx-wrap {
  max-width: var(--ctx-max);
  margin-inline: auto;
}

.ctx-wrap--prose { max-width: 68ch; }

/* Every grid reflows without a breakpoint. 1080px is the only hard switch. */
.ctx-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
}

.ctx-grid--wide {
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
}

.ctx-section-head {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 32px;
}

/* --------------------------------------------------------------------------
   Buttons — every one is a pill, at least 48px tall and 44px wide
   -------------------------------------------------------------------------- */

.ctx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: var(--ctx-control);
  min-width: var(--ctx-target);
  padding: 13px 26px;
  border: 2px solid transparent;
  border-radius: var(--ctx-radius-pill);
  font-family: var(--wp--preset--font-family--display), sans-serif;
  font-weight: 800;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}

.ctx-btn--primary {
  background: var(--ctx-ink);
  color: #FFFFFF;
}

.ctx-btn--primary:hover,
.ctx-btn--primary:focus-visible {
  background: #0C2233;
  color: #FFFFFF;
}

/* One accent action per surface. The ink is derived per palette so this stays
   legible whether the accent is lime (#7ED321) or violet (#7B2FBE). */
.ctx-btn--accent {
  background: var(--ctx-secondary);
  color: var(--ctx-secondary-on, #12212F);
}

.ctx-btn--accent:hover,
.ctx-btn--accent:focus-visible {
  background: var(--ctx-secondary);
  filter: brightness(0.92);
}

.ctx-btn--outline {
  background: transparent;
  border-color: var(--ctx-ink);
  color: var(--ctx-ink);
}

.ctx-btn--outline:hover,
.ctx-btn--outline:focus-visible {
  background: var(--ctx-ink);
  color: #FFFFFF;
}

/* For use on the dark hero scrim only. */
.ctx-btn--ghost {
  background: rgb(255 255 255 / 12%);
  border-color: #FFFFFF;
  color: #FFFFFF;
}

.ctx-btn--ghost:hover,
.ctx-btn--ghost:focus-visible { background: rgb(255 255 255 / 26%); }

.ctx-btn[aria-disabled="true"],
.ctx-btn:disabled {
  background: #DDE5EA;
  border-color: transparent;
  color: #5A6E7B;
  cursor: not-allowed;
  filter: none;
}

.ctx-link {
  font-family: var(--wp--preset--font-family--display), sans-serif;
  font-weight: 800;
  color: var(--ctx-ink);
  text-decoration: none;
  border-bottom: 3px solid var(--ctx-secondary);
  padding-bottom: 3px;
  display: inline-block;
  min-height: var(--ctx-target);
  line-height: var(--ctx-target);
}

.ctx-link:hover { color: #0C2233; }

/* --------------------------------------------------------------------------
   Chips and badges
   -------------------------------------------------------------------------- */

.ctx-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--ctx-target);
  padding: 10px 16px;
  border: 2px solid #C9D6DF;
  border-radius: var(--ctx-radius-pill);
  background: #FFFFFF;
  color: #12212F;
  font-family: var(--wp--preset--font-family--display), sans-serif;
  font-weight: 800;
  font-size: 0.875rem;
  cursor: pointer;
}

.ctx-chip[aria-pressed="true"],
.ctx-chip[data-selected="true"] {
  background: var(--ctx-ink);
  border-color: transparent;
  color: #FFFFFF;
}

/* Selection is also carried by aria-pressed, so colour is never the only cue. */
.ctx-chip[aria-pressed="true"]::before {
  content: "✓";
  font-size: 0.8em;
}

.ctx-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 13px;
  border-radius: var(--ctx-radius-pill);
  background: #FFFFFF;
  border: 1px solid #C9D6DF;
  color: #12212F;
  font-family: var(--wp--preset--font-family--display), sans-serif;
  font-weight: 800;
  font-size: 0.75rem;
}

.ctx-badge--accent {
  background: var(--ctx-secondary);
  color: var(--ctx-secondary-on, #12212F);
  border-color: transparent;
}

.ctx-trait-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.ctx-trait {
  padding: 8px 16px;
  border-radius: var(--ctx-radius-pill);
  background: #FFFFFF;
  border: 2px solid var(--ctx-primary);
  font-family: var(--wp--preset--font-family--display), sans-serif;
  font-weight: 800;
  font-size: 0.875rem;
  color: #12212F;
}

/* A badge bound to an empty value still renders its element. No empty pills. */
.ctx-badge:empty { display: none; }

/* --------------------------------------------------------------------------
   Pet profile. The spine (photo, name, facts, the asks) comes from the
   template and is the same on every animal; .ctx-pet__body is post content,
   where staff arrange the story.
   -------------------------------------------------------------------------- */

.ctx-pet__spine { gap: 32px; }

.ctx-pet .wp-block-post-title { margin-block: 14px 6px; }

.ctx-pet .ctx-trait-list { margin-top: 20px; }

.ctx-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 14px;
  margin: 24px 0 0;
  padding: 20px;
  background: var(--ctx-bg-alt);
  border-radius: 22px;
}

.ctx-facts dt {
  font-family: var(--wp--preset--font-family--display), sans-serif;
  font-weight: 800;
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #4A5A68;
}

.ctx-facts dd {
  margin: 4px 0 0;
  font-family: var(--wp--preset--font-family--display), sans-serif;
  font-weight: 800;
  font-size: 1.0625rem;
  color: #12212F;
}

.ctx-gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.ctx-gallery a { display: block; border-radius: 14px; }

.ctx-gallery img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 14px;
}

.ctx-gallery__video { margin-top: 12px; }

.ctx-pet-actions { margin-top: 26px; }

.ctx-fee-card {
  margin-top: 28px;
  padding: 24px;
  background: #FFFFFF;
  border: 1px solid rgb(12 33 51 / 10%);
  border-radius: 22px;
}

.ctx-fee-card h2 { font-size: 1.1875rem; }

.ctx-fee-card ul {
  display: grid;
  gap: 6px;
  margin: 12px 0 0;
  padding-left: 22px;
  color: #33424F;
}

.ctx-fee-card__note {
  margin-top: 12px;
  font-size: 0.9375rem;
  color: #4A5A68;
}

.ctx-pet__body { margin-top: clamp(32px, 5vw, 56px); }

/* --------------------------------------------------------------------------
   Cards. Border and shadow both, so cards survive high-contrast mode.
   -------------------------------------------------------------------------- */

.ctx-card {
  display: flex;
  flex-direction: column;
  background: #FFFFFF;
  border: 1px solid #C9D6DF;
  border-radius: var(--ctx-radius-card);
  box-shadow: var(--ctx-shadow-card);
  overflow: hidden;
}

.ctx-card__media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #E3ECF2;
}

.ctx-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%; /* keeps faces in frame */
  display: block;
}

/* Listings with no photo get a labelled tile, never a broken image frame. */
.ctx-card__placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #4A5A68;
  font-family: var(--wp--preset--font-family--display), sans-serif;
  font-weight: 700;
  font-size: 0.9375rem;
  text-align: center;
  padding: 16px;
}

.ctx-card__agepill {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgb(255 255 255 / 94%);
  border-radius: var(--ctx-radius-pill);
  padding: 6px 13px;
  font-family: var(--wp--preset--font-family--display), sans-serif;
  font-weight: 800;
  font-size: 0.75rem;
  color: #12212F;
}

.ctx-card__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  flex: 1;
}

.ctx-card__meta {
  color: #4A5A68;
  font-size: 0.9375rem;
}

.ctx-card__blurb {
  color: #12212F;
  font-size: 0.9375rem;
  flex: 1;
}

/* The card is not a link — only the action is, so keyboard users get one stop
   per card rather than a duplicate. */
.ctx-card__action {
  margin-top: auto;
  width: 100%;
}

/* --------------------------------------------------------------------------
   Header and navigation
   -------------------------------------------------------------------------- */

.ctx-utility-bar {
  background: var(--ctx-footer);
  color: #DCE7EE;
  font-size: 0.875rem;
  padding: 8px var(--ctx-gutter);
}

.ctx-utility-bar a { color: #FFFFFF; }

.ctx-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: #FFFFFF;
  border-bottom: 1px solid #C9D6DF;
  padding: 0 var(--ctx-gutter);
}

.ctx-header__inner {
  max-width: var(--ctx-max);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 84px;
}

.ctx-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex: none;
}

.ctx-logo img { height: 84px; width: auto; }

.ctx-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
}

.ctx-nav a {
  font-family: var(--wp--preset--font-family--display), sans-serif;
  font-weight: 800;
  font-size: 0.9375rem;
  color: #12212F;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 12px;
  min-height: var(--ctx-target);
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.ctx-nav a:hover { background: var(--ctx-bg-alt); }

.ctx-nav a[aria-current="page"] {
  background: var(--ctx-bg-alt);
  box-shadow: inset 0 -3px 0 var(--ctx-ink);
}

.ctx-menu-toggle {
  width: 52px;
  height: 52px;
  border-radius: var(--ctx-radius-field);
  border: 2px solid #12212F;
  background: #FFFFFF;
  cursor: pointer;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.ctx-menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #12212F;
}

.ctx-mobile-panel {
  display: none;
  flex-direction: column;
  padding: 8px var(--ctx-gutter) 20px;
  border-bottom: 1px solid #C9D6DF;
  background: #FFFFFF;
}

.ctx-mobile-panel[data-open="true"] { display: flex; }

.ctx-mobile-panel a {
  font-family: var(--wp--preset--font-family--display), sans-serif;
  font-weight: 800;
  font-size: 1.125rem;
  color: #12212F;
  text-decoration: none;
  padding: 14px 6px;
  border-bottom: 1px solid rgb(12 33 51 / 8%);
  min-height: var(--ctx-control);
  display: flex;
  align-items: center;
}

@media (width <= 1080px) {
  .ctx-nav { display: none; }
  .ctx-menu-toggle { display: flex; }
}

/* --------------------------------------------------------------------------
   Hero rotator. Fixed height is a launch blocker (A6) — do not make these auto.
   -------------------------------------------------------------------------- */

.ctx-hero {
  position: relative;
  min-height: clamp(520px, 44vw, 600px);
  display: grid;
  isolation: isolate;
  background: var(--ctx-footer);
}

.ctx-hero__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 400ms ease;
  display: grid;
  align-items: end;
}

.ctx-hero__slide[data-active="true"] {
  opacity: 1;
  position: relative;
  z-index: 1;
}

.ctx-hero__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}

/* A left-to-right scrim, not a blur. Text never sits on bare photography —
   the editor controls the image, not the contrast. */
.ctx-hero__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    rgb(12 33 51 / 92%) 0%,
    rgb(12 33 51 / 78%) 42%,
    rgb(12 33 51 / 28%) 78%,
    rgb(12 33 51 / 12%) 100%
  );
}

.ctx-hero__content {
  position: relative;
  z-index: 2;
  max-width: var(--ctx-max);
  margin-inline: auto;
  width: 100%;
  padding: 44px var(--ctx-gutter) 96px;
  /* Reserved so a longer headline cannot shove the controls down. */
  min-height: clamp(330px, 26vw, 370px);
  display: flex;
  flex-direction: column;
  justify-content: end;
}

.ctx-hero__kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: start;
  background: var(--ctx-secondary);
  color: var(--ctx-secondary-on, #12212F);
  font-family: var(--wp--preset--font-family--display), sans-serif;
  font-weight: 800;
  font-size: 0.8125rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 9px 18px;
  border-radius: var(--ctx-radius-pill);
}

.ctx-hero__title {
  color: #FFFFFF;
  font-size: var(--wp--preset--font-size--hero);
  line-height: 1.02;
  margin: 20px 0 16px;
  max-width: 18ch;
}

.ctx-hero__body {
  color: #F0F6FA;
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  max-width: 56ch;
}

.ctx-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.ctx-hero__controls {
  position: absolute;
  z-index: 3;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, var(--ctx-max));
  padding-inline: var(--ctx-gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.ctx-hero__dots {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* The visible dot is 14px, but the hit area is a padded 44px square. */
.ctx-hero__dot {
  appearance: none;
  background: none;
  border: 0;
  padding: 15px 8px;
  min-width: var(--ctx-target);
  min-height: var(--ctx-target);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.ctx-hero__dot::before {
  content: "";
  display: block;
  width: 14px;
  height: 14px;
  border-radius: var(--ctx-radius-pill);
  border: 2px solid #FFFFFF;
  background: transparent;
  transition: width 160ms ease;
}

.ctx-hero__dot[aria-selected="true"]::before {
  width: 34px;
  background: #FFFFFF;
}

.ctx-hero__pause {
  background: rgb(255 255 255 / 14%);
  border: 1px solid rgb(255 255 255 / 55%);
  color: #FFFFFF;
  border-radius: var(--ctx-radius-pill);
  padding: 10px 18px;
  font-family: var(--wp--preset--font-family--display), sans-serif;
  font-weight: 700;
  font-size: 0.8125rem;
  cursor: pointer;
  min-height: var(--ctx-target);
}

.ctx-hero__pause:hover { background: rgb(255 255 255 / 30%); }

/* --------------------------------------------------------------------------
   Sticky utility rail — Donate · Directions · Contact · Accessibility
   Fixed order, every template, every breakpoint (WCAG 3.2.6).
   -------------------------------------------------------------------------- */

.ctx-rail {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 70;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ctx-rail__item {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 56px;
  width: 56px;
  padding: 0 12px;
  overflow: hidden;
  white-space: nowrap;
  border-radius: 0 var(--ctx-radius-tile) var(--ctx-radius-tile) 0;
  box-shadow: 3px 0 14px rgb(12 33 51 / 22%);
  text-decoration: none;
  transition: width 220ms ease;
}

.ctx-rail__item:hover,
.ctx-rail__item:focus-visible { width: 196px; }

.ctx-rail__icon {
  flex: none;
  width: 28px;
  text-align: center;
  font-size: 20px;
  line-height: 1;
}

.ctx-rail__label {
  font-family: var(--wp--preset--font-family--display), sans-serif;
  font-weight: 800;
  font-size: 0.9375rem;
}

.ctx-rail__item--donate { background: var(--ctx-ink); color: #FFFFFF; }
.ctx-rail__item--directions { background: #0C2233; color: #FFFFFF; }

.ctx-rail__item--light {
  background: #FFFFFF;
  color: #12212F;
  border: 2px solid #0C2233;
  border-left: none;
}

.ctx-bottombar { display: none; }

@media (width <= 1080px) {
  .ctx-rail { display: none; }

  .ctx-bottombar {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 70;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    padding: 8px var(--ctx-gutter);
    background: #FFFFFF;
    border-top: 1px solid #C9D6DF;
    box-shadow: 0 -4px 22px rgb(12 33 51 / 12%);
  }

  .ctx-bottombar a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 52px;
    border-radius: var(--ctx-radius-field);
    font-family: var(--wp--preset--font-family--display), sans-serif;
    font-weight: 800;
    font-size: 0.75rem;
    text-decoration: none;
  }
}

/* --------------------------------------------------------------------------
   Filters and results
   -------------------------------------------------------------------------- */

.ctx-filters {
  background: var(--ctx-bg-alt);
  border: 1px solid #C9D6DF;
  border-radius: var(--ctx-radius-card);
  padding: 24px;
  display: grid;
  gap: 20px;
}

.ctx-filters fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.ctx-filters legend {
  font-family: var(--wp--preset--font-family--display), sans-serif;
  font-weight: 800;
  font-size: 0.9375rem;
  color: #12212F;
  padding: 0;
}

.ctx-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ctx-results-count {
  font-family: var(--wp--preset--font-family--display), sans-serif;
  font-weight: 800;
  font-size: 1.0625rem;
  color: #12212F;
}

.ctx-empty {
  border: 2px dashed #C9D6DF;
  border-radius: var(--ctx-radius-card);
  padding: 40px 24px;
  text-align: center;
  color: #4A5A68;
  max-width: 56ch;
  margin-inline: auto;
}

/* --------------------------------------------------------------------------
   Forms. Labels above, always visible. 16px text so iOS does not zoom.
   -------------------------------------------------------------------------- */

.ctx-field {
  display: grid;
  gap: 6px;
  margin-bottom: 20px;
}

.ctx-field label {
  font-family: var(--wp--preset--font-family--display), sans-serif;
  font-weight: 800;
  font-size: 0.9375rem;
  color: #12212F;
}

.ctx-field__hint {
  font-size: 0.875rem;
  color: #4A5A68;
}

.ctx-field input,
.ctx-field select,
.ctx-field textarea {
  width: 100%;
  min-height: var(--ctx-control);
  padding: 12px 14px;
  font-family: var(--wp--preset--font-family--body), sans-serif;
  font-size: 1rem; /* never smaller — iOS zooms below 16px */
  color: #12212F;
  background: #FFFFFF;
  border: 2px solid #C9D6DF;
  border-radius: var(--ctx-radius-field);
}

.ctx-field input:hover,
.ctx-field select:hover,
.ctx-field textarea:hover { border-color: #4A5A68; }

.ctx-field--error input,
.ctx-field--error select,
.ctx-field--error textarea { border-color: var(--ctx-error); }

.ctx-field__error {
  display: flex;
  align-items: start;
  gap: 8px;
  color: var(--ctx-error);
  font-size: 0.9375rem;
  font-weight: 600;
}

.ctx-field__error::before {
  content: "⚠";
  font-size: 1em;
  line-height: 1.4;
}

.ctx-error-summary {
  border: 2px solid var(--ctx-error);
  border-radius: var(--ctx-radius-card);
  padding: 20px 24px;
  margin-bottom: 28px;
  background: #FFFFFF;
}

.ctx-error-summary h2 {
  font-size: 1.1875rem;
  color: var(--ctx-error);
  margin: 0 0 10px;
}

.ctx-error-summary ol { margin: 0; padding-left: 20px; }
.ctx-error-summary a { color: var(--ctx-error); }

/* --------------------------------------------------------------------------
   Stats, campaign meter, steps
   -------------------------------------------------------------------------- */

.ctx-stats {
  background: var(--ctx-primary);
  border-radius: var(--ctx-radius-feature);
  padding: 32px 24px;
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
  text-align: center;
}

/* --ctx-primary is a fill that carries dark ink. Never white here. */
.ctx-stat__n {
  display: block;
  font-family: var(--wp--preset--font-family--display), sans-serif;
  font-weight: 900;
  font-size: clamp(1.9rem, 4.4vw, 2.7rem);
  line-height: 1.05;
  color: #0C2233;
}

.ctx-stat__l {
  font-family: var(--wp--preset--font-family--display), sans-serif;
  font-weight: 700;
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0C2233;
}

.ctx-meter {
  background: #FFFFFF;
  border: 1px solid #C9D6DF;
  border-radius: var(--ctx-radius-pill);
  height: 22px;
  overflow: hidden;
}

.ctx-meter__fill {
  height: 100%;
  background: var(--ctx-secondary);
  border-radius: var(--ctx-radius-pill);
}

.ctx-steps {
  counter-reset: ctx-step;
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Numbered because adoption genuinely is a sequence, not for decoration. */
.ctx-step {
  counter-increment: ctx-step;
  background: #FFFFFF;
  border: 1px solid #C9D6DF;
  border-radius: var(--ctx-radius-card);
  box-shadow: var(--ctx-shadow-card);
  padding: 24px;
}

.ctx-step::before {
  content: counter(ctx-step);
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--ctx-radius-pill);
  background: var(--ctx-primary);
  color: #0C2233;
  font-family: var(--wp--preset--font-family--display), sans-serif;
  font-weight: 900;
  font-size: 1.1875rem;
  margin-bottom: 14px;
}

/* --------------------------------------------------------------------------
   Tables — used for the fee table, which is quasi-legal content
   -------------------------------------------------------------------------- */

.ctx-table {
  width: 100%;
  border-collapse: collapse;
}

.ctx-table th,
.ctx-table td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid #C9D6DF;
  vertical-align: top;
}

.ctx-table th {
  font-family: var(--wp--preset--font-family--display), sans-serif;
  font-weight: 800;
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #4A5A68;
}

.ctx-table caption {
  text-align: left;
  color: #4A5A68;
  font-size: 0.9375rem;
  padding-bottom: 10px;
}

/* Wide tables scroll rather than break the 320px reflow requirement. */
.ctx-table-scroll {
  overflow-x: auto;
  border-radius: var(--ctx-radius-card);
  border: 1px solid #C9D6DF;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.ctx-footer {
  background: var(--ctx-footer);
  color: #DCE7EE;
  padding: var(--ctx-section-y) var(--ctx-gutter);
}

.ctx-footer a { color: #FFFFFF; }

.ctx-footer h2,
.ctx-footer h3 { color: #FFFFFF; }

/* --------------------------------------------------------------------------
   Notices
   -------------------------------------------------------------------------- */

.ctx-notice {
  background: var(--ctx-bg-alt);
  border: 1px solid #C9D6DF;
  border-left: 6px solid var(--ctx-ink);
  border-radius: var(--ctx-radius-field);
  padding: 18px 22px;
  color: #12212F;
}

/* --------------------------------------------------------------------------
   Motion, contrast, print
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  /* The rail still expands, just instantly. */
  .ctx-rail__item { transition: none; }

  /* Only slide one renders; rotator.js also refuses to start the timer. */
  .ctx-hero__slide { transition: none; }
}

@media (forced-colors: active) {
  .ctx-hero__scrim { background: Canvas; }
  .ctx-card,
  .ctx-chip,
  .ctx-btn,
  .ctx-rail__item { border: 1px solid; }
}

@media print {
  .ctx-rail,
  .ctx-bottombar,
  .ctx-hero__controls,
  .ctx-menu-toggle { display: none !important; }

  body { padding-bottom: 0; }
}

/* --------------------------------------------------------------------------
   Multi-step forms (ctxtoh-forms). No third-party form CSS to override —
   these classes are the only form styling on the site.
   -------------------------------------------------------------------------- */

.ctx-form__progress {
  font-family: var(--wp--preset--font-family--display), sans-serif;
  font-weight: 800;
  font-size: 0.9375rem;
  color: #12212F;
  margin-bottom: 8px;
}

.ctx-form .ctx-meter { margin-bottom: 28px; }

.ctx-field__optional {
  font-weight: 400;
  color: #4A5A68;
}

/* Radio and checkbox rows are targets in their own right, so the whole label
   is clickable and clears 44px. */
.ctx-radio {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--ctx-target);
  padding: 8px 14px;
  border: 2px solid #C9D6DF;
  border-radius: var(--ctx-radius-field);
  background: #FFFFFF;
  cursor: pointer;
  font-size: 1rem;
}

.ctx-radio:hover { border-color: #4A5A68; }

.ctx-radio input {
  width: 20px;
  height: 20px;
  flex: none;
  accent-color: var(--ctx-ink);
}

.ctx-radio:has(input:checked) {
  border-color: var(--ctx-ink);
  background: var(--ctx-bg-alt);
}

.ctx-check-list {
  display: grid;
  gap: 10px;
}

.ctx-form__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid #C9D6DF;
}

/* Review step: a read-back, not a second form. */
.ctx-review__list {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) 2fr;
  gap: 8px 20px;
  margin: 0;
}

.ctx-review__list dt {
  font-family: var(--wp--preset--font-family--display), sans-serif;
  font-weight: 800;
  font-size: 0.9375rem;
  color: #4A5A68;
}

.ctx-review__list dd {
  margin: 0;
  color: #12212F;
}

@media (width <= 600px) {
  .ctx-review__list { grid-template-columns: 1fr; gap: 2px 0; }
  .ctx-review__list dd { margin-bottom: 12px; }
}

/* --------------------------------------------------------------------------
   Third-party embed facade (BetterUnite)
   -------------------------------------------------------------------------- */

.ctx-embed-facade {
  display: grid;
  gap: 14px;
  justify-items: start;
  padding: 28px;
  background: var(--ctx-bg-alt);
  border: 1px solid #C9D6DF;
  border-radius: var(--ctx-radius-card);
}

.ctx-event-facts p { margin-bottom: 8px; }

/* --------------------------------------------------------------------------
   Core block target sizes (A2)

   Several core blocks ship targets under 44px: social links render at 36px,
   pagination numbers are bare text links, and the search submit is icon-sized.
   None of that is visible until you measure, which is exactly why the axe suite
   measures it. Fixed here rather than per-template.
   -------------------------------------------------------------------------- */

.wp-block-social-links .wp-social-link a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: var(--ctx-target);
  min-height: var(--ctx-target);
  padding: 10px;
}

.wp-block-query-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.wp-block-query-pagination a,
.wp-block-query-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--ctx-target);
  min-height: var(--ctx-target);
  padding: 8px 14px;
  border: 2px solid #C9D6DF;
  border-radius: var(--ctx-radius-pill);
  font-family: var(--wp--preset--font-family--display), sans-serif;
  font-weight: 800;
  text-decoration: none;
  color: var(--ctx-ink);
}

.wp-block-query-pagination .page-numbers.current {
  background: var(--ctx-ink);
  border-color: transparent;
  color: #FFFFFF;
}

.wp-block-query-pagination .page-numbers.dots {
  border-color: transparent;
  color: #4A5A68;
}

.wp-block-search__button,
.wp-block-search .wp-block-search__input {
  min-height: var(--ctx-control);
}

.wp-block-search__button {
  min-width: var(--ctx-target);
  border-radius: var(--ctx-radius-pill);
  background: var(--ctx-ink);
  color: #FFFFFF;
  border: 0;
  padding-inline: 20px;
  font-family: var(--wp--preset--font-family--display), sans-serif;
  font-weight: 800;
}

/* The navigation block's submenu toggle and mobile opener. */
.wp-block-navigation__responsive-container-open,
.wp-block-navigation__responsive-container-close,
.wp-block-navigation-submenu__toggle {
  min-width: var(--ctx-target);
  min-height: var(--ctx-target);
}

/* Core renders the nav as <nav> with no name when there is more than one on a
   page, which trips the unique-landmark rule. The footer nav gets a name. */
.ctx-footer .wp-block-navigation { --ctx-nav-context: footer; }

/* === Coming Soon construction page === */
/* Every value below is a DESIGN.md token: --wp--preset--color/font-size/
   spacing come from theme.json's palette, type scale and spacing scale;
   --ctx-radius-* are the design system's rounded-corner tokens. No raw
   hex, px font-size, or off-scale spacing in this section. */
.cs-outer { min-height: 100vh; display: flex; flex-direction: column; }

.cs-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--wp--preset--color--base);
  border-bottom: 1px solid var(--wp--preset--color--hairline);
}
.cs-header__inner {
  max-width: 1240px; margin: 0 auto;
  min-height: clamp(72px, 9vw, 100px);
  padding: 0 clamp(var(--wp--preset--spacing--40), 4vw, var(--wp--preset--spacing--80));
  justify-content: space-between; align-items: stretch; gap: var(--wp--preset--spacing--40); flex-wrap: wrap;
}
.cs-logo { margin: 0; flex: none; display: flex; align-items: center; }
.cs-logo img { height: clamp(72px, 9vw, 100px); width: auto; display: block; }
.cs-header__actions { gap: var(--wp--preset--spacing--20); flex-wrap: wrap; justify-content: flex-end; align-items: center; }

.cs-btn .wp-block-button__link { border-radius: var(--ctx-radius-pill); }
.cs-btn--ghost .wp-block-button__link {
  background: transparent; color: var(--wp--preset--color--text);
  box-shadow: none; padding-inline: var(--wp--preset--spacing--40);
}
.cs-btn--ghost .wp-block-button__link:hover { background: var(--wp--preset--color--bg-alt); color: var(--wp--preset--color--text); }
.cs-btn--accent .wp-block-button__link {
  background: var(--wp--preset--color--secondary); color: var(--wp--preset--color--text);
}
.cs-btn--accent .wp-block-button__link:hover { background: var(--wp--preset--color--base); color: var(--wp--preset--color--text); }
.cs-btn--outline .wp-block-button__link {
  background: transparent; border: 2px solid var(--wp--preset--color--base); color: var(--wp--preset--color--base); box-shadow: none;
  padding-inline: var(--wp--preset--spacing--50);
}
.cs-btn--outline .wp-block-button__link:hover { background: var(--wp--preset--color--base); color: var(--wp--preset--color--midnight); }
.cs-btn--cta .wp-block-button__link { background: var(--ctx-cta); color: var(--wp--preset--color--base); }
.cs-btn--cta .wp-block-button__link:hover { background: var(--ctx-cta-hover); color: var(--wp--preset--color--base); }
.cs-btn--block { width: 100%; }
.cs-btn--block .wp-block-button__link { width: 100%; justify-content: center; }

.cs-hero { padding: clamp(var(--wp--preset--spacing--80), 7vw, 96px) 0 clamp(150px, 18vw, 260px); margin-top: 0; }
.cs-hero__grid { gap: clamp(var(--wp--preset--spacing--60), 5vw, 64px); align-items: end; }
.cs-eyebrow {
  margin: 0;
  padding: var(--wp--preset--spacing--30) var(--wp--preset--spacing--50);
  border-radius: var(--ctx-radius-pill);
  background: var(--wp--preset--color--secondary);
  color: var(--wp--preset--color--text);
  font-family: var(--wp--preset--font-family--display), sans-serif;
  font-weight: 800; font-size: var(--wp--preset--font-size--meta); line-height: 1;
  letter-spacing: .12em; text-transform: uppercase;
}
.cs-hero__title {
  color: var(--wp--preset--color--base);
  font-family: var(--wp--preset--font-family--display), sans-serif;
  font-weight: 900; font-size: var(--wp--preset--font-size--hero); line-height: 1.02;
  letter-spacing: -.01em; margin-top: var(--wp--preset--spacing--40);
}
.cs-hero__copy-text { color: var(--wp--preset--color--base); line-height: 1.55; margin-top: var(--wp--preset--spacing--40); max-width: 560px; }
.cs-hero__copy-text a { color: var(--wp--preset--color--base); font-weight: 700; text-underline-offset: 3px; }
.cs-hero__copy-text a:hover { color: var(--wp--preset--color--secondary); }
.cs-hero__copy .wp-block-buttons { margin-top: var(--wp--preset--spacing--50); }

.cs-card { background: var(--wp--preset--color--base); color: var(--wp--preset--color--text); border-radius: var(--ctx-radius-card); padding: clamp(var(--wp--preset--spacing--50), 3vw, var(--wp--preset--spacing--60)); }
.cs-card__art { margin: 0; }
.cs-card__art img { display: block; width: 100%; height: auto; aspect-ratio: 2282 / 926; object-fit: cover; }
.cs-card__rule {
  background: var(--wp--preset--color--hairline); color: var(--wp--preset--color--hairline);
  border: 0; height: 1px; margin: var(--wp--preset--spacing--50) 0;
}
.cs-card__label {
  margin: 0;
  font-family: var(--wp--preset--font-family--display), sans-serif;
  font-weight: 800; font-size: var(--wp--preset--font-size--meta); letter-spacing: .12em; text-transform: uppercase;
  color: var(--wp--preset--color--slate);
}
.cs-fund-row { margin-top: var(--wp--preset--spacing--30); align-items: baseline; gap: var(--wp--preset--spacing--30); flex-wrap: wrap; }
.cs-fund-row__raised {
  margin: 0;
  font-family: var(--wp--preset--font-family--display), sans-serif;
  font-weight: 900; font-size: var(--wp--preset--font-size--h1); line-height: 1;
  color: var(--wp--preset--color--ink);
}
.cs-fund-row__unit { font-size: .5em; font-weight: 800; }
.cs-fund-row__goal { margin: 0; font-family: var(--wp--preset--font-family--display), sans-serif; font-weight: 700; font-size: var(--wp--preset--font-size--body); color: var(--wp--preset--color--slate); }
.cs-progress { margin-top: var(--wp--preset--spacing--40); height: 22px; border-radius: var(--ctx-radius-pill); background: var(--wp--preset--color--hairline); overflow: hidden; }
.cs-progress__fill { height: 100%; border-radius: var(--ctx-radius-pill); background: var(--wp--preset--color--secondary); width: 73%; }
.cs-progress-meta { margin-top: var(--wp--preset--spacing--30); gap: var(--wp--preset--spacing--30); flex-wrap: wrap; }
.cs-progress-meta p { margin: 0; font-family: var(--wp--preset--font-family--display), sans-serif; font-weight: 700; font-size: var(--wp--preset--font-size--meta); }
.cs-card .wp-block-buttons { margin-top: var(--wp--preset--spacing--50); }

.cs-scene { padding: 0 clamp(var(--wp--preset--spacing--40), 4vw, var(--wp--preset--spacing--80)); margin-top: clamp(-220px, -15vw, -120px); }
.cs-scene__card { max-width: 1240px; margin: 0 auto; }
.cs-scene__img { margin: 0; }
.cs-scene__img img {
  display: block; width: 100%; aspect-ratio: 2560 / 836; min-height: 220px;
  object-fit: cover; object-position: 60% center; border-radius: var(--ctx-radius-feature);
}
.cs-scene__caption { margin: var(--wp--preset--spacing--30) 0 0; }

.cs-footer { margin-top: clamp(var(--wp--preset--spacing--80), 6vw, 72px); }
.cs-footer__inner {
  max-width: 1240px; margin: 0 auto;
  padding: var(--wp--preset--spacing--50) clamp(var(--wp--preset--spacing--40), 4vw, var(--wp--preset--spacing--80));
  gap: var(--wp--preset--spacing--30) var(--wp--preset--spacing--60); align-items: center; font-size: var(--wp--preset--font-size--meta);
}
.cs-footer__meta { gap: var(--wp--preset--spacing--30); }
.cs-footer__meta p { margin: 0; line-height: 1.55; }
.cs-footer__meta a, .cs-footer__nav a { color: var(--wp--preset--color--base); font-weight: 700; text-underline-offset: 3px; }
.cs-footer__meta a:hover, .cs-footer__nav a:hover { color: var(--wp--preset--color--secondary); }
.cs-footer__nav a { text-decoration: none; }

@media (prefers-reduced-motion: reduce) { .cs-header { position: static; } }
