/*
 * TSI – Styl podstron PF
 * Warstwa zgodności między starszymi sekcjami motywu Furman
 * a nowym, editorialowym stylem strony głównej.
 */

:root {
	--tsi-pf-page-max: 1480px;
	--tsi-pf-section-space: 88px;
	--tsi-pf-bg: #f6f4ef;
	--tsi-pf-surface: #ffffff;
	--tsi-pf-soft: #ebe8e2;
	--tsi-pf-dark: #111110;
	--tsi-pf-text: #171614;
	--tsi-pf-muted: #6d6962;
	--tsi-pf-line: rgba(23, 22, 20, 0.15);
	--tsi-pf-accent: #aa7a3d;
	--tsi-pf-shadow: 0 14px 46px rgba(25, 22, 18, 0.08);
}

html.tsi-pf-subpage-style-active,
body.tsi-pf-subpage-style {
	scroll-behavior: smooth;
}

html.tsi-pf-subpage-style-active body {
	overflow-x: hidden;
	background: var(--tsi-pf-bg) !important;
	color: var(--tsi-pf-text);
}

/* ===== Konstrukcja strony – usunięcie starego efektu nakładanych ekranów ===== */
html.tsi-pf-subpage-style-active main#content {
	display: block !important;
	width: 100% !important;
	max-width: none !important;
	min-height: 1px;
	margin: 0 !important;
	padding: 0 !important;
	background: var(--tsi-pf-bg);
}

html.tsi-pf-subpage-style-active main#content section {
	position: relative !important;
	top: auto !important;
	left: auto !important;
	transform: none;
	animation: none !important;
	box-shadow: none !important;
}

html.tsi-pf-subpage-style-active main#content > section:not(.blank) {
	width: min(100%, var(--tsi-pf-page-max)) !important;
	max-width: var(--tsi-pf-page-max) !important;
	margin-right: auto !important;
	margin-left: auto !important;
}

html.tsi-pf-subpage-style-active section.blank,
html.tsi-pf-subpage-style-active header section.blank,
html.tsi-pf-subpage-style-active main#content > section.blank,
html.tsi-pf-subpage-style-active body > section.blank {
	display: none !important;
	width: 0 !important;
	height: 0 !important;
	min-height: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	opacity: 0 !important;
	visibility: hidden !important;
}

html.tsi-pf-subpage-style-active footer,
html.tsi-pf-subpage-style-active #site-footer {
	position: relative !important;
	top: auto !important;
	margin-top: 0 !important;
}

/* ===== Menu jak na nowej stronie głównej ===== */
html.tsi-pf-subpage-style-active .basic-nav {
	position: sticky !important;
	top: 0 !important;
	z-index: 9998 !important;
	width: 100% !important;
	max-width: none !important;
	margin: 0 !important;
	padding: 0 !important;
	box-shadow: 0 8px 24px rgba(17, 17, 16, 0.08) !important;
}

html.tsi-pf-subpage-style-active .basic-menu-banner {
	min-height: 79px;
	padding: 14px clamp(24px, 5vw, 64px) !important;
	background: rgba(255, 255, 255, 0.97) !important;
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
}

html.tsi-pf-subpage-style-active .basic-menu-banner .logo-wrapper img {
	display: block;
	width: auto;
	max-width: 150px;
	max-height: 48px;
	object-fit: contain;
}

html.tsi-pf-subpage-style-active .basic-menu-banner button img {
	display: block;
	width: 26px;
	height: 26px;
	object-fit: contain;
}

body.admin-bar .basic-nav {
	top: 32px !important;
}

/* ===== Kolorystyka zgodna z nowymi modułami ===== */
html.tsi-pf-subpage-style-active
	main#content
	> section.section-color-jasny:not([class*="tsi-"]) {
	background: var(--tsi-pf-bg) !important;
	color: var(--tsi-pf-text) !important;
}

html.tsi-pf-subpage-style-active
	main#content
	> section.section-color-szary:not([class*="tsi-"]) {
	background: var(--tsi-pf-soft) !important;
	color: var(--tsi-pf-text) !important;
}

html.tsi-pf-subpage-style-active
	main#content
	> section.section-color-ciemny:not([class*="tsi-"]) {
	background: var(--tsi-pf-dark) !important;
	color: #f7f5f1 !important;
}

/* Nowe moduły TSI mają własne kompletne arkusze – nie zmieniamy ich wnętrza. */
html.tsi-pf-subpage-style-active main#content > section[class*="tsi-"] {
	width: min(100%, var(--tsi-pf-page-max)) !important;
	max-width: var(--tsi-pf-page-max) !important;
}

/* ===== Starsze sekcje ACF: naturalny układ i rytm ===== */
html.tsi-pf-subpage-style-active
	main#content
	> section.section-type-kolumny:not([class*="tsi-"]) {
	display: flex !important;
	align-items: stretch !important;
	justify-content: center !important;
	min-height: 0 !important;
	overflow: hidden;
	border-bottom: 1px solid rgba(23, 22, 20, 0.08);
}

html.tsi-pf-subpage-style-active
	main#content
	> section.section-type-kolumny:not([class*="tsi-"])
	> div {
	position: relative;
	min-width: 0;
	min-height: 0 !important;
	box-sizing: border-box;
}

html.tsi-pf-subpage-style-active
	main#content
	> section.section-type-kolumny:not([class*="tsi-"])
	> div:not(.column-background-wrapper) {
	/* padding-top: clamp(54px, 6.3vw, var(--tsi-pf-section-space)) !important;
    padding-bottom: clamp(54px, 6.3vw, var(--tsi-pf-section-space)) !important;
    padding-right: clamp(28px, 5.2vw, 84px) !important;
    padding-left: clamp(28px, 5.2vw, 84px) !important; */
}

/* Kolumny składające się wyłącznie ze zdjęcia zachowują układ bez sztucznej ramki. */
html.tsi-pf-subpage-style-active
	main#content
	.section-type-kolumny
	> div:has(> .single-element-obraz:only-child) {
	padding: 0 !important;
}

html.tsi-pf-subpage-style-active main#content .single-element-obraz,
html.tsi-pf-subpage-style-active main#content .single-element-logo {
	overflow: hidden;
}

html.tsi-pf-subpage-style-active main#content .single-element-obraz img,
html.tsi-pf-subpage-style-active main#content .single-element-logo img,
html.tsi-pf-subpage-style-active main#content .text-wysiwig img {
	display: block;
	width: 100%;
	max-width: 100%;
	height: auto;
}

/* ===== Typografia ===== */
html.tsi-pf-subpage-style-active main#content > section:not([class*="tsi-"]) h1,
html.tsi-pf-subpage-style-active main#content > section:not([class*="tsi-"]) h2,
html.tsi-pf-subpage-style-active main#content > section:not([class*="tsi-"]) h3,
html.tsi-pf-subpage-style-active
	main#content
	> section:not([class*="tsi-"])
	h4 {
	text-wrap: balance;
}

html.tsi-pf-subpage-style-active main#content > section:not([class*="tsi-"]) h1,
html.tsi-pf-subpage-style-active
	main#content
	> section:not([class*="tsi-"])
	h2 {
	margin: 0;
	font-weight: 500 !important;
	letter-spacing: -0.045em !important;
	line-height: 1.02 !important;
}

html.tsi-pf-subpage-style-active
	main#content
	> section:not([class*="tsi-"])
	h3 {
	margin: 0;
	font-weight: 600 !important;
	letter-spacing: -0.025em !important;
	line-height: 1.14 !important;
}

html.tsi-pf-subpage-style-active main#content .single-element-naglowek_h2_256px,
html.tsi-pf-subpage-style-active
	main#content
	.single-element-naglowek_h2_256px
	h2 {
	font-size: clamp(52px, 7vw, 94px) !important;
}

html.tsi-pf-subpage-style-active main#content .single-element-naglowek_h2_128px,
html.tsi-pf-subpage-style-active
	main#content
	.single-element-naglowek_h2_128px
	h2,
html.tsi-pf-subpage-style-active main#content .single-element-naglowek_h2_91px,
html.tsi-pf-subpage-style-active
	main#content
	.single-element-naglowek_h2_91px
	h2 {
	font-size: clamp(44px, 5.3vw, 72px) !important;
}

html.tsi-pf-subpage-style-active main#content .single-element-naglowek_h2_64px,
html.tsi-pf-subpage-style-active
	main#content
	.single-element-naglowek_h2_64px
	h2 {
	font-size: clamp(38px, 4vw, 58px) !important;
}

html.tsi-pf-subpage-style-active main#content .single-element-naglowek_h2_51px,
html.tsi-pf-subpage-style-active
	main#content
	.single-element-naglowek_h2_51px
	h2 {
	font-size: clamp(32px, 3.2vw, 46px) !important;
}

html.tsi-pf-subpage-style-active main#content .single-element-naglowek_h2_36px,
html.tsi-pf-subpage-style-active
	main#content
	.single-element-naglowek_h2_36px
	h2 {
	font-size: clamp(28px, 2.6vw, 38px) !important;
}

html.tsi-pf-subpage-style-active main#content .single-element-naglowek_h3_32px,
html.tsi-pf-subpage-style-active
	main#content
	.single-element-naglowek_h3_32px
	h3,
html.tsi-pf-subpage-style-active main#content .single-element-naglowek_h3_25px,
html.tsi-pf-subpage-style-active
	main#content
	.single-element-naglowek_h3_25px
	h3 {
	font-size: clamp(23px, 2.1vw, 32px) !important;
}

html.tsi-pf-subpage-style-active main#content > section:not([class*="tsi-"]) p,
html.tsi-pf-subpage-style-active main#content > section:not([class*="tsi-"]) li,
html.tsi-pf-subpage-style-active
	main#content
	> section:not([class*="tsi-"])
	.text-wysiwig {
	font-size: clamp(16px, 1.15vw, 18px) !important;
	line-height: 1.72 !important;
}

html.tsi-pf-subpage-style-active main#content .text-wysiwig {
	max-width: 76ch;
}

html.tsi-pf-subpage-style-active main#content .text-wysiwig p,
html.tsi-pf-subpage-style-active main#content .text-wysiwig ul,
html.tsi-pf-subpage-style-active main#content .text-wysiwig ol {
	margin: 0 0 1.15em;
}

html.tsi-pf-subpage-style-active main#content .text-wysiwig > *:last-child {
	margin-bottom: 0;
}

/* Spójne odstępy między elementami w kolumnach. */
html.tsi-pf-subpage-style-active
	main#content
	.section-type-kolumny
	> div
	> .single-element
	+ .single-element {
	margin-top: clamp(20px, 2.3vw, 36px);
}

/* ===== Odnośniki i CTA ===== */
html.tsi-pf-subpage-style-active
	main#content
	.single-element-podpis_odnosnik
	h4 {
	margin: 0;
}

html.tsi-pf-subpage-style-active
	main#content
	.single-element-podpis_odnosnik
	a {
	display: inline-flex !important;
	align-items: center;
	gap: 14px;
	min-height: 48px;
	padding: 12px 52px 12px 0 !important;
	border-bottom: 1px solid currentColor;
	font-family: "Red Hat Display", sans-serif;
	font-size: 15px !important;
	font-weight: 600 !important;
	letter-spacing: 0.01em;
	transition:
		opacity 0.22s ease,
		gap 0.22s ease;
}

html.tsi-pf-subpage-style-active
	main#content
	.single-element-podpis_odnosnik
	a:hover {
	gap: 20px;
	opacity: 0.7;
}

/* ===== Listy, tabele i rozwijane zakładki ===== */
html.tsi-pf-subpage-style-active main#content .list-row,
html.tsi-pf-subpage-style-active main#content .ul-list-row,
html.tsi-pf-subpage-style-active main#content .table-row {
	gap: clamp(18px, 2vw, 32px);
	padding: 22px 0;
	border-bottom: 1px solid var(--tsi-pf-line);
}

html.tsi-pf-subpage-style-active main#content .section-type-rozwijane_zakladki {
	padding: clamp(56px, 7vw, 100px) clamp(24px, 5vw, 84px) !important;
}

html.tsi-pf-subpage-style-active
	main#content
	.section-type-rozwijane_zakladki
	> div {
	width: 100%;
	max-width: 1120px;
	margin: 0 auto;
}

html.tsi-pf-subpage-style-active main#content .rozwijane_zakladki-title {
	border: 1px solid var(--tsi-pf-line) !important;
	background: var(--tsi-pf-surface) !important;
}

/* ===== Slidery i galerie ===== */
html.tsi-pf-subpage-style-active
	main#content
	> section.section-type-slider_logotrypow,
html.tsi-pf-subpage-style-active main#content > section.section-type-galeria,
html.tsi-pf-subpage-style-active
	main#content
	> section.section-type-slider_zdjec {
	overflow: hidden;
	border: 0;
}

html.tsi-pf-subpage-style-active
	main#content
	> section.section-type-slider_logotrypow {
	padding: 18px 0 !important;
	background: #fff !important;
	box-shadow: 0 10px 30px rgba(17, 17, 16, 0.07) !important;
}

html.tsi-pf-subpage-style-active
	main#content
	.section-type-slider_logotrypow
	.slider-wrapper
	li
	a
	img {
	max-height: 76px;
	object-fit: contain;
	filter: grayscale(1);
	opacity: 0.78;
}

html.tsi-pf-subpage-style-active
	main#content
	.section-type-slider_logotrypow
	.slider-wrapper
	li
	a:hover
	img {
	filter: grayscale(0);
	opacity: 1;
}

/* ===== Blog / archiwa ===== */
html.tsi-pf-subpage-style-active main#content .post-items {
	display: grid !important;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: clamp(22px, 3vw, 42px) !important;
	width: 100% !important;
}

html.tsi-pf-subpage-style-active main#content .post-item {
	display: flex;
	flex-direction: column;
	min-width: 0;
	padding: 0 0 26px;
	overflow: hidden;
	border: 1px solid var(--tsi-pf-line);
	background: var(--tsi-pf-surface);
	box-shadow: var(--tsi-pf-shadow);
}

html.tsi-pf-subpage-style-active
	main#content
	.post-item
	> *:not(.single-element-obraz) {
	margin-right: 24px;
	margin-left: 24px;
}

html.tsi-pf-subpage-style-active
	main#content
	.post-item
	.single-element-obraz
	img {
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
}

html.tsi-pf-subpage-style-active main#content .post-item h3 a {
	color: var(--tsi-pf-text) !important;
}

html.tsi-pf-subpage-style-active main#content .tag-container {
	display: flex;
	flex-wrap: wrap;
	gap: 7px;
	margin-top: 20px;
	margin-bottom: 14px;
	list-style: none;
}

html.tsi-pf-subpage-style-active main#content .tag-container a {
	color: var(--tsi-pf-muted) !important;
	font-size: 12px !important;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

/* ===== Pływający link Home – subtelniejszy ===== */
html.tsi-pf-subpage-style-active .homepage-btn {
	z-index: 9997 !important;
	bottom: 24px !important;
	left: 24px !important;
	padding: 8px 18px !important;
	border: 1px solid rgba(17, 17, 16, 0.16);
	background: rgba(255, 255, 255, 0.92) !important;
	box-shadow: 0 10px 26px rgba(17, 17, 16, 0.12);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
}

/* ===== Dostępność i focus ===== */
html.tsi-pf-subpage-style-active a:focus-visible,
html.tsi-pf-subpage-style-active button:focus-visible {
	outline: 2px solid var(--tsi-pf-accent) !important;
	outline-offset: 4px;
}

/* ===== Tablet ===== */
@media (max-width: 1100px) {
	html.tsi-pf-subpage-style-active main#content .post-items {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	html.tsi-pf-subpage-style-active
		main#content
		> section.section-type-kolumny:not([class*="tsi-"])
		> div {
		padding-right: clamp(24px, 4vw, 54px) !important;
		padding-left: clamp(24px, 4vw, 54px) !important;
	}
}

/* ===== Telefon ===== */
@media (max-width: 760px) {
	body.admin-bar .basic-nav {
		top: 46px !important;
	}

	html.tsi-pf-subpage-style-active .basic-menu-banner {
		min-height: 68px;
		padding: 12px 20px !important;
	}

	html.tsi-pf-subpage-style-active .basic-menu-banner button {
		width: 52px !important;
	}

	html.tsi-pf-subpage-style-active main#content > section:not(.blank) {
		width: 100% !important;
	}

	html.tsi-pf-subpage-style-active
		main#content
		> section.section-type-kolumny:not([class*="tsi-"]) {
		display: flex !important;
		flex-direction: column !important;
	}

	html.tsi-pf-subpage-style-active
		main#content
		> section.section-type-kolumny:not([class*="tsi-"])
		> div,
	html.tsi-pf-subpage-style-active main#content .column-width-10,
	html.tsi-pf-subpage-style-active main#content .column-width-20,
	html.tsi-pf-subpage-style-active main#content .column-width-30,
	html.tsi-pf-subpage-style-active main#content .column-width-40,
	html.tsi-pf-subpage-style-active main#content .column-width-50,
	html.tsi-pf-subpage-style-active main#content .column-width-60,
	html.tsi-pf-subpage-style-active main#content .column-width-70,
	html.tsi-pf-subpage-style-active main#content .column-width-80,
	html.tsi-pf-subpage-style-active main#content .column-width-90,
	html.tsi-pf-subpage-style-active main#content .column-width-100 {
		width: 100% !important;
		max-width: 100% !important;
	}

	html.tsi-pf-subpage-style-active
		main#content
		> section.section-type-kolumny:not([class*="tsi-"])
		> div:not(.column-background-wrapper) {
		padding: 48px 24px !important;
	}

	html.tsi-pf-subpage-style-active main#content .post-items {
		grid-template-columns: minmax(0, 1fr);
	}

	html.tsi-pf-subpage-style-active
		main#content
		.section-type-slider_logotrypow
		.slider-wrapper
		li {
		min-width: 42% !important;
		max-width: 42% !important;
	}

	html.tsi-pf-subpage-style-active .homepage-btn {
		bottom: 14px !important;
		left: 14px !important;
	}
}

@media (prefers-reduced-motion: reduce) {
	html.tsi-pf-subpage-style-active *,
	html.tsi-pf-subpage-style-active *::before,
	html.tsi-pf-subpage-style-active *::after {
		scroll-behavior: auto !important;
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}
