/*
 * custom.css — nadpisania po cache/modules.css i cache/dynamic.css
 * Nagłówek (body.home + body.page): jedna linia na desktopie, okruszki, kontrast treści
 */

/* --- dynamic.css ustawia na desktopie body.page header .header { position:absolute } — psuje układ z okruszkami/sekcją; przywracamy przepływ dokumentu --- */
@media (min-width: 992px) {
	body.page header .header {
		position: relative !important;
		top: auto !important;
		left: auto !important;
		width: 100% !important;
		z-index: 50 !important;
	}
}

/* Kolumna nagłówka: strona główna + podstrony --- */
body.home header,
body.page header {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	width: 100%;
}

body.home header > .center[data-center="1"],
body.page header > .center[data-center="1"] {
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 1170px;
	margin-left: auto;
	margin-right: auto;
	padding-left: 15px;
	padding-right: 15px;
	box-sizing: border-box;
	position: relative;
}

/* Miejsce na przełącznik języka (block1785 absolut) — nie nachodzi na menu */
@media (min-width: 992px) {
	body.home header > .center[data-center="1"]:has(> .block1785),
	body.page header > .center[data-center="1"]:has(> .block1785) {
		padding-right: 200px;
	}
}

/* GTranslate (moduł 1785): prawy górny róg nagłówka */
@media (min-width: 992px) {
	body.home header > .center[data-center="1"] > .block1785,
	body.page header > .center[data-center="1"] > .block1785 {
		position: absolute;
		top: 0.35rem;
		right: 15px;
		z-index: 55;
		width: auto;
		max-width: min(220px, 42vw);
	}

	body.home header > .center[data-center="1"] > .block1785 > div > div.inner,
	body.page header > .center[data-center="1"] > .block1785 > div > div.inner {
		min-height: 0 !important;
	}
}

@media (max-width: 991px) {
	body.home header > .center[data-center="1"] > .block1785,
	body.page header > .center[data-center="1"] > .block1785 {
		align-self: flex-end;
		order: -1;
		margin-bottom: 0.35rem;
	}
}

/* GTranslate: inline position:fixed z wtyczki — wraca do układu nagłówka */
header .block1785 .gt_switcher_wrapper {
	position: static !important;
	top: auto !important;
	right: auto !important;
	left: auto !important;
	z-index: 1 !important;
}

header .block1785 .gtranslate_wrapper {
	position: relative;
}

/*
 * Header Q (#section-header): struktura to .section1631 > .center (opakowania) > .block*
 * Dzieci flex to .center, nie .block1629 — flex przypisujemy do .center
 */
body.home #section-header.header .section1631,
body.page #section-header.header .section1631,
body.home #section-header.block1631 .section1631,
body.page #section-header.block1631 .section1631 {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	width: 100%;
	row-gap: 0.5rem;
}

@media (min-width: 992px) {
	body.home #section-header .section1631,
	body.page #section-header .section1631 {
		flex-direction: row;
		flex-wrap: wrap;
		align-items: center;
		justify-content: flex-start;
		column-gap: 0.75rem;
		row-gap: 0.5rem;
	}

	body.home #section-header .section1631 > .clearfix,
	body.page #section-header .section1631 > .clearfix {
		display: none;
	}

	/* DOM: clearfix, .center(logo), .center(kontakt), .center(menu) — indeksy 2–4 */
	body.home #section-header .section1631 > .center:nth-child(2),
	body.page #section-header .section1631 > .center:nth-child(2) {
		flex: 0 1 auto;
		min-width: 0;
		width: auto !important;
		max-width: min(38%, 320px) !important;
		float: none !important;
	}

	body.home #section-header .section1631 > .center:nth-child(3),
	body.page #section-header .section1631 > .center:nth-child(3) {
		flex: 0 1 auto;
		min-width: 0;
		width: auto !important;
		max-width: min(34%, 280px) !important;
		float: none !important;
	}

	body.home #section-header .section1631 > .center:nth-child(4),
	body.page #section-header .section1631 > .center:nth-child(4) {
		flex: 1 1 auto;
		min-width: 180px;
		width: auto !important;
		max-width: none !important;
		float: none !important;
	}

	body.home #section-header .block1629,
	body.page #section-header .block1629,
	body.home #section-header .block1630,
	body.page #section-header .block1630,
	body.home #section-header .block1632,
	body.page #section-header .block1632 {
		float: none !important;
	}

	/* Bootstrap col-* w rzędzie nagłówka — nie łamać na „100% szerokości” */
	body.home #section-header .section1631 [class*="col-"],
	body.page #section-header .section1631 [class*="col-"] {
		width: auto !important;
		max-width: none !important;
		float: none !important;
	}

	body.home #section-header .block1629 a.logo,
	body.page #section-header .block1629 a.logo,
	body.home #section-header .block1629 .logo {
		display: inline-flex;
		align-items: center;
		max-width: min(340px, 46vw);
	}

	body.home #section-header .block1629 a.logo img,
	body.page #section-header .block1629 a.logo img,
	body.home #section-header .block1629 img {
		width: auto !important;
		height: auto !important;
		max-height: 80px;
		max-width: 100%;
		object-fit: contain;
	}

	/* Kontakt: cache wymusza flex-direction:column na lg/xl — jedna linia numeru */
	body.home #section-header .block1632 > div > div.inner,
	body.page #section-header .block1632 > div > div.inner {
		flex-direction: row !important;
		flex-wrap: nowrap !important;
		align-items: center !important;
		justify-content: flex-end !important;
	}

	body.home #section-header .block1632 > div > div.inner p,
	body.page #section-header .block1632 > div > div.inner p {
		white-space: nowrap;
		margin-bottom: 0;
	}

	/* Menu: poziomo w jednym rzędzie */
	body.home #section-header .block1630 .navbar-custom,
	body.page #section-header .block1630 .navbar-custom {
		overflow: visible !important;
	}

	body.home #section-header .block1630 .navbar-collapse.collapse,
	body.page #section-header .block1630 .navbar-collapse.collapse {
		display: block !important;
		height: auto !important;
		overflow: visible !important;
		visibility: visible !important;
	}

	body.home #section-header .block1630 .navbar-nav.menu,
	body.page #section-header .block1630 .navbar-nav.menu {
		display: flex;
		flex-direction: row;
		flex-wrap: nowrap;
		align-items: center;
		justify-content: flex-end;
		width: 100%;
	}

	body.home #section-header .block1630 .navbar-nav.menu > li,
	body.page #section-header .block1630 .navbar-nav.menu > li {
		float: none;
		flex: 0 0 auto;
	}
}

@media (min-width: 1200px) {
	body.home #section-header .section1631,
	body.page #section-header .section1631 {
		flex-wrap: nowrap;
		justify-content: space-between;
		column-gap: 1rem;
	}

	body.home #section-header .section1631 > .center:nth-child(2),
	body.page #section-header .section1631 > .center:nth-child(2) {
		max-width: min(30%, 300px) !important;
	}

	body.home #section-header .section1631 > .center:nth-child(3),
	body.page #section-header .section1631 > .center:nth-child(3) {
		max-width: 260px !important;
	}

	body.home #section-header .section1631 > .center:nth-child(4),
	body.page #section-header .section1631 > .center:nth-child(4) {
		flex: 1 1 0;
		min-width: 0;
	}
}

/* Podstrony: okruszki w bloku 163 — było position:absolute;bottom:0 w modules.css */
body.page .block163 > div > div.inner {
	position: relative !important;
	bottom: auto !important;
	left: auto !important;
	width: 100% !important;
}

body.page .section163 {
	position: relative;
	overflow: hidden;
}

/* Logo nad warstwą okruszków */
body.home .block1629 > div > div.inner,
body.page .block1629 > div > div.inner {
	position: relative;
	z-index: 2;
}

body.page .block163 > div > div.inner {
	z-index: 1;
}

/* Pas okruszków — czytelny, jak na Galerii */
body.page .block222 > div > div.inner {
	position: relative;
	z-index: 3;
	background: rgba(0, 0, 0, 0.55);
	padding: 0.55rem 1rem;
	border-radius: 0 0 6px 6px;
	box-sizing: border-box;
}

header .block222 .breadcrumbs,
.block222 .breadcrumbs {
	align-items: center;
	justify-content: flex-start;
	max-width: 100%;
	flex-wrap: wrap;
	row-gap: 0.35rem;
	column-gap: 0.35rem;
}

body.page .block222 .breadcrumbs,
body.page .block222 .breadcrumbs a,
body.page .block222 .pathway {
	color: rgba(255, 255, 255, 0.95);
}

body.page .block222 .breadcrumbs a:hover {
	color: #fff;
	text-decoration: underline;
}

.block222 .pathwayicon img {
	vertical-align: middle;
	max-height: 1.25em;
	width: auto;
}

/* --- Treść artykułu: listy z białym tłem w edytorze — poprawa kontrastu na ciemnym tle witryny --- */
body.page #content .item-page ul li,
body.page #content article ul li,
body.page #content .com-content-article__body ul li {
	background-color: rgba(35, 35, 35, 0.92) !important;
	color: rgba(245, 245, 245, 0.98) !important;
	border: 1px solid rgba(255, 255, 255, 0.12);
	padding: 0.5rem 0.75rem;
	border-radius: 4px;
}

body.page #content .item-page ul li a,
body.page #content article ul li a {
	color: rgba(230, 200, 120, 0.98);
}

@media (max-width: 991px) {
	body.home #section-header .section1631,
	body.page #section-header .section1631 {
		padding-bottom: 0.25rem;
	}

	body.page .block222 > div > div.inner {
		padding: 0.45rem 0.65rem;
		font-size: 0.9rem;
	}
}
