/* ==========================================================================
   FEATURED BRANDS BANNER ([featured_brands])
   --------------------------------------------------------------------------
   Full-width rotating banner on the home page. Slides come from the ACF
   options page "featured-brands" (brands repeater); the markup and the
   rotation script live in the child theme's shortcode.

   Layout
     .fb-stage       the banner; background image swapped per slide
     .fb-content     eyebrow, heading, description, button
     .fb-nav         vertical brand tabs along the bottom (desktop)
     .fb-indicator   slide counter with a progress line
     .fb-logo        brand logo, top right (hidden on mobile)

   Contents
     1. Settings
     2. Stage
     3. Content
     4. Brand tabs
     5. Slide counter
     6. Brand logo
     7. Mobile
   ========================================================================== */


/* --- 1. Settings --------------------------------------------------------- */

:root {
	--fb-stage-h: clamp(400px, 85dvh, 800px); /* banner height */
	--fb-lift: 16px;                          /* how far the active tab rises */
}


/* --- 2. Stage ------------------------------------------------------------ */

.fb-stage {
	position: relative;
	width: 100%;
	height: var(--fb-stage-h);
	overflow: hidden;
	background-size: cover;
	background-position: top right;
	isolation: isolate;
}
.fb-bg-layer {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-size: cover;
  background-position: right top;
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
  pointer-events: none;
}
.fb-bg-layer.is-back { z-index: -2; }
.fb-bg-layer.is-visible { opacity: 1; }
/* Scrim: darker on the left behind the copy and on the right behind the
   logo, lighter in the middle so the image reads. */
.fb-stage::after {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background: linear-gradient(90deg, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.1) 45%, rgba(0, 0, 0, 0.4));
}


/* --- 3. Content ---------------------------------------------------------- */

.fb-content {
	position: absolute;
	top: 14%;
	left: 6%;
	z-index: 2;
	max-width: 34%;
}

.fb-content h2 {
	color: #fff;
}

.fb-content .fb-eyebrow {
	display: block;
	margin: 0 0 12px;
}

.fb-content .fb-eyebrow .w-text-value {
	color: #fff;
	font-family: var(--h1-font-family);
	font-size: var(--h6-font-size);
	font-weight: 300;
	letter-spacing: 2px;
}

.fb-content .fb-desc {
	margin: 0 0 26px;
}

.fb-content .fb-desc,
.fb-content .fb-desc p {
	color: rgba(255, 255, 255, 0.85);
}

.fb-content .w-btn-wrapper {
	margin-top: 4px;
}


/* --- 4. Brand tabs (desktop) --------------------------------------------- */

.fb-nav {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 3;
	display: flex;
	height: 180px;
}

.fb-tab {
	position: relative;
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	justify-content: flex-end;
	padding: 0 18px 28px 0;
	background: none;
	border: none;
	font: inherit;
	cursor: pointer;
}

/* Hairline divider between tabs. */
.fb-tab + .fb-tab {
	border-left: 1px solid rgba(255, 255, 255, 0.15);
}

/* Brand name (vertical text) stacked above a small tick. */
.fb-inner {
	display: flex;
	flex-direction: column-reverse;
	align-items: center;
	gap: 12px;
	transform: translateY(0);
	transition: transform 0.3s ease;
}

.fb-tab .fb-inner > span {
	color: rgba(255, 255, 255, 0.55);
	font-size: 13px;
	letter-spacing: 0.16em;
	writing-mode: vertical-rl;
	transform: rotate(180deg);
	transition: color 0.3s ease;
}

.fb-tab .tick {
	width: 1px;
	height: 24px;
	background: #fff;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.fb-tab:hover .fb-inner > span {
	color: rgba(255, 255, 255, 0.85);
}

/* Active tab: lifts, turns white, shows its tick. */
.fb-tab.is-active .fb-inner {
	transform: translateY(calc(-1 * var(--fb-lift)));
}

.fb-tab.is-active .fb-inner > span {
	color: #fff;
}

.fb-tab.is-active .tick {
	opacity: 1;
}


/* --- 5. Slide counter ---------------------------------------------------- */

.fb-indicator {
	position: absolute;
	top: 8%;
	left: 6%;
	z-index: 4;
	display: flex;
	align-items: center;
	gap: 8px;
	color: rgba(255, 255, 255, 0.85);
	font-family: var(--h1-font-family, inherit);
	font-size: 13px;
	letter-spacing: 0.15em;
	font-variant-numeric: tabular-nums;
}

.fb-indicator .fb-index-current { color: #fff; }
.fb-indicator .fb-index-sep     { opacity: 0.5; }
.fb-indicator .fb-index-total   { opacity: 0.6; }

/* Progress line under the counter; fills over each slide.
   Remove these two rules for numbers only. */
.fb-indicator::after {
	content: "";
	position: absolute;
	right: 0;
	bottom: -8px;
	left: 0;
	height: 1px;
	background: rgba(255, 255, 255, 0.25);
	transform: scaleX(0);
	transform-origin: left center;
}

/* 6s must match the rotation interval (ROTATE_MS) in the featured brands
   script in the child theme. */
.fb-indicator.is-progressing::after {
	transform: scaleX(1);
	transition: transform 6s linear;
}


/* --- 6. Brand logo ------------------------------------------------------- */

.fb-logo {
	position: absolute;
	top: 8%;
	right: 6%;
	z-index: 4;
	max-width: 180px;
	max-height: 64px;
	object-fit: contain;
	object-position: right center;
}

.fb-logo[hidden] {
	display: none;
}


/* --- 7. Mobile (below 768px) ---------------------------------------------
   The banner becomes a column: counter first, then the content.
   The logo is hidden. */

@media (max-width: 767px) {
	.fb-stage {
		display: flex;
		flex-direction: column;
		height: auto;
		min-height: 85vh;
	}

	.fb-content {
		position: static;
		order: 0;
		box-sizing: border-box;
		max-width: 50ch;
		padding: 18px 24px 0;
	}

	.fb-eyebrow {
		max-width: 20ch;
	}

	/* NOTE: the margin here never applies — ".fb-content .fb-desc" above is
	   more specific. Left as-is to keep the current layout; change the
	   selector to ".fb-content .fb-desc" if 10px is what's wanted. */
	.fb-desc {
		margin-bottom: 10px;
		font-size: 14px;
	}

	.fb-logo {
		display: none;
	}

	/* Counter moves into the flow, above the heading, top left. */
	.fb-indicator {
		position: relative;
		top: auto;
		right: auto;
		left: auto;
		order: -1;
		align-self: flex-start;
		margin: 28px 24px 0;
	}

	.fb-indicator::after {
		bottom: -6px;
	}
}
