/* IC Carousels (patterns/ic-carousel-peek.php = "IC Carousel: 80/20", patterns/ic-carousel-full.php = "IC Carousel: Full Width").
 * MTP-866, 2026-11-06: aligned with the SCD (scd-lifestyle, centred 3-up) and 300 NLS (transformation, 80/20) carousels.
 *
 * Mechanics are the shared .tt5c-carousel (landing.js + landing-base.css), unchanged: the track moves by one slide + gap,
 * read from layout. Every slide is 100% of the viewport's content box. The neighbours show in the viewport's padding,
 * because overflow clips at the padding box. So each layout is just "how wide is the slide, and where does the padding go":
 *   80/20 (default): the viewport sits on the page rails; padding-right holds the next slide's 20%.
 *   Full width (--full): the viewport is full bleed; equal padding on both sides centres the slide, with both neighbours showing.
 * `tt5c-nav--overlay` makes landing.js build the arrows into .tt5c-carousel__nav, over the photos, and only the counter
 * into the head. That's the same contract the SCD and 300 NLS sections use.
 * --tt5c-ic-cp-rail = the distance from the section edge to the content column, resolved against the section (an
 * inline-size container). */
.tt5c-ic-carousel-peek {
	--tt5c-ic-cp-w: 1200px; /* approximate — from Figma I5797:192850;5014:155524 (container = 1200) */
	--tt5c-ic-cp-rail: max(var(--wp--custom--layout--gutter), (100cqw - var(--tt5c-ic-cp-w)) / 2);
	--tt5c-ic-cp-gap: var(--wp--preset--spacing--27);
	--tt5c-ic-cp-pad: var(--wp--preset--spacing--40);
	--tt5c-ic-cp-ratio: 15 / 7; /* approximate — from Figma I5797:192850;5014:155524 (1200 x 560) */
	--tt5c-ic-cp-ratio-k: 0.4667; /* height / width of that ratio, for centring the arrows on the photo */
	/* 80/20: the column minus one gap, split 80 / 20. */
	--tt5c-ic-cp-col: calc(100cqw - 2 * var(--tt5c-ic-cp-rail));
	--tt5c-ic-cp-slide: calc((var(--tt5c-ic-cp-col) - var(--tt5c-ic-cp-gap)) * 0.8);
	--tt5c-ic-cp-arrow: 36px; /* approximate — from Figma UI Kit "Primary icon button" 9242:5730 (36 x 36, radius 4) */
	container-type: inline-size;
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	padding-inline: 0;
	overflow: hidden;
}
.tt5c-ic-carousel-peek > * { margin-block: 0; }

/* Full width: the active slide is centred at about 62% of the screen, the same proportion as scd-lifestyle (893 of 1440). */
.tt5c-ic-carousel-peek--full {
	--tt5c-ic-cp-slide: 62cqw; /* derived — not Figma: matches the SCD centred carousel */
}

/* Head: section title left, slide number right (upper right of the section), on the content rails. */
.tt5c-ic-carousel-peek .tt5c-carousel__head {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: var(--wp--preset--spacing--20) var(--wp--preset--spacing--35);
	margin: 0 var(--tt5c-ic-cp-rail) var(--wp--preset--spacing--50);
}
.tt5c-ic-carousel-peek .tt5c-carousel__head > * { margin-block: 0; }
.tt5c-ic-carousel-peek__title { margin: 0; }
.tt5c-ic-carousel-peek .tt5c-carousel__controls {
	margin-left: auto;
	gap: var(--wp--preset--spacing--20);
}
.tt5c-ic-carousel-peek .tt5c-carousel__counter {
	white-space: nowrap;
	font-family: var(--ico-type-label-strong-small-family);
	font-size: var(--ico-type-label-strong-small-size);
	font-weight: var(--ico-type-label-strong-small-weight);
	line-height: var(--ico-type-label-strong-small-lh);
	letter-spacing: var(--ico-type-label-strong-small-ls);
	text-transform: var(--ico-type-label-strong-small-case);
	font-variant-numeric: tabular-nums;
	color: var(--ico-color-text);
}
.tt5c-ic-carousel-peek.tt5c-ic-on-dark .tt5c-carousel__counter { color: var(--ico-color-on-dark); }

/* Viewport. */
.tt5c-ic-carousel-peek .tt5c-carousel__viewport {
	margin: 0 var(--tt5c-ic-cp-rail);
	padding: 0 calc(var(--tt5c-ic-cp-col) - var(--tt5c-ic-cp-slide)) 0 0;
	scroll-padding-inline: 0;
}
.tt5c-ic-carousel-peek--full .tt5c-carousel__viewport {
	margin: 0;
	padding: 0 calc((100cqw - var(--tt5c-ic-cp-slide)) / 2);
}
.tt5c-js .tt5c-ic-carousel-peek .tt5c-carousel__viewport { scroll-snap-type: none; }
.tt5c-ic-carousel-peek .tt5c-carousel__viewport:focus-visible { outline-offset: calc(var(--ico-btn-focus-ring-width) * -1); }
.tt5c-ic-carousel-peek .tt5c-carousel__viewport:focus:not(:focus-visible) { outline: none; }
.tt5c-ic-carousel-peek .tt5c-carousel__track.wp-block-group {
	gap: var(--tt5c-ic-cp-gap);
	margin: 0;
	align-items: stretch;
}

/* Slide: photo over the caption band. */
.tt5c-ic-carousel-peek .tt5c-slide {
	display: flex;
	flex-direction: column;
	flex: 0 0 100%;
	min-width: 100%;
	margin: 0;
	background: var(--ico-color-surface);
}
.tt5c-ic-carousel-peek .tt5c-slide > * { margin-block: 0; }
.tt5c-ic-carousel-peek__img {
	margin: 0;
	aspect-ratio: var(--tt5c-ic-cp-ratio);
	background: var(--ico-color-band-bg);
	overflow: hidden;
}
.tt5c-ic-carousel-peek__img img { display: block; width: 100%; height: 100%; object-fit: cover; }

.tt5c-ic-carousel-peek__caption {
	flex: 1;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: var(--wp--preset--spacing--20);
	padding: var(--tt5c-ic-cp-pad);
	color: var(--ico-color-text);
}
.tt5c-ic-carousel-peek__caption > * { margin-block: 0; }
.tt5c-ic-carousel-peek__row {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: var(--wp--preset--spacing--20) var(--wp--preset--spacing--35);
}
.tt5c-ic-carousel-peek__row > * { margin-block: 0; }
.tt5c-ic-carousel-peek__headline { margin: 0; color: inherit; }
.tt5c-ic-carousel-peek__actions { margin: 0; flex: none; }

/* Neighbours read as context, not as content competing with the active slide. */
.tt5c-js .tt5c-ic-carousel-peek .tt5c-slide:not(.is-active) .tt5c-ic-carousel-peek__caption > * { opacity: 0.45; }
.tt5c-js .tt5c-ic-carousel-peek .tt5c-slide .tt5c-ic-carousel-peek__caption > * { transition: opacity 0.4s ease; }

/* Arrows over the photos (landing.js .tt5c-carousel__nav). The strip spans the viewport, so it is the photo row across
 * the page column (80/20) or the full bleed (Full width, arrows over the neighbours as on SCD). It is as tall as the
 * active photo, so the arrows centre on the photo, not on the photo plus the caption. */
.tt5c-ic-carousel-peek .tt5c-carousel__nav {
	margin: 0; /* the viewport is a flow-layout group: its blockGap would push the absolutely placed strip down 26px */
	height: calc(var(--tt5c-ic-cp-slide) * var(--tt5c-ic-cp-ratio-k));
	padding: 0 var(--wp--preset--spacing--30);
}
.tt5c-ic-carousel-peek--full .tt5c-carousel__nav { padding-inline: var(--wp--custom--layout--gutter); }
.tt5c-ic-carousel-peek .tt5c-carousel__dots { display: none; } /* position is the counter (Figma); dots are not in the design */

/* Arrow button. States follow the Figma UI Kit "Primary icon button" (the arrow icon button, 9242:5730), which is the
 * Solid Citrus button language in --ico-btn-solid-citrus-* tokens:
 *   default  Citrus fill, light arrow    hover  Warm White 1 fill, Citrus stroke, Black arrow
 *   press    Black fill, light arrow     focus  2px Black ring, 2px outside (a Warm White 1 gap keeps it visible on photos)
 * The 36px box is drawn by ::before inside a 44px button, so the touch target stays at the layout tap size.
 * landing.js's chevron SVG is hidden, and ::after draws the UI Kit's straight arrow. */
.tt5c-ic-carousel-peek .tt5c-carousel__nav .tt5c-carousel__btn {
	position: relative;
	width: var(--wp--custom--layout--tap);
	height: var(--wp--custom--layout--tap);
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	-webkit-backdrop-filter: none;
	backdrop-filter: none;
	color: var(--ico-btn-solid-citrus-default-fg);
	transition: none;
}
.tt5c-ic-carousel-peek .tt5c-carousel__nav .tt5c-carousel__btn svg { display: none; }
.tt5c-ic-carousel-peek .tt5c-carousel__nav .tt5c-carousel__btn::before {
	content: "";
	position: absolute;
	inset: calc((100% - var(--tt5c-ic-cp-arrow)) / 2);
	border-radius: var(--ico-btn-radius);
	background: var(--ico-btn-solid-citrus-default-bg);
	box-shadow: inset 0 0 0 var(--ico-btn-border-width, 1px) var(--ico-btn-solid-citrus-default-border);
	transition: background-color 0.2s ease, box-shadow 0.2s ease;
}
.tt5c-ic-carousel-peek .tt5c-carousel__nav .tt5c-carousel__btn::after {
	content: "";
	position: relative;
	width: 1.25rem;
	height: 1.25rem;
	background: currentColor;
	-webkit-mask: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5'%3E%3Cpath d='M4 12h16M14 6l6 6-6 6'/%3E%3C/svg%3E");
	mask: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5'%3E%3Cpath d='M4 12h16M14 6l6 6-6 6'/%3E%3C/svg%3E");
}
.tt5c-ic-carousel-peek .tt5c-carousel__nav [data-carousel-prev]::after { transform: scaleX(-1); }
@media (hover: hover) {
	.tt5c-ic-carousel-peek .tt5c-carousel__nav .tt5c-carousel__btn:hover {
		background: none;
		color: var(--ico-btn-solid-citrus-hover-fg);
	}
	.tt5c-ic-carousel-peek .tt5c-carousel__nav .tt5c-carousel__btn:hover::before {
		background: var(--ico-btn-solid-citrus-hover-bg);
		box-shadow: inset 0 0 0 var(--ico-btn-border-width, 1px) var(--ico-btn-solid-citrus-hover-border);
	}
}
.tt5c-ic-carousel-peek .tt5c-carousel__nav .tt5c-carousel__btn:active { background: none; color: var(--ico-btn-solid-citrus-press-fg); }
.tt5c-ic-carousel-peek .tt5c-carousel__nav .tt5c-carousel__btn:active::before {
	background: var(--ico-btn-solid-citrus-press-bg);
	box-shadow: inset 0 0 0 var(--ico-btn-border-width, 1px) var(--ico-btn-solid-citrus-press-border);
}
.tt5c-ic-carousel-peek .tt5c-carousel__nav .tt5c-carousel__btn:focus-visible {
	outline: none;
	background: none;
}
.tt5c-ic-carousel-peek .tt5c-carousel__nav .tt5c-carousel__btn:focus-visible::before {
	box-shadow:
		inset 0 0 0 var(--ico-btn-border-width, 1px) var(--ico-btn-solid-citrus-default-border),
		0 0 0 var(--ico-btn-focus-ring-offset) var(--ico-color-warm-white-1),
		0 0 0 calc(var(--ico-btn-focus-ring-offset) + var(--ico-btn-focus-ring-width)) var(--ico-btn-focus-ring-color);
}

/* Variant: title kept for screen readers (it names the carousel region) but not shown, as on the Home comp. */
.tt5c-ic-carousel-peek--quiet-title .tt5c-ic-carousel-peek__title {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* Variant: captions over the photos (tt5c-ic-carousel-peek--overlay). */
.tt5c-ic-carousel-peek--overlay .tt5c-slide { position: relative; background: none; }
.tt5c-ic-carousel-peek--overlay .tt5c-ic-carousel-peek__caption {
	position: absolute;
	inset: auto 0 0 0;
	padding-top: var(--wp--preset--spacing--70);
	background: linear-gradient(to top, var(--ico-color-overlay-dark), transparent);
	color: var(--ico-color-on-dark);
}
.tt5c-ic-carousel-peek--overlay .tt5c-ic-carousel-peek__caption :where(p, h3) { color: inherit; }
/* Safety net if a slide keeps the Text Black button: render it as Text White on the photo. */
.tt5c-ic-carousel-peek--overlay .wp-block-button.is-style-ic-text-black .wp-block-button__link {
	color: var(--ico-btn-text-white-default-fg);
	background-image: linear-gradient(var(--ico-btn-text-white-default-rule), var(--ico-btn-text-white-default-rule));
}
.tt5c-ic-carousel-peek--overlay .wp-block-button.is-style-ic-text-black .wp-block-button__link:is(:hover, :focus-visible) {
	color: var(--ico-btn-text-white-hover-fg);
	background-image: linear-gradient(var(--ico-btn-text-white-hover-rule), var(--ico-btn-text-white-hover-rule));
}
.tt5c-ic-carousel-peek--overlay .tt5c-ic-carousel-peek__caption a:focus-visible { outline-color: var(--ico-color-on-dark); }
/* The neighbours' captions would show as clipped slivers of text on the photo. */
.tt5c-js .tt5c-ic-carousel-peek--overlay .tt5c-slide:not(.is-active) .tt5c-ic-carousel-peek__caption { visibility: hidden; }

@media (max-width: 900px) {
	.tt5c-ic-carousel-peek { --tt5c-ic-cp-pad: var(--wp--preset--spacing--30); }
	.tt5c-ic-carousel-peek--full { --tt5c-ic-cp-slide: 78cqw; } /* derived — not Figma: neighbours stay visible on tablets */
}
/* Phones: one slide on the page rails, for both layouts (the gap equals the rail, so the neighbour sits just past the
 * edge), a 3:2 photo, and the arrows inset on the photo. */
@media (max-width: 600px) {
	.tt5c-ic-carousel-peek,
	.tt5c-ic-carousel-peek--full {
		--tt5c-ic-cp-rail: var(--wp--custom--layout--gutter);
		--tt5c-ic-cp-gap: var(--wp--custom--layout--gutter);
		--tt5c-ic-cp-slide: var(--tt5c-ic-cp-col);
		--tt5c-ic-cp-ratio: 3 / 2;
		--tt5c-ic-cp-ratio-k: 0.6667;
	}
	.tt5c-ic-carousel-peek .tt5c-carousel__viewport,
	.tt5c-ic-carousel-peek--full .tt5c-carousel__viewport {
		margin: 0 var(--tt5c-ic-cp-rail);
		padding: 0;
	}
	.tt5c-ic-carousel-peek .tt5c-carousel__nav { padding-inline: var(--wp--preset--spacing--10); }
}

/* Editor: no JS, so landing-base shows every slide in a numbered 2-up grid. Keep it on the content column. */
.editor-styles-wrapper .tt5c-ic-carousel-peek .tt5c-carousel__viewport {
	margin-inline: var(--tt5c-ic-cp-rail);
	padding: 0;
	overflow: visible;
}
.editor-styles-wrapper .tt5c-ic-carousel-peek .tt5c-slide { position: relative; }
