/* Reset + a11y + layout helpers.
   Global element styling (body, headings, links) lives in theme.json → styles. */

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

* { margin: 0; }

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
}

body {
	min-height: 100vh;
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
}

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

input, button, textarea, select { font: inherit; color: inherit; }

a { color: inherit; text-decoration: none; }

ul[role='list'], ol[role='list'] { list-style: none; padding: 0; }

/* Typografia bazowa (kolor/waga/wysokość-linii nagłówków = theme.json → styles).
   Tu tylko text-wrap, którego theme.json nie generuje. */
h1, h2, h3, h4, h5, h6 { text-wrap: balance; }

p { text-wrap: pretty; }

/* lowercase jest globalne (theme.json → styles). Wyjątek dla nazw własnych/skrótów. */
.is-cased { text-transform: none; }

:focus-visible {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 2px;
}

/* JEDNO ŹRÓDŁO reduced-motion (ADR-0032). Ten globalny blok zeruje WSZYSTKIE
   transitions/animations `!important` na każdym elemencie — więc per-plikowe
   `@media (prefers-reduced-motion) { … transition: none }` są redundantne i ich
   NIE dodajemy. Wyjątek = własność, której ten blok nie rusza (np. `transform`,
   `scroll-behavior`) — tylko taką regułę wolno dopisać lokalnie. */
@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;
	}
}

/* Centered max-width container with fluid side padding. */
.wrapper {
	width: 100%;
	max-width: var(--wp--style--global--wide-size, 1280px);
	margin-inline: auto;
	padding-inline: var(--wp--preset--spacing--sm);
}

/* Visually hidden, still available to screen readers.
   `.screen-reader-text` = ta sama technika pod nazwą, której używa WooCommerce
   (etykiety „Required", opisy pól w klasycznych formularzach konta/koszyka).
   Legacy CSS Woo jest wyłączony (inc/woo/foundation.php), więc bez tej reguły
   te teksty byłyby widoczne — dublujemy utility globalnie. */
.visually-hidden,
.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

/* Fokus-widoczny na skrótach SR (np. „przejdź do treści") — gdyby pojawił się
   interaktywny element z tą klasą, nie chowaj go, gdy dostanie fokus. */
.screen-reader-text:focus {
	position: static;
	width: auto;
	height: auto;
	margin: 0;
	overflow: visible;
	clip: auto;
	white-space: normal;
}

/* #main carries tabindex="-1" so the skip link moves keyboard focus into it
   (Chromium scrolls but won't focus a non-interactive target otherwise). Suppress
   the focus ring on this programmatic focus — the skip link is the visible cue. */
#main:focus { outline: none; }

/* Skip link — off-screen until focused. */
.skip-link {
	position: absolute;
	left: -9999px;
	z-index: 999;
	padding: var(--wp--preset--spacing--xs) var(--wp--preset--spacing--sm);
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--dark);
}

.skip-link:focus {
	left: var(--wp--preset--spacing--sm);
	top: var(--wp--preset--spacing--sm);
}
