/* ==========================================================================
   Featured Programs homepage spotlight ([featured_programs] shortcode).
   Adapts to 1-5 cards: the primary card (lowest Featured Order) is always
   larger; any secondary cards stack in a column beside it and share height
   equally, however many there are. Reuses the .program-apply-modal* popup
   chrome from programs.css — no separate modal styles here.
   ========================================================================== */

.exegypt-featured-programs {
	background: #F0F5FA;
	padding: 4rem 1.5rem;
}

.exegypt-featured-programs__inner {
	max-width: 1280px;
	margin: 0 auto;
}

.exegypt-featured-programs__eyebrow {
	display: block;
	color: #8a6215;
	font-family: "Inter", sans-serif;
	font-weight: 700;
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.16em;
	margin: 0 0 12px;
}

.exegypt-featured-programs__heading {
	color: #001844;
	font-family: "Montserrat", sans-serif;
	font-weight: 700;
	font-size: 2.25rem;
	line-height: 1.25;
	margin: 0 0 12px;
	max-width: 720px;
}

.exegypt-featured-programs__intro {
	color: #475467;
	font-family: "Inter", sans-serif;
	font-size: 1rem;
	line-height: 1.6;
	max-width: 560px;
	margin: 0 0 2.5rem;
}

/*
 * Grid: primary card + an optional secondary stack, side by side. Cross-axis
 * alignment is flex-start (not stretch) deliberately: with 2+ secondary
 * cards, stretching the stack's total height to match the primary card and
 * then dividing that equally between cards clips their content (title/
 * description/buttons) whenever there isn't room. Letting each column size
 * to its own natural content height means the secondary stack can end up
 * taller than the primary card once there are 3+ secondaries — expected and
 * fine, like a "feature story + headline list" layout.
 */
.exegypt-featured-programs__grid {
	display: flex;
	align-items: flex-start;
	gap: 28px;
}

.exegypt-featured-programs__secondary-stack {
	flex: 1 1 0;
	display: flex;
	flex-direction: column;
	gap: 20px;
	min-width: 0;
}

/* ==========================================================================
   Card
   ========================================================================== */
.featured-program-card {
	display: flex;
	flex-direction: column;
	background: #fff;
	border-radius: 2px;
	outline: 1px solid rgba(0, 45, 114, 0.08);
	outline-offset: -1px;
	box-shadow: 0 4px 24px rgba(0, 24, 68, 0.06);
	overflow: hidden;
}

.featured-program-card--primary {
	flex: 1.4 1 0;
	min-width: 0;
}

.featured-program-card--secondary {
	flex: none;
	width: 100%;
}

/*
 * Height is set via a padding-top spacer rather than `aspect-ratio`. Early
 * in development these cards sat inside a flex column stretched to match a
 * sibling's height, and `aspect-ratio` combined with that kind of nested
 * cross-axis stretch resolved against the wrong available width in
 * Chromium, producing a wildly oversized box. The padding-top technique
 * sizes purely from the element's own resolved width, so it's kept even
 * though the layout no longer forces that stretch.
 */
.featured-program-card__media {
	position: relative;
	flex: none;
	padding-top: 62.5%; /* 16:10 */
	background: #E4EBF3;
	overflow: hidden;
}

.featured-program-card--secondary .featured-program-card__media {
	padding-top: 56.25%; /* 16:9 */
}

.featured-program-card__media img,
.featured-program-card__media-placeholder {
	display: block;
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.featured-program-card__badge {
	position: absolute;
	top: 16px;
	left: 16px;
	background: rgba(201, 150, 56, 0.92);
	color: #001020;
	font-family: "Inter", sans-serif;
	font-weight: 700;
	font-size: 0.68rem;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	padding: 5px 12px;
	border-radius: 999px;
}

.featured-program-card__body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	padding: 28px;
}

.featured-program-card--secondary .featured-program-card__body {
	padding: 20px;
}

.featured-program-card__eyebrow {
	display: block;
	color: #8a6215;
	font-family: "Inter", sans-serif;
	font-weight: 700;
	font-size: 0.7rem;
	text-transform: uppercase;
	letter-spacing: 0.14em;
	margin-bottom: 8px;
}

.featured-program-card__title {
	color: #001844;
	font-family: "Montserrat", sans-serif;
	font-weight: 700;
	font-size: 1.5rem;
	line-height: 1.3;
	margin: 0 0 6px;
}

.featured-program-card--secondary .featured-program-card__title {
	font-size: 1.15rem;
}

.featured-program-card__audience {
	color: #667085;
	font-family: "Inter", sans-serif;
	font-size: 0.85rem;
	margin-bottom: 10px;
}

.featured-program-card__description {
	color: #475467;
	font-family: "Inter", sans-serif;
	font-size: 0.92rem;
	line-height: 1.6;
	margin: 0 0 20px;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.featured-program-card--secondary .featured-program-card__description {
	-webkit-line-clamp: 2;
	font-size: 0.88rem;
	margin-bottom: 16px;
}

.featured-program-card__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: auto;
}

.featured-program-card--secondary .featured-program-card__actions {
	flex-direction: column;
}

.featured-program-card__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	font-family: "Inter", sans-serif;
	font-weight: 600;
	font-size: 0.9rem;
	text-decoration: none;
	border: none;
	border-radius: 2px;
	padding: 13px 22px;
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease;
}

.featured-program-card__cta svg {
	width: 16px;
	height: 16px;
	transition: transform 0.25s ease;
}

.featured-program-card__cta--details:hover svg {
	transform: translateX(3px);
}

.featured-program-card__cta--apply {
	background: #C99638;
	color: #001020;
}

.featured-program-card__cta--apply:hover {
	background: #b8842c;
}

.featured-program-card__cta--details {
	background: #002D72;
	color: #fff;
}

.featured-program-card__cta--details:hover {
	background: #001844;
}

/* ==========================================================================
   1-card layout: primary card alone, horizontal (image left / content right)
   ========================================================================== */
.exegypt-featured-programs__grid[data-count="1"] .featured-program-card--primary {
	flex-direction: row;
}

.exegypt-featured-programs__grid[data-count="1"] .featured-program-card--primary .featured-program-card__media {
	flex: 0 0 48%;
	padding-top: 0;
}

.exegypt-featured-programs__grid[data-count="1"] .featured-program-card--primary .featured-program-card__body {
	flex: 1 1 auto;
	justify-content: center;
	padding: 40px;
}

.exegypt-featured-programs__grid[data-count="1"] .featured-program-card--primary .featured-program-card__title {
	font-size: 1.85rem;
}

.exegypt-featured-programs__grid[data-count="1"] .featured-program-card--primary .featured-program-card__actions {
	flex-direction: row;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 991px) {
	.exegypt-featured-programs__heading {
		font-size: 1.85rem;
	}

	.exegypt-featured-programs__grid {
		gap: 20px;
	}

	.exegypt-featured-programs__grid[data-count="1"] .featured-program-card--primary .featured-program-card__body {
		padding: 28px;
	}
}

@media (max-width: 768px) {
	.exegypt-featured-programs {
		padding: 2.75rem 1.25rem;
	}

	.exegypt-featured-programs__grid,
	.exegypt-featured-programs__grid[data-count="1"] .featured-program-card--primary {
		flex-direction: column;
	}

	/*
	 * Reset the desktop row layout's flex-basis: 0 (fine there, since the
	 * grid's width is definite) back to natural/content-based sizing now
	 * that the grid stacks vertically with an auto (content-driven) height.
	 * Without this, the primary card collapses to 0 height: flex-basis: 0
	 * plus `overflow: hidden` on .featured-program-card (which zeroes a flex
	 * item's automatic minimum size) leaves it nothing to size from in an
	 * auto-height column container.
	 */
	.featured-program-card--primary,
	.exegypt-featured-programs__secondary-stack {
		flex: none;
		width: 100%;
	}

	.exegypt-featured-programs__grid[data-count="1"] .featured-program-card--primary .featured-program-card__media {
		flex: none;
		padding-top: 62.5%;
	}

	.exegypt-featured-programs__grid[data-count="1"] .featured-program-card--primary .featured-program-card__body {
		padding: 24px;
	}

	.exegypt-featured-programs__secondary-stack {
		gap: 16px;
	}

	.featured-program-card__actions,
	.exegypt-featured-programs__grid[data-count="1"] .featured-program-card--primary .featured-program-card__actions {
		flex-direction: column;
	}

	.featured-program-card__cta {
		width: 100%;
	}
}

@media (max-width: 480px) {
	.exegypt-featured-programs__heading {
		font-size: 1.5rem;
	}

	.featured-program-card__body {
		padding: 20px;
	}
}
