/* Smart House: style uzupełniające theme.json. Tokeny kolorów i krojów są w theme.json. */

:root {
	--sh-ramka: 14px;
	--sh-linia: 1px solid var(--wp--preset--color--aluminium);
}

/* Typografia: nagłówki lekkie i lekko poszerzone (etap W), tekst w normalnej szerokości */
h1, h2, .wp-block-post-title { font-stretch: 112%; }
h3, h4 { font-stretch: 100%; }
p, li, td, th, summary { text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; }
/* WordPress łamie nagłówki w środku słowa (word-break: break-word); łamiemy tylko między słowami */
:where(h1, h2, h3, h4) { word-break: normal; overflow-wrap: break-word; hyphens: manual; }
.sh-lead { font-size: var(--wp--preset--font-size--large); color: var(--wp--preset--color--szary); max-width: 38em; }
.sh-maly { font-size: var(--wp--preset--font-size--small); color: var(--wp--preset--color--szary); }

:where(a, button, summary, input, select, textarea):focus-visible {
	outline: 2px solid var(--wp--preset--color--grafit);
	outline-offset: 3px;
}

/* Sekcje: nagłówek, treść i stopka stykają się bez białych szczelin */
.wp-site-blocks > * { margin-block-start: 0; }
.sh-sekcja { padding-block: var(--wp--preset--spacing--60); }
/* Tekst w szerokiej sekcji: wygodna długość wiersza, wyrównany do lewej krawędzi kolumny 1240 px (nie wyśrodkowany) */
.sh-sekcja.is-layout-constrained > :where(.sh-lead, p, ul, ol, h2, h3, h4, .wp-block-details, .wp-block-quote, .wp-block-image:not(.alignwide):not(.alignfull)) {
	margin-left: max(0px, calc((100% - 1240px) / 2)) !important;
	margin-right: auto !important;
}
.sh-sekcja.is-layout-constrained > :where(p, ul, ol:not(.is-style-kroki), .wp-block-details, .wp-block-quote) { max-width: 46rem; }
.sh-sekcja.is-layout-constrained > ol.is-style-kroki { max-width: 1240px; }
.sh-sekcja.is-layout-constrained > :where(h2, h3, h4) { max-width: 30em; }
.sh-sekcja.is-layout-constrained > .wp-block-image:not(.alignwide):not(.alignfull) { max-width: 40rem; }
.sh-sekcja.is-layout-constrained > .wp-block-table { max-width: 1240px; }
.sh-galeria.wp-block-gallery { gap: 8px; }
.sh-sekcja > :first-child { margin-block-start: 0; }
.sh-pas-biel { background: var(--wp--preset--color--biel-profilu); }
.sh-pas-antracyt { background: var(--wp--preset--color--antracyt); color: var(--wp--preset--color--biel); }
.sh-pas-antracyt :where(h1, h2, h3, h4) { color: var(--wp--preset--color--biel); }
.sh-pas-antracyt .sh-lead, .sh-pas-antracyt .sh-maly { color: #D9DDDF; }
.sh-pas-antracyt a:where(:not(.wp-element-button)) { color: var(--wp--preset--color--biel); }
.sh-naglowek-sekcji { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 1rem 2rem; }
.sh-naglowek-sekcji h2 { margin: 0; max-width: 18em; }

/* Przyciski */
.wp-block-button.is-style-outline > .wp-block-button__link {
	background: transparent;
	color: var(--wp--preset--color--grafit);
	border: 2px solid var(--wp--preset--color--grafit);
	padding-block: calc(0.9rem - 2px);
}
.wp-block-button.is-style-outline > .wp-block-button__link:hover { background: var(--wp--preset--color--grafit); color: var(--wp--preset--color--biel); }
.sh-pas-antracyt .wp-block-button.is-style-outline > .wp-block-button__link { color: var(--wp--preset--color--biel); border-color: var(--wp--preset--color--biel); }
.sh-pas-antracyt .wp-block-button.is-style-outline > .wp-block-button__link:hover { background: var(--wp--preset--color--biel); color: var(--wp--preset--color--antracyt); }

/* Obraz w „otworze”: ramka profilu w antracycie i czerwona ościeżnica, jak belka w logo */
.wp-block-image.is-style-otwor {
	background: var(--wp--preset--color--antracyt);
	padding: var(--sh-ramka);
	border-left: var(--sh-ramka) solid var(--wp--preset--color--czerwien);
	margin: 0;
}
.wp-block-image.is-style-otwor img { display: block; width: 100%; height: 100%; object-fit: cover; }
.wp-block-image.is-style-otwor figcaption { color: #D9DDDF; margin: 0.75rem 0 0; }

/* Obraz bez ramki i bez przycinania (rendery, przekroje) */
.wp-block-image.is-style-bez { margin: 0; }
.wp-block-image.is-style-bez img { display: block; max-height: 32rem; width: auto; margin-inline: auto; }

/* Obraz w jasnej ramce profilu (realizacje, produkty) */
.wp-block-image.is-style-profil { background: var(--wp--preset--color--biel-profilu); padding: 8px; margin: 0; }
.sh-pas-biel .wp-block-image.is-style-profil { background: var(--wp--preset--color--biel); }
.wp-block-image.is-style-profil img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.wp-block-image.is-style-profil figcaption { margin: 0.6rem 0.25rem 0.2rem; color: var(--wp--preset--color--szary); }

/* Nagłówek strony */
.sh-naglowek {
	position: sticky; top: 0; z-index: 50;
	background: var(--wp--preset--color--biel);
	border-bottom: var(--sh-linia);
}
.admin-bar .sh-naglowek { top: var(--wp-admin--admin-bar--height, 32px); }
.sh-naglowek__wnetrze { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 4.5rem; }
.sh-logo { display: block; line-height: 0; flex-shrink: 0; }
.sh-logo img { height: 30px; width: auto; }
.sh-naglowek .wp-block-navigation { font-stretch: 100%; }
.sh-naglowek .wp-block-navigation a { text-decoration: none; color: var(--wp--preset--color--grafit); }
.sh-naglowek .wp-block-navigation a:hover { color: var(--wp--preset--color--czerwien); }
.sh-naglowek .wp-block-navigation .wp-block-navigation__submenu-container {
	border: var(--sh-linia); padding: 0.5rem 0; min-width: 16rem;
	box-shadow: 0 12px 24px -12px rgba(56, 62, 66, 0.35);
}
.sh-naglowek .wp-block-navigation .wp-block-navigation__submenu-container a { padding: 0.45rem 1rem; }
.sh-naglowek__akcje { display: flex; align-items: center; gap: 1.25rem; flex-shrink: 0; }
.sh-telefon { font-weight: 650; color: var(--wp--preset--color--grafit); text-decoration: none; white-space: nowrap; }
.sh-telefon:hover { color: var(--wp--preset--color--czerwien); }
.sh-naglowek__akcje .wp-block-button__link { padding: 0.7rem 1.1rem; font-size: 0.9375rem; }

@media (max-width: 1100px) {
	.sh-telefon { display: none; }
}
@media (max-width: 781px) {
	.sh-naglowek__akcje { display: none; }
	.sh-naglowek .wp-block-navigation { margin-left: auto; }
	.sh-naglowek__wnetrze { min-height: 3.75rem; }
	.sh-logo img { height: 26px; }
}

/* Pierwszy ekran */
.sh-hero { padding-block: var(--wp--preset--spacing--60); }
.sh-hero .wp-block-columns { align-items: center; gap: var(--wp--preset--spacing--50); }
.sh-hero h1 { margin-block: 0 1.25rem; }
h1.sh-h1-dlugi { font-size: clamp(2rem, 1.2rem + 2.2vw, 3.125rem); line-height: 1.08; }
.sh-hero .wp-block-image.is-style-otwor img { aspect-ratio: 4 / 5; }
.sh-fakty { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: 0.35rem; color: var(--wp--preset--color--szary); font-size: var(--wp--preset--font-size--small); }
.sh-fakty li { padding: 0; }
.sh-fakty strong { color: var(--wp--preset--color--grafit); font-weight: 650; }
@media (max-width: 781px) {
	.sh-hero { padding-block: var(--wp--preset--spacing--40) var(--wp--preset--spacing--50); }
	.sh-hero .wp-block-image.is-style-otwor { --sh-ramka: 10px; }
	.sh-hero .wp-block-image.is-style-otwor img { aspect-ratio: 4 / 3; }
}

/* Kafle rodzin produktów */
.sh-kafle { gap: var(--wp--preset--spacing--40) var(--wp--preset--spacing--30); }
.sh-kafel { display: flex; flex-direction: column; gap: 0.5rem; }
.sh-kafel h3 { margin: 0.5rem 0 0; font-size: 1.1875rem; }
.sh-kafel h3 a { color: var(--wp--preset--color--grafit); text-decoration: none; }
.sh-kafel h3 a:hover { color: var(--wp--preset--color--czerwien); text-decoration: underline; }
.sh-kafel p { margin: 0; color: var(--wp--preset--color--szary); font-size: 0.9375rem; line-height: 1.5; }
.sh-kafel .wp-block-image.is-style-profil img { aspect-ratio: 1; }

/* Kroki procesu: to jest prawdziwa kolejność, więc numerujemy */
ol.is-style-kroki {
	list-style: none; padding: 0; margin: var(--wp--preset--spacing--40) 0 0; counter-reset: krok;
	display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: var(--wp--preset--spacing--40);
}
ol.is-style-kroki > li { counter-increment: krok; border-top: 2px solid var(--wp--preset--color--grafit); padding-top: 1rem; }
.sh-pas-antracyt ol.is-style-kroki > li { border-top-color: var(--wp--preset--color--biel); }
ol.is-style-kroki > li::before {
	content: counter(krok); display: block; font-size: 2.5rem; font-weight: 300; font-stretch: 118%; line-height: 1; margin-bottom: 0.75rem;
}
ol.is-style-kroki > li strong { display: block; font-size: 1.125rem; font-weight: 650; margin-bottom: 0.35rem; }

/* Karta techniczna (tabela parametrów) */
.wp-block-table.is-style-karta table { border-collapse: collapse; width: 100%; }
.wp-block-table.is-style-karta :where(th, td) { border: 0; border-bottom: var(--sh-linia); padding: 0.85rem 1rem 0.85rem 0; text-align: left; vertical-align: top; }
.wp-block-table.is-style-karta thead th { border-bottom: 2px solid var(--wp--preset--color--grafit); font-weight: 650; }
.wp-block-table.is-style-karta tbody td:first-child { color: var(--wp--preset--color--szary); width: 36%; }
.wp-block-table.is-style-karta tbody td strong { font-weight: 650; }
.wp-block-table.is-style-karta figcaption { text-align: left; }
@media (max-width: 600px) {
	/* Porównanie (z nagłówkiem kolumn) przewija się w bok; karta parametrów układa etykietę nad wartością */
	.wp-block-table.is-style-karta { overflow-x: auto; }
	.wp-block-table.is-style-karta table:has(thead) { min-width: 34rem; }
	.wp-block-table.is-style-karta table:not(:has(thead)) :is(tbody, tr, td) { display: block; width: auto; }
	.wp-block-table.is-style-karta table:not(:has(thead)) tr { border-bottom: var(--sh-linia); padding-block: 0.75rem; }
	.wp-block-table.is-style-karta table:not(:has(thead)) td { border: 0; padding: 0; }
	.wp-block-table.is-style-karta table:not(:has(thead)) td:first-child { font-size: var(--wp--preset--font-size--small); margin-bottom: 0.15rem; }
}

/* Linia wymiarowa: jedyny ozdobnik, tylko przy pomiarze */
.sh-wymiar {
	position: relative; display: flex; align-items: center; gap: 1rem;
	font-size: var(--wp--preset--font-size--small); color: var(--wp--preset--color--szary); margin-block: 0 1.5rem;
}
.sh-wymiar::before, .sh-wymiar::after {
	content: ""; flex: 1; height: 13px;
	background: linear-gradient(currentColor, currentColor) center / 100% 1px no-repeat;
	border-inline: 1px solid currentColor;
}
.sh-wymiar::before { border-right: 0; }
.sh-wymiar::after { border-left: 0; }
.sh-pas-antracyt .sh-wymiar { color: #D9DDDF; }

/* Dane kontaktowe i zespół */
.sh-osoby { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.sh-osoby li { padding: 0 0 1rem; border-bottom: var(--sh-linia); }
.sh-osoby strong { display: block; font-weight: 650; }

/* FAQ */
.wp-block-details { border-bottom: var(--sh-linia); padding-block: 1rem; }
.wp-block-details summary { font-weight: 650; cursor: pointer; font-size: 1.0625rem; list-style-position: outside; }
.wp-block-details[open] summary { margin-bottom: 0.5rem; }
.wp-block-details > :not(summary) { color: var(--wp--preset--color--szary); max-width: 44em; }

/* Formularz zapytań (wtyczka Smart House Core) */
.shc-formularz { background: var(--wp--preset--color--biel); padding: clamp(1.25rem, 3vw, 2rem); border-top: 4px solid var(--wp--preset--color--czerwien); color: var(--wp--preset--color--grafit); }
.shc-formularz h3 { margin: 0 0 1rem; }
.shc-pola { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 0 1.25rem; }
.shc-pole { margin: 0 0 1rem; display: flex; flex-direction: column; gap: 0.35rem; }
.shc-pole--szerokie { grid-column: 1 / -1; }
.shc-pole label { font-weight: 600; font-size: 0.9375rem; }
.shc-pole label span { font-weight: 400; color: var(--wp--preset--color--szary); }
.shc-formularz :is(input:not([type=checkbox]), select, textarea) {
	font: inherit; font-size: 1rem; padding: 0.75rem 0.85rem; border: 1px solid #8A9196; border-radius: 2px; background: var(--wp--preset--color--biel); color: inherit; width: 100%;
}
.shc-formularz :is(input, select, textarea):focus { outline: 2px solid var(--wp--preset--color--grafit); outline-offset: 1px; border-color: var(--wp--preset--color--grafit); }
.shc-formularz [aria-invalid="true"] { border-color: var(--wp--preset--color--czerwien); outline-color: var(--wp--preset--color--czerwien); }
.shc-pulapka { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.shc-zgoda { font-size: var(--wp--preset--font-size--small); color: var(--wp--preset--color--szary); }
.shc-zgoda label { display: flex; gap: 0.6rem; align-items: flex-start; }
.shc-zgoda input { margin-top: 0.2rem; width: 1.1rem; height: 1.1rem; flex-shrink: 0; accent-color: var(--wp--preset--color--czerwien); }
.shc-wyslij button { cursor: pointer; }
.shc-wyslij button:disabled { opacity: 0.6; cursor: wait; }
.shc-komunikat { margin: 0.75rem 0 0; font-weight: 600; min-height: 1.5em; }
.shc-komunikat--ok { color: #1E6B35; }
.shc-komunikat--blad { color: var(--wp--preset--color--czerwien); }

/* Stopka */
.sh-stopka { background: var(--wp--preset--color--antracyt); color: #E4E7E8; padding-block: var(--wp--preset--spacing--60) var(--wp--preset--spacing--40); font-size: 0.9375rem; }
.sh-stopka :where(h2, h3) { color: var(--wp--preset--color--biel); font-size: 1rem; font-stretch: 100%; font-weight: 650; letter-spacing: 0; margin-bottom: 0.75rem; }
.sh-stopka a { color: var(--wp--preset--color--biel); text-decoration: none; }
.sh-stopka a:hover { text-decoration: underline; }
.sh-stopka ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.4rem; }
.sh-stopka .sh-logo img { height: 28px; }
.sh-stopka__dol { border-top: 1px solid rgba(255, 255, 255, 0.18); margin-top: var(--wp--preset--spacing--50); padding-top: 1.25rem; font-size: var(--wp--preset--font-size--small); color: #BFC5C9; }

/* Pasek akcji na telefonie: zadzwoń i pomiar zawsze pod kciukiem */
.sh-pasek-mobilny { display: none; }
@media (max-width: 781px) {
	.sh-pasek-mobilny {
		display: grid; grid-template-columns: 1fr 1fr; position: fixed; inset: auto 0 0 0; z-index: 60;
		background: var(--wp--preset--color--biel); border-top: var(--sh-linia);
		padding: 0.5rem clamp(1rem, 4vw, 2.5rem) calc(0.5rem + env(safe-area-inset-bottom)); gap: 0.5rem;
	}
	.sh-pasek-mobilny a { display: flex; justify-content: center; align-items: center; min-height: 3rem; font-weight: 650; text-decoration: none; border-radius: 2px; }
	.sh-pasek-mobilny .sh-zadzwon { border: 2px solid var(--wp--preset--color--grafit); color: var(--wp--preset--color--grafit); }
	.sh-pasek-mobilny .sh-pomiar { background: var(--wp--preset--color--czerwien); color: var(--wp--preset--color--biel); }
	body { padding-bottom: 4.5rem; }
	/* Baner zgód (wtyczka Cookie Notice) nad paskiem akcji, nie pod nim */
	#cookie-notice { bottom: calc(4rem + env(safe-area-inset-bottom)) !important; }
}

/* Wpis na blogu: w kolumnie 720 px śródtytuły mniejsze niż na stronach ofertowych */
body.single .wp-block-post-content h2 { font-size: clamp(1.5rem, 1.15rem + 1.2vw, 2rem); margin-top: 2.5rem; }
body.single .wp-block-post-content h3 { font-size: 1.25rem; margin-top: 2rem; }
.sh-wpis-meta { color: var(--wp--preset--color--szary); font-size: var(--wp--preset--font-size--small); }
.sh-autor { border-top: 2px solid var(--wp--preset--color--grafit); padding-top: 1.5rem; }
.sh-autor img { border-radius: 50%; }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
