/*
 * Gambit Benefit Cards Block — Mobile-First
 *
 * Expandable accordion cards: horizontal flex on desktop, stacked on mobile.
 * Each card: clickable header (image + title) with expand/collapse description.
 * Matches Maximus TRT benefit cards pattern with Gambit dark palette.
 */

/* Tight padding on program pages (testosterone, etc.) — match Maximus spacing */
.single-program .gambit-benefit-cards {
	padding-top: 24px;
	padding-bottom: 24px;
}

@media (min-width: 768px) {
	.single-program .gambit-benefit-cards {
		padding-top: 32px;
		padding-bottom: 32px;
	}
}

@media (min-width: 1200px) {
	.single-program .gambit-benefit-cards {
		padding-top: 40px;
		padding-bottom: 40px;
	}
}

.gambit-benefit-cards {
	background-color: var(--deep-charcoal);
}

/* Reduce top spacing when benefit cards follow hero directly */
.gambit-hero--cpt + .gambit-benefit-cards {
	padding-top: 24px;
}

@media (min-width: 768px) {
	.gambit-hero--cpt + .gambit-benefit-cards {
		padding-top: 32px;
	}
}

@media (min-width: 1200px) {
	.gambit-hero--cpt + .gambit-benefit-cards {
		padding-top: 40px;
	}
}

/* Eyebrow */
.gambit-benefit-cards__eyebrow {
	font-family: var(--font-mono);
	font-size: 12px;
	font-weight: 400;
	letter-spacing: 0.15em;
	text-transform: uppercase;
	color: var(--signal-red);
	margin: 0 0 16px;
}

/* Headline */
.gambit-benefit-cards__headline {
	font-family: var(--font-heading);
	font-weight: 700;
	font-size: clamp(24px, 4vw, 40px);
	line-height: 1.15;
	letter-spacing: -0.02em;
	color: var(--warm-white);
	margin: 0 0 24px;
	max-width: 600px;
}

@media (min-width: 768px) {
	.gambit-benefit-cards__headline {
		margin-bottom: 32px;
	}
}

/* Desktop (matches grid breakpoint): remove max-width so headline fits on one line */
@media (min-width: 1100px) {
	.gambit-benefit-cards__headline {
		max-width: none;
	}
}

/* ==========================================================================
   Grid — horizontal flex on desktop, stacked on mobile
   ========================================================================== */

.gambit-benefit-cards__grid {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

@media (min-width: 1100px) {
	.gambit-benefit-cards__grid {
		flex-direction: row;
		gap: 24px;
		/* flex-start so only the expanded card grows — collapsed siblings stay at their resting header height */
		align-items: flex-start;
	}
}

/* ==========================================================================
   Card — rounded container with subtle surface lift
   ========================================================================== */

.gambit-benefit-cards__card {
	/* Dark-navy gradient matches the lifestyle-banner card surface
	   (`#242B36 → #1A2028`) used on /testosterone/fertility-friendly-testosterone/
	   for the "Apply one dose. Same time, every day." card. Used by every dark-mode
	   program page that renders this block (testosterone, growth-hormone). Light-mode
	   programs (weight-loss, womens-health) use a different block (`health-risk-cards`)
	   so this rule never reaches them. */
	background: linear-gradient(180deg, #242B36 0%, #1A2028 100%);
	border: 1px solid var(--warm-white-8);
	border-radius: 16px;
	overflow: hidden;
	flex: 1 1;
	/* inset highlight catches light on the top edge — lifts the card off the deep-charcoal ground */
	box-shadow: inset 0 1px 0 rgba(247, 245, 242, 0.04);
	transition:
		border-color 0.25s var(--ease-out-expo),
		background 0.25s var(--ease-out-expo),
		box-shadow 0.25s var(--ease-out-expo),
		transform 0.25s var(--ease-out-expo);
}

@media (min-width: 1100px) {
	.gambit-benefit-cards__card {
		border-radius: var(--radius-card);
	}
}

@media (hover: hover) and (pointer: fine) {
	.gambit-benefit-cards__card:hover {
		border-color: var(--warm-white-20);
		transform: translateY(-1px);
		box-shadow:
			inset 0 1px 0 rgba(247, 245, 242, 0.06),
			0 10px 24px -14px var(--signal-red-25);
	}
}

/* ==========================================================================
   Card Header — clickable trigger (image + title + chevron)
   ========================================================================== */

.gambit-benefit-cards__card-header {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 16px;
	padding-right: 48px;
	position: relative;
	cursor: pointer;
	width: 100%;
	text-align: left;
	background: none;
	border: none;
	color: inherit;
	font: inherit;
}

@media (min-width: 768px) {
	.gambit-benefit-cards__card-header {
		gap: 20px;
		padding: 20px 56px 20px 24px;
	}
}

@media (min-width: 1100px) {
	.gambit-benefit-cards__card-header {
		gap: 20px;
		padding: 24px 56px 24px 24px;
	}
}

@media (min-width: 1400px) {
	.gambit-benefit-cards__card-header {
		padding: 28px 60px 28px 28px;
	}
}

.gambit-benefit-cards__card-header:focus-visible {
	outline: 2px solid var(--signal-red);
	outline-offset: -2px;
	border-radius: inherit;
}

/* ==========================================================================
   Image — rounded square thumbnails (Maximus pattern)
   ========================================================================== */

.gambit-benefit-cards__image {
	position: relative;
	width: 62px;
	height: 62px;
	border-radius: 12px;
	overflow: hidden;
	flex-shrink: 0;
}

/* Depth: subtle bottom-up darken so the thumbnail integrates with the dark card surface */
.gambit-benefit-cards__image::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.35), transparent 55%);
	mix-blend-mode: multiply;
	pointer-events: none;
}

@media (min-width: 768px) {
	.gambit-benefit-cards__image {
		width: 88px;
		height: 88px;
	}
}

.gambit-benefit-cards__image-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	border-radius: 12px;
}

/* Icon fallback (when no image is set) */
.gambit-benefit-cards__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	border-radius: 12px;
	background: var(--signal-red-10);
	color: var(--signal-red);
	flex-shrink: 0;
}

@media (min-width: 768px) {
	.gambit-benefit-cards__icon {
		width: 56px;
		height: 56px;
	}
}

/* ==========================================================================
   Title
   ========================================================================== */

.gambit-benefit-cards__title {
	font-family: var(--font-heading);
	font-weight: 600;
	font-size: 20px;
	line-height: 1.2;
	letter-spacing: -0.02em;
	color: var(--warm-white);
	margin: 0;
	flex: 1;
}

@media (min-width: 1100px) {
	.gambit-benefit-cards__title {
		font-size: 22px;
		letter-spacing: -0.025em;
	}
}

@media (min-width: 1400px) {
	.gambit-benefit-cards__title {
		font-size: 24px;
	}
}

/* ==========================================================================
   Chevron — expand indicator
   ========================================================================== */

.gambit-benefit-cards__chevron {
	position: absolute;
	right: 16px;
	top: 50%;
	transform: translateY(-50%);
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	color: var(--warm-white);
	opacity: 0.5;
	background: var(--warm-white-6);
	border: 1px solid var(--warm-white-10);
	transition: transform 0.25s var(--ease-out-expo),
	            opacity 0.25s var(--ease-out-expo),
	            background 0.25s var(--ease-out-expo),
	            border-color 0.25s var(--ease-out-expo),
	            color 0.25s var(--ease-out-expo);
}

@media (min-width: 768px) {
	.gambit-benefit-cards__chevron {
		right: 20px;
	}
}


.gambit-benefit-cards__card-header:hover .gambit-benefit-cards__chevron {
	opacity: 0.9;
	background: var(--signal-red-10);
	border-color: var(--signal-red-10);
	color: var(--signal-red);
}

/* Open state — card asserts itself: red border, lifted surface, tinted shadow */
.gambit-benefit-cards__card--open {
	border-color: var(--signal-red);
	background: var(--warm-white-10);
	box-shadow:
		inset 0 1px 0 rgba(247, 245, 242, 0.06),
		0 10px 28px -14px var(--signal-red-35);
}

@media (hover: hover) and (pointer: fine) {
	.gambit-benefit-cards__card--open:hover {
		/* keep the expanded card visually anchored — no lift on hover while open */
		transform: none;
	}
}

.gambit-benefit-cards__card--open .gambit-benefit-cards__chevron {
	transform: translateY(-50%) rotate(180deg);
	opacity: 1;
	background: var(--signal-red);
	color: var(--warm-white);
}

/* ==========================================================================
   Body Wrap — expandable description (hidden by default)
   ========================================================================== */

.gambit-benefit-cards__body-wrap {
	max-height: 0;
	overflow: hidden;
	padding: 0 16px;
}

@media (min-width: 768px) {
	.gambit-benefit-cards__body-wrap {
		padding: 0 24px;
	}
}

/* Transition for expand/collapse animation */
.gambit-benefit-cards__body-wrap[data-animating] {
	transition: max-height 0.35s var(--ease-out-expo);
}

/* Body text */
.gambit-benefit-cards__body {
	font-family: var(--font-body);
	font-size: 14px;
	line-height: 1.6;
	color: var(--off-white);
	opacity: 0.7;
	margin: 0;
	padding-bottom: 16px;
}

@media (min-width: 768px) {
	.gambit-benefit-cards__body {
		font-size: 15px;
		padding-bottom: 20px;
	}
}

@media (min-width: 1100px) {
	.gambit-benefit-cards__body {
		padding-bottom: 24px;
	}
}

/* ==========================================================================
   Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
	.gambit-benefit-cards__chevron {
		transition: none;
	}

	.gambit-benefit-cards__body-wrap[data-animating] {
		transition: none !important;
	}

	.gambit-benefit-cards__card,
	.gambit-benefit-cards__card:hover {
		transition: none;
		transform: none;
	}
}


/* ==========================================================================
   Executive Health — Gambit Gold Tier — Benefit Cards
   Dark gold card surface — matches the lightness of the TRT benefit-cards
   navy gradient (#242B36 → #1A2028, L≈17% → 13%) but in warm-copper hue.
   Computed: HSL(28°, 22%, 17%) → HSL(28°, 22%, 13%).
   ========================================================================== */

body.postname-executive-health .gambit-benefit-cards__card {
	background: linear-gradient(180deg, #3D2A1A 0%, #28201A 100%);
}

body.postname-executive-health .gambit-benefit-cards__card:hover {
	border-color: rgba(184, 115, 51, 0.40);
}

body.postname-executive-health .gambit-benefit-cards__card--open {
	background: linear-gradient(180deg, #4A3320 0%, #312820 100%);
}
