/* Adam Milo – Video Banner Block
 * Matches Figma "plan pages – global / Risk" (desktop 1920) and "Risk – mobile". */

.amvb-banner {
	--amvb-bg: #000316;
	--amvb-media-opacity: .66;
	position: relative;
	overflow: hidden;
	display: flex;
	align-items: flex-start;
	/* Design (Figma "Section"): 850px tall at 1920px wide = 44.27vw.
	   Scales with screen width; between 650px and 900px. Override per banner. */
	min-height: var(--amvb-min-h, clamp(650px, 44.27vw, 900px));
	padding-top: 200px;
	padding-bottom: 100px;
	background-color: var(--amvb-bg);
	/* Keep the banner's internal layers (gradient z1, text z2, button z3)
	   inside the banner, so blocks that overlap it from below
	   (e.g. banner_floating_caption, top:-100px) are drawn on top. */
	isolation: isolate;
}

/* ---------- Media layer (image / video) ---------- */
.amvb-banner .amvb-media {
	position: absolute;
	inset: 0;
	z-index: 0;
}
.amvb-banner .amvb-bg {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	display: block;
	opacity: var(--amvb-media-opacity);
}
.amvb-banner .amvb-bg img,
.amvb-banner video.amvb-bg {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: var(--amvb-focus, center center);
}
/* Video stays invisible (image shows) until it actually plays, then fades in */
.amvb-banner video.amvb-bg {
	opacity: 0;
	transition: opacity .8s ease;
}
.amvb-banner.amvb-video-ready video.amvb-bg {
	opacity: var(--amvb-media-opacity);
}
/* Once the video is playing, the background image fades out */
.amvb-banner .amvb-bg-image {
	transition: opacity .8s ease;
}
.amvb-banner.amvb-video-ready .amvb-bg-image {
	opacity: 0;
}
.amvb-banner .amvb-video-toggle {
	visibility: hidden;
}
.amvb-banner.amvb-video-ready .amvb-video-toggle {
	visibility: visible;
}
.amvb-banner.amvb-video-skipped video.amvb-bg {
	display: none;
}

.amvb-banner .amvb-fade {
	position: absolute;
	inset: 0;
	pointer-events: none;
}

/* ===== Values below are read from Figma (file "Global+israel sites",
   frame "Risk" > Section 2788:3551, 1920x850) via the Figma API. ===== */

/* Figma: nothing dark sits UNDER the video – it is the page's light gray
   (#F9F9F9) seen through the 66% video. The navy comes only from the
   radial gradient layer ON TOP of it. */
.amvb-banner .amvb-media {
	background-color: var(--amvb-media-underlay, #F9F9F9);
}

/* "Right side" placement = Figma video crop: videoTransform
   [[1.339, 0, -0.479], [0, 1, 0]] → the video box starts at 35.78% of the
   banner width, is 74.68% wide (its right ~10% is cut off) and full height. */
.amvb-banner.amvb-fit-right .amvb-media {
	inset: 0 auto 0 35.78%;
	width: 74.68%;
	height: 100%;
	max-width: none;
}

/* Figma radial gradient fill over the whole Section:
   center (78.8%, 60.5%), radii = 78.85% of width / 220.5% of height,
   stops #000316 @0% a0 -> @28.6% a0.64 -> @57.2% a1. */
.amvb-banner.amvb-edge-fade::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
	background: radial-gradient(
		78.85% 220.5% at 78.8% 60.5%,
		color-mix(in srgb, var(--amvb-bg) 0%, transparent) 0%,
		color-mix(in srgb, var(--amvb-bg) 64%, transparent) 28.6%,
		var(--amvb-bg) 57.2%
	);
}
/* With the gradient off, the media keeps no light underlay */
.amvb-banner:not(.amvb-edge-fade) .amvb-media {
	background-color: transparent;
}

/* ---------- Content (left aligned) ---------- */
.amvb-banner .container {
	position: relative;
	z-index: 2;
}
.amvb-banner .amvb-content {
	text-align: left;
	max-width: 744px;
	margin-right: auto;
	display: flex;
	flex-direction: column;
	gap: 16px;
}
.amvb-banner .amvb-content > * {
	margin: 0;
}

.amvb-banner .amvb-eyebrow {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	color: var(--amvb-eyebrow-color, #fff);
	font-size: 18px;
	font-weight: 400;
	line-height: 24px;
}
.amvb-banner .amvb-eyebrow-sep,
.amvb-banner .amvb-eyebrow-secondary {
	opacity: .5;
}

.amvb-banner .amvb-title {
	color: var(--amvb-title-color, #fff);
	font-size: 40px;
	font-weight: 700;
	line-height: 1.5; /* Figma: Poppins Bold 40, line-height normal (3 lines = 180px) */
}
.amvb-banner .amvb-title .amvb-hl,
.amvb-banner .amvb-title span:not([style]) {
	color: var(--amvb-title-hl-color, #E96835);
}

.amvb-banner .amvb-sub-title,
.amvb-banner .amvb-sub-title p {
	color: var(--amvb-sub-title-color, #fff);
	font-size: 18px;
	font-weight: 500;
	line-height: 28px;
}
.amvb-banner .amvb-sub-title p:last-child {
	margin-bottom: 0;
}

.amvb-banner .amvb-buttons {
	justify-content: flex-start;
	gap: 20px;
	margin-top: 16px; /* Figma: 32px between text group and button (16 gap + 16) */
}
.amvb-banner .banner-button-wrap {
	display: flex;
	justify-content: flex-start;
	margin: 0;
	padding: 0;
}

/* ---------- Pause / play (accessibility) ---------- */
.amvb-banner .amvb-video-toggle {
	position: absolute;
	right: 20px;
	bottom: 20px;
	z-index: 3;
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, .45);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
}
.amvb-banner .amvb-video-toggle:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}
.amvb-banner .amvb-icon-pause {
	width: 12px;
	height: 14px;
	border-left: 4px solid #fff;
	border-right: 4px solid #fff;
	box-sizing: border-box;
}
.amvb-banner .amvb-icon-play {
	display: none;
	width: 0;
	height: 0;
	margin-left: 3px;
	border-style: solid;
	border-width: 7px 0 7px 12px;
	border-color: transparent transparent transparent #fff;
}
.amvb-banner.amvb-paused .amvb-icon-pause { display: none; }
.amvb-banner.amvb-paused .amvb-icon-play  { display: block; }

/* ---------- Light header while it sits on the banner ---------- */
@media (min-width: 1200px) {
	/* top-level menu items only – dropdown panels keep their normal colors */
	body:has(.amvb-light-header) #Header:not(.sticky) .navbar-nav a.nav-link:not(.dropdown-menu a),
	body:has(.amvb-light-header) #Header:not(.sticky) .navbar-nav a.nav-link:not(.dropdown-menu a) .title_menu,
	body:has(.amvb-light-header) #Header:not(.sticky) .LogIn {
		color: #fff;
	}
	body:has(.amvb-light-header) #Header:not(.sticky) .navbar-nav a.nav-link:not(.dropdown-menu a) .dorpdownArrow {
		filter: brightness(0) invert(1);
	}
	/* Theme draws a #fcfcfc underline under each item (invisible on white,
	   visible on dark). Hide it; keep the theme's red hover underline. */
	body:has(.amvb-light-header) #Header:not(.sticky) .menu_in ul.navbar-nav li.nav-item:not(.dropdown-menu li) {
		border-bottom-color: transparent;
	}
	body:has(.amvb-light-header) #Header:not(.sticky) .menu_in ul.navbar-nav li.nav-item:not(.dropdown-menu li):hover {
		border-bottom-color: var(--color-red);
	}
}
@media (max-width: 1199px) {
	body:has(.amvb-light-header) #Header:not(.sticky) .menu_in nav > button.navbar-toggler {
		filter: brightness(0) invert(1);
	}
}
/* Figma: header bar has its own layer – black at 21%, over the video */
body:has(.amvb-light-header) #Header:not(.sticky) {
	background-color: rgba(0, 0, 0, .21);
}
body:has(.amvb-light-header) .breadcrumbs-container .breadcrumbs,
body:has(.amvb-light-header) .breadcrumbs-container .breadcrumbs a,
body:has(.amvb-light-header) .breadcrumbs-container .breadcrumbs span,
body:has(.amvb-light-header) .breadcrumbs-container .breadcrumbs li:last-child a {
	color: #fff !important; /* theme forces the last crumb dark with !important */
}

/* Breadcrumb row floats over the banner instead of pushing it down,
   so the banner starts under the transparent header (as in the design). */
body:has(.amvb-banner) #pageContent {
	position: relative;
}
body:has(.amvb-banner) #pageContent > .breadcrumbs-container {
	position: absolute !important; /* theme uses .position-relative (!important) */
	top: 0;
	left: 0;
	right: 0;
	margin-left: auto;
	margin-right: auto;
	z-index: 5;
}

/* When the theme's "Banner floating caption" comes right after the banner,
   its box is pulled 100px up into the banner (theme: .captionBox top:-100px).
   On screens where the banner's height comes from its text (about 1536px and
   narrower) that overlap swallowed the space under the button. Keep room for
   the overlap + a 100px gap. (A hidden marker/style of the caption settings
   may sit between the two elements.) */
@media (min-width: 991px) {
	.amvb-banner:has(+ .banner_floating_caption),
	.amvb-banner:has(+ .amfc-cfg),
	.amvb-banner:has(+ style + .amfc-cfg) {
		padding-bottom: 232px;
	}
}

/* ---------- Tablet / mobile ---------- */
@media (max-width: 990px) {
	.amvb-banner {
		flex-direction: column;
		min-height: 0;
		padding-top: 150px; /* header + breadcrumb row */
		padding-bottom: 0;
	}
	/* Media becomes a strip below the text */
	.amvb-banner .container {
		order: 1;
	}
	/* Figma "Risk - mobile": text, then a 300px video strip directly
	   below it, on the dark container color (no light underlay). */
	.amvb-banner .amvb-media,
	.amvb-banner.amvb-fit-right .amvb-media {
		order: 2;
		position: relative;
		inset: auto;
		width: 100%;
		max-width: none;
		height: 300px;
		margin-top: 32px;
		overflow: hidden;
		background-color: transparent;
	}
	/* Mobile: the video/image fills the whole width of the strip (no gap on the
	   left). Same framing as the Figma crop – the video's left edge at the
	   screen edge, cropped on the right. */
	.amvb-banner.amvb-fit-right .amvb-bg {
		left: 0;
		right: 0;
		width: 100%;
	}
	.amvb-banner.amvb-fit-right .amvb-bg img,
	.amvb-banner.amvb-fit-right video.amvb-bg {
		object-position: left center;
	}
	/* on mobile the banner-wide layer is replaced by one on the video strip */
	.amvb-banner.amvb-edge-fade::before {
		display: none;
	}
	/* Figma mobile gradient: center (72%, 56%), radii 105% x 58%, #000316 a0 -> a1 */
	/* The top edge of the strip is fully the banner color (plus 2px above it),
	   so no thin line of the image shows through there on phones
	   (sub-pixel rounding between the image and this layer). */
	.amvb-banner.amvb-edge-fade .amvb-fade {
		top: -2px;
		background:
			linear-gradient(to bottom,
				var(--amvb-bg) 0,
				var(--amvb-bg) 4px,
				color-mix(in srgb, var(--amvb-bg) 0%, transparent) 24px),
			radial-gradient(
				105% 58% at 72% 56%,
				color-mix(in srgb, var(--amvb-bg) 0%, transparent) 0%,
				var(--amvb-bg) 100%
			);
	}
	.amvb-banner .amvb-title {
		font-size: 36px;
	}
	.amvb-banner.amvb-video-desktop-only video.amvb-bg,
	.amvb-banner.amvb-video-desktop-only .amvb-video-toggle {
		display: none;
	}
}

@media (max-width: 580px) {
	.amvb-banner .amvb-buttons {
		gap: 0;
	}
	.amvb-banner .banner-button-wrap + .banner-button-wrap {
		margin-top: 15px !important;
	}
}
