/*
 * Header on scroll — the soft transitions that go with assets/js/header-scroll.js.
 * Plain CSS (no build toolchain needed), loaded after site.css.
 *
 * Applies to the transparent-overlay header — every page without
 * `inverse_header` / `separate_header`. The white "not-on-top" state used to
 * swap `background`, the logo (display) and the icon colours instantly, and the
 * header jumped from `absolute` to `fixed`. Here every one of those changes
 * fades instead.
 */

body:not(.inverse_header):not(.separate_header) .site-header,
body:not(.inverse_header):not(.separate_header) .site-header.not-on-top {
	/* Fixed from the start, so going white is never also a position jump. */
	position: fixed;
	/* Keep the dark top gradient as the base in both states; the white layer
	   below fades in over it. */
	background: linear-gradient(180deg, color-mix(in srgb, var(--wp--preset--color--primary) 85%, transparent) 0%, color-mix(in srgb, var(--wp--preset--color--primary) 0%, transparent) 100%);
	background-color: color-mix(in srgb, var(--wp--preset--color--primary) 0%, transparent);
	transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
		box-shadow 0.35s ease-out,
		background-color 0.35s ease-out,
		backdrop-filter 0.35s ease-out;
}

/* Shown again in the middle of the hero: the photo/text under it would clash
   with the logo and icons, so it becomes dark frosted glass — the same
   material as the "Деца / Възрастни" panel in the hero. */
body:not(.inverse_header):not(.separate_header) .site-header.over-hero {
	background-color: color-mix(in srgb, var(--wp--preset--color--primary) 55%, transparent);
	-webkit-backdrop-filter: blur(16px) saturate(140%);
	backdrop-filter: blur(16px) saturate(140%);
}

/* The white surface, faded in and out instead of swapped. */
body:not(.inverse_header):not(.separate_header) .site-header::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: var(--wp--preset--color--white);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.35s ease-out;
}

body:not(.inverse_header):not(.separate_header) .site-header.not-on-top::before {
	opacity: 1;
}

body:not(.inverse_header):not(.separate_header) .site-header:not(.not-on-top) {
	box-shadow: none;
}

/* Light and dark logo stacked and cross-faded. */
body:not(.inverse_header):not(.separate_header) .site-header .main-logo .custom-logo-link,
body:not(.inverse_header):not(.separate_header) .site-header .main-logo .logo-dark {
	display: block !important;
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	transition: opacity 0.35s ease-out;
}

body:not(.inverse_header):not(.separate_header) .site-header .main-logo .logo-dark,
body:not(.inverse_header):not(.separate_header) .site-header.not-on-top .main-logo .custom-logo-link {
	opacity: 0;
	pointer-events: none;
}

body:not(.inverse_header):not(.separate_header) .site-header.not-on-top .main-logo .logo-dark {
	opacity: 1;
	pointer-events: auto;
}

/* Icons, divider, search and the menu button change colour gradually. */
.site-header .header-icons .icon-button {
	transition: opacity 0.2s ease-out, color 0.35s ease-out;
}

.site-header .header-icons .icon-divider,
.site-header .header-icons .search-box [for="search-btn"] {
	transition: color 0.35s ease-out;
}

.site-header .header-icons svg path {
	transition: fill 0.35s ease-out;
}

.site-header .header-icons .menu-button {
	transition: background-color 0.35s ease-out, opacity 0.2s ease-out;
}

@media (min-width: 1024px) {
	.site-header .header-icons .search-container .search-box [id="search-bar"] {
		transition: background-color 0.35s ease-out, border-color 0.35s ease-out, color 0.35s ease-out;
	}
}

@media (prefers-reduced-motion: reduce) {
	.site-header,
	.site-header::before,
	.site-header .main-logo a,
	.site-header .header-icons * {
		transition-duration: 0.01ms !important;
	}
}
