/**
 * Category Page Tabs.
 * Sizes use container query units of the element (cqw), so the layout scales with the site container.
 * Breakpoints: layered tabs >= 768px, swipeable tab row <= 767px.
 */

/* Clip the next-slide preview / mobile slides at the viewport, never the page. */
.wve-side-spacing:has(> .wve-cpt) {
	overflow-x: clip;
}

.wve-cpt {
	--wve-cpt-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
	--wve-cpt-speed: 0.65s;
	--wve-cpt-peek: 0px;
	position: relative;
	box-sizing: border-box;
	width: 100%;
	color: #000;
	container-type: inline-size;
}

.wve-cpt *,
.wve-cpt *::before,
.wve-cpt *::after {
	box-sizing: border-box;
}

/* Palettes. tone a/b = tabs behind the front tab (alternating), front = active tab + panel. */
.wve-cpt--serve {
	--strip: #121213;
	--logo: #fff860;
	--front: #fff860;
	--front-ink: #000;
	--tone-a: #f8f1ac;
	--tone-b: #ebdd47;
	--tab-ink: #000;
	--preview: #000;
	--preview-ink: #fff860;
}

.wve-cpt--bare {
	--strip: #6becdc;
	--logo: #fff;
	--front: #6becdc;
	--front-ink: #000;
	--tone-a: #abfff5;
	--tone-b: #cae5e1;
	--tab-ink: #000;
	--preview: #bce6e0;
	--preview-ink: #000;
}

.wve-cpt--move {
	--strip: #fc78a8;
	--logo: #fff;
	--front: #cf7eea;
	--front-ink: #000;
	--tone-a: #dbed87;
	--tone-b: #62c1ed;
	--tab-ink: #000;
	--preview: #ffe3ee;
	--preview-ink: #000;
}

.wve-cpt--loud {
	--strip: #cafc4c;
	--logo: #000;
	--front: #cafc4c;
	--front-ink: #000;
	--tone-a: #b2c667;
	--tone-b: #f6fed1;
	--tab-ink: #000;
	--preview: #e9f7ab;
	--preview-ink: #000;
}

.wve-cpt--inner {
	--strip: #000;
	--logo: #fff;
	--front: #000;
	--front-ink: #fff;
	--tone-a: #d8d8d8;
	--tone-b: #b9b9b9;
	--tab-ink: #000;
	--preview: #6b6b6b;
	--preview-ink: #fff;
}

/* ── Hero ─────────────────────────────────────────────────────────── */
.wve-cpt-hero {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 50cqw;
	padding: 3cqw 0;
}

.wve-cpt .wve-cpt-title {
	margin: 0;
	padding: 0;
	font-weight: 400;
	line-height: 1;
	letter-spacing: 0;
	white-space: nowrap;
	text-transform: lowercase;
}

.wve-cpt--serve .wve-cpt-title {
	width: 112cqw;
	margin: 0 -6cqw;
	padding: 0.02em 0 0.05em;
	background: #121213;
	color: #fff860;
	font-family: "Inter Variable", Inter, Arial, sans-serif;
	font-size: 25cqw;
	font-weight: 500;
	line-height: 1;
	letter-spacing: -0.02em;
	text-align: center;
	text-transform: uppercase;
	transform: translateY(1.5cqw) rotate(-10deg);
}

.wve-cpt--bare .wve-cpt-hero {
	justify-content: flex-start;
	overflow-x: clip;
}

.wve-cpt--bare .wve-cpt-title {
	color: #6becdc;
	font-family: "Cook Psychesans", "Arial Black", Impact, sans-serif;
	font-size: 42cqw;
	letter-spacing: -0.02em;
	line-height: 1;
	text-transform: uppercase;
	/* Cook Psychesans draws high in its em box. */
	transform: translateY(0.15em);
}

.wve-cpt--move .wve-cpt-title {
	color: #fc78a8;
	font-family: "Better Times", "Segoe Script", "Brush Script MT", cursive;
	font-size: 48cqw;
	line-height: 1.05;
}

.wve-cpt--loud .wve-cpt-title {
	color: #cafc4c;
	font-family: UnifrakturCook, UnifrakturMaguntia, "Old English Text MT", serif;
	font-size: 31cqw;
	font-weight: 700;
	line-height: 1.15;
	text-shadow: 0.03em 0.03em 0 #1d1d1d;
}

.wve-cpt--inner .wve-cpt-title {
	color: #000;
	font-family: "Shantell Sans", "Comic Neue", "Comic Sans MS", cursive;
	font-size: 12.5cqw;
	font-weight: 700;
	line-height: 0.88;
	letter-spacing: -0.02em;
	white-space: normal;
}

.wve-cpt--inner .wve-cpt-word {
	display: block;
}

.wve-cpt--inner .wve-cpt-word-1 {
	padding-left: 0.4em;
	font-size: 0.45em;
	line-height: 1.1;
}

/* ── Stage: layered tabs + panels ─────────────────────────────────── */
.wve-cpt-stage {
	--s: max(6px, 1.55cqw);
	--th: max(30px, 4cqw);
	--lw: 12cqw;
	--tw: min(16.6cqw, (100cqw - var(--lw)) / var(--n));
	--gap: max(16px, 3cqw);
	position: relative;
	container-type: inline-size;
}

.wve-cpt-nav {
	position: relative;
	height: calc((var(--n) - 1) * var(--s) + var(--th));
}

.wve-cpt-logo {
	position: absolute;
	top: 0;
	right: 0;
	left: 0;
	z-index: 0;
	display: flex;
	align-items: center;
	height: var(--th);
	padding-left: 1.4cqw;
	background: var(--strip);
	color: var(--logo);
	line-height: 1;
	white-space: nowrap;
	overflow: hidden;
	text-transform: lowercase;
}

.wve-cpt-logo span {
	display: block;
	font-size: calc(var(--th) * 0.62);
}

.wve-cpt--serve .wve-cpt-logo span {
	font-family: "Inter Variable", Inter, Arial, sans-serif;
	font-size: calc(var(--th) * 0.42);
	font-style: italic;
	font-weight: 600;
	text-transform: uppercase;
	transform: rotate(-8deg);
}

.wve-cpt--bare .wve-cpt-logo span {
	font-family: "Cook Psychesans", "Arial Black", Impact, sans-serif;
	text-transform: uppercase;
}

.wve-cpt--move .wve-cpt-logo span {
	font-family: "Better Times", "Segoe Script", "Brush Script MT", cursive;
	font-size: calc(var(--th) * 0.7);
}

.wve-cpt--loud .wve-cpt-logo span {
	font-family: UnifrakturCook, UnifrakturMaguntia, "Old English Text MT", serif;
	font-weight: 700;
}

.wve-cpt--inner .wve-cpt-logo span {
	font-family: "Shantell Sans", "Comic Neue", "Comic Sans MS", cursive;
	font-size: calc(var(--th) * 0.5);
	font-weight: 700;
}

/* Body strip of the layer at depth --d: from the left edge to the right edge of that layer's tab. */
.wve-cpt-strip {
	position: absolute;
	top: calc((var(--n) - 1 - var(--d)) * var(--s) + var(--th));
	bottom: 0;
	left: 0;
	z-index: calc(var(--n) - var(--d));
	width: calc(100% - var(--d) * var(--tw));
}

.wve-cpt-tablist {
	position: absolute;
	inset: 0;
}

.wve-cpt .wve-cpt-tab {
	position: absolute;
	top: 0;
	right: 0;
	z-index: calc(var(--n) - var(--d));
	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--tw);
	height: var(--th);
	margin: 0;
	padding: 0 0.6em;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	font-family: var(--wve-font-space-mono, "Space Mono", ui-monospace, monospace);
	font-size: max(10px, 1.1cqw);
	font-weight: 400;
	line-height: 1.1;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	cursor: pointer;
	transform: translate(calc(var(--d) * var(--tw) * -1), calc((var(--n) - 1 - var(--d)) * var(--s)));
	transition: transform var(--wve-cpt-speed) var(--wve-cpt-ease), background-color var(--wve-cpt-speed) ease, color var(--wve-cpt-speed) ease;
	-webkit-tap-highlight-color: transparent;
}

.wve-cpt-tab span {
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
	pointer-events: none;
}

.wve-cpt [data-tone="a"] {
	background-color: var(--tone-a);
	color: var(--tab-ink);
}

.wve-cpt [data-tone="b"] {
	background-color: var(--tone-b);
	color: var(--tab-ink);
}

.wve-cpt .wve-cpt-tab[data-tone="front"] {
	background-color: var(--front);
	color: var(--front-ink);
	cursor: default;
}

.wve-cpt .wve-cpt-tab:hover:not([data-tone="front"]) {
	filter: brightness(0.94);
}

.wve-cpt .wve-cpt-tab:focus {
	outline: none;
}

.wve-cpt .wve-cpt-tab:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: -5px;
}

/* Panels: active panel at --rel 0, next-slide preview at 1, previous at -1. */
.wve-cpt-panels {
	position: relative;
	height: 46.3cqw;
	touch-action: pan-y;
	/* Left edge = container edge (outgoing slide stays inside); right side stays open for the preview. */
	clip-path: inset(-50% -100vw -50% 0);
}

.wve-cpt-panel {
	--drag: 0px;
	position: absolute;
	inset: 0;
	z-index: 1;
	display: flex;
	align-items: center;
	gap: 12.8cqw;
	padding: 1.8cqw 5cqw 2.2cqw 4.9cqw;
	background-color: var(--front);
	color: var(--front-ink);
	transform: translateX(calc(var(--rel) * (100% + var(--gap)) + var(--drag)));
	transition: transform var(--wve-cpt-speed) var(--wve-cpt-ease), background-color var(--wve-cpt-speed) ease, color var(--wve-cpt-speed) ease, opacity var(--wve-cpt-speed) ease, visibility 0s linear 0s;
}

.wve-cpt-panel[data-rel="0"] {
	z-index: 2;
}

.wve-cpt-panel[data-rel="1"] {
	background-color: var(--preview);
	color: var(--preview-ink);
	cursor: pointer;
}

.wve-cpt-panel:not([data-rel="0"]):not([data-rel="1"]):not([data-rel="-1"]) {
	visibility: hidden;
	opacity: 0;
	transition-delay: 0s, 0s, 0s, 0s, var(--wve-cpt-speed);
}

/* Previous panel slips back behind the stack (slower than the incoming one: parallax). */
.wve-cpt-panel[data-rel="-1"] {
	visibility: hidden;
	opacity: 0;
	transform: translateX(calc(-24% + var(--drag)));
	transition-delay: 0s, 0s, 0s, 0s, var(--wve-cpt-speed);
}

/* Preview only where the viewport has room beside the container. */
.wve-cpt:not(.has-peek) .wve-cpt-panel[data-rel="1"] {
	visibility: hidden;
	opacity: 0;
	transition-delay: 0s, 0s, 0s, 0s, var(--wve-cpt-speed);
}

.wve-cpt-panel-tab {
	position: absolute;
	bottom: 100%;
	left: calc(var(--wve-cpt-peek) - min(var(--tw), var(--wve-cpt-peek)));
	display: flex;
	align-items: center;
	justify-content: center;
	width: min(var(--tw), var(--wve-cpt-peek));
	height: var(--th);
	padding: 0 0.6em;
	overflow: hidden;
	background-color: inherit;
	color: inherit;
	font-family: var(--wve-font-space-mono, "Space Mono", ui-monospace, monospace);
	font-size: max(10px, 1.1cqw);
	line-height: 1.1;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	white-space: nowrap;
	text-overflow: ellipsis;
	opacity: 0;
	transition: opacity calc(var(--wve-cpt-speed) / 2) ease;
}

.wve-cpt.has-peek-label .wve-cpt-panel[data-rel="1"] .wve-cpt-panel-tab {
	opacity: 1;
}

.wve-cpt-media {
	position: relative;
	display: block;
	flex: 0 0 30cqw;
	aspect-ratio: 135 / 191;
	overflow: hidden;
	border-radius: max(6px, 0.7cqw);
	background: rgba(0, 0, 0, 0.12);
}

.wve-cpt-media img,
.wve-cpt-img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
}

.wve-cpt .wve-cpt-post-title {
	flex: 1 1 auto;
	max-width: 42cqw;
	margin: 0;
	padding: 0;
	color: inherit;
	font-family: var(--wve-font-unbounded, "Unbounded", Arial, sans-serif);
	font-size: 3.4cqw;
	font-weight: 400;
	line-height: 1.12;
	letter-spacing: 0;
	text-transform: none;
	display: -webkit-box;
	overflow-wrap: break-word;
	text-wrap: pretty;
	-webkit-line-clamp: 6;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.wve-cpt .wve-cpt-post-title a {
	color: inherit;
	text-decoration: none;
}

.wve-cpt .wve-cpt-post-title a:hover {
	text-decoration: underline;
	text-decoration-thickness: 0.06em;
	text-underline-offset: 0.12em;
}

.wve-cpt .wve-cpt-post-title a:focus-visible,
.wve-cpt .wve-cpt-media:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 4px;
}

.wve-cpt.is-dragging .wve-cpt-panel {
	transition: none;
}

/* ── Mobile: swipeable tab row + swipeable panels ─────────────────── */
@media (max-width: 767px) {
	.wve-cpt-hero {
		min-height: 56cqw;
		padding: 4cqw 0 6cqw;
	}

	.wve-cpt-stage {
		--th: 40px;
	}

	.wve-cpt-nav {
		height: auto;
	}

	.wve-cpt-logo {
		position: relative;
		padding-left: 12px;
	}

	.wve-cpt-strip {
		display: none;
	}

	.wve-cpt-tablist {
		position: static;
		display: flex;
		overflow-x: auto;
		overscroll-behavior-x: contain;
		scroll-snap-type: x proximity;
		scrollbar-width: none;
	}

	.wve-cpt-tablist::-webkit-scrollbar {
		display: none;
	}

	.wve-cpt .wve-cpt-tab {
		position: relative;
		z-index: auto;
		flex: 0 0 auto;
		width: auto;
		min-width: 96px;
		padding: 0 16px;
		font-size: 12px;
		scroll-snap-align: start;
		transform: none;
	}

	.wve-cpt .wve-cpt-tab[data-alt="0"]:not([data-tone="front"]) {
		background-color: var(--tone-b);
		color: var(--tab-ink);
	}

	.wve-cpt .wve-cpt-tab[data-alt="1"]:not([data-tone="front"]) {
		background-color: var(--tone-a);
		color: var(--tab-ink);
	}

	.wve-cpt-panels {
		height: calc(56.6cqw + 8cqw);
	}

	.wve-cpt-panel {
		gap: 5cqw;
		padding: 4cqw;
	}

	.wve-cpt-panel[data-rel="1"] {
		cursor: auto;
	}

	/* Neighbours sit off-screen beside the active slide and follow the finger while swiping. */
	.wve-cpt .wve-cpt-panel[data-rel="1"],
	.wve-cpt .wve-cpt-panel[data-rel="-1"] {
		visibility: visible;
		opacity: 1;
		transform: translateX(calc(var(--rel) * (100% + var(--gap)) + var(--drag)));
		transition-delay: 0s;
	}

	.wve-cpt-panel-tab {
		display: none;
	}

	.wve-cpt-media {
		flex-basis: 40cqw;
	}

	.wve-cpt .wve-cpt-post-title {
		max-width: none;
		font-size: max(16px, 5cqw);
		line-height: 1.15;
		-webkit-line-clamp: 7;
	}
}

@media (prefers-reduced-motion: reduce) {
	.wve-cpt {
		--wve-cpt-speed: 0.01s;
	}
}
