/*
 * Tabbed showcase
 */

.crunchr-tabbed-showcase {
	--crunchr-showcase-border: rgba(147, 197, 250, 0.3);
	--crunchr-showcase-muted: #baddff;

	box-sizing: border-box;
	padding: clamp(64px, 9vw, 150px) max(24px, calc((100% - 1248px) / 2));
	overflow: hidden;
	color: var(--wp--preset--color--white, #fff);
}

.crunchr-tabbed-showcase .crunchr-tab-panel__content,
.crunchr-tabbed-showcase .crunchr-tab-panel__content :where(p, li) {
	color: var(--wp--preset--color--white, #fff);
}

.crunchr-tabbed-showcase__tabs {
	display: flex;
	gap: clamp(16px, 2.8vw, 40px);
	align-items: stretch;
	margin: 0 auto clamp(40px, 5vw, 72px);
	padding: 14px 8px;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scrollbar-width: none;
	scroll-snap-type: x proximity;
	touch-action: pan-x;
	cursor: grab;
}

.crunchr-tabbed-showcase__tabs:active {
	cursor: grabbing;
}

.crunchr-tabbed-showcase__tabs::-webkit-scrollbar {
	display: none;
}

.crunchr-tabbed-showcase__tab {
	display: flex;
	flex: 1 0 300px;
	gap: 16px;
	align-items: center;
	min-height: 96px;
	padding: 16px 24px;
	color: var(--crunchr-showcase-muted);
	text-align: left;
	background: #174ca1;
	border: 1px solid #496fac;
	border-radius: 200px;
	box-shadow: 0 8px 30px rgba(5, 25, 59, 0);
	backdrop-filter: blur(3px);
	scroll-snap-align: center;
	will-change: transform;
	transform: translateZ(0);
	contain: layout style;
	transition:
		color 420ms ease,
		background-color 420ms ease,
		border-color 420ms ease,
		box-shadow 420ms ease,
		transform 420ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

button.crunchr-tabbed-showcase__tab {
	font: inherit;
	cursor: pointer;
}

.crunchr-tabbed-showcase__tab:hover {
	transform: translateY(-2px);
	border-color: rgba(186, 221, 255, 0.6);
}

.crunchr-tabbed-showcase__tab[aria-selected="true"] {
	color: var(--wp--preset--color--neutral-900, #171d26);
	background: #fff;
	border: 0.75px solid #fff;
	border-radius: 106px;
	box-shadow:
		inset -3px -4px 36.9px 0 rgba(255, 255, 255, 0.09),
		inset 4px 4px 22.2px 0 rgba(5, 25, 59, 0.05),
		1px 4px 27.7px 0 rgba(5, 25, 59, 0.38);
	backdrop-filter: blur(1.85px);
	transform: translateY(-3px);
	contain: layout style;
}

.crunchr-tabbed-showcase__tab[aria-selected="true"]
	.crunchr-tabbed-showcase__tab-copy strong {
	color: var(--wp--preset--color--blue-700, #174ca1);
}

.crunchr-tabbed-showcase__tab[aria-selected="true"]
	.crunchr-tabbed-showcase__tab-copy > span {
	color: var(--wp--preset--color--neutral-900, #171d26);
}

.crunchr-tabbed-showcase__tab:focus-visible {
	outline: 3px solid var(--wp--preset--color--blue-200, #93c5fa);
	outline-offset: 4px;
}

.crunchr-tabbed-showcase__tab-image {
	position: relative;
	display: block;
	width: 64px;
	height: 64px;
	flex: 0 0 64px;
	overflow: hidden;
	background: #dce2eb;
	border-radius: 50%;
}

.crunchr-tabbed-showcase__tab-image::after {
	position: absolute;
	inset: 0;
	pointer-events: none;
	content: "";
	background: rgba(5, 25, 59, 0.28);
	border-radius: inherit;
	opacity: 1;
	transition: opacity 420ms ease;
}

.crunchr-tabbed-showcase__tab[aria-selected="true"]
	.crunchr-tabbed-showcase__tab-image::after {
	opacity: 0;
}

.crunchr-tabbed-showcase__tab-image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: inherit;
}

.crunchr-tabbed-showcase.is-style-numbered-tabs .crunchr-tabbed-showcase__tabs {
	gap: clamp(16px, 2.8vw, 40px);
}

.crunchr-tabbed-showcase.is-style-numbered-tabs .crunchr-tabbed-showcase__tab {
	min-width: 300px;
	flex: 1 1 390px;
	min-height: 125px;
	padding: 29px 30px;
}

.crunchr-tabbed-showcase__tab-number {
	display: grid;
	width: 65px;
	height: 65px;
	flex: 0 0 65px;
	place-items: center;
	color: #baddff;
	font-size: var(--wp--preset--font-size--body);
	font-weight: 600;
	line-height: 1.4;
	background: #2b5dac;
	border: 0;
	border-radius: 50%;
	transition: color 420ms ease, background-color 420ms ease;
}

.crunchr-tabbed-showcase.is-style-numbered-tabs
	.crunchr-tabbed-showcase__tab[aria-selected="true"]
	.crunchr-tabbed-showcase__tab-number {
	color: #fff;
	background: var(--wp--preset--color--blue-700, #174ca1);
}

.crunchr-tabbed-showcase__tab-copy {
	display: grid;
	gap: 7px;
	min-width: 0;
}

.crunchr-tabbed-showcase__tab-copy strong {
	color: #b4d6fb;
	font-size: var(--wp--preset--font-size--eyebrow);
	font-weight: 500;
	line-height: 1.2;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.crunchr-tabbed-showcase__tab-copy > span {
	color: #b7d0f5;
	font-size: var(--wp--preset--font-size--caption);
	font-weight: 500;
	line-height: 1.5;
}

.crunchr-tabbed-showcase__tabs.is-compact-tabs
	.crunchr-tabbed-showcase__tab:not([aria-selected="true"]) {
	--crunchr-compact-tab-size: 96px;

	width: var(--crunchr-compact-tab-size);
	height: var(--crunchr-compact-tab-size);
	box-sizing: border-box;
	min-width: var(--crunchr-compact-tab-size);
	min-height: var(--crunchr-compact-tab-size);
	flex: 0 0 var(--crunchr-compact-tab-size);
	justify-content: center;
	padding: 0;
	border-radius: 50%;
}

.crunchr-tabbed-showcase__tabs.is-compact-tabs
	.crunchr-tabbed-showcase__tab:not([aria-selected="true"])
	.crunchr-tabbed-showcase__tab-copy {
	display: none;
}

.crunchr-tabbed-showcase.is-style-numbered-tabs
	.crunchr-tabbed-showcase__tabs.is-compact-tabs
	.crunchr-tabbed-showcase__tab:not([aria-selected="true"]) {
	--crunchr-compact-tab-size: 125px;

	padding: 0;
}

.crunchr-tabbed-showcase__stage {
	position: relative;
	transition: height 560ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.crunchr-tabbed-showcase.is-initialized .crunchr-tab-panel {
	position: absolute;
	top: 0;
	right: 0;
	left: 0;
	z-index: 0;
	visibility: hidden;
	opacity: 0;
	transform: translateY(18px) scale(0.992);
	pointer-events: none;
	transition:
		opacity 480ms ease,
		transform 620ms cubic-bezier(0.2, 0.8, 0.2, 1),
		visibility 0s linear 620ms;
}

.crunchr-tabbed-showcase.is-initialized .crunchr-tab-panel.is-active {
	position: relative;
	z-index: 1;
	visibility: visible;
	opacity: 1;
	transform: translateY(0) scale(1);
	pointer-events: auto;
	transition-delay: 80ms, 80ms, 0s;
}

.crunchr-tab-panel__default-layout {
	align-items: stretch !important;
}

.crunchr-tab-panel__default-layout > .wp-block-column {
	display: flex;
}

.crunchr-tab-panel__card {
	box-sizing: border-box;
	width: 100%;
	padding: clamp(24px, 3vw, 40px);
	color: #e7f3fe;
	background: #174ca1;
	border: 1px solid #496fac;
	border-radius: 16px;
}

.crunchr-tab-panel__card h3 {
	margin-top: 0;
	color: #fff;
	font-size: var(--wp--preset--font-size--body);
	font-weight: 600;
}

.crunchr-tab-panel__card--primary > p:not(.crunchr-tab-panel__summary) {
	margin: 0;
	padding: 13px 0;
	white-space: pre-wrap;
	border-bottom: 1px solid rgba(186, 221, 255, 0.22);
}

.crunchr-tab-panel__summary {
	margin: 24px 0 0;
	padding: 12px 16px;
	overflow: hidden;
	font-size: var(--wp--preset--font-size--caption);
	white-space: nowrap;
	text-overflow: ellipsis;
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid var(--crunchr-showcase-border);
	border-radius: 8px;
}

.crunchr-tab-panel__mobile-subtitle {
	display: none;
}

.crunchr-tab-panel__editor-header {
	display: flex;
	gap: 16px;
	align-items: center;
	margin-bottom: 24px;
	padding: 16px;
	color: var(--wp--preset--color--neutral-900, #171d26);
	background: #fff;
	border-radius: 12px;
}

.crunchr-tab-panel__image-button,
.crunchr-tab-panel__image-button img {
	width: 64px;
	height: 64px;
	object-fit: cover;
	border-radius: 50%;
}

.crunchr-tab-panel__editor-copy {
	flex: 1;
}

.crunchr-tab-panel__editor-copy p {
	margin: 4px 0;
}

.crunchr-tab-panel__title {
	font-size: var(--wp--preset--font-size--eyebrow);
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.editor-styles-wrapper .crunchr-tabbed-showcase.is-editor-preview .crunchr-tabbed-showcase__stage {
	height: auto !important;
}

.editor-styles-wrapper .crunchr-tabbed-showcase.is-editor-preview
	.crunchr-tabbed-showcase__stage
	> .block-editor-inner-blocks
	> .block-editor-block-list__layout
	> .wp-block-crunchr-tab-panel {
	position: relative;
	display: none;
	visibility: visible;
	margin-top: 0;
	opacity: 1;
	transform: none;
}

.editor-styles-wrapper .crunchr-tabbed-showcase.is-editor-preview.has-active-tab-0
	.wp-block-crunchr-tab-panel:nth-child(1),
.editor-styles-wrapper .crunchr-tabbed-showcase.is-editor-preview.has-active-tab-1
	.wp-block-crunchr-tab-panel:nth-child(2),
.editor-styles-wrapper .crunchr-tabbed-showcase.is-editor-preview.has-active-tab-2
	.wp-block-crunchr-tab-panel:nth-child(3),
.editor-styles-wrapper .crunchr-tabbed-showcase.is-editor-preview.has-active-tab-3
	.wp-block-crunchr-tab-panel:nth-child(4),
.editor-styles-wrapper .crunchr-tabbed-showcase.is-editor-preview.has-active-tab-4
	.wp-block-crunchr-tab-panel:nth-child(5),
.editor-styles-wrapper .crunchr-tabbed-showcase.is-editor-preview.has-active-tab-5
	.wp-block-crunchr-tab-panel:nth-child(6),
.editor-styles-wrapper .crunchr-tabbed-showcase.is-editor-preview.has-active-tab-6
	.wp-block-crunchr-tab-panel:nth-child(7),
.editor-styles-wrapper .crunchr-tabbed-showcase.is-editor-preview.has-active-tab-7
	.wp-block-crunchr-tab-panel:nth-child(8),
.editor-styles-wrapper .crunchr-tabbed-showcase.is-editor-preview.has-active-tab-8
	.wp-block-crunchr-tab-panel:nth-child(9),
.editor-styles-wrapper .crunchr-tabbed-showcase.is-editor-preview.has-active-tab-9
	.wp-block-crunchr-tab-panel:nth-child(10) {
	display: block;
}

@media (max-width: 781px) {
	.crunchr-tabbed-showcase {
		padding-right: 20px;
		padding-left: 20px;
	}

	.crunchr-tabbed-showcase__tabs {
		width: calc(100% + 40px);
		margin-right: -20px;
		margin-left: -20px;
		padding-right: calc(50% - 145px);
		padding-left: calc(50% - 145px);
		scroll-padding-inline: calc(50% - 145px);
	}

	.crunchr-tabbed-showcase__tab {
		width: max-content;
		min-width: 0;
		flex: 0 0 auto;
		min-height: 88px;
		padding: 12px 18px;
	}

	.crunchr-tabbed-showcase__tab-image {
		width: 56px;
		height: 56px;
		flex-basis: 56px;
	}

	.crunchr-tabbed-showcase.is-style-numbered-tabs .crunchr-tabbed-showcase__tab {
		min-width: 0;
		min-height: 104px;
		padding: 19px 22px;
	}

	.crunchr-tabbed-showcase__tabs.is-compact-tabs
		.crunchr-tabbed-showcase__tab[aria-selected="true"] {
		width: max-content;
		min-width: 0;
		flex: 0 0 auto;
	}

	.crunchr-tabbed-showcase.is-style-numbered-tabs
		.crunchr-tabbed-showcase__tabs.is-compact-tabs
		.crunchr-tabbed-showcase__tab:not([aria-selected="true"]) {
		--crunchr-compact-tab-size: 104px;
	}

	.crunchr-tabbed-showcase__tab-number {
		width: 64px;
		height: 64px;
		flex-basis: 64px;
	}

	.crunchr-tabbed-showcase__tab-copy > span {
		display: none;
	}

	.crunchr-tab-panel__mobile-subtitle {
		display: block;
		box-sizing: border-box;
		width: 100%;
		margin: 0 0 20px;
		color: var(--wp--preset--color--white, #fff);
		font-size: var(--wp--preset--font-size--h-5);
		font-weight: 500;
		line-height: 1.4;
	}

	.crunchr-tab-panel__default-layout {
		gap: 20px;
	}

	.crunchr-tab-panel__summary {
		white-space: normal;
	}
}

@media (max-width: 500px) {
	.crunchr-tabbed-showcase {
		padding-right: 10px;
		padding-left: 10px;
	}

	.crunchr-tabbed-showcase .crunchr-tab-panel__card {
		padding-right: 10px;
		padding-left: 10px;
	}

	.crunchr-tabbed-showcase .crunchr-tab-panel__card.crunchr-tab-panel__card--primary,
	.crunchr-tabbed-showcase .crunchr-tab-panel__card.crunchr-tab-panel__card--primary .has-body-small-font-size {
		font-size: var(--wp--preset--font-size--eyebrow) !important;
	}
}

@media (prefers-reduced-motion: reduce) {
	.crunchr-tabbed-showcase *,
	.crunchr-tabbed-showcase *::before,
	.crunchr-tabbed-showcase *::after {
		scroll-behavior: auto !important;
		transition-duration: 0.01ms !important;
	}
}
