/**
 * Wujek Maron – fundamenty.
 *
 * Zasady (docs/AUDYT-UI-UX.md):
 *  - zero cieni (box-shadow i text-shadow), ostre narożniki,
 *  - ramki tylko tam, gdzie mają funkcję (pola formularzy, przycisk outline),
 *  - rytm z presetów spacing (theme.json), typografia z presetów font-size,
 *  - fokus klawiatury zawsze widoczny (czerwony, 3 px).
 */

:root {
	--wm-black: var(--wp--preset--color--primary, #000);
	--wm-white: var(--wp--preset--color--secondary, #fff);
	--wm-yellow: var(--wp--preset--color--yellow, #fdf06f);
	--wm-red: var(--wp--preset--color--red, #da000b);
	--wm-surface: var(--wp--preset--color--surface, #f4f4f2);
	--wm-surface-dark: var(--wp--preset--color--surface-dark, #141414);
	--wm-muted: var(--wp--preset--color--muted, #5c5c5c);
	--wm-muted-dark: var(--wp--preset--color--muted-dark, #a8a8a8);
	--wm-hairline: var(--wp--preset--color--hairline, #e3e3e0);
	--wm-display: var(--wp--preset--font-family--heading-font);
	--wm-body: var(--wp--preset--font-family--body-font);
	--wm-section: var(--wp--preset--spacing--90);
	--wm-gutter: var(--wp--style--root--padding-left, 1rem);
	--wm-header-h: 76px;
	--wm-ease: cubic-bezier(.2, .7, .3, 1);
	--wm-dur: 160ms;
}

/* ------------------------------------------------------------------ */
/* Baza                                                                */
/* ------------------------------------------------------------------ */

html {
	scroll-padding-top: calc(var(--wm-header-h) + 1rem);
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
	font-kerning: normal;
	overflow-x: clip;
}

::selection {
	background: var(--wm-yellow);
	color: var(--wm-black);
}

/* Szerokość z paddingiem i ramką w środku (bez tego kolumny 100% + padding wychodziły poza ekran). */
*,
*::before,
*::after {
	box-sizing: border-box;
}

/* Zero cieni – decyzja projektowa P9. */
*,
*::before,
*::after {
	box-shadow: none !important;
	text-shadow: none !important;
}

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

/* Header, main i stopka stykają się – odstępy robią sekcje, nie globalny blockGap. */
.wp-site-blocks > * + * {
	margin-block-start: 0;
}

main {
	display: block;
}

/* ------------------------------------------------------------------ */
/* Typografia                                                          */
/* ------------------------------------------------------------------ */

h1, h2, h3, h4, h5, h6,
.wp-block-heading,
.wp-block-post-title {
	text-wrap: balance;
	overflow-wrap: break-word;
	hyphens: manual;
}

p,
li,
dd,
figcaption {
	text-wrap: pretty;
}

:where(p, li) strong,
:where(p, li) b {
	font-weight: 600;
}

/* Linki w tekście: czytelne podkreślenie, grubsze na hover. */
a {
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
	transition: color var(--wm-dur) var(--wm-ease), background-color var(--wm-dur) var(--wm-ease), text-decoration-thickness var(--wm-dur) var(--wm-ease);
}

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

/* Treść nie powinna wylewać się ponad ~72 znaki. */
.is-layout-constrained > :where(p, ul, ol):not(.alignwide):not(.alignfull) {
	max-width: min(var(--wp--style--global--content-size, 720px), 100%);
}

/* Wersaliki w kroju display tylko dla krótkich tekstów: długie akapity
   z treści (stare ustawienie „uppercase + heading-font”) wracają do zdań. */
p.has-heading-font-font-family[style*="text-transform:uppercase"]:not(.is-style-eyebrow) {
	font-family: var(--wm-body) !important;
	text-transform: none !important;
	font-weight: 400 !important;
	letter-spacing: 0;
}

/* ------------------------------------------------------------------ */
/* Fokus i dostępność                                                   */
/* ------------------------------------------------------------------ */

:where(a, button, input, select, textarea, summary, [tabindex]:not([tabindex="-1"])):focus-visible {
	outline: 3px solid var(--wm-red);
	outline-offset: 2px;
}

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

.skip-link.screen-reader-text:focus {
	background: var(--wm-yellow);
	color: var(--wm-black);
	font-family: var(--wm-display);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	padding: 1rem 1.5rem;
	z-index: 100000;
}

@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;
	}
}

/* ------------------------------------------------------------------ */
/* Header                                                               */
/* ------------------------------------------------------------------ */

.wp-site-blocks > header.wp-block-template-part,
.wp-site-blocks > .wp-block-template-part:has(> .wm-header) {
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0px);
	z-index: 100;
}

@media (max-width: 600px) {
	.admin-bar .wp-site-blocks > header.wp-block-template-part {
		top: 0;
	}
}

.wm-header {
	transition: padding var(--wm-dur) var(--wm-ease);
}

.wm-header.is-scrolled {
	padding-top: var(--wp--preset--spacing--20) !important;
	padding-bottom: var(--wp--preset--spacing--20) !important;
}

.wm-header__bar {
	min-height: 52px;
}

.wm-header__logo img,
.wm-overlay__logo img {
	transition: width var(--wm-dur) var(--wm-ease), transform 600ms var(--wm-ease);
}

.wm-header.is-scrolled .wm-header__logo img {
	width: 48px !important;
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
	.wm-header__logo a:hover img {
		transform: rotate(-24deg);
	}
}

.wm-header__nav {
	flex: 1 1 auto;
}

.wm-header__actions {
	flex: 0 0 auto;
	gap: 0.25rem !important;
}

/* Breakpoint menu: hamburger do 1023 px (core: 600 px). */
@media (max-width: 1023px) {
	.wm-header__nav {
		order: 3;
		flex: 0 0 auto;
	}

	.wm-header__nav .wp-block-navigation__responsive-container-open:not(.always-shown) {
		display: flex;
	}

	.wm-header__nav .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) {
		display: none;
	}
}

/* Cele dotyku ≥ 44 px dla ikon w headerze (display hamburgera steruje core + breakpoint wyżej). */
.wm-header .wp-block-navigation__responsive-container-open {
	min-width: 44px;
	min-height: 44px;
	align-items: center;
	justify-content: center;
	padding: 8px;
	margin-right: -8px;
	color: inherit;
}

.wm-header__actions .wc-block-customer-account a,
.wm-header__actions .wc-block-mini-cart__button {
	min-width: 44px;
	min-height: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 10px;
	color: inherit;
	background: transparent;
	border: 0;
	border-radius: 0;
	cursor: pointer;
}

.wm-header .wp-block-navigation__responsive-container-open svg {
	width: 28px;
	height: 28px;
}

/* Otwarte menu: pływające przyciski (język, cookies) nie mogą przykrywać overlayu. */
.has-modal-open .kc-lang-float,
.has-modal-open .kc-cc-float,
.has-modal-open .kc-back-to-top-button {
	display: none !important;
}

/* ------------------------------------------------------------------ */
/* Style bloków (register_block_style)                                  */
/* ------------------------------------------------------------------ */

/* Etykieta nad nagłówkiem. */
.is-style-eyebrow {
	font-family: var(--wm-display);
	font-size: var(--wp--preset--font-size--tiny);
	font-weight: 600;
	letter-spacing: 0.14em;
	line-height: 1.3;
	text-transform: uppercase;
}

/* Lead. */
.is-style-lead {
	font-size: var(--wp--preset--font-size--medium);
	line-height: 1.5;
	font-weight: 400;
}

/* Link-etykieta ze strzałką (zamiast gołego „Sprawdź całą ofertę”). */
.is-style-text-link a {
	display: inline-flex;
	align-items: center;
	gap: 0.6em;
	min-height: 44px;
	font-family: var(--wm-display);
	font-size: var(--wp--preset--font-size--tiny);
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	text-decoration: none;
}

.is-style-text-link a::after {
	content: "→";
	font-family: var(--wm-body);
	transition: transform var(--wm-dur) var(--wm-ease);
}

.is-style-text-link a:hover {
	text-decoration: underline;
}

.is-style-text-link a:hover::after {
	transform: translateX(4px);
}

/* Przyciski: wspólny szkielet. */
.wp-element-button,
.wp-block-button__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.6em;
	min-height: 48px;
	text-align: center;
	transition: background-color var(--wm-dur) var(--wm-ease), color var(--wm-dur) var(--wm-ease), border-color var(--wm-dur) var(--wm-ease);
}

/* Na ciemnym tle przycisk główny się odwraca. */
:where(.has-primary-background-color, .has-surface-dark-background-color, .wp-block-cover.is-dark, .wm-header, .wm-footer, .wm-overlay) .wp-block-button:not(.is-style-outline):not(.is-style-accent) > .wp-block-button__link:not(.has-background) {
	background-color: var(--wm-white);
	color: var(--wm-black);
}

:where(.has-primary-background-color, .has-surface-dark-background-color, .wp-block-cover.is-dark, .wm-header, .wm-footer, .wm-overlay) .wp-block-button:not(.is-style-outline):not(.is-style-accent) > .wp-block-button__link:not(.has-background):hover {
	background-color: var(--wm-yellow);
	color: var(--wm-black);
}

/* Akcent – żółty (zakup / start). */
.wp-block-button.is-style-accent > .wp-block-button__link {
	background-color: var(--wm-yellow);
	color: var(--wm-black);
}

.wp-block-button.is-style-accent > .wp-block-button__link:hover,
.wp-block-button.is-style-accent > .wp-block-button__link:focus-visible {
	background-color: var(--wm-white);
	color: var(--wm-black);
}

:where(.has-secondary-background-color, .has-surface-background-color, body) .wp-block-button.is-style-accent > .wp-block-button__link:hover {
	background-color: var(--wm-black);
	color: var(--wm-white);
}

/* Outline – jedyna „funkcjonalna” ramka przycisku. */
.wp-block-button.is-style-outline > .wp-block-button__link,
.wp-block-button.is-style-outline > .wp-block-button__link:not(.has-background) {
	background: transparent;
	color: currentColor;
	border: 1px solid currentColor;
	padding: calc(1rem - 1px) calc(1.75rem - 1px);
}

.wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: var(--wm-yellow);
	border-color: var(--wm-yellow);
	color: var(--wm-black);
}

/* Separator: domyślnie cienka linia; wariant „pasek marki”. */
.wp-block-separator {
	border: 0;
	border-top: 1px solid currentColor;
	opacity: 1;
}

.wp-block-separator:not(.is-style-dots):not(.is-style-brand-stripe) {
	height: 0;
	background: none !important;
}

.wp-block-separator.has-background:not(.is-style-dots):not(.is-style-brand-stripe) {
	border-top-color: currentColor;
}

.wp-block-separator.is-style-brand-stripe {
	height: 4px;
	border: 0;
	background: linear-gradient(90deg, var(--wm-yellow) 0 50%, var(--wm-red) 50% 100%) !important;
	max-width: none;
	opacity: 1;
}

/* Lista z kreskami. */
.wp-block-list.is-style-checks {
	list-style: none;
	padding-left: 0;
}

.wp-block-list.is-style-checks > li {
	position: relative;
	padding-left: 1.75em;
}

.wp-block-list.is-style-checks > li + li {
	margin-top: 0.6em;
}

.wp-block-list.is-style-checks > li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.8em;
	width: 1em;
	height: 2px;
	background: var(--wm-red);
}

/* Sekcja – pionowy rytm z jednego tokenu. */
.wp-block-group.is-style-section {
	padding-top: var(--wm-section);
	padding-bottom: var(--wm-section);
}

/* ------------------------------------------------------------------ */
/* Film w tle – przycisk pauzy (Interactivity API, media.js)            */
/* ------------------------------------------------------------------ */

.wp-block-cover.has-video-toggle {
	position: relative;
}

.wm-video-toggle {
	position: absolute;
	right: var(--wp--preset--spacing--40);
	bottom: var(--wp--preset--spacing--40);
	z-index: 3;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.55);
	color: #fff;
	cursor: pointer;
	opacity: 0.7;
	transition: opacity var(--wm-dur) var(--wm-ease), background-color var(--wm-dur) var(--wm-ease);
}

.wm-video-toggle:hover,
.wm-video-toggle:focus-visible {
	opacity: 1;
	background: var(--wm-black);
}

.wm-video-toggle .wm-video-toggle__play,
.wm-video-toggle[aria-pressed="true"] .wm-video-toggle__pause {
	display: none;
}

.wm-video-toggle[aria-pressed="true"] .wm-video-toggle__play {
	display: block;
}

/* ------------------------------------------------------------------ */
/* Stopka                                                               */
/* ------------------------------------------------------------------ */

.wm-footer__social-hero {
	align-items: center;
}

.wm-footer__social-hero h2 a,
.wm-footer__title {
	text-decoration: none;
}

.wm-footer__social-hero h2 a:hover {
	text-decoration: underline;
	text-decoration-thickness: 2px;
}

.wm-footer__gif img {
	display: block;
	aspect-ratio: 4 / 5;
	object-fit: cover;
}

.wm-footer__title {
	color: var(--wm-muted-dark);
	letter-spacing: 0.14em !important;
	margin-bottom: var(--wp--preset--spacing--40);
}

.wm-footer__menu .wp-block-navigation-item__content,
.wm-footer__contact a {
	display: inline-flex;
	align-items: center;
	min-height: 32px;
	text-decoration: none;
}

.wm-footer__menu .wp-block-navigation-item__content:hover,
.wm-footer__contact a:hover {
	text-decoration: underline;
}

.wm-footer__menu,
.wm-footer__contact {
	font-family: var(--wm-display);
	font-size: var(--wp--preset--font-size--tiny);
	font-weight: 500;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.wm-footer__contact p {
	margin: 0;
}

.wm-footer__contact p:first-child {
	text-transform: none;
	letter-spacing: 0.02em;
	overflow-wrap: anywhere;
}

.wm-footer__bottom p {
	margin: 0;
}

.wm-footer__bottom a {
	color: var(--wm-white);
}

@media (max-width: 781px) {
	.wm-footer__cols {
		display: grid !important;
		grid-template-columns: 1fr 1fr;
	}

	.wm-footer__about {
		grid-column: 1 / -1;
	}
}

/* ------------------------------------------------------------------ */
/* Kompatybilność z treścią z poprzedniego motywu                       */
/* ------------------------------------------------------------------ */

.has-white-color { color: #fff !important; }
.has-white-background-color { background-color: #fff !important; }
.has-black-color, .has-contrast-color, .has-foreground-color { color: #000 !important; }
.has-black-background-color, .has-contrast-background-color, .has-foreground-background-color { background-color: #000 !important; }
.has-contrast-2-color { color: var(--wm-muted) !important; }
.has-accent-color { color: var(--wm-red) !important; }
.has-accent-background-color { background-color: var(--wm-red) !important; }
.has-background-background-color, .has-selection-background-color { background-color: var(--wm-surface) !important; }
.has-selection-color { color: var(--wm-hairline) !important; }

:root {
	--wp--preset--color--white: #fff;
	--wp--preset--color--black: #000;
	--wp--preset--color--contrast: #000;
	--wp--preset--color--accent: var(--wm-red);
}

.l-no-margin-top { margin-top: 0 !important; }
.l-no-margin-bottom { margin-bottom: 0 !important; }

@media (max-width: 781px) {
	.l-above-mobile-only { display: none !important; }
}

@media (max-width: 1023px) {
	.wp-block-columns.stack-on-tablet--portrait {
		flex-wrap: wrap !important;
	}

	.wp-block-columns.stack-on-tablet--portrait > .wp-block-column {
		flex-basis: 100% !important;
	}
}

/* Ukryte wizualnie, dostępne dla czytników. */
.wm-sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ------------------------------------------------------------------ */
/* Sekcja tytułu podstron (wzorzec wujekmaron/page-hero)                */
/* ------------------------------------------------------------------ */

.wm-page-hero {
	background: var(--wm-surface);
	margin-block: 0 !important;
}

.wm-page-hero__inner > * {
	margin-block: 0 !important;
}

/* Znak marki: krótki pasek żółty/czerwony nad okruszkami. */
.wm-page-hero__inner::before {
	content: "";
	display: block;
	width: 56px;
	height: 4px;
	margin-bottom: var(--wp--preset--spacing--30);
	background: linear-gradient(90deg, var(--wm-yellow) 0 50%, var(--wm-red) 50% 100%);
}

.wm-page-hero__title {
	max-width: 20ch;
	line-height: 1.02 !important;
	letter-spacing: -0.01em;
	margin-top: var(--wp--preset--spacing--20) !important;
}

.wm-page-hero__lead,
.wm-page-hero .wp-block-term-description {
	max-width: 60ch;
	color: var(--wm-muted);
}

.wm-page-hero__lead p,
.wm-page-hero .wp-block-term-description p {
	margin: 0 0 0.6em;
}

.wm-page-hero__text {
	max-width: 60ch;
	color: var(--wm-muted);
}

.wm-page-hero p:empty,
.wm-page-hero__eyebrow:empty,
.wm-page-hero__lead:empty {
	display: none;
}

.wm-page-hero + * {
	margin-block-start: 0 !important;
}

/* Pierwsza sekcja treści po tytule: odstęp z jednego tokenu. */
.wm-page-content {
	padding-top: var(--wp--preset--spacing--80);
}

.wm-page-content > .alignfull:first-child[class*="-background-color"] {
	margin-top: calc(var(--wp--preset--spacing--80) * -1) !important;
}

/* Jedna lewa krawędź: treść 720 px wyrównana do kontenera wide (1360 px). */
.wm-page-content.is-layout-constrained > :where(:not(.alignwide):not(.alignfull)),
.wm-shop.is-layout-constrained > :where(:not(.alignwide):not(.alignfull)) {
	margin-left: calc((100% - min(var(--wp--style--global--wide-size), 100%)) / 2) !important;
	margin-right: auto !important;
}
