/*
 * Awiteks — style bazowe: reset, typografia, linki, fokus, narzędzia dostępności.
 * Wartości wyłącznie z tokens.css.
 */

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

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-padding-top: var(--space-l);
}

@media (prefers-reduced-motion: no-preference) {
	html { scroll-behavior: smooth; }
}

body {
	margin: 0;
	background: var(--color-bg);
	color: var(--color-text);
	font-family: var(--font-serif);
	font-size: var(--text-base);
	line-height: var(--leading-relaxed);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

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

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

button { cursor: pointer; }

/* ── Typografia ────────────────────────────────────────────────── */
h1,
h2,
h3,
h4 {
	margin-top: 0;
	font-weight: 400;
	line-height: var(--leading-tight);
	letter-spacing: var(--tracking-heading);
	text-wrap: balance;
}

h1 { font-size: var(--text-3xl); margin-bottom: var(--space-m); }
h2 { font-size: var(--text-2xl); margin-bottom: var(--space-m); }
h3 { font-size: var(--text-xl); margin-bottom: var(--space-s); }
h4 { font-size: var(--text-lg); margin-bottom: var(--space-xs); }

p,
ul,
ol,
dl,
blockquote,
figure {
	margin-top: 0;
	margin-bottom: var(--space-m);
}

p { text-wrap: pretty; }

strong,
b { font-weight: 700; }

/* ── Linki ─────────────────────────────────────────────────────── */
/* Linki w treści są podkreślone — nie odróżniamy ich samym kolorem (WCAG 1.4.1). */
a {
	color: inherit;
	text-decoration-line: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}

a:hover { text-decoration-thickness: 2px; }

/* ── Fokus (WCAG 2.4.7, 1.4.11) ────────────────────────────────── */
:focus-visible {
	outline: var(--focus-width) solid var(--focus-color);
	outline-offset: var(--focus-offset);
}

/* Fokus programowy (np. po „Przejdź do treści”) bez ramki na całym <main>. */
[tabindex="-1"]:focus:not(:focus-visible) { outline: none; }

/* ── Narzędzia dostępności ─────────────────────────────────────── */
.skip-link {
	position: absolute;
	top: var(--space-s);
	left: var(--space-s);
	z-index: 1000;
	padding: var(--space-xs) var(--space-m);
	background: var(--color-green);
	color: var(--color-cream);
	font: 600 var(--text-sm) / 1 var(--font-sans);
	text-decoration: none;
	transform: translateY(calc(-100% - var(--space-l)));
}

.skip-link:focus {
	transform: none;
	--focus-color: var(--color-gold);
}

/* Tekst tylko dla czytników ekranu (nazwa klasy zgodna z WordPressem). */
.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;
}

[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}

/* Tryb wysokiego kontrastu Windows: przywróć ramki tam, gdzie styl je zdejmuje. */
@media (forced-colors: active) {
	.button,
	.chip { border: 1px solid ButtonText; }
}
