/*
 * ART Banner — responsive hero banner.
 * Design: normal document flow (flex/grid), not absolutely-positioned layers, so content can
 * never overlap or get clipped at any screen size or orientation — the bug this replaces.
 *
 * Colors/radius consume the shared rcrr design-token layer (astra-child :root) via var(..,fallback),
 * so this plugin matches the site automatically when those tokens exist, and still looks right
 * (using its own sensible defaults) on any other site where they don't.
 */

.art-banner {
	--art-banner-navy: var(--navy, #0E3A5C);
	--art-banner-sky: var(--sky, #2E96CE);
	--art-banner-sky-deep: var(--sky-deep, #1E7BB0);
	--art-banner-radius-btn: var(--radius-btn, 10px);
	--art-banner-radius-pill: var(--radius-pill, 999px);

	position: relative;
	overflow: hidden;
	display: flex;
	align-items: center;
	min-height: 420px;
	padding: 64px 0;
	color: #fff;
	isolation: isolate;
}

.art-banner__bg-layer {
	position: absolute;
	inset: 0;
	z-index: 0;
}

.art-banner__bg {
	position: absolute;
	inset: 0;
	background-size: cover;
	background-position: right center;
	opacity: 0;
	transition: opacity 1.2s ease-in-out;
}

.art-banner__bg.is-active {
	opacity: 1;
}

/* Left-to-right navy gradient so text stays legible over any photo, matching the current look.
   Plain rgba stops (not color-mix()) for the widest possible browser support. */
.art-banner__overlay {
	position: absolute;
	inset: 0;
	z-index: 1;
	background: linear-gradient(
		90deg,
		rgba(14, 58, 92, 0.95) 0%,
		rgba(14, 58, 92, 0.82) 45%,
		rgba(14, 58, 92, 0.45) 75%,
		rgba(14, 58, 92, 0.18) 100%
	);
}

.art-banner__content {
	position: relative;
	z-index: 2;
	width: 100%;
	max-width: 1240px;
	margin: 0 auto;
	padding: 0 40px;
	box-sizing: border-box;
}

.art-banner__content > * {
	max-width: 640px;
}

/* Colors below are !important: the theme's own heading styles (commonly scoped like
   ".entry-content h2", which out-specifies a bare class selector) would otherwise win over this
   component's own white-on-navy design. This keeps the banner correct on any theme, not just rcrr's. */

/* Typography selectors are doubled (.art-banner .art-banner__x) on purpose: this raises their
   specificity to (0,2,0), which beats theme content-heading rules like ".entry-content h2/h3"
   (0,1,1) that the banner would otherwise inherit when placed inside post content. A portable
   component must own its own type scale regardless of the host theme, not rely on the theme
   excluding it. Colors also carry !important as a second line of defense. */

.art-banner .art-banner__headline {
	margin: 0 0 16px;
	font-size: clamp(28px, 3.4vw, 40px) !important;
	font-weight: 700;
	line-height: 1.15;
	color: #fff !important;
}

.art-banner .art-banner__text {
	margin: 0 0 24px;
	font-size: 16px !important;
	line-height: 1.6;
	color: rgba(255, 255, 255, 0.92) !important;
}

.art-banner .art-banner__subheading {
	margin: 0 0 12px;
	font-size: 18px !important;
	font-weight: 700;
	color: #fff !important;
}

.art-banner__conditions {
	list-style: none;
	margin: 0 0 28px;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px 24px;
}

.art-banner__conditions li {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 15px;
	color: #fff !important;
}

.art-banner__chevron {
	flex: 0 0 auto;
	width: 8px;
	height: 12px;
	color: var(--art-banner-sky);
}

.art-banner__btn .art-banner__chevron {
	color: currentColor;
}

.art-banner__buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
}

.art-banner__btn {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 12px 26px;
	border-radius: var(--art-banner-radius-pill);
	font-size: 14px;
	font-weight: 500;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
	border: 1px solid transparent;
}

.art-banner__btn--primary {
	background: rgba(0, 7, 38, 0.35);
	color: #fff !important;
	border-color: rgba(255, 255, 255, 0.6);
}

.art-banner__btn--primary:hover {
	background: #fff;
	color: #000 !important;
	border-color: #000;
}

.art-banner__btn--secondary {
	background: rgba(0, 7, 38, 0.35);
	color: #fff !important;
	border-color: rgba(255, 255, 255, 0.6);
}

.art-banner__btn--secondary:hover {
	background: var(--art-banner-sky-deep);
	color: #fff !important;
	border-color: #000;
}

/* Respect reduced-motion: no crossfade transition, JS also skips rotation entirely. */
@media (prefers-reduced-motion: reduce) {
	.art-banner__bg {
		transition: none;
	}
}

/* Tablet / narrow desktop: trim padding a touch. */
@media (max-width: 900px) {
	.art-banner {
		padding: 48px 0;
	}
	.art-banner__content {
		padding: 0 28px;
	}
}

/* Phones: single-column conditions list, tighter spacing. Height is NOT hardcoded — the section
   simply grows with its content via padding, which is what makes this immune to the SR clipping bug. */
@media (max-width: 560px) {
	.art-banner {
		padding: 40px 0;
		min-height: 0;
	}
	.art-banner__conditions {
		grid-template-columns: 1fr;
	}
	.art-banner__btn {
		flex: 1 1 auto;
		justify-content: center;
	}
	/* These photos are wide (~3.2:1), built for a desktop strip, so background-size:cover on a
	   narrow phone only ever shows a slice of the image. WHICH slice looks right depends on how
	   each photo is composed — these aren't interchangeable, so this is scoped per banner "set"
	   (see the art-banner--<set> class), not a single blanket rule:
	   - "mockup2" (ART_Training_Banner_*): full-bleed group photos with people across the whole
	     frame — centering the crop shows the subject well from any slice.
	   - unscoped / "mockup1" (Welcome-to-ART-*): a deliberate empty-gradient left ~60% with the
	     subject clustered toward the right — falls through to the base rule's "right center",
	     which is the correct choice for this composition style (centering would show pure gradient). */
	.art-banner--mockup2 .art-banner__bg {
		background-position: center center;
	}
}
