/*
 * Who: JD and ChatGPT
 * When: August 25, 2026
 * Purpose: Style the reusable Elementor homepage testimonials section,
 * including the desktop card layout and mobile horizontal slider.
 */
.apex-home-testimonials-elementor {
	position: relative;
	z-index: 2;
	clear: both;
	margin: 0 !important;
	background: transparent;
}

.apex-home-testimonials-elementor > .elementor-container,
.apex-home-testimonials-elementor .elementor-column,
.apex-home-testimonials-elementor .elementor-widget-wrap,
.apex-home-testimonials-elementor .elementor-widget-html,
.apex-home-testimonials-elementor .elementor-widget-container {
	margin: 0 !important;
	padding: 0 !important;
}

.apex-home-testimonials {
	--aht-red: #d71920;
	--aht-card: #151515;
	--aht-border: rgba(255, 255, 255, 0.16);
	/* Spacing controls — adjust these instead of hunting through the rules below. */
	--aht-cards-to-button-gap: clamp(72px, 5vw, 96px);
	--aht-section-bottom-space: clamp(120px, 8.3vw, 160px);
	--aht-track-max-width: 1200px;
	--aht-card-gap: clamp(26px, 2.55vw, 48px);
	box-sizing: border-box;
	position: relative;
	isolation: isolate;
	width: 100%;
	overflow: hidden;
	min-height: 0;
	padding: clamp(104px, 7.3vw, 140px) 24px var(--aht-section-bottom-space);
	background-color: transparent;
	background-image: url("../images/home-testimonials/section-flare-desktop.png");
	background-position: center top;
	background-repeat: no-repeat;
	background-size: contain;
	color: #fff;
	font-family: "Work Sans", Arial, sans-serif;
}

.apex-home-testimonials *,
.apex-home-testimonials *::before,
.apex-home-testimonials *::after {
	box-sizing: border-box;
}

.apex-home-testimonials__inner {
	width: min(1600px, 100%);
	margin: 0 auto;
}

.apex-home-testimonials__header {
	margin: 0 auto clamp(74px, 5vw, 96px);
	text-align: center;
}

.apex-home-testimonials__mark {
	display: none;
}

.apex-home-testimonials__header h2 {
	margin: 0;
	color: #fff;
	text-transform: uppercase;
}

.apex-home-testimonials__header h2.deer_head_heading {
	margin: 0 !important;
	font-size: 52px !important;
	line-height: 1.2;
	letter-spacing: 3px;
}

.apex-home-testimonials__header p {
	margin: clamp(28px, 1.8vw, 35px) 0 0;
	color: rgba(255, 255, 255, 0.96);
	font-size: clamp(22px, 1.65vw, 31px);
	font-weight: 400;
	line-height: 1.25;
	letter-spacing: 0.025em;
}

.apex-home-testimonials__viewport {
	overflow: visible;
	/* Reserve room for the transparent portraits that rise above each card. */
	padding-top: clamp(79px, 6vw, 101px);
}

.apex-home-testimonials__track {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: var(--aht-card-gap);
	max-width: var(--aht-track-max-width);
	margin-inline: auto;
	align-items: stretch;
}

.apex-home-testimonial {
	display: grid;
	grid-template-rows: auto auto;
	min-width: 0;
	overflow: visible;
	border: 0;
	border-radius: 23px;
	background: transparent;
	box-shadow: none;
}

.apex-home-testimonial__portrait {
	position: relative;
	z-index: 2;
	aspect-ratio: 701 / 575;
	overflow: visible;
	border: 0;
	border-radius: 23px 23px 0 0;
	background: linear-gradient(180deg, #171717 0%, #171717 18%, #8e050b 100%) !important;
}

.apex-home-testimonial__portrait::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 2;
	pointer-events: none;
	background: linear-gradient(180deg, transparent 72%, rgba(10, 10, 10, 0.12));
}

.apex-home-testimonial__portrait img {
	display: block;
	position: absolute;
	z-index: 1;
	left: 0;
	bottom: 0;
	width: 100%;
	height: 128.5%;
	max-width: none;
	object-fit: contain;
	object-position: center bottom;
}

.apex-home-testimonial:nth-child(1) .apex-home-testimonial__portrait img {
	content: url("../images/home-testimonials/mike-keckler.png");
}

.apex-home-testimonial:nth-child(2) .apex-home-testimonial__portrait img {
	content: url("../images/home-testimonials/billy-stewart.png");
}

.apex-home-testimonial:nth-child(3) .apex-home-testimonial__portrait img {
	content: url("../images/home-testimonials/jacob-klatt.png");
}

.apex-home-testimonial__copy {
	display: flex;
	/* min-height: clamp(190px, 11.2vw, 215px); */
	padding: 26px 18px 23px;
	border: 1px solid var(--aht-border);
	border-top: 0;
	border-radius: 0 0 23px 23px;
	align-items: center;
	justify-content: center;
	flex-direction: column;
	background: rgba(18, 18, 18, 0.97);
	text-align: center;
}

.apex-home-testimonial blockquote {
	margin: 0;
	padding: 0;
	border: 0;
	color: #fff;
	font-size: clamp(15px, 1.11vw, 21px);
	font-style: italic;
	font-weight: 400;
	line-height: 1.25;
}

.apex-home-testimonial__copy p {
	display: flex;
	gap: 12px;
	align-items: baseline;
	justify-content: center;
	margin: 20px 0 0;
	color: #9b9b9b;
	/* Right-aligned like mobile. The copy block is a centred flex column, so
	   align-self moves just this line; the card’s own 18px right padding is the
	   inset (mobile needs padding-right because its copy has none). */
	align-self: self-end;
	font-size: clamp(14px, 1.01vw, 20px);
	line-height: 1;
}

.apex-home-testimonial__copy strong {
	font-weight: 700;
}

.apex-home-testimonials__dots {
	display: none;
}

.apex-home-testimonials__video {
	/* Sized to match the page's other video buttons - the hero's .apex_watch_video
	   and the rewards calculator's Elementor button - which are both 24px/1 Work
	   Sans, 3px tracking, 20px 40px padding, 10px radius, no fill, 66px tall.
	   Width is content-driven with white-space:nowrap rather than pinned to one
	   card (a third of the track): that fixed width wrapped "Testimonial Videos"
	   onto two lines and made this the only 98px-tall button on the home page. */
	display: block;
	min-width: 0;
	width: auto;
	max-width: 100%;
	margin: var(--aht-cards-to-button-gap) auto 0;
	padding: 20px 40px;
	border: 1px solid rgba(250, 250, 250, 0.7);
	border-radius: 10px;
	background: transparent;
	color: #fff;
	font: 300 24px / 1 "Work Sans", Arial, sans-serif;
	letter-spacing: 3px;
	text-transform: uppercase;
	white-space: nowrap;
	cursor: pointer;
	transition: transform 300ms ease;
}

/* One button, two labels: home-testimonials.js builds both spans, this picks
   one per breakpoint. display:none rather than visibility/clip so the label
   that is not showing stays out of the button's accessible name as well. */
.apex-home-testimonials__video-label--narrow {
	display: none;
}

.apex-home-testimonials__video:hover,
.apex-home-testimonials__video:focus-visible {
	/* Astra styles every <button>:hover white with dark text, so the idle
	   colours are restated here to hold them. Only the zoom moves. */
	background: transparent;
	border-color: rgba(250, 250, 250, 0.7);
	color: #fff;
	transform: scale(1.1);
}

@media (max-width: 768px) {
	.apex-home-testimonials {
		--aht-cards-to-button-gap: 69px;
		--aht-section-bottom-space: 72px;
		/* Must be at least the side margin a centred 76vw card leaves (12vw),
		   or the next card intrudes into it. A fixed 28px was showing a
		   15-24px sliver of card 2 on every phone from 360px up. 13vw keeps
		   ~4px of headroom against sub-pixel rounding. */
		--aht-mobile-card-gap: 13vw;
		padding: 50px 0 72px;
		padding-bottom: var(--aht-section-bottom-space);
		background-image: url("../images/home-testimonials/red-flare-mobile.jpg");
		background-position: center top;
		background-size: contain;
	}

	.apex-home-testimonials__header {
		padding: 0 24px;
		margin-bottom: 34px;
	}

	.apex-home-testimonials__header h2.deer_head_heading {
		white-space: nowrap;
		font-size: clamp(30px, 8vw, 42px) !important;
		line-height: 1.15;
		letter-spacing: 3px;
	}

	.apex-home-testimonials__header p {
		margin-top: 31px;
		font-size: clamp(20px, calc(14px + 1.8vw), 28px);
	}

	.apex-home-testimonials__viewport {
		overflow-x: auto;
		overflow-y: hidden;
		padding-top: clamp(76px, 18vw, 126px);
		scroll-snap-type: x mandatory;
		scroll-behavior: smooth;
		scrollbar-width: none;
		-webkit-overflow-scrolling: touch;
	}

	.apex-home-testimonials__viewport::-webkit-scrollbar {
		display: none;
	}

	.apex-home-testimonials__track {
		display: flex;
		gap: var(--aht-mobile-card-gap);
		width: max-content;
		/* Leading gutter only. The trailing 12vw is applied as a margin on the
		   last card instead (rule below), because Safari leaves a scroll
		   container's trailing PADDING out of the scrollable overflow: with
		   `padding: 0 12vw` the scroll runs out 12vw early, so the first two
		   cards centre but the LAST one never can. A margin on the flex item is
		   honoured by every engine, and the geometry is byte-identical in
		   Chromium - scrollWidth measures 1084px at 390 wide either way.
		   The 12vw pairs with the 76vw card: (100 - 76) / 2 = 12, which is what
		   lets the first and last cards sit centred. */
		padding: 0 0 0 12vw;
	}

	.apex-home-testimonials__track > .apex-home-testimonial:last-child {
		margin-right: 12vw;
	}

	.apex-home-testimonial {
		grid-template-rows: auto auto;
		flex: 0 0 76vw;
		width: 76vw;
		min-height: 0;
		border-radius: 23px;
		scroll-snap-align: center;
		scroll-snap-stop: always;
	}

	.apex-home-testimonial__portrait {
		height: auto;
		max-height: none;
		border-radius: 23px 23px 0 0;
	}

	.apex-home-testimonial__copy {
		/* min-height: 210px; */
		padding: 34px 0 31px;
		border-radius: 0 0 23px 23px;
	}

	.apex-home-testimonial blockquote {
		font-size: clamp(18px, 4.5vw, 31px);
	}

	.apex-home-testimonial__copy p {
		gap: 9px;
		margin-top: 32px;
		font-size: clamp(19px, 5vw, 27px);
		align-self: self-end;
    	padding-right: 15px;
	}

	.apex-home-testimonials__dots {
		display: flex;
		min-height: 24px;
		gap: 10px;
		align-items: center;
		justify-content: center;
		margin-top: 47px;
	}

	.apex-home-testimonials__dot {
		width: 10px;
		height: 10px;
		padding: 0;
		border: 0;
		border-radius: 50%;
		background: #777;
		cursor: pointer;
		transition: transform 180ms ease, background-color 180ms ease;
	}

	.apex-home-testimonials__dot[aria-current="true"] {
		background: #f1121b;
		transform: scale(1.15);
	}

	.apex-home-testimonials__video {
		min-width: 0;
		width: 70%;
		margin-top: var(--aht-cards-to-button-gap);
		/* 10px of side padding so the shorter label cannot touch the border on a
		   narrow phone now that the button no longer wraps. */
		padding: 15px 10px;
		font-size: clamp(21px, 6vw, 30px);
	}

	/* "Testimonial Videos" does not fit one line at this width; the phone gets
	   "Watch Videos", the same wording as the other video buttons on the page. */
	.apex-home-testimonials__video-label--wide {
		display: none;
	}

	.apex-home-testimonials__video-label--narrow {
		display: inline;
	}
}

@media (prefers-reduced-motion: reduce) {
	.apex-home-testimonials__viewport {
		scroll-behavior: auto;
	}
}
