/* YesWas accessibility layer (wave 3, agent 06). Loads last (inc/a11y.php, priority 40).
   Only global fixes found by the audit (docs/A11Y_REPORT.md). Tokens: --yw-* from tokens.css (all with fallbacks, this
   file must work if tokens.css is ever dequeued).
   Colours: ring navy #182879 on white 12.98 | ring yellow #FFD60A on black 14.88, on #0E1481 band 10+ */

/* 1. Focus rings the module sheets miss ----------------------------------------------------------------------- */

/* Episode cards (archive, search, v2 home): components.css draws the ring on the card with a :has() selector that
   can never match (it nests .yw-card inside :has), and then removes the link outline. Draw it here. */
.yw-card:has(.yw-card__title a:focus-visible) {
	outline: var(--yw-ring-width, 3px) solid var(--yw-ring-color, #182879);
	outline-offset: var(--yw-ring-offset, 2px);
}

/* Dark surfaces: the navy ring is 1.5:1 on black. Hero, blue band, credit bar, mobile menu get the yellow one. */
#container #site-home-welcome :is(a, button):focus-visible,
#container .page-intro-header :is(a, button):focus-visible,
#container .page-intro-subscribe :is(a, button):focus-visible,
#container #site-footer-credit a:focus-visible,
#container #site-mobile-menu :is(a, button, input):focus-visible,
#container .yw-section--dark :is(a, button):focus-visible {
	outline: 3px solid var(--yw-focus-on-dark, #ffd60a);
	outline-offset: 2px;
}

/* Text fields: border + 1px inset shadow was the only cue. Add the ring. */
#container .yeswas-search__field:focus-visible,
#container .contact-form :is(input, textarea, select):focus-visible,
#container .entry-content :is(input:not([type=checkbox], [type=radio], [type=submit]), textarea, select):focus-visible {
	outline: 3px solid var(--yw-focus, #182879);
	outline-offset: 2px;
}
#container .contact-form button:focus-visible,
#container .entry-content button:focus-visible {
	outline: 3px solid var(--yw-focus, #182879);
	outline-offset: 2px;
}

/* 2. Target size (WCAG 2.5.8) --------------------------------------------------------------------------------- */

/* The "Pobierz plik audio" link under the player stands alone in its paragraph and was 18px tall. Inline links in sentences are exempt. */
.yeswas-ep-audiolink a { display: inline-block; min-height: 24px; line-height: 24px; }

/* 3. Contrast ------------------------------------------------------------------------------------------------- */

/* Parent link blue #058DD1 is 3.66:1 on white. Episode footer links ("Patreon", "Forum", credits) used it. */
.yeswas-ep-footer a, .yeswas-ep-footer .yeswas-ep-credits a { color: var(--yw-link, #0b6ba0); }
.yeswas-ep-footer a:hover, .yeswas-ep-footer a:focus { color: var(--yw-link-hover, #084d73); }
/* Mobile menu: the parent turns a:hover / a:focus dark blue, which vanishes on the navy panel (focused link was ~1.3:1). */
#container #site-mobile-menu .mobile-menu a:is(:hover, :focus, :focus-visible) { color: #fff; text-decoration: underline; }
/* Year pills with 0 results: ink-muted on the disabled grey was 4.21:1. */
.yw-pill[aria-disabled="true"], .yw-pill[aria-disabled="true"] .yw-archive__n { color: var(--yw-border-strong, #5b6070); }

/* 4. Reduced motion ------------------------------------------------------------------------------------------- */

/* Parent sets html { scroll-behavior: smooth } and transition: all on links and buttons. */
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after {
		transition-duration: 0.01ms !important;
		transition-delay: 0s !important;
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
	}
}

/* 5. Reflow with enlarged text ---------------------------------------------------------------------------------- */

/* Root font 200% on a 375px phone: the 5.5rem artwork column left ~120px for the body and the "Słuchaj" button
   (home v2 cards) ran 49px past the viewport. Cap the art column by viewport width; let the button wrap. */
@media (max-width: 39.99rem) {
	.yw-card:not(.yw-card--stacked) { grid-template-columns: min(5.5rem, 22vw) minmax(0, 1fr); }
}
.yw-card__actions > * { max-width: 100%; min-width: 0; }
#container .yw-card .yeswas-player__btn { max-width: 100%; white-space: normal; }
