/* IC Tabs (patterns/ic-tabs.php) and IC Tabs: Hover (patterns/ic-tabs-hover.php).
 * Generalized from plaza-utc-construction + plaza-utc-location. Behaviour: landing.js initTabs (unchanged); the
 * crossfade, `.is-tabs-ready` gating and no-JS fallback are landing-base.css's. This sheet is the IC look only.
 * Both variants live here: the loader picks up assets/css/ic/{registry name}.css, and only `ic-tabs` is in the registry.
 * Active indicator: a Citrus rule (the accent). It is not the only cue: the active label also steps from muted to full
 * text color. */

.tt5c-ic-tabs {
	--tt5c-ic-tabs-w: 1200px; /* approximate — from Figma I5797:192850;5014:155543 (1200 content container) */
	--tt5c-ic-tabs-rule: 3px; /* derived — not Figma: active-tab indicator thickness */
}
.tt5c-ic-tabs > * {
	max-width: var(--tt5c-ic-tabs-w);
	margin-inline: auto;
	margin-block: 0;
}
.tt5c-ic-tabs .tt5c-ic-tabs__title { margin-block: 0; }

/* ---------- Click tabs ---------- */

/* Tab row: one line, a hairline under it; scrolls sideways (no scrollbar) when the labels don't fit. landing.js keeps
 * the active tab in view. */
.tt5c-ic-tabs .tt5c-ic-tabs__list {
	margin-top: var(--wp--preset--spacing--40);
	gap: var(--wp--preset--spacing--40);
	align-items: stretch;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x proximity;
	scrollbar-width: none;
	box-shadow: inset 0 -1px 0 var(--ico-color-border);
}
.tt5c-ic-tabs .tt5c-ic-tabs__list::-webkit-scrollbar { display: none; }
.tt5c-ic-tabs .tt5c-ic-tabs__tab {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	min-height: var(--wp--custom--layout--tap);
	margin: 0;
	padding: var(--wp--preset--spacing--10) 0 var(--wp--preset--spacing--15);
	border-bottom: var(--tt5c-ic-tabs-rule) solid transparent;
	font-family: var(--ico-type-nav-v2-link-family);
	font-size: var(--ico-type-nav-v2-link-size);
	font-weight: var(--ico-type-nav-v2-link-weight);
	line-height: var(--ico-type-nav-v2-link-lh);
	letter-spacing: var(--ico-type-nav-v2-link-ls);
	text-transform: var(--ico-type-nav-v2-link-case);
	white-space: nowrap;
	color: var(--ico-color-text);
	scroll-snap-align: start;
	transition: color 0.2s ease-out, border-color 0.2s ease-out;
}
.tt5c-ic-tabs.is-tabs-ready .tt5c-ic-tabs__tab:not(.is-active) { color: var(--ico-color-text-muted); }
.tt5c-ic-tabs.is-tabs-ready .tt5c-ic-tabs__tab:not(.is-active):hover { color: var(--ico-color-text); }
.tt5c-ic-tabs.is-tabs-ready .tt5c-ic-tabs__tab.is-active { border-bottom-color: var(--ico-color-citrus); }
/* The row clips overflow, so ring the focused tab inside its own box. */
.tt5c-ic-tabs .tt5c-ic-tabs__tab:focus-visible { outline-offset: calc(var(--ico-btn-focus-ring-width) * -1); }

/* Panels: image beside copy. */
.tt5c-ic-tabs .tt5c-ic-tabs__panels { margin-top: var(--wp--preset--spacing--50); }
.tt5c-ic-tabs .tt5c-ic-tabs__panel {
	display: grid;
	grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
	gap: var(--wp--preset--spacing--50);
	align-items: center;
}
.tt5c-ic-tabs .tt5c-ic-tabs__panel > * { margin-block: 0; }
/* The panel takes focus when it has nothing focusable (landing.js); keep its ring off the image edge. */
.tt5c-ic-tabs .tt5c-ic-tabs__panel:focus-visible { outline-offset: var(--ico-btn-focus-ring-offset); }
.tt5c-ic-tabs .tt5c-ic-tabs__panel:focus:not(:focus-visible) { outline: none; }
.tt5c-ic-tabs .tt5c-ic-tabs__media.wp-block-image { margin: 0; }
.tt5c-ic-tabs .tt5c-ic-tabs__media img { display: block; width: 100%; }
.tt5c-ic-tabs .tt5c-ic-tabs__copy > * { margin-block: 0; }
.tt5c-ic-tabs .tt5c-ic-tabs__copy > .tt5c-ic-tabs__heading { margin-top: var(--wp--preset--spacing--20); }
.tt5c-ic-tabs .tt5c-ic-tabs__copy > .tt5c-ic-tabs__heading:first-child { margin-top: 0; }
.tt5c-ic-tabs .tt5c-ic-tabs__copy > * + p:not(.tt5c-ic-eyebrow) { margin-top: var(--wp--preset--spacing--30); }
.tt5c-ic-tabs .tt5c-ic-tabs__copy { max-width: var(--wp--custom--layout--measure); }

/* The open panel sets the panel area's height (phones: panels differ a lot); inactive ones sit on top while they fade
 * out. landing.js eases the height change. */
.tt5c-ic-tabs.is-tabs-ready:not(.tt5c-ic-tabs--hover) .tt5c-tabs__panels > .tt5c-tabs__panel:not(.is-active) {
	position: absolute;
	inset: 0 0 auto 0;
}

/* ---------- Hover tabs (full-bleed background swap) ---------- */

.tt5c-ic-tabs--hover {
	position: relative;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	min-height: 900px; /* approximate — from Figma 2057:1105 (1440 x 900 frame) */
}
/* Photos fill the section under everything. Two classes outrank base's `.is-tabs-ready .tt5c-tabs__panels`. */
.tt5c-ic-tabs--hover.tt5c-tabs > .tt5c-ic-tabs__stage {
	position: absolute;
	inset: 0;
	z-index: 0;
	max-width: none;
	margin: 0;
	display: grid;
	grid-template-rows: 100%;
	overflow: hidden;
}
.tt5c-ic-tabs--hover .tt5c-ic-tabs__bg.wp-block-image {
	grid-area: 1 / 1;
	height: 100%;
	min-height: 0;
	margin: 0;
	overflow: hidden;
}
.tt5c-ic-tabs--hover .tt5c-ic-tabs__bg img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}
/* Before the script is ready (or with no JS) only the first photo shows. */
.tt5c-ic-tabs--hover:not(.is-tabs-ready) .tt5c-ic-tabs__bg:not(:first-child) { display: none; }
/* The brand image overlay keeps on-dark copy readable on every photo. */
.tt5c-ic-tabs--hover::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
	background: var(--ico-color-overlay-dark);
}
.tt5c-ic-tabs--hover > :not(.tt5c-ic-tabs__stage) {
	position: relative;
	z-index: 2;
	width: 100%;
}
.tt5c-ic-tabs--hover .tt5c-ic-tabs__head > * { margin-block: 0; }
.tt5c-ic-tabs--hover .tt5c-ic-tabs__head > .tt5c-ic-tabs__title { margin-top: var(--wp--preset--spacing--20); }
.tt5c-ic-tabs--hover .tt5c-ic-tabs__intro {
	margin-top: var(--wp--preset--spacing--30);
	max-width: var(--wp--custom--layout--measure);
}

/* Items along the bottom: one column each, so a 5th item is one more column. */
.tt5c-ic-tabs--hover .tt5c-ic-tabs__items {
	margin-top: auto;
	padding-top: var(--wp--preset--spacing--55);
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: minmax(0, 1fr);
	gap: var(--wp--preset--spacing--40);
}
.tt5c-ic-tabs--hover .tt5c-ic-tabs__item {
	margin: 0;
	padding-top: var(--wp--preset--spacing--20);
	border-top: var(--tt5c-ic-tabs-rule) solid transparent;
	box-shadow: inset 0 1px 0 currentColor;
	transition: opacity 0.2s ease-out, border-color 0.2s ease-out;
}
.tt5c-ic-tabs--hover .tt5c-ic-tabs__item > * { margin-block: 0; }
.tt5c-ic-tabs--hover.is-tabs-ready .tt5c-ic-tabs__item:not(.is-active) { opacity: 0.75; }
.tt5c-ic-tabs--hover.is-tabs-ready .tt5c-ic-tabs__item:not(.is-active):hover { opacity: 1; }
.tt5c-ic-tabs--hover.is-tabs-ready .tt5c-ic-tabs__item.is-active { border-top-color: var(--ico-color-citrus); }
.tt5c-ic-tabs--hover .tt5c-ic-tabs__item-title {
	font-family: var(--ico-type-headline-subhead-family);
	font-size: var(--ico-type-headline-subhead-size);
	font-weight: var(--ico-type-headline-subhead-weight);
	line-height: var(--ico-type-headline-subhead-lh);
	letter-spacing: var(--ico-type-headline-subhead-ls);
	text-transform: var(--ico-type-headline-subhead-case);
}
.tt5c-ic-tabs--hover .tt5c-ic-tabs__item > .tt5c-ic-tabs__item-body { margin-top: var(--wp--preset--spacing--15); }

@media (prefers-reduced-motion: reduce) {
	.tt5c-ic-tabs .tt5c-ic-tabs__tab,
	.tt5c-ic-tabs--hover .tt5c-ic-tabs__item { transition: none; }
}

@media (max-width: 900px) {
	.tt5c-ic-tabs .tt5c-ic-tabs__panel {
		grid-template-columns: minmax(0, 1fr);
		gap: var(--wp--preset--spacing--35);
	}
	.tt5c-ic-tabs .tt5c-ic-tabs__panels { margin-top: var(--wp--preset--spacing--40); }
	.tt5c-ic-tabs .tt5c-ic-tabs__list { gap: var(--wp--preset--spacing--35); }

	.tt5c-ic-tabs--hover { min-height: 0; }
	.tt5c-ic-tabs--hover .tt5c-ic-tabs__items {
		grid-auto-flow: row;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		row-gap: var(--wp--preset--spacing--35);
	}
}
@media (max-width: 600px) {
	.tt5c-ic-tabs--hover .tt5c-ic-tabs__items { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Editor ----------
 * No JS runs in the editor, so landing-base.css already stacks every panel in order with a number badge. Two fixes:
 * the click-tab row (hidden by landing-base when <html> lacks .tt5c-js, which the editor canvas does) stays visible so
 * labels can be edited; and the hover photos become a row of numbered thumbnails above the copy, so each is reachable. */
.editor-styles-wrapper .tt5c-ic-tabs .tt5c-tabs__list.tt5c-ic-tabs__list { display: flex; }
.editor-styles-wrapper .tt5c-ic-tabs--hover.tt5c-tabs > .tt5c-ic-tabs__stage {
	position: relative;
	inset: auto;
	z-index: 2;
	max-width: var(--tt5c-ic-tabs-w);
	margin: 0 auto var(--wp--preset--spacing--40);
	grid-template-rows: none;
	grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); /* derived — not Figma: thumbnail width */
	gap: var(--wp--preset--spacing--15);
	overflow: visible;
}
.editor-styles-wrapper .tt5c-ic-tabs--hover .tt5c-ic-tabs__bg.wp-block-image {
	display: block;
	grid-area: auto;
	height: auto;
}
.editor-styles-wrapper .tt5c-ic-tabs--hover .tt5c-ic-tabs__bg img {
	height: auto;
	aspect-ratio: 16 / 9;
}
.editor-styles-wrapper .tt5c-ic-tabs--hover { min-height: 0; }
.editor-styles-wrapper .tt5c-ic-tabs--hover .tt5c-ic-tabs__items { margin-top: var(--wp--preset--spacing--55); }
