/* ASF Hero Slider
 * Colors and fonts follow the ASF brand guide (updated 2/14/24).
 * Everything is scoped to .asf-slider so it can't affect the theme.
 * To adjust colors or sizing, change the variables below.
 */

.asf-slider {
	/* Brand colors */
	--asf-blue: #0073ae;      /* primary */
	--asf-blue-75: #5597c3;
	--asf-blue-25: #c7dceb;
	--asf-green: #c4df9b;
	--asf-green-50: #e2eecd;
	--asf-gray: #a6a6a6;
	--asf-white: #ffffff;
	--asf-navy: #003a57;      /* brand blue darkened 50%, for the left-edge shadow */

	/* Layout */
	--asf-height: clamp(480px, 75vh, 680px);
	--asf-content-width: 1200px; /* match the theme's content width */

	position: relative;
	width: 100%;
	height: var(--asf-height);
	overflow: hidden;
	background: var(--asf-blue);
	font-family: 'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif;
	font-weight: 400;
	line-height: 1.6;
	text-align: left;
	color: var(--asf-white);
}
.asf-slider,
.asf-slider *,
.asf-slider *::before,
.asf-slider *::after { box-sizing: border-box; }

/* Neutralize theme styles on headings, paragraphs, buttons, links */
.asf-slider h1,
.asf-slider h2,
.asf-slider p { margin: 0; padding: 0; letter-spacing: normal; text-transform: none; font-family: inherit; }
.asf-slider button {
	font: inherit;
	line-height: 1;
	margin: 0;
	padding: 0;
	min-height: 0;
	text-transform: none;
	letter-spacing: normal;
	box-shadow: none;
	-webkit-appearance: none;
	appearance: none;
}
.asf-slider a { text-decoration: none; box-shadow: none; }
/* Text only screen readers hear */
.asf-slider .asf-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
.asf-slider :focus-visible { outline: 3px solid var(--asf-green); outline-offset: 3px; }

/* ── Photos ─────────────────────────────── */
.asf-slider .s3-frames,
.asf-slider .s3-frame,
.asf-slider .s3-image,
.asf-slider .s3-image picture { position: absolute; inset: 0; }
.asf-slider .s3-frame { opacity: 0; transition: opacity 0.8s ease; }
.asf-slider .s3-frame.is-active { opacity: 1; }
.asf-slider .asf-img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	border-radius: 0;
	margin: 0;
}

/* Narrow navy shade on the left edge only, behind the card.
   Make it wider by raising the last % (e.g. 45%); darker by raising 0.75. */
.asf-slider .s3-veil {
	position: absolute;
	inset: 0;
	z-index: 1;
	background: linear-gradient(to right,
		rgba(0, 58, 87, 0.75) 0%,
		rgba(0, 58, 87, 0.35) 18%,
		rgba(0, 58, 87, 0) 35%);
}

/* ── Floating card ──────────────────────── */
.asf-slider .s3-card {
	position: absolute;
	z-index: 10;
	bottom: 3rem;
	/* line up with the site's content column on wide screens */
	left: max(5rem, calc((100% - var(--asf-content-width)) / 2));
	width: min(460px, calc(100% - 7rem));
	padding: 2rem;
	background: rgba(0, 115, 174, 0.94);
	-webkit-backdrop-filter: blur(12px);
	backdrop-filter: blur(12px);
	border-radius: 10px;
	border-top: 4px solid var(--asf-green);
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}
.asf-slider .s3-slide-txt { display: none; }
.asf-slider .s3-slide-txt.is-active { display: block; animation: asfFadeUp 0.5s 0.3s ease both; }

@keyframes asfFadeUp {
	from { opacity: 0; transform: translateY(12px); }
	to   { opacity: 1; transform: translateY(0); }
}

.asf-slider .s3-eyebrow {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	margin-bottom: 0.75rem;
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--asf-white);
}
.asf-slider .s3-eyebrow::before {
	content: "";
	width: 24px;
	height: 3px;
	border-radius: 2px;
	background: var(--asf-green);
	flex-shrink: 0;
}
.asf-slider .s3-heading {
	margin-bottom: 0.85rem;
	font-size: clamp(1.35rem, 2.4vw, 1.85rem);
	font-weight: 700;
	line-height: 1.22;
	color: var(--asf-white);
	text-wrap: balance;
}
.asf-slider .s3-body {
	margin-bottom: 1.4rem;
	max-width: 46ch;
	font-size: 0.95rem;
	font-weight: 400;
	line-height: 1.65;
	color: var(--asf-white);
}
.asf-slider .s3-actions { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; }

/* White button + blue text: on-brand and passes contrast */
.asf-slider .s3-btn-primary {
	display: inline-block;
	padding: 0.75rem 1.4rem;
	border-radius: 6px;
	background: var(--asf-white);
	color: var(--asf-blue);
	font-size: 0.85rem;
	font-weight: 700;
	transition: background 0.2s, color 0.2s;
}
.asf-slider .s3-btn-primary:hover,
.asf-slider .s3-btn-primary:focus-visible { background: var(--asf-green); color: var(--asf-navy); }
.asf-slider .s3-btn-ghost {
	color: var(--asf-white);
	font-size: 0.85rem;
	font-weight: 600;
	text-decoration: underline;
	text-decoration-color: var(--asf-green);
	text-decoration-thickness: 2px;
	text-underline-offset: 4px;
}
.asf-slider .s3-btn-ghost:hover { color: var(--asf-green-50); }

/* ── Arrows ─────────────────────────────── */
.asf-slider .s3-arrow-nav {
	position: absolute;
	inset: 0;
	z-index: 20;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 1.25rem;
	pointer-events: none;
}
.asf-slider .asf-arrow {
	pointer-events: auto;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	border: 2px solid var(--asf-white);
	background: rgba(0, 115, 174, 0.7);
	color: var(--asf-white);
	font-size: 1rem;
	font-weight: 700;
	cursor: pointer;
	transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
}
.asf-slider .asf-arrow:hover {
	background: var(--asf-green);
	border-color: var(--asf-green);
	color: var(--asf-blue);
	transform: scale(1.08);
}

/* ── 6-second progress bar ─────────────── */
.asf-slider .s3-progress {
	position: absolute;
	z-index: 25;
	left: 0;
	bottom: 0;
	width: 0;
	height: 4px;
	background: var(--asf-green);
}

/* ── Smaller desktops and sideways tablets: narrower card so it stays clear of the subject ── */
@media (min-width: 701px) and (max-width: 1199px) {
	.asf-slider .s3-card {
		width: min(400px, 40%);
		padding: 1.6rem;
		bottom: 2.5rem;
	}
	.asf-slider .s3-heading { font-size: 1.4rem; }
	.asf-slider .s3-body { font-size: 0.88rem; line-height: 1.55; margin-bottom: 1.1rem; }
}

/* ── Phones + upright tablets: tall photo behind the card; card hangs slightly into the next section ── */
@media (max-width: 700px), (max-width: 1024px) and (orientation: portrait) {
	.asf-slider {
		--asf-photo-top: min(76vw, 330px);  /* photo showing above the card */
		--asf-hang: 2.5rem;                 /* how far the card hangs into the section below */
		height: auto;
		overflow: visible;
		z-index: 2;
		padding: var(--asf-photo-top) 1rem 0;
		margin-bottom: calc(-1 * var(--asf-hang));
		background: transparent;
	}
	/* Photo runs from the top down behind the card, ending just above the card's bottom edge */
	.asf-slider .s3-frames {
		inset: 0 0 var(--asf-hang) 0;
		overflow: hidden;
	}
	.asf-slider .s3-veil { background: none; }

	/* A dedicated mobile photo is already framed, so keep its top (cap and face) in view */
	.asf-slider picture .asf-img { object-position: center 15% !important; }

	/* "Mobile photo position" field, when set, picks the horizontal crop on phones */
	.asf-slider .asf-img[style*="--asf-mpos"] { object-position: var(--asf-mpos) 20% !important; }

	.asf-slider .s3-card {
		position: relative;
		left: auto;
		bottom: auto;
		width: 100%;
		padding: 1.4rem 1.25rem 1.5rem;
		background: var(--asf-blue);
	}
	.asf-slider .s3-heading { margin-bottom: 0.6rem; }
	.asf-slider .s3-body { font-size: 0.9rem; line-height: 1.55; margin-bottom: 1.1rem; }
	/* Arrows sit over the photo, above the card */
	.asf-slider .s3-arrow-nav {
		inset: auto;
		top: 0;
		left: 0;
		right: 0;
		height: var(--asf-photo-top);
		padding: 0 0.75rem;
	}
	.asf-slider .asf-arrow { width: 38px; height: 38px; }
	.asf-slider .s3-progress { top: 0; bottom: auto; }
}

/* ── Upright tablets: same stacked layout, sized up ── */
@media (min-width: 701px) and (max-width: 1024px) and (orientation: portrait) {
	.asf-slider {
		--asf-photo-top: min(70vw, 700px);
		--asf-hang: 3rem;
		padding-left: 2.5rem;
		padding-right: 2.5rem;
	}
	.asf-slider .s3-card {
		width: min(640px, 100%);
		padding: 2rem 2.25rem;
	}
	.asf-slider .s3-heading { font-size: 1.85rem; }
	.asf-slider .s3-body { font-size: 1rem; line-height: 1.65; }
	.asf-slider .s3-arrow-nav { padding: 0 1.5rem; }
	.asf-slider .asf-arrow { width: 44px; height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
	.asf-slider .s3-frame,
	.asf-slider .s3-slide-txt { transition: none; animation: none; }
	.asf-slider .s3-progress { display: none; }
}
