/* ToGreen design system — D.2 */

:root {
	/* Light rhythm (D.7.5A-3) */
	--tg-bg-base: #f7f5f1;
	--tg-bg-soft: #f1eee8;
	--tg-bg-white: #ffffff;
	--tg-bg: var(--tg-bg-base);
	--tg-bg-alt: var(--tg-bg-white);
	/* Dark two-tone */
	--tg-dark: #1e2a24;
	--tg-dark-deeper: #121c17;
	--tg-body: #2a2e2b;
	--tg-secondary: #5c6560;
	--tg-accent: #3d6b4f;
	--tg-accent-hover: #2f5440;
	--tg-border: #e2e0db;

	--tg-font-heading: "Source Sans 3", system-ui, -apple-system, sans-serif;
	--tg-font-body: "Source Sans 3", system-ui, -apple-system, sans-serif;

	--tg-space-1: 8px;
	--tg-space-2: 16px;
	--tg-space-3: 24px;
	--tg-space-4: 40px;
	--tg-space-5: 64px;
	--tg-space-6: 80px;

	--tg-container: 1200px;
	--tg-text-max: 680px;
	--tg-gutter: 16px;
	--tg-radius: 0;
	--tg-header-h: 60px;
	--tg-header-top-h: 72px;
	--tg-header-bar-h: 56px;
	--tg-header-h-desktop: calc(var(--tg-header-top-h) + var(--tg-header-bar-h));
	--tg-bp: 1024px;
}

@media (min-width: 768px) {
	:root {
		--tg-gutter: 24px;
	}
}

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

html {
	scroll-behavior: smooth;
	scroll-padding-top: calc(var(--tg-header-h) + 12px);
}

@media (min-width: 1024px) {
	html {
		scroll-padding-top: calc(var(--tg-header-h-desktop) + 16px);
	}
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

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

body {
	margin: 0;
	font-family: var(--tg-font-body);
	font-size: 16px;
	line-height: 1.65;
	color: var(--tg-body);
	background: var(--tg-bg);
	-webkit-font-smoothing: antialiased;
}

@media (min-width: 1024px) {
	body {
		font-size: 17px;
	}
}

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

a {
	color: var(--tg-accent);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.15em;
}

a:hover {
	color: var(--tg-accent-hover);
}

:focus-visible {
	outline: 2px solid var(--tg-accent);
	outline-offset: 3px;
}

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

.skip-link:focus {
	clip: auto;
	clip-path: none;
	height: auto;
	width: auto;
	left: var(--tg-gutter);
	top: var(--tg-gutter);
	z-index: 10000;
	padding: 12px 16px;
	background: var(--tg-dark);
	color: #fff;
	text-decoration: none;
}

.container {
	width: min(100% - (var(--tg-gutter) * 2), var(--tg-container));
	margin-inline: auto;
}

.content-width {
	max-width: var(--tg-text-max);
}

.section {
	padding-block: 40px;
}

.section--alt {
	background: var(--tg-bg-alt);
}

@media (min-width: 768px) {
	.section {
		padding-block: 56px;
	}
}

@media (min-width: 1024px) {
	.section {
		padding-block: 72px;
	}
}

h1,
h2,
h3,
h4,
.page-intro__title,
.home-foundation__title {
	font-family: var(--tg-font-heading);
	font-weight: 700;
	line-height: 1.18;
	letter-spacing: -0.02em;
	color: var(--tg-dark);
	margin: 0 0 var(--tg-space-2);
}

h1,
.page-intro__title,
.home-foundation__title {
	font-size: clamp(2.125rem, 4vw, 3.25rem);
}

h2 {
	font-size: clamp(1.6875rem, 2.5vw, 2.125rem);
}

h3 {
	font-size: clamp(1.25rem, 1.8vw, 1.4375rem);
	font-weight: 600;
	letter-spacing: -0.015em;
}

.lead,
.page-intro__lead {
	font-size: 1.0625rem;
	line-height: 1.6;
	color: var(--tg-secondary);
	max-width: var(--tg-text-max);
	margin: 0 0 var(--tg-space-3);
}

.eyebrow {
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--tg-secondary);
	margin: 0 0 var(--tg-space-2);
}

/* Buttons */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 44px;
	padding: 0.65rem 1.25rem;
	border-radius: var(--tg-radius);
	border: 1px solid transparent;
	font-family: var(--tg-font-body);
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn--primary {
	background: var(--tg-accent);
	color: #fff;
}

.btn--primary:hover {
	background: var(--tg-accent-hover);
	color: #fff;
}

.btn--secondary {
	background: transparent;
	color: var(--tg-dark);
	border-color: var(--tg-border);
}

.btn--secondary:hover {
	border-color: var(--tg-accent);
	color: var(--tg-accent);
}

.btn--dark {
	background: var(--tg-dark);
	color: #fff;
}

.btn--dark:hover {
	background: #162019;
	color: #fff;
}

.btn + .btn {
	margin-left: 8px;
}

/* Header */
.site-header {
	position: sticky;
	top: 0;
	z-index: 1000;
	height: var(--tg-header-h);
	background: rgba(247, 245, 241, 0.96);
	border-bottom: 1px solid transparent;
	/* no backdrop-filter: it makes sticky header a containing block
	   and collapses position:fixed mobile nav to ~header height */
	transition: border-color 0.2s ease, background-color 0.2s ease;
}

.site-header.is-scrolled {
	border-bottom-color: var(--tg-border);
	background: rgba(247, 245, 241, 0.98);
}

@media (min-width: 1024px) {
	.site-header {
		height: var(--tg-header-h-desktop);
		display: flex;
		flex-direction: column;
		background: var(--tg-bg-base);
	}

	.site-header.is-scrolled {
		background: var(--tg-bg-base);
	}
}

/* Desktop contact bar — phone | logo | email */
.site-header__top {
	display: none;
}

@media (min-width: 1024px) {
	.site-header__top {
		display: block;
		flex: 0 0 var(--tg-header-top-h);
		height: var(--tg-header-top-h);
		background: var(--tg-bg-soft);
		border-bottom: 1px solid var(--tg-border);
	}
}

.site-header__top-grid {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	height: 100%;
	gap: var(--tg-space-2);
}

.site-header__contact {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	min-width: 0;
	text-decoration: none;
	color: inherit;
	padding: 6px 0;
	border-radius: 2px;
	transition: color 0.15s ease;
}

.site-header__contact--phone {
	justify-self: start;
}

.site-header__contact--mail {
	justify-self: end;
}

.site-header__contact-icon {
	display: inline-flex;
	flex-shrink: 0;
	color: var(--tg-accent);
}

.site-header__contact-icon .tg-icon {
	width: 28px;
	height: 28px;
}

.site-header__contact-text {
	display: flex;
	flex-direction: column;
	gap: 1px;
	min-width: 0;
}

.site-header__contact-label {
	font-family: var(--tg-font-body);
	font-size: 0.6875rem;
	font-weight: 500;
	letter-spacing: 0.02em;
	line-height: 1.2;
	color: var(--tg-secondary);
}

.site-header__contact-value {
	font-family: var(--tg-font-body);
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.25;
	color: var(--tg-dark);
	white-space: nowrap;
}

.site-header__contact:hover .site-header__contact-value,
.site-header__contact:focus-visible .site-header__contact-value {
	color: var(--tg-accent);
}

.site-header__contact:focus-visible {
	outline: 2px solid var(--tg-accent);
	outline-offset: 3px;
}

.site-header__brand--top {
	justify-self: center;
	grid-column: 2;
}

.site-header__brand--top .site-logo img,
.site-header__brand--top .custom-logo-link img {
	width: auto;
	height: auto;
	max-width: 200px;
	max-height: 68px;
}

.site-header__bar {
	height: 100%;
}

@media (min-width: 1024px) {
	.site-header__bar {
		flex: 0 0 var(--tg-header-bar-h);
		height: var(--tg-header-bar-h);
		background: rgba(247, 245, 241, 0.98);
		border-bottom: 1px solid transparent;
	}

	.site-header.is-scrolled .site-header__bar {
		border-bottom-color: var(--tg-border);
	}

	.site-header__brand--bar {
		display: none;
	}
}

.site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 100%;
	gap: var(--tg-space-2);
}

@media (min-width: 1024px) {
	.site-header__inner {
		justify-content: center;
	}
}

.site-logo,
.custom-logo-link {
	display: inline-flex;
	align-items: center;
	text-decoration: none;
	flex-shrink: 0;
}

.site-logo img,
.custom-logo-link img {
	width: auto;
	height: auto;
	max-width: 148px;
	max-height: 44px;
}

@media (min-width: 1024px) {
	.site-header__brand--bar .site-logo img,
	.site-header__brand--bar .custom-logo-link img {
		max-width: 190px;
		max-height: 52px;
	}
}

/*
 * Header logo tune variants (D.7.5A-4) — preview via ?logo_tune=a|b
 * Scoped to .site-header only; footer logo untouched.
 * No invert / grayscale / drop-shadow / full black recolor.
 */
body.tg-logo-tune-a .site-header .site-logo img,
body.tg-logo-tune-a .site-header .custom-logo-link img {
	height: 40px;
	max-width: 168px;
	filter: contrast(1.08) saturate(1.1) brightness(0.97);
}

@media (min-width: 1024px) {
	body.tg-logo-tune-a .site-header .site-logo img,
	body.tg-logo-tune-a .site-header .custom-logo-link img {
		height: 46px;
		max-width: 180px;
	}
}

body.tg-logo-tune-b .site-header .site-logo img,
body.tg-logo-tune-b .site-header .custom-logo-link img {
	height: 42px;
	max-width: 176px;
	filter: contrast(1.14) saturate(1.16) brightness(0.94);
}

@media (min-width: 1024px) {
	body.tg-logo-tune-b .site-header .site-logo img,
	body.tg-logo-tune-b .site-header .custom-logo-link img {
		height: 48px;
		max-width: 190px;
	}
}

.site-header__cta {
	margin-left: 8px;
	min-height: 40px;
	padding: 0.45rem 1rem;
}

.site-header__mobile-contacts {
	display: flex;
	flex-direction: column;
	gap: 0;
	margin-top: var(--tg-space-3);
	padding-top: var(--tg-space-2);
	border-top: 1px solid var(--tg-border);
}

.site-header__mobile-contact {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 12px 4px;
	text-decoration: none;
	border-bottom: 1px solid var(--tg-border);
	color: inherit;
}

.site-header__mobile-contact-label {
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--tg-secondary);
}

.site-header__mobile-contact-value {
	font-size: 1.0625rem;
	font-weight: 600;
	color: var(--tg-dark);
	word-break: break-word;
}

.site-header__mobile-contact:hover .site-header__mobile-contact-value,
.site-header__mobile-contact:focus-visible .site-header__mobile-contact-value {
	color: var(--tg-accent);
}

@media (min-width: 1024px) {
	.site-header__mobile-contacts {
		display: none;
	}
}

.nav-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid var(--tg-border);
	border-radius: var(--tg-radius);
	background: var(--tg-bg-alt);
	cursor: pointer;
}

.nav-toggle__bars,
.nav-toggle__bars::before,
.nav-toggle__bars::after {
	display: block;
	width: 18px;
	height: 2px;
	background: var(--tg-dark);
	position: relative;
	transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle__bars::before,
.nav-toggle__bars::after {
	content: "";
	position: absolute;
	left: 0;
}

.nav-toggle__bars::before {
	top: -6px;
}

.nav-toggle__bars::after {
	top: 6px;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars {
	background: transparent;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before {
	top: 0;
	transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after {
	top: 0;
	transform: rotate(-45deg);
}

@media (min-width: 1024px) {
	.nav-toggle {
		display: none;
	}
}

.primary-nav {
	display: none;
}

.primary-nav.is-open {
	display: block;
	position: fixed;
	inset: var(--tg-header-h) 0 0 0;
	background: var(--tg-bg);
	padding: var(--tg-space-3);
	overflow-y: auto;
	z-index: 999;
}

@media (min-width: 1024px) {
	.primary-nav {
		display: flex;
		align-items: center;
		justify-content: center;
		gap: var(--tg-space-2);
		position: static;
		padding: 0;
		overflow: visible;
		background: transparent;
		width: 100%;
	}

	.primary-nav.is-open {
		display: flex;
		position: static;
		inset: auto;
	}
}

.primary-menu {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
}

@media (min-width: 1024px) {
	.primary-menu {
		flex-direction: row;
		align-items: center;
		justify-content: center;
		gap: 2px;
		flex: 0 1 auto;
		margin: 0 auto;
	}

	.primary-menu .menu-link {
		min-height: 44px;
		padding: 8px 14px;
		font-size: 0.9875rem;
	}
}

.primary-menu .menu-item {
	position: relative;
	margin: 0;
}

.primary-menu .menu-link {
	display: flex;
	align-items: center;
	min-height: 44px;
	padding: 10px 12px;
	color: var(--tg-body);
	text-decoration: none;
	font-weight: 500;
}

.primary-menu .menu-link:hover,
.primary-menu .current-menu-item > .menu-link,
.primary-menu .current-menu-ancestor > .menu-link {
	color: var(--tg-accent);
}

.menu-item-has-children {
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: center;
}

@media (min-width: 1024px) {
	.menu-item-has-children {
		display: block;
	}
}

.submenu-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border: 0;
	background: transparent;
	cursor: pointer;
	color: var(--tg-body);
}

.submenu-toggle span {
	width: 8px;
	height: 8px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg);
	margin-top: -4px;
	transition: transform 0.15s ease;
}

.submenu-toggle[aria-expanded="true"] span {
	transform: rotate(225deg);
	margin-top: 2px;
}

@media (min-width: 1024px) {
	.submenu-toggle {
		display: none;
	}
}

.primary-menu .sub-menu {
	list-style: none;
	margin: 0;
	padding: 0 0 8px 12px;
	display: none;
	grid-column: 1 / -1;
}

.menu-item-has-children.is-open > .sub-menu {
	display: block;
}

@media (min-width: 1024px) {
	.primary-menu .sub-menu {
		display: none;
		position: absolute;
		top: 100%;
		left: 0;
		min-width: 280px;
		padding: 8px;
		background: var(--tg-bg-alt);
		border: 1px solid var(--tg-border);
		border-radius: 6px;
		box-shadow: none;
		z-index: 20;
	}

	.menu-item-has-children:hover > .sub-menu,
	.menu-item-has-children:focus-within > .sub-menu,
	.menu-item-has-children.is-open > .sub-menu {
		display: block;
	}
}

.menu-badge {
	display: inline-block;
	margin-left: 6px;
	font-size: 0.625rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	color: var(--tg-secondary);
	vertical-align: middle;
}

/* B.7F — hub link at end of Usługi dropdown */
.primary-menu .sub-menu > .menu-item-oferta-hub {
	margin-top: 6px;
	padding-top: 6px;
	border-top: 1px solid var(--tg-border);
}

.primary-menu .sub-menu > .menu-item-oferta-hub > .menu-link {
	font-weight: 600;
	color: var(--tg-body);
}

.primary-menu .sub-menu > .menu-item-oferta-hub > .menu-link:hover,
.primary-menu .sub-menu > .menu-item-oferta-hub.current-menu-item > .menu-link {
	color: var(--tg-accent);
}

@media (min-width: 1024px) {
	.primary-menu .sub-menu > .menu-item-oferta-hub {
		margin-top: 4px;
		padding-top: 8px;
	}
}

.site-header__cta {
	margin-top: var(--tg-space-2);
	width: 100%;
}

@media (min-width: 1024px) {
	.site-header__cta {
		display: none;
	}
}

body.nav-open {
	overflow: hidden;
}

@media (min-width: 1024px) {
	body.nav-open {
		overflow: visible;
	}
}

/* Page intro + breadcrumbs */
.page-intro {
	padding: var(--tg-space-4) 0 var(--tg-space-3);
	border-bottom: 1px solid var(--tg-border);
	background: var(--tg-bg);
}

.page-intro__title {
	max-width: var(--tg-text-max);
}

.breadcrumbs {
	margin-bottom: var(--tg-space-2);
}

.breadcrumbs__list {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	align-items: center;
	list-style: none;
	margin: 0;
	padding: 0;
	font-size: 0.875rem;
	color: var(--tg-secondary);
}

.breadcrumbs__list a {
	color: var(--tg-secondary);
	text-decoration: none;
}

.breadcrumbs__list a:hover {
	color: var(--tg-accent);
}

.breadcrumbs__sep {
	margin: 0 2px;
	color: var(--tg-secondary);
}

.breadcrumbs__item:not(:last-child)::after {
	content: "/";
	margin-left: 6px;
	color: var(--tg-secondary);
}

.breadcrumbs p.breadcrumbs__list {
	display: block;
}

/* Entry / Gutenberg basics */
.entry__content > *:first-child {
	margin-top: 0;
}

.entry__content > *:last-child {
	margin-bottom: 0;
}

.entry__content .alignwide {
	max-width: var(--tg-container);
}

.entry__content .alignfull {
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(50% - 50vw);
}

.wp-block-image img {
	border-radius: var(--tg-radius);
}

.wp-block-button__link {
	border-radius: var(--tg-radius) !important;
	min-height: 44px;
}

/* Footer — deeper dark green than CTA (D.7.5A-3) */
.site-footer {
	background: var(--tg-dark-deeper);
	color: #d7ddd9;
	padding: var(--tg-space-5) 0 var(--tg-space-3);
	margin-top: 0;
	border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.site-footer a {
	color: #eef2ef;
	text-decoration: none;
}

.site-footer a:hover {
	color: #fff;
	text-decoration: underline;
}

.site-footer__grid {
	display: grid;
	gap: var(--tg-space-4);
}

@media (min-width: 768px) {
	.site-footer__grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 1024px) {
	.site-footer__grid {
		grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
		gap: var(--tg-space-3);
	}
}

.site-footer__heading {
	font-family: var(--tg-font-body);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: #a8c4b0;
	margin: 0 0 var(--tg-space-2);
}

.site-footer__tagline,
.site-footer__meta,
.site-footer p {
	margin: 0 0 var(--tg-space-2);
	font-size: 0.95rem;
	line-height: 1.55;
}

.site-footer__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.site-footer__list li {
	margin: 0 0 8px;
}

.site-footer__list a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
}

.site-footer__col--brand .site-logo--footer {
	display: inline-flex;
	align-items: center;
	margin-bottom: var(--tg-space-2);
}

.site-footer__col--brand .site-logo img {
	display: block;
	width: auto;
	height: 72px;
	max-width: none;
	max-height: none;
}

/* Raster fallback only (legacy PNG) — keep readable on dark footer */
.site-footer__col--brand .site-logo:not(.site-logo--svg) img {
	filter: brightness(0) invert(1);
	margin-bottom: var(--tg-space-2);
}

.site-footer__bottom {
	margin-top: var(--tg-space-4);
	padding-top: var(--tg-space-3);
	border-top: 1px solid rgba(255, 255, 255, 0.12);
	font-size: 0.875rem;
	color: #a8b1ac;
}

.site-footer__bottom p {
	margin: 0;
}

.site-main {
	min-height: 40vh;
}

.post-list {
	list-style: none;
	padding: 0;
	margin: 0;
}

.post-list__item {
	padding: 12px 0;
	border-bottom: 1px solid var(--tg-border);
}

.post-list__item a {
	color: var(--tg-dark);
	text-decoration: none;
	font-weight: 600;
}

.post-list__item a:hover {
	color: var(--tg-accent);
}

.home-foundation__title {
	margin-bottom: var(--tg-space-2);
}

/* reCAPTCHA v3 — hide Google badge; legal notice shown at contact form */
.grecaptcha-badge {
	visibility: hidden !important;
}
