/* ============================================================
   GPCA Accessibility CSS
   WCAG fixes flagged by SortSite scan.
   Selectors use specificity rather than !important.
   ============================================================ */

/* ------------------------------------------------------------
   Issue #2 — Restore visible focus outline (WCAG 2.4.7)
   Kadence's reset and Cookie Yes both set outline:0/none on
   interactive elements, leaving keyboard users with no
   focus indicator. Apply a brand-blue ring on :focus-visible
   so it shows for keyboard navigation but not mouse clicks.
   ------------------------------------------------------------ */
html body a:focus-visible,
html body button:focus-visible,
html body input:focus-visible,
html body select:focus-visible,
html body textarea:focus-visible,
html body summary:focus-visible,
html body [role="button"]:focus-visible,
html body [role="link"]:focus-visible,
html body [tabindex]:focus-visible {
  outline: 2px solid #015ed0;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(1, 94, 208, 0.25);
  border-radius: 2px;
}

/* Cookie-Yes revisit button — same focus ring */
html body button.cky-btn-revisit:focus-visible {
  outline: 2px solid #015ed0;
  outline-offset: 2px;
}

/* ------------------------------------------------------------
   Issue #3 — Button text size for contrast (WCAG 1.4.3)
   Brand orange #ff4e00 with white text gives a 3.31:1 ratio.
   WCAG AA accepts that ratio only at "large text" thresholds:
   18pt regular (24px) OR 14pt bold (≈18.67px).
   Kadence ships buttons at 16px/700 — just under the bar.
   Bump primary buttons to 19px/700 so contrast passes.
   ------------------------------------------------------------ */
html body button,
html body .button,
html body .wp-block-button__link,
html body .wp-element-button,
html body input[type="button"],
html body input[type="reset"],
html body input[type="submit"],
html body .fl-button,
html body .elementor-button-wrapper .elementor-button,
html body .wc-block-components-checkout-place-order-button,
html body .wc-block-cart__submit {
  font-size: 1.1875rem;  /* 19px = >14pt bold large-text threshold */
  font-weight: 700;
}

/* Outline-style buttons sit on white — readable at smaller text.
   Keep them at the same enlarged size for visual consistency. */
html body .button.button-style-outline,
html body .wp-block-button.is-style-outline .wp-block-button__link,
html body .wp-block-button.is-style-outline .wp-element-button {
  font-size: 1.1875rem;
}

/* ------------------------------------------------------------
   Issue #4 — Respect prefers-reduced-motion (WCAG 2.3.3 / AAA)
   Kadence hover transitions on cards, buttons and nav fire
   regardless of OS-level motion preference. Suppress all
   transitions and animations when the user has asked to.
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  html body,
  html body *,
  html body *::before,
  html body *::after {
    transition-duration: 0.001ms;
    transition-delay: 0s;
    animation-duration: 0.001ms;
    animation-iteration-count: 1;
    scroll-behavior: auto;
  }
}

/* ------------------------------------------------------------
   Issue #15 — Targeted contrast fixes via font-size bump
   (WCAG 1.4.3 — AA contrast)
   Brand orange #ff4e00 on white/off-white gives 3.31:1. WCAG
   accepts 3:1 at "large text": 18pt regular (24px) OR 14pt
   bold (≈18.67px). Per design feedback, brand orange stays;
   we bump font-size on the specific flagged elements into the
   large-text band. Element classes identified from SortSite
   evidence; selectors prefixed with `html body` to beat
   Kadence/Tribe Events default rules without `!important`.
   ------------------------------------------------------------ */

/* Comment-form floating labels — Kadence renders these orange
   on the off-white page background at 20px regular. 28 of the
   406 flagged contrast cases come from this class on commentable
   pages. Bumping to 19px bold drops them into large-text. */
html body label.float-label,
html body .float-label {
  font-size: 1.1875rem;  /* 19px */
  font-weight: 700;
}

/* Kadence Count-up block — the orange-bg/white-text caption
   below each animated number (e.g. "Cultural alliance MEMBERS").
   Was 12.75pt bold = 17px bold. */
html body .kb-count-up-title,
html body .wp-block-kadence-countup .kb-count-up-title {
  font-size: 1.1875rem;
  font-weight: 700;
}

/* Tribe Events Calendar — list view event title links.
   Were 13.50pt bold = 18px bold, just under the 14pt-bold bar. */
html body .tribe-events-calendar-list__event-title-link,
html body .tribe-events-calendar-list__event-title-link.tribe-common-anchor-thin,
html body .tribe-events-calendar-day__event-title-link,
html body .tribe-events-calendar-month__calendar-event-title-link {
  font-size: 1.1875rem;
  font-weight: 700;
  line-height: 1.3;
}

/* Tribe Events Calendar — Subscribe / Add to calendar dropdown
   button labels. Tribe Events ships these inside a tightly-scoped
   `.tribe-common` BEM scale that wins single-class specificity,
   so we double the class on the same element to outweigh it
   without resorting to !important. */
html body .tribe-events-c-subscribe-dropdown__button-text,
html body .tribe-events-c-subscribe-dropdown__button-text.tribe-events-c-subscribe-dropdown__button-text,
html body .tribe-events-c-subscribe-dropdown__button.tribe-events-c-subscribe-dropdown__button,
html body .tribe-common .tribe-events-c-subscribe-dropdown__button-text,
html body .tribe-common .tribe-events-c-subscribe-dropdown__button {
  font-size: 1.1875rem;
  font-weight: 700;
  line-height: 1.3;
}

/* Gutenberg post-excerpt "Read More" link (used by Kadence on
   the news, culturewire, and research archive grids). Default
   Kadence styling renders this as a small orange pill button
   at 13px/700 — fails AA. Bump to 19px/700 to clear large-text. */
html body a.wp-block-post-excerpt__more-link,
html body .wp-block-post-excerpt a.wp-block-post-excerpt__more-link,
html body .wp-block-post-excerpt__more-link.wp-block-post-excerpt__more-link {
  font-size: 1.1875rem;
  font-weight: 700;
  line-height: 1.3;
}

/* Inline-styled "button" anchors that editors paste into post
   content (e.g. blue #2393d3 boxed buttons on culturewire posts
   and pa-culturecheck). The companion PHP filter strips the
   inline font-size declaration on these; this rule supplies the
   compliant size. The selector is scoped to post-content anchors
   that carry inline style so we don't shift other body text. */
html body .entry-content a[style*="background"],
html body .entry-content a[style*="display:inline-block"],
html body .entry-content a[style*="display: inline-block"] {
  font-size: 1.1875rem;
  font-weight: 700;
  line-height: 1.3;
}

/* "Register today!" pattern on Tribe Events single pages — bare
   <a> with no class, no inline style, rendered as orange button
   via Tribe Events parent rules at ≈16.6px. Bump to 19px. */
html body .tribe-block__event-website a,
html body .tribe-events-event-meta a,
html body #tribe-events-content .tribe-block a {
  font-size: 1.1875rem;
  font-weight: 700;
}

/* Gutenberg Query Pagination — page-numbers links, previous/next
   page buttons. Default Kadence styling renders as small orange
   pill buttons at 14px/700. Bump to 19px/700. */
html body .wp-block-query-pagination a.page-numbers,
html body .wp-block-query-pagination span.page-numbers,
html body .page-numbers,
html body a.page-numbers,
html body .wp-block-query-pagination-previous,
html body .wp-block-query-pagination-next,
html body a.wp-block-query-pagination-previous,
html body a.wp-block-query-pagination-next {
  font-size: 1.1875rem;
  font-weight: 700;
}

/* Tribe Events search bar — "Find Events" submit button.
   Was 16px/700 white on orange. */
html body .tribe-events-c-search__button,
html body button.tribe-events-c-search__button.tribe-common-c-btn {
  font-size: 1.1875rem;
  font-weight: 700;
}

/* Tribe Events top-bar nav buttons — "Today" / "This Month" /
   month-jump buttons. Were 14px/400 orange on white. Tribe ships
   these with a `tribe-common-c-btn-border-small` class whose own
   font-size rule wins single-class specificity, so double up here. */
html body .tribe-events-c-top-bar__today-button,
html body .tribe-events-c-top-bar__datepicker-button,
html body a.tribe-events-c-top-bar__today-button,
html body button.tribe-events-c-top-bar__datepicker-button,
html body a.tribe-events-c-top-bar__today-button.tribe-events-c-top-bar__today-button,
html body .tribe-common-c-btn-border-small.tribe-events-c-top-bar__today-button,
html body .tribe-common .tribe-events-c-top-bar__today-button,
html body .tribe-common .tribe-events-c-top-bar__datepicker-button {
  font-size: 1.1875rem;
  font-weight: 700;
}

/* Tribe Events "Featured" badge — was 16px/700 orange on white. */
html body .tribe-events-calendar-list__event-datetime-featured-text,
html body .tribe-events-calendar-month__calendar-event-datetime-featured-text,
html body .tribe-events-calendar-month-mobile-events__mobile-event-datetime-featured-text,
html body .tribe-events-calendar-day__event-datetime-featured-text {
  font-size: 1.1875rem;
  font-weight: 700;
}

/* Tribe Events single-event "previous / next event" sub-nav at
   the bottom of event detail pages. The arrow links are bare
   anchors inside <ul class="tribe-events-sub-nav">. */
html body .tribe-events-sub-nav a,
html body .tribe-events-sub-nav li a {
  font-size: 1.1875rem;
  font-weight: 700;
}

/* Kadence Advanced Heading subtitle blocks on archive hero
   sections (e.g. news/press-room, culturewire archives). The
   class names follow `kt-adv-heading{slug}_archive_sub` and
   they render white on orange at 22px/400 — needs 24px regular
   (18pt) to clear large-text 3:1. */
html body .wp-block-kadence-advancedheading[class*="_archive_sub"],
html body [class*="kt-adv-heading"][class*="_archive_sub"] {
  font-size: 1.5rem;  /* 24px = 18pt regular */
}

/* Kadence Advanced Heading non-title elements (P/DIV/SPAN) that
   render in brand-orange palette colors (1=orange, 5=orange-dup,
   9=white). Editors set per-block font-sizes that often fall
   below the large-text threshold, then the orange↔white pairing
   fails AA. Force 19px bold which clears 14pt-bold large-text at
   the 3.31:1 ratio. h1–h6 are excluded so hero titles stay sized
   as the editor intended (they're large enough to pass anyway).

   Kadence generates per-block CSS that uses a 3-class selector
   `.wp-block-kadence-advancedheading.kt-adv-heading{id}[data-kb-block="kb-adv-heading{id}"]`
   — to beat that specificity we add the [data-kb-block] attribute
   selector here as well. */
html body p.wp-block-kadence-advancedheading.has-theme-palette-1-color[data-kb-block],
html body p.wp-block-kadence-advancedheading.has-theme-palette-5-color[data-kb-block],
html body p.wp-block-kadence-advancedheading.has-theme-palette-9-color[data-kb-block],
html body div.wp-block-kadence-advancedheading.has-theme-palette-1-color[data-kb-block],
html body div.wp-block-kadence-advancedheading.has-theme-palette-5-color[data-kb-block],
html body div.wp-block-kadence-advancedheading.has-theme-palette-9-color[data-kb-block],
html body span.wp-block-kadence-advancedheading.has-theme-palette-1-color[data-kb-block],
html body span.wp-block-kadence-advancedheading.has-theme-palette-5-color[data-kb-block],
html body span.wp-block-kadence-advancedheading.has-theme-palette-9-color[data-kb-block] {
  font-size: 1.1875rem;  /* 19px */
  font-weight: 700;
}

/* Kadence Mega-menu / nav-drop dropdown title — "About Us",
   "What We Do" etc. render orange at 18px/700 on white, falling
   0.67px short of the 18.67px bold threshold. */
html body .nav-drop-title-wrap,
html body span.nav-drop-title-wrap {
  font-size: 1.1875rem;
  font-weight: 700;
}

/* Tribe Events Calendar — back-link ("« All Events") on single
   event pages. Was 11.25pt bold = 15px bold. */
html body .tribe-events-back a,
html body .tribe-events-c-top-bar__nav-link,
html body .tribe-events-back-link {
  font-size: 1.1875rem;
  font-weight: 700;
}
