/**
 * Protomuseum: header logo scale, Polylang row, Elementor Theme Builder header fallbacks.
 */

/* --- Hello theme header: logo scale (dynamic + classic branding) --- */
.pm-proto-header .site-logo .custom-logo-link,
#site-header.pm-proto-header .site-logo .custom-logo-link,
.pm-proto-header .site-branding > .custom-logo-link {
	display: inline-block;
	max-width: min(200px, 40vw);
	line-height: 0;
}

.pm-proto-header .site-logo picture,
.pm-proto-header .site-branding > .custom-logo-link picture {
	display: block;
	line-height: 0;
}

.pm-proto-header .site-branding > .custom-logo-link img,
.pm-proto-header .site-logo img,
.pm-proto-header .site-logo picture img,
.pm-proto-header .custom-logo-link img,
#site-header.pm-proto-header .site-logo img,
#site-header.pm-proto-header .site-logo picture img,
#site-header.pm-proto-header .custom-logo-link img {
	display: block;
	max-height: 48px;
	width: auto !important;
	height: auto !important;
	object-fit: contain;
}

@media (min-width: 768px) {
	.pm-proto-header .site-logo .custom-logo-link,
	#site-header.pm-proto-header .site-logo .custom-logo-link,
	.pm-proto-header .site-branding > .custom-logo-link {
		max-width: min(200px, 40vw);
	}

	.pm-proto-header .site-branding > .custom-logo-link img,
	.pm-proto-header .site-logo img,
	.pm-proto-header .site-logo picture img,
	.pm-proto-header .custom-logo-link img,
	#site-header.pm-proto-header .site-logo img,
	#site-header.pm-proto-header .site-logo picture img,
	#site-header.pm-proto-header .custom-logo-link img {
		max-height: 48px;
	}
}

/* Site title text (when logo hidden): was 2.5rem in parent — too large */
.pm-proto-header .site-title {
	font-size: clamp(1.05rem, 2.2vw, 1.35rem) !important;
	font-weight: 400;
	line-height: 1.2;
}

.pm-proto-header .site-title a {
	text-decoration: none;
	color: inherit;
}

/* Flex: logo left, nav + lang + toggle flow to the right */
.pm-proto-header {
	padding-top: clamp(1.8rem, 4vw, 2.7rem);
	padding-bottom: clamp(1.8rem, 4vw, 2.7rem);
}

.pm-proto-header .header-inner.pm-proto-header__inner {
	align-items: center;
	gap: 0.35rem 1rem;
	flex-wrap: nowrap;
	position: relative;
}

/* Brand = logo (naslov) levo; mobilni jezik je sibling u .header-inner, desno uz meni */
.pm-proto-header .pm-proto-header__brand {
	flex: 0 1 auto;
	min-width: 0;
	display: flex;
	align-items: center;
	justify-content: flex-start;
	align-self: center;
}

.pm-proto-header .pm-proto-header__brand .site-branding {
	flex: 0 1 auto;
	min-width: 0;
	text-align: left;
}

.pm-proto-header .pm-proto-header__titles {
	flex: 1 1 auto;
	min-width: 0;
	text-align: center;
}

.pm-proto-header .pm-proto-header__title,
.pm-proto-header .pm-proto-header__subtitle {
	margin: 0;
	color: #22211f;
}

.pm-proto-header .pm-proto-header__title {
	font-family: "Roboto", system-ui, -apple-system, sans-serif;
	font-size: clamp(2rem, 4.5vw, 2.65rem);
	font-weight: 400;
	line-height: 1.08 !important;
	letter-spacing: -0.025em;
	margin: 0 auto 0.2em !important;
}

.pm-proto-header .pm-proto-header__subtitle {
	font-family: "Roboto", system-ui, -apple-system, sans-serif;
	font-size: clamp(1.125rem, 1.9vw, 1.3rem) !important;
	font-weight: 400 !important;
	font-style: normal;
	line-height: 1.4 !important;
	margin: 0 auto 0 !important;
	padding: 0 !important;
	color: #4d4c49 !important;
	letter-spacing: 0 !important;
	max-width: 38rem;
}

@media (min-width: 768px) {
	.pm-proto-header .pm-proto-header__titles {
		position: absolute;
		left: 0;
		right: 0;
		width: min(60vw, 760px);
		margin-left: auto;
		margin-right: auto;
		transform: translateX(-1px);
		pointer-events: none;
	}

	.pm-proto-header .pm-proto-header__brand {
		flex: 0 1 auto;
	}

	.pm-proto-header .pm-proto-header__brand .site-branding {
		text-align: inherit;
	}
}

/* Polylang: pill switcher (segmented control) */
.pm-proto-header .pm-lang-switcher {
	margin-left: auto;
	display: flex;
	align-items: center;
	flex-shrink: 0;
	align-self: center;
}

.pm-proto-header .pm-lang-switcher--pills {
	flex-shrink: 0;
}

.pm-proto-header .pm-lang-switcher--pills ul,
.pm-proto-header .pm-lang-switcher--pills .pm-lang-switcher__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: inline-flex;
	flex-direction: column;
	flex-wrap: nowrap;
	align-items: flex-end;
	gap: 0.4rem;
	row-gap: 0.4rem;
}

.pm-proto-header .pm-lang-switcher--pills li {
	margin: 0;
	padding: 0;
	width: auto;
	align-self: flex-end;
	list-style: none;
}

.pm-proto-header .pm-lang-switcher--pills a {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	font-family: "Roboto", system-ui, sans-serif;
	font-size: 0.8125rem;
	font-weight: 400;
	line-height: 1.2;
	color: #3a3937;
	background-color: rgba(90, 74, 54, 0.06);
	border: 1px solid rgba(90, 74, 54, 0.14);
	border-radius: 999px;
	padding: 0.35rem 0.85rem;
	text-decoration: none;
	transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.pm-proto-header .pm-lang-switcher--pills a:hover,
.pm-proto-header .pm-lang-switcher--pills a:focus-visible {
	background-color: rgba(90, 74, 54, 0.12);
	border-color: rgba(90, 74, 54, 0.32);
	color: #22211f;
}

.pm-proto-header .pm-lang-switcher--pills a:focus {
	outline: none;
}

.pm-proto-header .pm-lang-switcher--pills a:focus-visible {
	box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(90, 74, 54, 0.45);
}

.pm-proto-header .pm-lang-switcher--pills .current-lang > a,
.pm-proto-header .pm-lang-switcher--pills a[aria-current="true"] {
	background-color: #3a3937;
	border-color: #3a3937;
	color: #fff;
	cursor: default;
	pointer-events: none;
}

/*
 * Mobile: Hello "header-stacked" postavlja .header-inner na flex-direction: column
 * (logo / naslovi / jezik u DOM redosledu). Grid-template-areas zaobilazi to pouzdano.
 */
@media (max-width: 767px) {
	.pm-proto-header {
		padding-top: clamp(1.35rem, 3.2vw, 2rem);
		padding-bottom: clamp(0.8rem, 2.4vw, 1.15rem);
	}

	.site-header.pm-proto-header .header-inner.pm-proto-header__inner,
	header#site-header.pm-proto-header .header-inner.pm-proto-header__inner {
		display: grid;
		grid-template-columns: minmax(0, 1fr) auto;
		grid-template-areas:
			"pm-brand pm-lang"
			"pm-titles pm-titles"
			"pm-nav pm-nav";
		align-items: center;
		align-content: start;
		column-gap: 0.75rem;
		row-gap: 0.45rem;
		width: 100%;
		box-sizing: border-box;
		/* reset Hello stacked / inverted */
		flex-direction: unset;
		flex-wrap: unset;
		justify-content: unset;
		text-align: unset;
	}

	.site-header.pm-proto-header.header-stacked .header-inner.pm-proto-header__inner {
		flex-direction: unset;
	}

	.pm-proto-header .pm-proto-header__brand {
		grid-area: pm-brand;
		justify-self: start;
		min-width: 0;
		align-self: center;
	}

	.pm-proto-header .pm-lang-switcher {
		grid-area: pm-lang;
		margin-left: 0;
		justify-self: end;
		align-self: center;
	}

	.pm-proto-header .pm-proto-header__titles {
		grid-area: pm-titles;
		width: 100%;
		min-width: 0;
		text-align: center;
		max-width: none;
		margin-top: 15px;
		margin-bottom: 0;
		padding-bottom: 0;
	}

	.pm-proto-header .pm-proto-header__title {
		margin-bottom: 0.12em !important;
	}

	.pm-proto-header .site-navigation {
		grid-area: pm-nav;
		width: 100%;
		justify-self: center;
	}
}

/* Elementor header: Polylang widget kao pilule (vertikalno, uz desnu ivicu) */
.elementor-location-header .widget_polylang,
.elementor-location-header .elementor-widget-polylang {
	display: flex;
	justify-content: flex-end;
}

.elementor-location-header .widget_polylang ul,
.elementor-location-header .widget_polylang .pll-parent-menu-item ul,
.elementor-location-header .elementor-widget-polylang ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: inline-flex;
	flex-direction: column;
	flex-wrap: nowrap;
	align-items: flex-end;
	gap: 0.4rem;
	row-gap: 0.4rem;
}

.elementor-location-header .widget_polylang li,
.elementor-location-header .elementor-widget-polylang li {
	margin: 0;
	padding: 0;
	list-style: none;
	width: auto;
	align-self: flex-end;
}

.elementor-location-header .widget_polylang a,
.elementor-location-header .elementor-widget-polylang a {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	font-family: "Roboto", system-ui, sans-serif;
	font-size: 0.8125rem;
	font-weight: 400;
	line-height: 1.2;
	color: #3a3937;
	background-color: rgba(90, 74, 54, 0.06);
	border: 1px solid rgba(90, 74, 54, 0.14);
	border-radius: 999px;
	padding: 0.35rem 0.85rem;
	text-decoration: none;
	transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.elementor-location-header .widget_polylang a:hover,
.elementor-location-header .widget_polylang a:focus-visible,
.elementor-location-header .elementor-widget-polylang a:hover,
.elementor-location-header .elementor-widget-polylang a:focus-visible {
	background-color: rgba(90, 74, 54, 0.12);
	border-color: rgba(90, 74, 54, 0.32);
	color: #22211f;
}

.elementor-location-header .widget_polylang .current-lang > a,
.elementor-location-header .widget_polylang a[aria-current="true"],
.elementor-location-header .elementor-widget-polylang .current-lang > a,
.elementor-location-header .elementor-widget-polylang a[aria-current="true"] {
	background-color: #3a3937;
	border-color: #3a3937;
	color: #fff;
	cursor: default;
	pointer-events: none;
}

/* Non-dynamic header: isti padding kao prethodno — samo desktop (na mobile važi blok .pm-proto-header iznad) */
@media (min-width: 768px) {
	header#site-header.pm-proto-header:not(.dynamic-header) {
		padding-block: clamp(1.8rem, 4vw, 2.7rem);
	}

	header#site-header.pm-proto-header:not(.dynamic-header) .header-inner.pm-proto-header__inner {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		gap: 0.75rem 1rem;
		width: 100%;
	}

	header#site-header.pm-proto-header:not(.dynamic-header) .pm-lang-switcher--pills {
		margin-left: auto;
	}
}

/* --- Elementor Theme Builder header (when parent skips PHP header) --- */
.elementor-location-header .elementor-widget-theme-site-logo img,
.elementor-location-header .elementor-widget-image img {
	max-height: 48px !important;
	width: auto !important;
	height: auto !important;
	object-fit: contain;
}

.elementor-location-header .elementor-widget-theme-site-logo .elementor-image {
	display: inline-block;
	max-width: min(200px, 40vw);
}

@media (min-width: 768px) {
	.elementor-location-header .elementor-widget-theme-site-logo img,
	.elementor-location-header .elementor-widget-image img {
		max-height: 48px !important;
	}

	.elementor-location-header .elementor-widget-theme-site-logo .elementor-image {
		max-width: min(200px, 40vw);
	}
}
