/* USA site integration. Component styles live in firmalar.css.
   Only pages marked by the plugin are affected; dropdown colours stay with Elementor. */
body.isib-usa-site {
	--isib-header-ink: #111a28;
	--isib-header-navy: #063560;
	--isib-header-offset: 0px;
}
body.isib-usa-site.admin-bar { --isib-header-offset: 32px; }

/* Full-width page sections, without changing the header, footer or other pages. */
body.isib-usa-site :is(.elementor[data-elementor-type="wp-page"], .elementor[data-elementor-type="wp-post"]) .elementor-container { max-width: 100%; }
body.isib-usa-site .elementor-widget-shortcode,
body.isib-usa-site .elementor-shortcode { width: 100%; }

body.isib-usa-site .elementor-location-header {
	position: sticky;
	top: var(--isib-header-offset);
	z-index: 999;
	background: #fff;
	box-shadow: 0 2px 18px rgba(10, 51, 96, .08);
}
/* Neutralise only the header row's background, not every Elementor container. */
body.isib-usa-site .elementor-location-header > .e-con:first-of-type {
	background-color: transparent;
	background-image: none;
}
body.isib-usa-site.home .elementor-location-header {
	position: fixed;
	left: 0;
	right: 0;
	background: transparent;
	box-shadow: none;
	transition: background-color .25s ease, box-shadow .25s ease;
}
body.isib-usa-site.home .elementor-location-header.isib-head-solid {
	background: rgba(6, 53, 96, .98);
	box-shadow: 0 6px 24px rgba(0, 0, 0, .18);
}
/* White links belong to the main menu over the banner, never its dropdown. */
body.isib-usa-site.home .elementor-location-header .elementor-nav-menu--main a.elementor-item,
body.isib-usa-site.home .elementor-location-header .elementor-nav-menu--main a.elementor-item:is(:visited, :hover, :focus, .elementor-item-active) { color: #fff; }
body.isib-usa-site .elementor-location-header .elementor-nav-menu--dropdown a.elementor-item,
body.isib-usa-site .elementor-location-header .elementor-nav-menu--dropdown a.elementor-item:visited { color: var(--isib-header-ink); }
body.isib-usa-site.home .elementor-location-header .elementor-widget-nav-menu .elementor-menu-toggle { color: #fff; }
body.isib-usa-site.home .elementor-location-header .elementor-widget-nav-menu .elementor-menu-toggle svg { fill: currentColor; }

/* Inner pages use the coloured logo. Its accessible image/link remain present. */
body.isib-usa-site:not(.home) .elementor-location-header .elementor-widget-theme-site-logo img { opacity: 0; }
body.isib-usa-site:not(.home) .elementor-location-header .elementor-widget-theme-site-logo a {
	display: inline-block;
	background: url('isib-logo.png') left center / contain no-repeat;
}

@media (max-width: 1024px) {
	/* Keep the banner text below the header on phones and tablets. */
	body.isib-usa-site.home .elementor-location-header {
		position: sticky;
		background: var(--isib-header-navy);
	}
	/* Remove the old 90px spacer used to compensate for the fixed mobile header. */
	body.isib-usa-site.home .elementor[data-elementor-type="wp-page"] > .elementor-section:first-of-type { margin-top: 0; }
	body.isib-usa-site .elementor-location-header > .e-con:first-of-type {
		--min-height: 76px;
		--flex-wrap: nowrap;
		--flex-wrap-mobile: nowrap;
		--align-items: center;
		--gap: 8px;
		--padding-top: 0px;
		--padding-bottom: 0px;
		--padding-left: 16px;
		--padding-right: 16px;
	}
	body.isib-usa-site .elementor-location-header > .e-con:first-of-type > .e-con {
		--width: auto;
		min-width: 0;
		flex: 1 1 0;
	}
	body.isib-usa-site .elementor-location-header > .e-con:first-of-type > .e-con:has(> .elementor-widget-button) { flex: 0 0 auto; }
	/* The separate HTML container only loads Calendly, and needs no visual space. */
	body.isib-usa-site .elementor-location-header > .e-con:has(.elementor-widget-html):not(:has(.elementor-widget-theme-site-logo, .elementor-widget-nav-menu, .elementor-widget-button)) { display: none; }
	/* Elementor hides the existing home contact section on both smaller devices. */
	body.isib-usa-site.home .elementor-section:has(.isib-contact) { display: block !important; }
}
@media (max-width: 782px) {
	body.isib-usa-site.admin-bar { --isib-header-offset: 46px; }
}
@media (max-width: 767px) {
	body.isib-usa-site .elementor-location-header > .e-con:first-of-type > .e-con:has(> .elementor-widget-nav-menu) {
		flex: 0 0 44px;
		order: 3;
	}
	body.isib-usa-site .elementor-location-header > .e-con:first-of-type > .e-con:has(> .elementor-widget-button) { order: 2; }
	body.isib-usa-site .elementor-location-header .elementor-widget-theme-site-logo img {
		width: 100%;
		max-width: 140px;
		height: auto;
		max-height: 30px;
	}
	body.isib-usa-site .elementor-location-header #meetingButton .elementor-button {
		font-size: 12px;
		padding: 14px 12px;
		white-space: nowrap;
	}
	body.isib-usa-site .elementor-location-header .elementor-widget-nav-menu .elementor-menu-toggle {
		width: 44px;
		min-height: 44px;
		justify-content: center;
	}
}
@media (max-width: 600px) {
	/* WordPress's small-screen admin bar scrolls away instead of staying fixed. */
	body.isib-usa-site.admin-bar { --isib-header-offset: 0px; }
}
@media (prefers-reduced-motion: reduce) {
	body.isib-usa-site.home .elementor-location-header { transition: none; }
}
