/* Duál fejléc: nagy (.header-change-max), kompakt sticky (.header-change-min), mobil (.header-change-mobil) */

/*
 * Megjelenítés: elsősorban a JS/html osztály (g-dual-header-is-mobile),
 * hogy a téma / Additional CSS 782px szabályai ne írják felül.
 * Media query csak tartalék (JS nélkül).
 */

/* Asztali: mobil fejléc rejtve */
html:not(.g-dual-header-is-mobile) .header-change-mobil,
html:not(.g-dual-header-is-mobile) .g-dual-header-shell .header-change-mobil,
html:not(.g-dual-header-is-mobile) header .header-change-mobil {
	display: none !important;
	visibility: hidden !important;
	height: 0 !important;
	max-height: 0 !important;
	overflow: hidden !important;
	opacity: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	pointer-events: none !important;
	position: absolute !important;
	width: 0 !important;
}

/* Mobil: csak a mobil fejléc */
html.g-dual-header-is-mobile .header-change-mobil,
html.g-dual-header-is-mobile .g-dual-header-shell .header-change-mobil,
html.g-dual-header-is-mobile header .header-change-mobil {
	display: revert !important;
	visibility: visible !important;
	height: auto !important;
	max-height: none !important;
	overflow: visible !important;
	opacity: 1 !important;
	margin: revert !important;
	padding: revert !important;
	border: revert !important;
	pointer-events: auto !important;
	position: relative !important;
	width: 100% !important;
	z-index: 1000;
}

html.g-dual-header-is-mobile .header-change-max,
html.g-dual-header-is-mobile .header-change-min {
	display: none !important;
}

html.g-dual-header-is-mobile .g-dual-header-shell,
html.g-dual-header-is-mobile.g-dual-header-is-compact .g-dual-header-shell {
	height: auto !important;
	overflow: visible;
}

/* Tartalék media query (ha a JS osztály még nincs) */
@media screen and (min-width: 1501px) {
	.header-change-mobil,
	.g-dual-header-shell .header-change-mobil,
	header .header-change-mobil {
		display: none !important;
		visibility: hidden !important;
		height: 0 !important;
		max-height: 0 !important;
		overflow: hidden !important;
		opacity: 0 !important;
		margin: 0 !important;
		padding: 0 !important;
		border: 0 !important;
		pointer-events: none !important;
		position: absolute !important;
		width: 0 !important;
	}
}

.g-dual-header-shell {
	position: relative;
	z-index: 1000;
	width: 100%;
	overflow-anchor: none;
}

/* Nagy fejléc – alapból látható, görgetéskor felfelé csúszik és eltűnik */
.header-change-max {
	position: relative;
	z-index: 1;
	width: 100%;
	transform: translateY(0);
	opacity: 1;
	will-change: transform, opacity;
	transition:
		transform var(--g-dual-header-transition, 0.4s) ease,
		opacity calc(var(--g-dual-header-transition, 0.4s) * 0.75) ease;
}

/* Kompakt fejléc – alapból rejtett, görgetéskor sticky-ként jelenik meg */
.header-change-min {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 2;
	width: 100%;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: translateY(-100%);
	will-change: transform, opacity;
	transition:
		transform var(--g-dual-header-transition, 0.4s) ease,
		opacity calc(var(--g-dual-header-transition, 0.4s) * 0.85) ease,
		visibility 0s linear var(--g-dual-header-transition, 0.4s);
}

/* Navigáció utáni első festés: ne animáljon a nagy → kompakt váltás */
html.g-dual-header-boot-compact .header-change-max,
html.g-dual-header-boot-compact .header-change-min {
	transition: none !important;
}

/* Kompakt állapot: nagy fejléc kimegy, kicsi bejön */
html.g-dual-header-is-compact:not(.g-dual-header-is-mobile) .header-change-max {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	transform: translateY(-100%);
	opacity: 0;
	pointer-events: none;
}

html.g-dual-header-is-compact:not(.g-dual-header-is-mobile) .g-dual-header-shell {
	height: var(--g-dual-header-min-height, auto);
	overflow: hidden;
}

html.g-dual-header-is-compact:not(.g-dual-header-is-mobile) .header-change-min {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translateY(0);
	transition:
		transform var(--g-dual-header-transition, 0.4s) ease 0.12s,
		opacity calc(var(--g-dual-header-transition, 0.4s) * 0.85) ease 0.18s,
		visibility 0s;
}

/* WP admin sáv */
.admin-bar .header-change-min {
	top: 20px;
}

@media screen and (max-width: 1500px) {
	.admin-bar .header-change-min {
		top: 46px;
	}
}

/* Tartalék mobil media query */
@media screen and (max-width: 1500px) {
	.header-change-mobil {
		display: revert !important;
		visibility: visible !important;
		height: auto !important;
		max-height: none !important;
		overflow: visible !important;
		opacity: 1 !important;
		margin: revert !important;
		padding: revert !important;
		border: revert !important;
		pointer-events: auto !important;
		position: relative;
		width: 100% !important;
		z-index: 1000;
	}

	.header-change-max,
	.header-change-min {
		display: none !important;
	}

	html.g-dual-header-is-compact .g-dual-header-shell,
	.g-dual-header-shell {
		height: auto !important;
		overflow: visible;
	}
}

@media (prefers-reduced-motion: reduce) {
	.header-change-max,
	.header-change-min {
		transition: none;
	}
}

/* A nagy fejléc a rejtett kompakt fejléc fölé kerül, hogy a hero kattintható maradjon */
html:not(.g-dual-header-is-compact):not(.g-dual-header-is-mobile) .header-change-max {
	z-index: 3;
}

/* Kattintható doboz: átlátszó link réteg a teljes felületre */
.clickable-box {
	position: relative;
}

.clickable-box__overlay {
	position: absolute;
	inset: 0;
	z-index: 1;
	display: block;
	background: transparent;
	color: inherit;
	text-decoration: none;
	cursor: pointer;
}

.clickable-box__overlay::after {
	content: "";
	position: absolute;
	inset: 0;
}

.clickable-box__sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Belső linkek/gombok a réteg fölött maradnak */
.clickable-box a:not(.clickable-box__overlay),
.clickable-box button,
.clickable-box input,
.clickable-box select,
.clickable-box textarea,
.clickable-box label,
.clickable-box summary,
.clickable-box [role="button"],
.clickable-box [role="link"] {
	position: relative;
	z-index: 2;
}

html.g-dual-header-is-compact .header-change-max .clickable-box {
	pointer-events: none;
}

/*
 * Köztes szélesség (1501–1300 px: jelenleg inaktív, mobil 1500 px alatt):
 * hero háttér contain, középre igazítva — JS g-dual-header-is-medium osztály.
 */
html.g-dual-header-is-medium header.g-dual-header-shell,
html.g-dual-header-is-medium .gazdalkodas-hero.g-menu {
	width: 100%;
	max-width: 100%;
	overflow: visible !important;
	overflow-x: visible !important;
}

html.g-dual-header-is-medium .header-change-max.alignwide,
html.g-dual-header-is-medium .header-change-max {
	position: relative;
	width: 100vw !important;
	max-width: 100vw !important;
	margin-left: calc(50% - 50vw) !important;
	margin-right: calc(50% - 50vw) !important;
	padding-top: 0 !important;
	padding-bottom: var(--wp--preset--spacing--30) !important;
	padding-left: 0 !important;
	padding-right: 0 !important;
	box-sizing: border-box !important;
	overflow: hidden !important;
	background-color: #0e6627 !important;
	background-image: url("https://gazdalkodas.aki.gov.hu/wp-content/uploads/2026/05/Rajztabla-8-masolat0-scaled.png") !important;
	background-size: contain !important;
	background-repeat: no-repeat !important;
	background-position: center top !important;
}

html.g-dual-header-is-medium .header-change-max .clickable-box.wp-block-spacer,
html.g-dual-header-is-medium .header-change-max .wp-block-spacer {
	width: 100% !important;
	min-height: clamp(140px, 20vw, 250px) !important;
	height: clamp(140px, 20vw, 250px) !important;
}

html.g-dual-header-is-medium .header-change-max > .wp-block-columns,
html.g-dual-header-is-medium .header-change-max > .wp-block-columns.is-layout-flex {
	width: 100% !important;
	max-width: 100% !important;
	min-width: 0 !important;
}

html.g-dual-header-is-medium .header-change-max > .wp-block-columns > .wp-block-column {
	flex: 0 0 100% !important;
	flex-basis: 100% !important;
	width: 100% !important;
	max-width: 100% !important;
	min-width: 0 !important;
}

/* Kompakt fejléc logó (Rajztabla-110) – ne maradjon fix 288px */
html.g-dual-header-is-medium .header-change-min .wp-block-image img {
	width: 100% !important;
	max-width: 100% !important;
	height: auto !important;
	object-fit: contain !important;
}

html.g-dual-header-is-medium .header-change-min > .wp-block-column:first-child {
	flex-basis: auto !important;
	min-width: 0 !important;
	max-width: 35% !important;
}

/* Kompakt fejléc (header-change-min): logó + keresősáv felül, főmenü alatta */
html.g-dual-header-is-medium .header-change-min.wp-block-columns,
html.g-dual-header-is-medium .header-change-min {
	flex-wrap: wrap !important;
	align-items: center !important;
	justify-content: space-between !important;
	row-gap: var(--wp--preset--spacing--20, 1rem);
}

html.g-dual-header-is-medium .header-change-min > .wp-block-column:nth-child(1) {
	order: 1 !important;
	flex: 0 0 auto !important;
	flex-basis: auto !important;
	width: auto !important;
	max-width: 35% !important;
	min-width: 0 !important;
}

html.g-dual-header-is-medium .header-change-min > .wp-block-column:nth-child(3) {
	order: 2 !important;
	flex: 1 1 auto !important;
	flex-basis: auto !important;
	width: auto !important;
	max-width: none !important;
	min-width: 0 !important;
	display: flex !important;
	justify-content: flex-end !important;
	align-items: center !important;
}

html.g-dual-header-is-medium .header-change-min > .wp-block-column:nth-child(3) > .wp-block-group.is-nowrap {
	flex-wrap: wrap !important;
	justify-content: flex-end !important;
	align-items: center !important;
	column-gap: var(--wp--preset--spacing--30, 1.5rem);
	row-gap: var(--wp--preset--spacing--10, 0.5rem);
}

html.g-dual-header-is-medium .header-change-min > .wp-block-column:nth-child(2) {
	order: 3 !important;
	flex: 0 0 100% !important;
	flex-basis: 100% !important;
	width: 100% !important;
	max-width: 100% !important;
	min-width: 0 !important;
}

html.g-dual-header-is-medium .header-change-min > .wp-block-column:nth-child(2) > .wp-block-group.is-nowrap {
	flex-wrap: wrap !important;
	width: 100% !important;
	justify-content: center !important;
}

html.g-dual-header-is-medium .header-change-min #nyelvi-menu-2,
html.g-dual-header-is-medium .header-change-min #menu-magyar-fomenu-1 {
	width: 100% !important;
	justify-content: center !important;
}

html.g-dual-header-is-medium .header-change-max .menu-barn.alignwide {
	width: 100% !important;
	max-width: 100% !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
	box-sizing: border-box;
}

/* menu-barn: keresősáv felül, nyelvi-menu-3 alatta */
html.g-dual-header-is-medium .header-change-max .menu-barn.g-menu-barn--medium,
html.g-dual-header-is-medium .header-change-max .menu-barn {
	flex-wrap: wrap !important;
	justify-content: center !important;
	align-items: center !important;
	align-content: center;
	column-gap: var(--wp--preset--spacing--30, 1.5rem);
	row-gap: var(--wp--preset--spacing--20, 1rem);
	position: relative;
	z-index: 2;
	background-color: transparent;
}

html.g-dual-header-is-medium .header-change-max .menu-barn > nav:not(.nyelvi-menu),
html.g-dual-header-is-medium .header-change-max .menu-barn > p,
html.g-dual-header-is-medium .header-change-max .menu-barn > form.search-box,
html.g-dual-header-is-medium .header-change-max .menu-barn > .wp-block-search {
	order: 1 !important;
	flex: 0 0 auto !important;
}

html.g-dual-header-is-medium .header-change-max .menu-barn > p {
	margin: 0 !important;
}

html.g-dual-header-is-medium .header-change-max .menu-barn > #nyelvi-menu-3 {
	order: 2 !important;
	flex: 0 0 100% !important;
	width: 100% !important;
	max-width: 100% !important;
	justify-content: center;
	margin-top: var(--wp--preset--spacing--10, 0.5rem);
}

/* Tartalék: media query önmagában is (JS nélkül) — inaktív, amíg medium max < mobile */
@media screen and (min-width: 1501px) and (max-width: 1300px) {
	html:not(.g-dual-header-is-mobile) header.g-dual-header-shell,
	html:not(.g-dual-header-is-mobile) .gazdalkodas-hero.g-menu {
		width: 100%;
		max-width: 100%;
		overflow: visible !important;
		overflow-x: visible !important;
	}

	html:not(.g-dual-header-is-mobile) .header-change-max.alignwide,
	html:not(.g-dual-header-is-mobile) .header-change-max {
		position: relative;
		width: 100vw !important;
		max-width: 100vw !important;
		margin-left: calc(50% - 50vw) !important;
		margin-right: calc(50% - 50vw) !important;
		padding-top: 0 !important;
		padding-bottom: var(--wp--preset--spacing--30) !important;
		padding-left: 0 !important;
		padding-right: 0 !important;
		box-sizing: border-box !important;
		overflow: hidden !important;
		background-color: #0e6627 !important;
		background-image: url("https://gazdalkodas.aki.gov.hu/wp-content/uploads/2026/05/Rajztabla-8-masolat0-scaled.png") !important;
		background-size: contain !important;
		background-repeat: no-repeat !important;
		background-position: center top !important;
	}

	html:not(.g-dual-header-is-mobile) .header-change-max .clickable-box.wp-block-spacer,
	html:not(.g-dual-header-is-mobile) .header-change-max .wp-block-spacer {
		width: 100% !important;
		min-height: clamp(140px, 20vw, 250px) !important;
		height: clamp(140px, 20vw, 250px) !important;
	}

	html:not(.g-dual-header-is-mobile) .header-change-max > .wp-block-columns,
	html:not(.g-dual-header-is-mobile) .header-change-max > .wp-block-columns.is-layout-flex,
	html:not(.g-dual-header-is-mobile) .header-change-max > .wp-block-columns > .wp-block-column {
		width: 100% !important;
		max-width: 100% !important;
		min-width: 0 !important;
	}

	html:not(.g-dual-header-is-mobile) .header-change-max > .wp-block-columns > .wp-block-column {
		flex: 0 0 100% !important;
		flex-basis: 100% !important;
	}

	html:not(.g-dual-header-is-mobile) .header-change-min .wp-block-image img {
		width: 100% !important;
		max-width: 100% !important;
		height: auto !important;
		object-fit: contain !important;
	}

	html:not(.g-dual-header-is-mobile) .header-change-min.wp-block-columns,
	html:not(.g-dual-header-is-mobile) .header-change-min {
		flex-wrap: wrap !important;
		align-items: center !important;
		justify-content: space-between !important;
		row-gap: var(--wp--preset--spacing--20, 1rem);
	}

	html:not(.g-dual-header-is-mobile) .header-change-min > .wp-block-column:nth-child(1) {
		order: 1 !important;
		flex: 0 0 auto !important;
		flex-basis: auto !important;
		width: auto !important;
		max-width: 35% !important;
		min-width: 0 !important;
	}

	html:not(.g-dual-header-is-mobile) .header-change-min > .wp-block-column:nth-child(3) {
		order: 2 !important;
		flex: 1 1 auto !important;
		flex-basis: auto !important;
		width: auto !important;
		max-width: none !important;
		min-width: 0 !important;
		display: flex !important;
		justify-content: flex-end !important;
		align-items: center !important;
	}

	html:not(.g-dual-header-is-mobile) .header-change-min > .wp-block-column:nth-child(3) > .wp-block-group.is-nowrap {
		flex-wrap: wrap !important;
		justify-content: flex-end !important;
		align-items: center !important;
		column-gap: var(--wp--preset--spacing--30, 1.5rem);
		row-gap: var(--wp--preset--spacing--10, 0.5rem);
	}

	html:not(.g-dual-header-is-mobile) .header-change-min > .wp-block-column:nth-child(2) {
		order: 3 !important;
		flex: 0 0 100% !important;
		flex-basis: 100% !important;
		width: 100% !important;
		max-width: 100% !important;
		min-width: 0 !important;
	}

	html:not(.g-dual-header-is-mobile) .header-change-min > .wp-block-column:nth-child(2) > .wp-block-group.is-nowrap {
		flex-wrap: wrap !important;
		width: 100% !important;
		justify-content: center !important;
	}

	html:not(.g-dual-header-is-mobile) .header-change-min #nyelvi-menu-2,
	html:not(.g-dual-header-is-mobile) .header-change-min #menu-magyar-fomenu-1 {
		width: 100% !important;
		justify-content: center !important;
	}
}

/* Széles nézet (1301+): cover háttér – ha a WP inline stílus üres marad */
@media screen and (min-width: 1301px) {
	html:not(.g-dual-header-is-mobile) .header-change-max.has-background {
		background-color: #0e6627 !important;
		background-image: url("https://gazdalkodas.aki.gov.hu/wp-content/uploads/2026/05/Rajztabla-8-masolat0-scaled.png") !important;
		background-size: cover !important;
		background-repeat: no-repeat !important;
		background-position: center top !important;
	}
}

/* =========================================================
   MOBIL KERESŐ
   Alapállapotban csak a nagyító ikon látható
   ========================================================= */

.header-change-mobil .mobile-toolbar {
	position: relative;
	width: 100%;
}

/* A kereső alapállapotban csak ikon szélességű */
.header-change-mobil .search-box {
	margin: 0 !important;
	width: 44px;
	flex: 0 0 44px;
	z-index: 20;
}

/* Gutenberg belső kereső konténer */
.header-change-mobil .search-box .wp-block-search__inside-wrapper {
	display: flex;
	align-items: center;
	width: 44px;
	min-height: 44px;
	padding: 0;
	border: 0;
	background: transparent;
}

/* Input elrejtése alapállapotban */
.header-change-mobil .search-box:not(.is-open) .wp-block-search__input {
	width: 0 !important;
	min-width: 0 !important;
	flex: 0 0 0 !important;
	padding: 0 !important;
	margin: 0 !important;
	border: 0 !important;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

/* Nagyító gomb */
.header-change-mobil .search-box .wp-block-search__button {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	min-width: 44px;
	margin: 0;
	padding: 10px;
	border: 0;
	background: transparent;
	color: #fff;
	cursor: pointer;
}

/* SVG ikon */
.header-change-mobil .search-box .wp-block-search__button svg {
	width: 24px;
	height: 24px;
	fill: currentColor;
}


/* =========================================================
   NYITOTT ÁLLAPOT
   ========================================================= */

.header-change-mobil .search-box.is-open {
	position: absolute;
	left: 0;
	right: 0;
	top: 50%;
	transform: translateY(-50%);
	width: 100%;
	max-width: none;
	flex-basis: auto;
	z-index: 100;
	background: #0e6627;
}

/* Teljes szélességű kereső */
.header-change-mobil .search-box.is-open .wp-block-search__inside-wrapper {
	width: 100%;
	padding: 4px;
	background: #fff;
	border-radius: 4px;
}

/* Input megjelenítése */
.header-change-mobil .search-box.is-open .wp-block-search__input {
	display: block;
	width: 100% !important;
	min-width: 0;
	flex: 1 1 auto;
	opacity: 1;
	visibility: visible;
	pointer-events: auto;

	padding: 10px 12px !important;
	border: 0 !important;
	outline: 0;
	background: #fff;
	color: #222;
	font-size: 16px;
}

/* Keresés gomb nyitott állapotban */
.header-change-mobil .search-box.is-open .wp-block-search__button {
	background: #00943e;
	color: #fff;
	border-radius: 3px;
}

/* fókusz */
.header-change-mobil .search-box.is-open .wp-block-search__input:focus {
	outline: 2px solid #00943e;
	outline-offset: -2px;
}

@media (max-width: 1500px) {
	.nyelvi-menu--responsive {
		justify-content: flex-start !important;
	}
	#pll-switcher-1 { width: 30px; }
	#pll-switcher-1 .pll-switcher-flag { padding-top: 10px; width: 30px !important; height: 30px; }
}
#pll-switcher-3 { width: 30px; }
#pll-switcher-3 .pll-switcher-flag, #pll-switcher-2 .pll-switcher-flag { padding-top: 8px; width: 30px !important; height: 30px; }
