/*
 * TheSybin — podstawy: zmienne responsywne, typografia, fokus, dostępność, formularze.
 * Wartości: design-ref/spec/global.md („Tokeny projektu”, „Globalne decyzje WCAG”), docs/DECYZJE.md.
 * Punkty przełamania: tablet ≤1024, telefon ≤767.
 */

:root {
	/* Skala typograficzna (desktop) */
	--ts-fs-display: 55px;
	--ts-fs-h1: 60px;
	--ts-fs-h2: 46px;
	--ts-fs-h2-content: 48px;
	--ts-fs-h3: 20px;
	--ts-fs-eyebrow: 18px;
	--ts-fs-small: 14px;

	/* Odstępy */
	--ts-gutter: 20px;
	--ts-section-y: 100px;
	--ts-sp-30: 30px;
	--ts-btn-py: 17px;
	--ts-btn-px: 30px;
	--ts-btn-icon: 50px;
	--ts-header-h: 111px;

	/* Kolory pomocnicze */
	--ts-divider: rgba(39, 74, 70, 0.1);
	--ts-divider-dark: rgba(255, 255, 255, 0.15);
	--ts-overlay: rgba(39, 74, 70, 0.8);
	--ts-focus: var(--wp--preset--color--primary);

	/* Promienie i cienie */
	--ts-radius-card: 20px;
	--ts-radius-pill: 100px;
	--ts-radius-accordion: 16px;
	--ts-shadow-card: 0 0 30px 0 rgba(0, 0, 0, 0.05);

	/* Ruch (hover): skracany do 0 przy ograniczeniu ruchu */
	--ts-ease: ease-in-out;
	--ts-dur: 0.4s;

	/* Sklep (design-ref/sklep-projekt/SKLEP-PROJEKT.md §2.1, §2.3; docs/SKLEP.md) — kontrasty w komentarzach: na #FFF / #F7F4EF */
	--ts-muted: #5F6562;              /* tekst pomocniczy 5.96 / 5.43 */
	--ts-field: var(--wp--preset--color--field-border, #898C8C); /* ramki pól, stepera, radia 3.39 / 3.09 (1.4.11) */
	--ts-field-hover: #6E7271;
	--ts-input-text: #1F2A28;
	--ts-error: #A3262A;              /* 7.32 / 6.67; na --ts-error-bg 6.42 */
	--ts-error-bg: #FBEDEC;
	--ts-ok: #1D5E43;                 /* na --ts-ok-bg 6.63 */
	--ts-ok-bg: #E6F1EA;
	--ts-cream-line: #E8E0CE;         /* ramki kart kremowych (dekoracja) */
	--ts-line: rgba(39, 74, 70, 0.12); /* separatory (dekoracja) */
	--ts-disabled-bg: #D9D4CB;        /* przycisk aria-disabled: tekst #4E5451 = 5.25:1 */
	--ts-radius-lg: 24px;
	--ts-radius-field: 12px;
	--ts-shadow-lift: 0 18px 50px -12px rgba(16, 43, 40, 0.18);
	--ts-shop-section: 100px;         /* pionowy rytm sekcji sklepu 100 / 72 / 56 */

	/* Stany formularzy CF7 (kontakt) — kontrast na #FFF; wzorzec #E65757 (3.58:1) i #46B450 (2.66:1) */
	--ts-form-error: #D14446;         /* 4.54 */
	--ts-form-ok: #03881F;            /* 4.62 */
}

@media (max-width: 1024px) {
	:root {
		--ts-fs-display: 45px;
		--ts-fs-h1: 45px;
		--ts-fs-h2: 36px;
		--ts-fs-h2-content: 36px;
		--ts-fs-eyebrow: 16px;
		--ts-section-y: 50px;
		--ts-sp-30: 20px;
		--ts-btn-py: 15px;
		--ts-btn-px: 20px;
		--ts-btn-icon: 46px;
		--ts-header-h: 91px;
		--ts-shop-section: 72px;
	}
}

@media (max-width: 767px) {
	:root {
		--ts-fs-display: 30px;
		--ts-fs-h1: 30px;
		--ts-fs-h2: 26px;
		--ts-fs-h2-content: 26px;
		--ts-fs-h3: 18px;
		--ts-shop-section: 56px;
	}
}

@media (prefers-reduced-motion: reduce) {
	:root {
		--ts-dur: 0s;
	}

	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		scroll-behavior: auto !important;
		transition-duration: 0.01ms !important;
	}
}

/* ---------- Dokument ---------- */

html {
	scroll-padding-top: 24px;
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

/* Wygładzanie fontów domyślne przeglądarki — jak wzorzec (Sellsmart nie ustawia font-smoothing; `antialiased` pocieniało cały tekst). */
body {
	margin: 0;
	overflow-x: clip;
}

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

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

:where(h1, h2, h3, h4, h5, h6, p, ul, ol, figure, blockquote) {
	margin-block: 0;
}

:where(h1, h2, h3, h4, h5, h6) {
	overflow-wrap: break-word;
}

/* Kursywne fragmenty nagłówków: Lora 400 italic, ta sama wielkość (C2) */
:where(h1, h2, h3, .ts-heading) :where(em, i) {
	font-family: var(--wp--preset--font-family--serif);
	font-style: italic;
	font-weight: 400;
	color: inherit;
}

strong,
b {
	font-weight: 700;
}

/* ---------- Linki ---------- */

a {
	color: inherit;
	text-decoration: none;
	transition: color 0.3s var(--ts-ease);
}

/* Linki w treści (wpisy, dokumenty, akapity): odróżnione podkreśleniem (1.4.1, D1) */
:where(.entry-content, .wp-block-post-content, .ts-prose) :where(p, li, td, dd, blockquote, figcaption) a:where(:not(.wp-element-button, .ts-btn, .ts-link-arrow, .is-style-ts-link-arrow, .ts-link-serif, .ts-pill, .ts-question-badge, .ts-video-btn)) {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

/* ---------- Fokus (D2) ---------- */

:where(.ts-surface-dark, .has-primary-background-color, .ts-header, .ts-footer, .ts-page-hero, .ts-hero) {
	--ts-focus: var(--wp--preset--color--accent-on-dark);
}

:where(.has-accent-background-color, .ts-surface-accent) {
	--ts-focus: var(--wp--preset--color--on-accent);
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 2px solid var(--ts-focus);
	outline-offset: 3px;
}

:where(input, textarea, select):focus-visible {
	outline-offset: 2px;
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus:not(:focus-visible) {
	outline: none;
}

main:focus {
	outline: none;
}

/* ---------- Dostępność ---------- */

.screen-reader-text {
	border: 0;
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute !important;
	width: 1px;
	word-wrap: normal !important;
}

.screen-reader-text:focus {
	background-color: var(--wp--preset--color--white);
	clip-path: none;
	color: var(--wp--preset--color--primary);
	display: block;
	font-size: 16px;
	font-weight: 700;
	height: auto;
	left: 12px;
	line-height: 1;
	padding: 15px 20px;
	top: 12px;
	width: auto;
	z-index: 100000;
}

/* Link „Przejdź do treści” (core dodaje .skip-link w motywach blokowych) */
.skip-link.screen-reader-text:focus,
.ts-skip-link:focus-visible {
	position: fixed !important;
	top: 12px;
	left: 12px;
	z-index: 1001;
	clip-path: none;
	width: auto;
	height: auto;
	margin: 0;
	padding: 15px 20px;
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--primary);
	font: 700 16px/1 var(--wp--preset--font-family--sans);
	border-radius: var(--ts-radius-pill);
	box-shadow: var(--ts-shadow-card);
	outline: 2px solid var(--wp--preset--color--primary);
	outline-offset: 3px;
	text-decoration: none;
}

/* ---------- Formularze (D1, D12) ---------- */

:where(input:not([type="checkbox"], [type="radio"], [type="submit"], [type="button"], [type="range"], [type="color"]), textarea, select) {
	font: inherit;
	color: var(--wp--preset--color--body-text);
	background-color: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--field-border);
	max-width: 100%;
}

:where(input, textarea)::placeholder {
	color: var(--wp--preset--color--body-text);
	opacity: 1;
}

:where(input[type="checkbox"], input[type="radio"]) {
	accent-color: var(--wp--preset--color--primary);
	width: 18px;
	height: 18px;
}

:where(button, input[type="submit"], input[type="button"]) {
	font: inherit;
	cursor: pointer;
}

/* ---------- Pomocnicze ---------- */

.ts-surface-dark {
	color: var(--wp--preset--color--white);
}

.ts-surface-dark :where(h1, h2, h3, h4, h5, h6) {
	color: var(--wp--preset--color--white);
}

/* Dekoracje liści (C20): components.css */

/* ---------- Sklep: pomocnicze (SKLEP-PROJEKT.md §2.1, §3.4, §12.1; docs/SKLEP.md) ---------- */

/* Atrybut hidden zawsze ukrywa (komponenty sklepu przełączają widoczność atrybutem, nie klasą).
   Wyjątek: hidden="until-found" (panele core/accordion — wyszukiwanie w stronie musi je odnaleźć). */
[hidden]:not([hidden="until-found"]) {
	display: none !important;
}

/* Tekst tylko dla czytników — alias .screen-reader-text (nazwa z makiet sklepu) */
.ts-sr {
	border: 0;
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute !important;
	white-space: nowrap;
	width: 1px;
}

/* Kontekst ciemny z makiet sklepu: fokus #F3BD71 (D2), tekst biały */
.ts-on-dark {
	--ts-focus: var(--wp--preset--color--accent-on-dark);
}
