/* * NDR Insurance Companies frontend styles (mobile-first, self-contained).
 *
 * Breakpoint QA Notes:
 * - <=360px: logo grid collapses to 1 column (no overflow, no gaps).
 * - <=480px: default mobile layout (stacked, centered) with 2-column logo grid.
 * - >=600px: logo grid becomes 3 columns; spacing increases smoothly.
 * - >=768px: two-column layout (left + right) with left aligned; no staggering.
 * - >=1024px: larger typography/spacing; still no staggering.
 * - >=1100px: desktop enhancement: safe staggering + motion drift allowed (no horizontal scroll).
 */

.ndr-insurance-band {
	/* * Palette (from NDR Color Guide). */
	--ndr-ic-blue: #002868;
	--ndr-ic-blue-hover: #001F4D;
	--ndr-ic-blue-active: #001530;

	--ndr-ic-red: #DC143C;
	--ndr-ic-red-hover: #B01030;
	--ndr-ic-red-active: #8B0D25;

	--ndr-ic-gold: #FFB81C;
	--ndr-ic-gold-hover: #CC8F00;

	--ndr-ic-text: #1A1A1A;
	--ndr-ic-white: #FFFFFF;
	--ndr-ic-muted: #6B7280;
	--ndr-ic-muted-strong: #5A6472;

	--ndr-ic-surface: #FFFFFF;
	--ndr-ic-surface-muted: #F3F4F6;
	--ndr-ic-border: #E5E7EB;

	/* * Focus rings (from NDR Color Guide). */
	--ndr-ic-focus-light: rgba(0, 40, 104, 0.75);
	--ndr-ic-focus-dark: rgba(255, 184, 28, 0.95);

	/* * Fluid sizing controls */
	--ndr-logo-w: clamp(112px, 28vw, 172px);
	--ndr-card-h: clamp(56px, 12vw, 90px);
	--ndr-gap: clamp(12px, 3vw, 22px);
	--ndr-row-gap: clamp(16px, 4vw, 40px);
	--ndr-stagger: 0px;
	--ndr-ease-premium: cubic-bezier(0.2, 0.8, 0.2, 1);
	--ndr-reveal-slide: 16px;
	--ndr-motion-dur: 320ms;

	/* * Animation controls (safe defaults; JS adjusts progress vars only). */
	--ndr-ic-aurora: 0;
	--ndr-ic-sweep: 0.5;
	--ndr-ic-aurora-opacity: 0.75;

	--ndr-ic-spotlight: 0;
	--ndr-ic-spot-x: 50%;
	--ndr-ic-spot-y: 50%;

	/* * Layout */
	/* * Slightly wider overall section on large screens. */
	padding-inline: clamp(16px, 4vw, 5%);
	padding-top: clamp(40px, 6vw, 96px);
	padding-bottom: clamp(64px, 8vw, 150px);
	background: var(--ndr-ic-white);
	color: var(--ndr-ic-text);

	/* * Prevent horizontal scroll without affecting focus rings (CTA uses box-shadow). */
	overflow-x: clip;
}

/* * Elementor shortcode widget: treat band like a full-width section. */
.elementor .elementor-widget-shortcode .elementor-shortcode > .ndr-insurance-band {
	width: 85vw;
	max-width: 85vw;
	margin-left: calc(50% - 42.5vw);
	margin-right: calc(50% - 42.5vw);
	box-sizing: border-box;
}

.ndr-insurance-band__inner {
	max-width: 1734px;
	margin: 0 auto;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: clamp(28px, 6.5vw, 54px);
}

.ndr-insurance-band__left {
	width: 100%;
	text-align: center;
}

.ndr-insurance-band__left h2 {
	margin: 0 0 clamp(12px, 3.5vw, 20px);
	font-size: clamp(26px, 6.8vw, 42px);
	line-height: 1.12;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	text-wrap: balance;
	color: var(--ndr-ic-text);
}

.ndr-insurance-band__left h2 strong {
	display: block;
	letter-spacing: 0.04em;
}

.ndr-insurance-band__left p {
	margin: clamp(12px, 3.2vw, 18px) auto 0;
	max-width: 52ch;
	font-size: clamp(14px, 3.6vw, 16px);
	line-height: 1.55;
	color: var(--ndr-ic-muted);
}

.ndr-insurance-band__right {
	width: 100%;
	min-width: 0;
}

/* * Premium lighting overlays (mode-specific). */
.ndr-insurance-band__right {
	position: relative;
	isolation: isolate;
}

.ndr-logo-rows {
	position: relative;
	z-index: 1;
}

.ndr-insurance-band__right::before {
	content: "";
	position: absolute;
	inset: -22%;
	z-index: 0;
	pointer-events: none;
	opacity: 0;
	transition: opacity 260ms var(--ndr-ease-premium);
}

.ndr-insurance-band.ndr-ic-anim--aurora .ndr-insurance-band__right::before {
	/* * Soft diagonal light sweep */
	background:
		linear-gradient(
			115deg,
			rgba(255, 255, 255, 0) 0%,
			rgba(255, 184, 28, 0.18) 34%,
			rgba(0, 40, 104, 0.12) 54%,
			rgba(255, 255, 255, 0) 74%
		);
	filter: blur(14px);
	transform: translate3d(calc((var(--ndr-ic-sweep, 0.5) - 0.5) * 60%), 0, 0);
	opacity: calc(var(--ndr-ic-aurora, 0) * var(--ndr-ic-aurora-opacity, 0.75));
}

.ndr-insurance-band[data-animation="aurora"] .ndr-insurance-band__right::before {
	/* * Matches aurora class behavior for preview/SSR. */
	background:
		linear-gradient(
			115deg,
			rgba(255, 255, 255, 0) 0%,
			rgba(255, 184, 28, 0.18) 34%,
			rgba(0, 40, 104, 0.12) 54%,
			rgba(255, 255, 255, 0) 74%
		);
	filter: blur(14px);
	transform: translate3d(calc((var(--ndr-ic-sweep, 0.5) - 0.5) * 60%), 0, 0);
	opacity: calc(var(--ndr-ic-aurora, 0) * var(--ndr-ic-aurora-opacity, 0.75));
}

.ndr-insurance-band.ndr-ic-anim--spotlight .ndr-insurance-band__right::before {
	/* * Gentle spotlight that moves through the grid */
	background:
		radial-gradient(
			circle at var(--ndr-ic-spot-x, 50%) var(--ndr-ic-spot-y, 50%),
			rgba(255, 184, 28, 0.24) 0%,
			rgba(255, 184, 28, 0.12) 18%,
			rgba(255, 255, 255, 0) 58%
		);
	filter: blur(10px);
	opacity: var(--ndr-ic-spotlight, 0);
}

.ndr-insurance-band[data-animation="spotlight"] .ndr-insurance-band__right::before {
	background:
		radial-gradient(
			circle at var(--ndr-ic-spot-x, 50%) var(--ndr-ic-spot-y, 50%),
			rgba(255, 184, 28, 0.24) 0%,
			rgba(255, 184, 28, 0.12) 18%,
			rgba(255, 255, 255, 0) 58%
		);
	filter: blur(10px);
	opacity: var(--ndr-ic-spotlight, 0);
}

/* * Logo grid (mobile-first) */
.ndr-logo-rows {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--ndr-gap);
	row-gap: var(--ndr-row-gap);
	align-items: stretch;
	grid-auto-rows: minmax(var(--ndr-card-h), auto);
}

.ndr-logo-card {
	--ndr-x: 0px;
	--ndr-y: 0px;
	--ndr-rot: 0deg;
	--ndr-scale: 1;
	--ndr-flip-x: 0px;
	--ndr-flip-y: 0px;
	--ndr-spot: 1;
	--ndr-hover-y: 0px;
	--ndr-stagger-x: 0px;

	background: rgba(255, 255, 255, 0.72);
	color: var(--ndr-ic-text);
	border: 1px solid rgba(0, 0, 0, 0.06);
	border-radius: 16px;
	box-shadow:
		0 1px 0 rgba(255, 255, 255, 0.7) inset;

	min-height: var(--ndr-card-h);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 10px 12px;
	text-align: center;

	transform:
		translate3d(
			calc(var(--ndr-stagger-x) + var(--ndr-x) + var(--ndr-flip-x)),
			calc(var(--ndr-hover-y) + var(--ndr-y) + var(--ndr-flip-y)),
			0
		)
		rotate(var(--ndr-rot))
		scale(var(--ndr-scale));
	transition:
		transform var(--ndr-motion-dur, 320ms) var(--ndr-ease-premium),
		box-shadow 320ms var(--ndr-ease-premium),
		background-color 320ms var(--ndr-ease-premium),
		border-color 320ms var(--ndr-ease-premium),
		opacity 320ms var(--ndr-ease-premium);
}

/* * Spotlight mode uses per-card focus value to subtly stage depth. */
.ndr-insurance-band.ndr-ic-anim--spotlight .ndr-logo-card {
	opacity: calc(0.60 + (var(--ndr-spot, 1) * 0.40));
}

.ndr-insurance-band[data-animation="spotlight"] .ndr-logo-card {
	opacity: calc(0.60 + (var(--ndr-spot, 1) * 0.40));
}

.ndr-logo-card:hover {
	--ndr-hover-y: -6px;
	background: rgba(255, 255, 255, 0.92);
	border-color: rgba(0, 0, 0, 0.10);
	box-shadow:
		0 12px 28px rgba(0, 40, 104, 0.12),
		0 2px 8px rgba(0, 40, 104, 0.08);
}

.ndr-logo-card:focus-within {
	border-color: rgba(0, 40, 104, 0.22);
	box-shadow:
		0 0 0 3px rgba(0, 40, 104, 0.16),
		0 12px 28px rgba(0, 40, 104, 0.10);
}

/* * Row scroll translation uses --ndr-x (set by JS on desktop only). */
.ndr-logo-card {
	will-change: transform;
}

/* * Reveal mode (rows fade/slide in). Only active when JS marks the section as initialized. */
.ndr-insurance-band.ndr-ic-js[data-animation="reveal"] .ndr-logo-card,
.ndr-insurance-band.ndr-ic-js.ndr-ic-anim--reveal .ndr-logo-card {
	opacity: 0;
	--ndr-scale: 0.985;
	transform:
		translate3d(
			calc(var(--ndr-stagger-x) + var(--ndr-x)),
			calc(var(--ndr-hover-y) + var(--ndr-y) + var(--ndr-reveal-slide, 16px)),
			0
		)
		rotate(var(--ndr-rot))
		scale(var(--ndr-scale));
	transition:
		transform 420ms ease,
		opacity 420ms ease;
	transition-delay: var(--ndr-delay, 0ms);
}

.ndr-insurance-band.ndr-ic-js[data-animation="reveal"] .ndr-logo-card.ndr-ic-visible,
.ndr-insurance-band.ndr-ic-js.ndr-ic-anim--reveal .ndr-logo-card.ndr-ic-visible {
	opacity: 1;
	--ndr-scale: 1;
	transform:
		translate3d(
			calc(var(--ndr-stagger-x) + var(--ndr-x)),
			calc(var(--ndr-hover-y) + var(--ndr-y)),
			0
		)
		rotate(var(--ndr-rot))
		scale(var(--ndr-scale));
}

/* * Linked logos */
.ndr-logo-link {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	text-decoration: none;
	color: inherit;
	border-radius: 10px; /* * Keeps focus ring readable without clipping. */
}

.ndr-logo-link:focus,
.ndr-logo-link:focus-visible {
	outline: none;
	box-shadow: 0 0 0 4px var(--ndr-ic-focus-light);
}

.ndr-logo-card span {
	font-size: clamp(13px, 3.4vw, 14px);
	line-height: 1.3;
	color: var(--ndr-ic-muted-strong);
}

.ndr-logo-card img {
	display: block;
	max-width: min(100%, var(--ndr-logo-w));
	height: auto;
	object-fit: contain;
	filter: saturate(1.02) contrast(1.02);
	transition: filter 260ms var(--ndr-ease-premium);
}

.ndr-logo-card:hover img {
	filter: saturate(1.06) contrast(1.05);
}

/* * CTA button */
.ndr-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 44px; /* * Touch target */
	padding: clamp(12px, 3.4vw, 14px) clamp(16px, 4.2vw, 20px);
	border-radius: 14px;
	border: 1px solid transparent;
	text-decoration: none;
	font-weight: 700;
	line-height: 1.1;
	letter-spacing: 0.01em;
	box-shadow: 0 14px 32px rgba(220, 20, 60, 0.20);
	transition:
		transform 220ms var(--ndr-ease-premium),
		background-color 220ms var(--ndr-ease-premium),
		box-shadow 220ms var(--ndr-ease-premium),
		filter 220ms var(--ndr-ease-premium);
	position: relative;
	isolation: isolate;
}

.ndr-btn--urgent {
	background:
		linear-gradient(180deg, #E3163F 0%, #C81034 100%);
	color: var(--ndr-ic-white);
}

/* * Ensure theme link hover styles don't override button text color. */
.ndr-insurance-band a.ndr-btn--urgent,
.ndr-insurance-band a.ndr-btn--urgent:visited,
.ndr-insurance-band a.ndr-btn--urgent:hover,
.ndr-insurance-band a.ndr-btn--urgent:active,
.ndr-insurance-band a.ndr-btn--urgent:focus,
.ndr-insurance-band a.ndr-btn--urgent:focus-visible {
	/* * Force against theme/global link hover colors. */
	color: var(--ndr-ic-white) !important;
	-webkit-text-fill-color: var(--ndr-ic-white);
	text-decoration: none;
}

.ndr-btn--urgent::before {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	pointer-events: none;
	z-index: -1;
	box-shadow:
		0 1px 0 rgba(255, 255, 255, 0.28) inset,
		0 -1px 0 rgba(0, 0, 0, 0.18) inset;
}

.ndr-btn--urgent::after {
	/* * Subtle premium sheen (kept very light for readability). */
	content: "";
	position: absolute;
	inset: 1px;
	border-radius: calc(inherit - 1px);
	pointer-events: none;
	z-index: 0;
	background:
		radial-gradient(
			120% 80% at 50% -10%,
			rgba(255, 255, 255, 0.22) 0%,
			rgba(255, 255, 255, 0.08) 22%,
			rgba(255, 255, 255, 0) 58%
		);
	opacity: 0.95;
}

.ndr-btn--urgent > * {
	position: relative;
	z-index: 1;
}

.ndr-btn--urgent:hover {
	background:
		linear-gradient(180deg, #F01845 0%, #D21138 100%);
	transform: translateY(-2px) scale(1.08);
	filter: saturate(1.03) contrast(1.02);
	box-shadow:
		0 18px 42px rgba(220, 20, 60, 0.24),
		0 2px 8px rgba(0, 40, 104, 0.08);
}

.ndr-btn--urgent:active {
	background:
		linear-gradient(180deg, #C81034 0%, #B01030 100%);
	transform: translateY(-1px);
	filter: none;
	box-shadow:
		0 10px 22px rgba(220, 20, 60, 0.18),
		0 1px 0 rgba(0, 0, 0, 0.18) inset;
}

.ndr-btn--urgent[disabled],
.ndr-btn--urgent:disabled {
	opacity: 0.85;
	cursor: not-allowed;
	transform: none;
	filter: none;
}

.ndr-btn--urgent[disabled]:hover,
.ndr-btn--urgent:disabled:hover {
	background:
		linear-gradient(180deg, #E3163F 0%, #C81034 100%);
	transform: none;
	box-shadow: 0 14px 32px rgba(220, 20, 60, 0.14);
	filter: none;
}

.ndr-btn--urgent:focus,
.ndr-btn--urgent:focus-visible {
	outline: none;
	box-shadow: 0 0 0 4px var(--ndr-ic-focus-dark);
}

/* * <=360px: prevent cramped 2-col grid by collapsing to 1 column */
@media (max-width: 360px) {
	.ndr-logo-rows {
		grid-template-columns: 1fr;
	}
}

/* * >=600px: 3-column logo grid */
@media (min-width: 600px) {
	.ndr-logo-rows {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

/* * >=768px: switch to two-column layout; left aligns left */
@media (min-width: 768px) {
	.ndr-insurance-band__inner {
		flex-direction: row;
		align-items: flex-start;
		/* * Creates more intentional separation between copy and logo cloud. */
		gap: clamp(48px, 6.5vw, 96px);
	}

	.ndr-insurance-band__left {
		/* * Slightly wider left column to reduce heading line breaks. */
		flex: 0 0 38%;
		text-align: left;
		margin-top: clamp(18px, 4vw, 84px);
	}

	.ndr-insurance-band__left h2 {
		/* * Encourages a 4-line wrap for “WE WORK WITH ALL INSURANCE COMPANIES”. */
		max-width: 22ch;
	}

	.ndr-insurance-band__right {
		flex: 1 1 auto;
		/* * No outer "boxed" container — logos float on the page background. */
		padding: 0;
		border-radius: 0;
		border: 0;
		background: transparent;
		box-shadow: none;
	}

	.ndr-insurance-band__left p {
		margin-left: 0;
		margin-right: 0;
	}
}

/* * >=1024px: polish spacing */
@media (min-width: 1024px) {
	.ndr-logo-rows {
		gap: clamp(16px, 2vw, 22px);
		row-gap: clamp(24px, 3vw, 40px);
	}
	/* * Reveal mode uses a more pronounced "cascade" on desktop. */
	.ndr-insurance-band {
		--ndr-reveal-slide: 22px;
	}
}

/* * Animation-mode layouts (desktop only). */
@media (min-width: 1024px) {
	/* * Rows move up/down: slightly denser grid to emphasize vertical motion. */
	.ndr-insurance-band[data-animation="row_y"] .ndr-logo-rows {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}

	/* * Pinwheel: denser, "designer" layout using safe spans + dense fill. */
	.ndr-insurance-band[data-animation="pinwheel"] .ndr-logo-rows {
		grid-template-columns: repeat(4, minmax(0, 1fr));
		grid-auto-flow: dense;
	}

	/* * Orbit/Float: more premium density on desktop. */
	.ndr-insurance-band[data-animation="orbit"] .ndr-logo-rows,
	.ndr-insurance-band[data-animation="float"] .ndr-logo-rows,
	.ndr-insurance-band.ndr-ic-anim--orbit .ndr-logo-rows,
	.ndr-insurance-band.ndr-ic-anim--float .ndr-logo-rows {
		grid-template-columns: repeat(4, minmax(0, 1fr));
		grid-auto-flow: dense;
	}

	/* * Aurora/Spotlight/Layers/Cinematic: premium density on desktop. */
	.ndr-insurance-band.ndr-ic-anim--aurora .ndr-logo-rows,
	.ndr-insurance-band.ndr-ic-anim--spotlight .ndr-logo-rows,
	.ndr-insurance-band.ndr-ic-anim--layers .ndr-logo-rows,
	.ndr-insurance-band.ndr-ic-anim--cinematic .ndr-logo-rows {
		grid-template-columns: repeat(4, minmax(0, 1fr));
		grid-auto-flow: dense;
	}

	.ndr-insurance-band[data-animation="pinwheel"] .ndr-logo-card:nth-child(8n + 1) {
		grid-column: 1 / span 2;
	}

	.ndr-insurance-band[data-animation="pinwheel"] .ndr-logo-card:nth-child(8n + 4) {
		grid-column: 3 / span 2;
	}

	.ndr-insurance-band[data-animation="pinwheel"] .ndr-logo-card:nth-child(8n + 6) {
		grid-column: 2 / span 2;
	}
}

/* * Morph mode (FLIP layout states). */
@media (min-width: 1024px) {
	.ndr-insurance-band.ndr-ic-anim--morph {
		--ndr-motion-dur: 520ms;
	}

	.ndr-insurance-band.ndr-ic-anim--morph .ndr-logo-rows.ndr-ic-morph--b {
		grid-auto-flow: dense;
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}

	.ndr-insurance-band.ndr-ic-anim--morph .ndr-logo-rows.ndr-ic-morph--b .ndr-logo-card:nth-child(10n + 1) {
		grid-column: 1 / span 2;
	}

	.ndr-insurance-band.ndr-ic-anim--morph .ndr-logo-rows.ndr-ic-morph--b .ndr-logo-card:nth-child(10n + 5) {
		grid-column: 3 / span 2;
	}

	.ndr-insurance-band.ndr-ic-anim--morph .ndr-logo-rows.ndr-ic-morph--b .ndr-logo-card:nth-child(10n + 8) {
		grid-column: 2 / span 2;
	}
}

/* * >=1100px: desktop-only staggering (safe) */
@media (min-width: 1100px) {
	.ndr-insurance-band {
		/* * More prominent drift without introducing horizontal scroll (overflow-x: clip). */
		--ndr-stagger: 110px;
	}

	/* * Row 1: -80px, Row 2: +80px, repeating every 2 rows (3 cols). */
	.ndr-logo-card:nth-child(6n + 1),
	.ndr-logo-card:nth-child(6n + 2),
	.ndr-logo-card:nth-child(6n + 3) {
		--ndr-stagger-x: calc(var(--ndr-stagger) * -1);
	}

	.ndr-logo-card:nth-child(6n + 4),
	.ndr-logo-card:nth-child(6n + 5),
	.ndr-logo-card:nth-child(6n + 6) {
		--ndr-stagger-x: var(--ndr-stagger);
	}

	/* * Vertical mode: no horizontal staggering (keeps vertical motion clean). */
	.ndr-insurance-band[data-animation="row_y"] .ndr-logo-card {
		--ndr-stagger-x: 0px;
	}
}

/* * Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
	.ndr-logo-card,
	.ndr-btn {
		transition: none;
	}

	.ndr-logo-card:hover,
	.ndr-btn--urgent:hover {
		transform: translate3d(var(--ndr-stagger-x, 0px), 0, 0);
	}

	.ndr-logo-card {
		will-change: auto;
	}

	.ndr-insurance-band[data-animation="reveal"] .ndr-logo-card,
	.ndr-insurance-band.ndr-ic-anim--reveal .ndr-logo-card {
		opacity: 1;
	}
}
