/**
 * JF Resource Templates — shared hero band with pill navigation.
 *
 * Used by the Testimonials, Case Studies and Podcasts templates, which render
 * the same band at the top of the page. It lives in its own file, loaded by both, so a
 * tweak to the pills lands on every template that uses them instead of having
 * to be repeated per template.
 *
 * Scoped on .jfh-hero — the band element itself — rather than on a template
 * wrapper class, which is what makes it template-agnostic. Hand-written and
 * outside the SCSS build, same as jf-slider.css: nothing here needs a
 * Bootstrap variable or mixin, so there is no source file to compile.
 *
 * Colours come from the custom properties printed by the Template Styles
 * options page; there are no literal brand colours below.
 */

/* ==========================================================================
   HERO BAND + PILL NAVIGATION
   ========================================================================== */

.jfh-hero {
	position: relative;
	/* Top/bottom come from the page's hero padding fields when set. */
	padding: var(--jfh-pad-top, 4rem) 0 var(--jfh-pad-bottom, 3.5rem);
	background-color: var(--brand-color, #123451);
	/* The gradient comes from "Hero Background Gradient" on Template Styles
	   (--jfh-hero-gradient); this radial one is the default when it's empty. */
	background: var(--jfh-hero-gradient, radial-gradient(181.71% 141.42% at 100% 0%, #0052DC 0%, #01215A 100%));
/* 	background-image: linear-gradient(
		135deg,
		var(--brand-color, #123451) 0%,
		color-mix(in srgb, var(--brand-color, #123451) 72%, #000) 100%
	); */
	background-size: cover;
	background-position: center center;
}

/* When an image is set it replaces the gradient, so the band keeps a dark
   base underneath for the white text to stay readable on a light photo. */
.jfh-hero--has-image {
	background-image: none;
	background-color: var(--brand-color, #123451);
}

.jfh-hero--has-image::before {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(
		135deg,
		color-mix(in srgb, var(--brand-color, #123451) 92%, transparent) 0%,
		color-mix(in srgb, var(--brand-color, #123451) 62%, transparent) 100%
	);
	pointer-events: none;
}

.jfh-hero > .container {
	position: relative;
	z-index: 1;
}

.jfh-hero__title {
	margin-bottom: 0.5rem;
}

.jfh-hero__subtitle {
	max-width: 46rem;
	opacity: 0.92;
}

/* ── Pill navigation ─────────────────────────────────────────────────────
   A wrapping flex row rather than a scroller: there are only ever a handful
   of resource types, and wrapping keeps every one reachable on a phone. */

.jfh-hero__tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	margin-top: 2.25rem;
}

.jfh-hero .jfh-tab {
	display: inline-flex;
	align-items: center;
	gap: 0.625rem;
	padding: 0.875rem 1.75rem;
	border: 0;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.1);
	color: #fff;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease;
}

/* Colours carry !important here, the same reason render_style_variables()
   does: these templates drop onto whatever theme a client runs, and a theme
   that styles its links with !important would otherwise repaint the pills.
   The colour is also restated on the label and the icon rather than left to
   inherit from the <a>, because an inherited value loses to ANY rule that
   matches the child directly, no matter how specific our rule on the parent
   is — that is what was turning the "Blogs" label dark. */
.jfh-hero .jfh-tab,
.jfh-hero .jfh-tab:hover,
.jfh-hero .jfh-tab:focus-visible,
.jfh-hero .jfh-tab .jfh-tab__label {
	color: #fff !important;
	text-decoration: none !important;
}

.jfh-hero .jfh-tab:hover,
.jfh-hero .jfh-tab:focus-visible {
	background: rgba(255, 255, 255, 0.2);
}

/* The page the visitor is already on: white pill, label in the global heading
   colour from Template Styles. The icon is handled separately, below. */
.jfh-hero .jfh-tab--current,
.jfh-hero .jfh-tab--current:hover,
.jfh-hero .jfh-tab--current:focus-visible,
.jfh-hero .jfh-tab--current .jfh-tab__label {
	color: var(--heading-color, #000) !important;
}

.jfh-hero .jfh-tab--current,
.jfh-hero .jfh-tab--current:hover,
.jfh-hero .jfh-tab--current:focus-visible {
	background: #fff;
}

/* Wraps either the built-in inline SVG or an uploaded image, so both sit on
   the text baseline the same way. */
.jfh-hero .jfh-tab__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	flex: 0 0 auto;
	color: inherit;
}

.jfh-hero img.jfh-tab__icon {
	object-fit: contain;
}

/* stroke/fill are set here rather than left to the SVG's own attributes:
   presentation attributes lose to any CSS rule, so a theme with a bare
   `svg { fill: … }` would otherwise repaint these icons. */
.jfh-hero .jfh-tab .jfh-tab__icon .jf-icon {
	display: block;
	width: 20px;
	height: 20px;
	stroke: #fff !important;
	fill: none !important;
}

/* Every icon is drawn white, and the selected pill flips its own to black.
   The filter is what makes this work for an uploaded image too: an <img> has
   no stroke to recolour, so inverting is the only way to turn a white icon
   file dark on the white pill. Note it inverts white to pure black, not to
   --heading-color, so on a site whose heading colour isn't black the selected
   pill's icon and its label won't match exactly. */
.jfh-hero .jfh-tab--current .jfh-tab__icon {
	filter: brightness(1) invert(1) contrast(100%);
}

/* The one filled shape in the set (the play triangle) keeps its fill. */
.jfh-hero .jfh-tab .jfh-tab__icon .jf-icon [fill="currentColor"] {
	fill: #fff !important;
	stroke: none !important;
}

/* ── Centred layout ─────────────────────────────────────────────────
   "Hero alignment: Center" on the page adds .jfh-hero--center. The subtitle
   keeps its max-width, so it needs auto side margins to sit in the middle. */

.jfh-hero--center > .container {
	text-align: center;
}

.jfh-hero--center .jfh-hero__subtitle {
	margin-left: auto;
	margin-right: auto;
}

.jfh-hero--center .jfh-hero__tabs {
	justify-content: center;
}

/* ── Mobile ─────────────────────────────────────────────────────────────── */

@media (max-width: 767.98px) {
	.jfh-hero {
		padding: var(--jfh-pad-top-mobile, 2.5rem) 0 var(--jfh-pad-bottom-mobile, 2.25rem);
	}

	.jfh-hero__tabs {
		margin-top: 1.5rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.jfh-hero .jfh-tab {
		transition: none;
	}
}
