/* wildtravel.ro - full-bleed hero + glass header over it.
 *
 * Mirrors the chettusia.com treatment, but wildtravel renders an ELEMENTOR header
 * template (#42651), not the wild-world theme's header.php - so the theme's own
 * transparent_header mod and its logo_transparent_image are both inert here and
 * every part of this has to be done in CSS, including the logo swap.
 *
 * Loaded from a mu-plugin, after the child theme, so the scrim override below wins
 * on cascade order without anyone editing wildworld-child/style.css.
 */

/* ---------- 1. the header floats over the hero ---------- */
.wildworld_page-wrapper { position: relative; }

.wildworld_page-wrapper > header.elementor-location-header {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	z-index: 99;
}

/* ---------- 2. the glass bar ---------- */
header.elementor-location-header > .e-con {
	background-color: transparent !important;
	position: relative;
}

header.elementor-location-header > .e-con::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 0;
	pointer-events: none;
	-webkit-backdrop-filter: blur(18px) saturate(140%);
	backdrop-filter: blur(18px) saturate(140%);
	background: linear-gradient(to bottom,
		rgba(8, 32, 40, 0.42) 0%,
		rgba(8, 32, 40, 0.26) 50%,
		rgba(8, 32, 40, 0) 100%);
	/* fades the glass out downward instead of ending on a hard edge */
	-webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 38%, rgba(0, 0, 0, 0.55) 70%, transparent 100%);
	mask-image: linear-gradient(to bottom, #000 0%, #000 38%, rgba(0, 0, 0, 0.55) 70%, transparent 100%);
}

/* 1px highlight along the very top */
header.elementor-location-header > .e-con::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: 0;
	height: 1px;
	z-index: 2;
	background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0));
	pointer-events: none;
}

header.elementor-location-header > .e-con > .e-con-inner { position: relative; z-index: 1; }

/* where backdrop-filter is unsupported, fall back to a flat tint so the bar stays readable */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
	header.elementor-location-header > .e-con::before {
		background: linear-gradient(to bottom, rgba(8, 32, 40, 0.72) 0%, rgba(8, 32, 40, 0.45) 100%);
	}
}

/* ---------- 3. make the bar's contents legible on a photo ---------- */
/* top-level menu items only; submenus keep their own panel styling */
header.elementor-location-header .elementor-nav-menu > li > a,
header.elementor-location-header .elementor-nav-menu > li > a:hover,
header.elementor-location-header .elementor-nav-menu > li > a:focus {
	color: #fff !important;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

header.elementor-location-header .elementor-nav-menu > li > a:hover { opacity: 0.82; }

/* the dark logo is unreadable on a photo - swap to the white variant the site already has */
header.elementor-location-header .elementor-widget-image img[src*="logo-125"] {
	content: url("/wp-content/uploads/2023/01/logo-alb-125.png");
}

/* ---------- 3b. the mobile menu ----------
 * The rule above targets `.elementor-nav-menu > li > a`, and Elementor's MOBILE dropdown
 * uses that exact structure too - so it was painting the dropdown's links white on the
 * dropdown's white panel. Rather than revert those links to dark, the panel becomes dark
 * glass to match the header, which keeps the white text and looks deliberate.
 */
header.elementor-location-header .elementor-nav-menu--dropdown,
header.elementor-location-header .elementor-nav-menu--dropdown ul {
	background-color: rgba(8, 32, 40, 0.94) !important;
	-webkit-backdrop-filter: blur(16px) saturate(140%);
	backdrop-filter: blur(16px) saturate(140%);
	border-top: 1px solid rgba(255, 255, 255, 0.16);
}

header.elementor-location-header .elementor-nav-menu--dropdown a {
	color: #fff !important;
	text-shadow: none !important;
	border-bottom: 1px solid rgba(255, 255, 255, 0.09);
	padding-top: 0.85em;
	padding-bottom: 0.85em;
}

header.elementor-location-header .elementor-nav-menu--dropdown li:last-child > a {
	border-bottom: 0;
}

header.elementor-location-header .elementor-nav-menu--dropdown a:hover,
header.elementor-location-header .elementor-nav-menu--dropdown a.elementor-item-active {
	background-color: rgba(255, 255, 255, 0.09) !important;
	color: #fff !important;
}

/* ---------- 3c. the hamburger ----------
 * Two separate problems: the icon is an SVG whose `fill` is a dark teal, so setting `color`
 * alone never reached it; and a bare icon on a photograph has nothing to sit against.
 * Fill it white and give it a glass pill, the same treatment chettusia uses for its buttons.
 */
/* ⚠ Do NOT set `display` here. Elementor hides this toggle with
 *     @media (min-width:1025px) .elementor-nav-menu--dropdown-tablet .elementor-menu-toggle { display:none }
 * and this selector is more specific, so an unscoped `display:flex` leaves the hamburger
 * showing on desktop next to the full nav. The flex centring is applied inside the matching
 * media query below instead, where Elementor is already showing the toggle.
 */
header.elementor-location-header .elementor-menu-toggle {
	color: #fff !important;
	background-color: rgba(8, 32, 40, 0.42) !important;
	-webkit-backdrop-filter: blur(10px) saturate(135%);
	backdrop-filter: blur(10px) saturate(135%);
	border: 1px solid rgba(255, 255, 255, 0.4);
	border-radius: 9px;
	width: 44px;
	height: 44px;
	align-items: center;
	justify-content: center;
	box-shadow: 0 2px 10px rgba(3, 21, 27, 0.28);
	transition: background-color 0.2s ease, border-color 0.2s ease;
}

/* matches Elementor's own breakpoint for this menu (dropdown-tablet => hidden at 1025px up) */
@media (max-width: 1024px) {
	header.elementor-location-header .elementor-menu-toggle {
		display: flex;
	}
}

/* the icon itself is drawn with fill, not currentColor */
header.elementor-location-header .elementor-menu-toggle svg,
header.elementor-location-header .elementor-menu-toggle i,
header.elementor-location-header .elementor-menu-toggle i::before {
	fill: #fff !important;
	color: #fff !important;
}

header.elementor-location-header .elementor-menu-toggle:hover,
header.elementor-location-header .elementor-menu-toggle:focus-visible,
header.elementor-location-header .elementor-menu-toggle.elementor-active {
	background-color: rgba(8, 32, 40, 0.68) !important;
	border-color: rgba(255, 255, 255, 0.62);
	outline: none;
}

/* ---------- 4. the hero, full bleed and at the very top ----------
 * theme.css:2551 caps it at max-width:1280px with margin:auto and pushes it down
 * with top:70px - all three have to be beaten.
 */
.wildworld_page_title_container {
	max-width: none !important;
	width: 100% !important;
	margin: 0 !important;
	top: 0 !important;
}

/* ---------- 5. the title sits low in the hero ---------- */
.wildworld_page_title_container > .container {
	align-items: flex-end !important;
	/* clears the floating header at the top, and lifts the title off the bottom edge */
	padding-top: 7.5rem;
	padding-bottom: 3.25rem;
}

/* ---------- 6. scrim, re-weighted for the lowered title ----------
 * The child theme adds a top-weighted scrim (faded out by 75%) for a title that used
 * to sit 30px from the top. With the title moved to the bottom it would sit in the
 * clear part, so this redefines the gradient: dark at the top for the glass bar to
 * sit on, dark again at the bottom for the title, and largely clear through the middle
 * so the photograph still reads.
 */
.wildworld_page_title_container::before {
	background: linear-gradient(to bottom,
		rgba(0, 0, 0, 0.48) 0%,
		rgba(0, 0, 0, 0.16) 26%,
		rgba(0, 0, 0, 0.10) 52%,
		rgba(0, 0, 0, 0.38) 80%,
		rgba(0, 0, 0, 0.66) 100%) !important;
}

/* ---------- 7. pages with no hero still need room for the floating header ----------
 * Elementor-built pages are exempt: they lay out their own full-bleed opening section
 * (the front page does exactly this), and padding there would push it down or leave a
 * band of body colour above it. Only plain theme pages with no page-title hero get the
 * spacer, since their content would otherwise start underneath the floating bar.
 */
body:not(.elementor-page):not(:has(.wildworld_page_title_container)) .wildworld_page-wrapper {
	padding-top: 78px;
}

/* ---------- 7b. footer ---------- */

/* The scroll-back-to-top button is hardcoded in wild-world/footer.php (no theme option for
 * it), so it is hidden here rather than by editing the parent theme, which a theme update
 * would overwrite. Its scroll listener still runs but has nothing to show. */
button.back-to-top {
	display: none !important;
}

/* Swap the footer row: copyright to the left, social icons to the right.
 * The two ids are Elementor's generated element ids for the icon column (6b090b6) and the
 * copyright column (3b063a6); Elementor keeps these across saves. Done with `order` rather
 * than row-reverse so it behaves predictably if the row wraps, and scoped to widths where
 * the two actually sit side by side - below that they stack and the icons stay first.
 */
@media (min-width: 768px) {
	footer.elementor-location-footer .elementor-element-6b090b6 { order: 2; }
	footer.elementor-location-footer .elementor-element-3b063a6 { order: 1; }
}

/* ---------- 8. narrow screens ---------- */
@media (max-width: 767px) {
	.wildworld_page_title_container > .container {
		padding-top: 6rem;
		padding-bottom: 2rem;
	}
	header.elementor-location-header > .e-con::before {
		-webkit-backdrop-filter: blur(10px) saturate(130%);
		backdrop-filter: blur(10px) saturate(130%);
	}
}
