/**
 * Featured Cases block — see init.php's top comment for the Figma
 * source (node 2001:7089 @1920). Card visual treatment is intentionally
 * identical to cases_archive_block's own card (same aspect-square photo
 * with the soft bottom fade, rounded-24, tag pills, clamped excerpt) —
 * copied rather than shared as a class because each block's card sits
 * inside a different structural wrapper (CSS grid there, a Swiper slide
 * here).
 *
 * One thing NOT copied from that card: cases_archive_block's own "Full
 * Case" pill button. Figma's mockup for THIS block's card (node
 * 2001:7089) has no such button — it ends after the excerpt.
 *
 * 09.09: the whole card is now one link (`.cases-featured__card-link`,
 * wrapping media+body — `display: contents` so it doesn't disturb this
 * card's own flex layout) plus a "Card design" switcher.
 *
 * 10.09, per Oleksandr's correction: the default (Screenshot) card
 * here was already correct — the aspect-square/fade treatment IS the
 * Figma "kit" Cards component's ("Variant 2"/Small, node 2001:2511)
 * screenshot design, cases_block (Home) now copies it. `.cases-featured__card--laptop`
 * was wrong though (no card chrome, unbounded photo height) — it's now
 * "Case"/Medium's own laptop-mockup design instead: photo keeps its
 * own pre-composited chrome (no CSS rounding — see
 * intobi_case_card_thumbnail_id()) at aspect-ratio 133/81, tucked
 * slightly under a white/bordered body via the same overlap trick.
 * Which style renders is the block's own switcher value, as-is — a
 * block set to "Laptop mockup" crops every card's photo to 133/81; that
 * function falls back to the plain Featured Image for any Case with no
 * laptop photo uploaded, but the fallback still renders in this Laptop
 * frame, not the Screenshot one (Oleksandr's explicit call, 10.09).
 *
 * The visible border lives on a different element per style —
 * `.cases-featured__card` itself for Screenshot, `.cases-featured__card-body`
 * (a sibling the media overlaps) for Laptop — so each gets its own
 * hover rule rather than sharing the `.io-case-hover` utility (css/
 * base.css).
 *
 * @package intobi
 */

.cases-featured__container {
	display: flex;
	flex-direction: column;
	gap: 32px;
	padding-top: var(--io-section-py);
	padding-bottom: var(--io-section-py);
}

/* "Cases per row" = 2 (init.php's "columns" field) — the single Service
   page's own section (node 2001:9766) sits in a narrower, 1024px-capped
   column, same convention as related_services_block/block.css's own
   content-column cap; see block.js for the matching ≥1024px slide-count
   change (2 instead of 3). */
.cases-featured--cols-2 .cases-featured__container {
	max-width: 1024px;
}

@media (min-width: 1024px) {
	.cases-featured__container {
		gap: 64px;
	}
}

.site-main__toc-content .cases-featured__container {
	gap: 32px;
}

.cases-featured__header {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 16px;
	width: 100%;
}

/* .cases-featured__heading — font-size now comes from the base h2 cascade (css/base.css) */

/* ---------------------------------------------------------------
   Swiper — see steps_block/block.css's top comment: core layout CSS
   comes from swiper-bundle.min.css, this is purely the visual skin.
------------------------------------------------------------------ */

.cases-featured__swiper {
	width: 100%;
}

.cases-featured__slide {
	height: auto !important;
}

.cases-featured__card {
	display: flex;
	flex-direction: column;
	height: 100%;
	background: var(--io-bg);
	border: 1px solid var(--io-border);
	border-radius: var(--io-radius-card);
	padding: 8px;
	transition: border-color 0.15s ease;
}

.cases-featured__card:hover,
.cases-featured__card:focus-within {
	border-color: var(--io-highlight);
}

/* Wraps the whole card (media + body) in one click target — display:
   contents so it doesn't disturb `.cases-featured__card`'s own flex
   layout. */
.cases-featured__card-link {
	display: contents;
	color: inherit;
	text-decoration: none;
}

.cases-featured__card-media {
	position: relative;
	aspect-ratio: 1 / 1;
	width: 100%;
	overflow: hidden;
	border-radius: var(--io-radius-btn) var(--io-radius-btn) 0 0;
	z-index: 1;
}

.cases-featured__card-media::after {
	content: '';
	position: absolute;
	inset: auto 0 0 0;
	height: 120px;
	background: linear-gradient(to bottom, rgba(255, 255, 255, 0), var(--io-bg) 70%);
	pointer-events: none;
}

.cases-featured__card-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: top;
	display: block;
}

.cases-featured__card-body {
	position: relative;
	z-index: 2;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 16px;
	padding: 0 24px 24px;
}

.cases-featured__card-title {
	font-size: 24px;
}

/* ---------------------------------------------------------------
   "Card design" switcher — laptop mockup (Figma kit "Case"/Medium,
   node 2001:2516). Crops tall photos to aspect-ratio 133/81 (same idea
   as Screenshot's square crop, just a different ratio/no fade), inset
   to the same width as .cases-featured__card-excerpt below (both use
   24px), and tucks slightly under a white/bordered body via the same
   overlap trick. Card chrome (background/border) moves from
   `.cases-featured__card` (reset to transparent below) to the body,
   same as the "Medium" component's own two-part structure.
   10.09: `overflow: hidden` (not `visible`) is required for the
   aspect-ratio to actually apply — `.cases-featured__card` is a flex
   container, and a flex item with `overflow: visible` gets an
   automatic minimum size from its content (the img) that can override
   an explicit aspect-ratio; `hidden` makes that automatic minimum 0,
   so the ratio wins and the image gets cropped, same as it needs to be
   anyway.
------------------------------------------------------------------ */

.cases-featured__card--laptop,
.cases-featured__card--laptop:hover,
.cases-featured__card--laptop:focus-within {
	background: transparent;
	border-color: transparent;
	padding: 0;
}

.cases-featured__card--laptop .cases-featured__card-media {
	aspect-ratio: 133 / 81;
	width: calc(100% - 48px);
	margin-inline: 24px;
	overflow: hidden;
	border-radius: var(--io-radius-card);
	margin-bottom: -80px;
	z-index: 2;
}

.cases-featured__card--laptop .cases-featured__card-media::after {
	content: none;
}

.cases-featured__card--laptop .cases-featured__card-body {
	background: var(--io-bg);
	border: 1px solid var(--io-border);
	border-radius: var(--io-radius-card);
	padding: 96px 24px 24px;
	z-index: 1;
	transition: border-color 0.15s ease;
}

.cases-featured__card--laptop:hover .cases-featured__card-body,
.cases-featured__card--laptop:focus-within .cases-featured__card-body {
	border-color: var(--io-highlight);
}

.cases-featured__card-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
}

.cases-featured__tag {
	display: inline-flex;
	align-items: center;
	padding: 8px;
	border-radius: 16px;
	background: rgba(199, 181, 242, 0.25);
	color: var(--io-primary-dark);
	font-family: var(--io-font-body);
	font-weight: 700;
	font-size: 14px;
	line-height: 1.125;
}

.cases-featured__card-excerpt {
	font-size: 16px;
	line-height: 1.5;
	color: var(--io-body);
	display: -webkit-box;
	-webkit-line-clamp: 4;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.cases-featured__card-excerpt p {
	margin: 0 0 12px;
}

.cases-featured__card-excerpt p:last-child {
	margin-bottom: 0;
}

/* ---------------------------------------------------------------
   Nav — two circular OUTLINE buttons (unlike Steps' filled purple
   buttons — Figma uses the outline treatment here, node 2001:7098/9).
------------------------------------------------------------------ */

.cases-featured__nav {
	display: flex;
	align-items: center;
	gap: 16px;
}

/* .cases-featured__nav-btn — visuals now come from the shared
   .io-icon-btn / .io-icon-btn--outline classes (css/base.css) added
   alongside it in block.php; kept here only as the JS hook for
   --prev/--next/--disabled. */

/* Figma "Outline/Inactive" (node 2001:2346): border + icon both use
   Text/muted (#81858c), not Border/additional — a flat single-tone
   grey read, not a paler border. */
.cases-featured__nav-btn--disabled {
	border-color: var(--io-muted);
	color: var(--io-muted);
	cursor: not-allowed;
	pointer-events: none;
}
.cases-featured__nav-btn--disabled svg path {
	stroke: var(--io-muted);
}

/* .cases-featured__empty-state — see .io-empty-state (css/base.css) */
