/**
 * WCAG 2.1 — skip link, reduced motion, kontrast stopki, dokumenty prawne.
 */

/* --- Skip link (WCAG 2.4.1) — pierwszy element <body>, widoczny po fokusie --- */
.eureka-skip-link {
	position: fixed;
	top: 0.5rem;
	left: 0.5rem;
	z-index: 100001;
	padding: 0.65rem 1rem;
	font-size: 0.9375rem;
	font-weight: 600;
	color: #fff;
	background: var(--eureka-foreground, #0e2341);
	border-radius: 0.5rem;
	box-shadow: 0 4px 16px rgba(14, 35, 65, 0.25);
	text-decoration: none;
	clip: rect(0, 0, 0, 0);
	clip-path: inset(50%);
	width: 1px;
	height: 1px;
	overflow: hidden;
	white-space: nowrap;
	border: 0;
}

.eureka-skip-link:focus,
.eureka-skip-link:focus-visible {
	clip: auto;
	clip-path: none;
	width: auto;
	height: auto;
	overflow: visible;
	white-space: normal;
	outline: none;
	box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--eureka-primary, #b00844) 40%, transparent),
		0 4px 16px rgba(14, 35, 65, 0.25);
}

/* --- Reduced motion (WCAG 2.3.3) --- */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}

	.eureka-skip-link {
		transition: none;
	}
}

/* Legacy: skip w nav landmark (starszy motyw) */
.eureka-skip-nav .eureka-skip-link {
	clip: auto;
	clip-path: none;
	width: auto;
	height: auto;
	overflow: visible;
}

/* --- Kontrast stopki: white-50 → ~4.6:1 na navy --- */
.eureka-footer .text-white-50,
.eureka-footer-bottom.text-white-50,
.eureka-footer-bottom .text-white-50 {
	color: rgba(255, 255, 255, 0.78) !important;
}

.eureka-footer-bottom__link,
.eureka-footer-bottom .nav a {
	color: rgba(255, 255, 255, 0.78);
}

.eureka-footer-bottom__link:hover,
.eureka-footer-bottom__link:focus-visible,
.eureka-footer-bottom .nav a:hover,
.eureka-footer-bottom .nav a:focus-visible {
	color: #fff;
	opacity: 1;
}

/* --- Kontrast linków akcentowych w stopce na navy --- */
.eureka-footer .eureka-footer-nav__link--accent,
.eureka-footer .eureka-footer-nav__link--accent:hover,
.eureka-footer .eureka-footer-nav__link--accent:focus-visible {
	color: #ff8fab;
	opacity: 1;
}

/* --- WooCommerce: błędy pól checkout --- */
.woocommerce-checkout .woocommerce-invalid input.input-text,
.woocommerce-checkout .woocommerce-invalid select,
.woocommerce-checkout .woocommerce-invalid textarea,
.woocommerce-checkout .woocommerce-invalid .select2-container--default .select2-selection--single,
.woocommerce-checkout .woocommerce-invalid-select2.select2-container--default .select2-selection--single {
	border-color: var(--bs-danger, #dc3545) !important;
}

.woocommerce-checkout .woocommerce-invalid label {
	color: var(--bs-danger, #dc3545);
}

/* --- Region live (visually hidden) --- */
.eureka-a11y-live {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* --- Focus visible — uzupełnienie motywu (WCAG 2.4.7) --- */
body.eureka-wcag-enabled :focus-visible {
	outline: 2px solid var(--eureka-primary, #dd0a54);
	outline-offset: 2px;
}

body.eureka-wcag-enabled .btn:focus-visible,
body.eureka-wcag-enabled a:focus-visible {
	outline-offset: 3px;
}

/* --- Target size minimum 44px dla kluczowych kontrolek (WCAG 2.5.5 AAA — wsparcie) --- */
@media (pointer: coarse) {
	body.eureka-wcag-enabled .eureka-social-btn,
	body.eureka-wcag-enabled .eureka-topbar-icon-btn,
	body.eureka-wcag-enabled .navbar-toggler {
		min-width: 44px;
		min-height: 44px;
	}
}

/* --- Linki w blokach prawnych (link-in-text-block) --- */
.legal-doc a,
.eureka-deklaracja-dostepnosci a {
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

.legal-doc a:hover,
.eureka-deklaracja-dostepnosci a:hover,
.legal-doc a:focus-visible,
.eureka-deklaracja-dostepnosci a:focus-visible {
	text-decoration-thickness: 2px;
}

/* --- Topbar: AAA enhanced kontrast (≥7:1 na #e2e3e5) — po main.css --- */
.eureka-masthead .eureka-topbar.bg-secondary-subtle {
	--bs-secondary-rgb: 61, 67, 72;
	--bs-secondary-color: #3d4348;
}

.eureka-masthead .eureka-topbar.bg-secondary-subtle a.eureka-topbar__link,
.eureka-masthead .eureka-topbar.bg-secondary-subtle a.link-secondary,
.eureka-masthead .eureka-topbar.bg-secondary-subtle a.d-xl-inline-flex[href],
.eureka-masthead .eureka-topbar.bg-secondary-subtle .eureka-topbar__action {
	color: #3d4348 !important;
}

.eureka-masthead .eureka-topbar.bg-secondary-subtle a.eureka-topbar__link:hover,
.eureka-masthead .eureka-topbar.bg-secondary-subtle a.eureka-topbar__link:focus-visible,
.eureka-masthead .eureka-topbar.bg-secondary-subtle a.link-secondary:hover,
.eureka-masthead .eureka-topbar.bg-secondary-subtle a.link-secondary:focus-visible,
.eureka-masthead .eureka-topbar.bg-secondary-subtle a.d-xl-inline-flex[href]:hover,
.eureka-masthead .eureka-topbar.bg-secondary-subtle a.d-xl-inline-flex[href]:focus-visible,
.eureka-masthead .eureka-topbar.bg-secondary-subtle .eureka-topbar__action:hover,
.eureka-masthead .eureka-topbar.bg-secondary-subtle .eureka-topbar__action:focus-visible {
	color: #2e3336 !important;
}

/* --- Okruszki: link-in-text-block --- */
nav[aria-label="Ścieżka nawigacji"] a.link-secondary {
	text-decoration: underline !important;
	text-underline-offset: 0.12em;
}

/* --- Tekst tylko dla czytników (WooCommerce ceny, ilości itd.) --- */
.screen-reader-text,
.visually-hidden:not(:focus):not(:active) {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	clip-path: inset(50%) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

html.eureka-wcag-dark-contrast .screen-reader-text,
html.eureka-wcag-light-contrast .screen-reader-text,
html.eureka-wcag-dark-contrast .screen-reader-text.ewc-contrast,
html.eureka-wcag-light-contrast .screen-reader-text.ewc-contrast {
	background: transparent !important;
	color: transparent !important;
	border: none !important;
	box-shadow: none !important;
}
