/* RKW Split Tabs
   ------------------------------------------------------------------ */

.rkw-st {
	--rkw-st-bg: #fdf8ef;
	--rkw-st-card-bg: #ffffff;
	--rkw-st-card-border: #f1e6d5;
	--rkw-st-card-title: #16324a;
	--rkw-st-active-bg: #123650;
	--rkw-st-active-title: #ffffff;
	--rkw-st-active-sub: #9db4c4;
	--rkw-st-panel-bg: #ffffff;
	--rkw-st-panel-border: #f1e6d5;
	--rkw-st-badge-bg: #0e3d4c;
	--rkw-st-badge-color: #ffffff;
	--rkw-st-heading: #16324a;
	--rkw-st-meta: #a0a6ab;
	--rkw-st-label: #de5220;
	--rkw-st-text: #3f4b55;
	--rkw-st-impact: #1f8a52;
	--rkw-st-radius: 14px;
	--rkw-st-gap: 22px;
	--rkw-st-panel-fr: 1.55fr;
	--rkw-st-card-min-h: 92px;
	--rkw-st-serif: Georgia, "Times New Roman", "Noto Serif", serif;
	--rkw-st-sans: inherit;

	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, var(--rkw-st-panel-fr)) minmax(0, 1fr);
	gap: var(--rkw-st-gap);
	align-items: start;
	background: var(--rkw-st-bg);
	padding: clamp(16px, 3vw, 34px);
	box-sizing: border-box;
}

.rkw-st *,
.rkw-st *::before,
.rkw-st *::after {
	box-sizing: border-box;
}

.rkw-st--left,
.rkw-st--right {
	grid-template-columns: minmax(0, 1fr) minmax(0, var(--rkw-st-panel-fr));
}

.rkw-st--right {
	grid-template-columns: minmax(0, var(--rkw-st-panel-fr)) minmax(0, 1fr);
}

/* Tab columns ------------------------------------------------------- */

/* The wrapper only exists to hold one tablist; on desktop the two columns
   act as direct grid items of .rkw-st. */
.rkw-st__tabs {
	display: contents;
}

.rkw-st__col--left  { grid-column: 1; grid-row: 1; }
.rkw-st__panels     { grid-column: 2; grid-row: 1; }
.rkw-st__col--right { grid-column: 3; grid-row: 1; }

.rkw-st--right .rkw-st__panels     { grid-column: 1; }
.rkw-st--right .rkw-st__col--right { grid-column: 2; }

.rkw-st__col {
	display: flex;
	flex-direction: column;
	gap: var(--rkw-st-gap);
	min-width: 0;
}

.rkw-st__tab {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 6px;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	min-height: var(--rkw-st-card-min-h);
	margin: 0;
	padding: 20px 22px;
	text-align: left;
	/* Themes often force button { white-space: nowrap } — undo it. */
	white-space: normal;
	word-break: normal;
	overflow-wrap: break-word;
	text-overflow: clip;
	background: var(--rkw-st-card-bg);
	border: 1px solid var(--rkw-st-card-border);
	border-radius: var(--rkw-st-radius);
	color: var(--rkw-st-card-title);
	cursor: pointer;
	box-shadow: none;
	transition: background-color .3s ease, color .3s ease, border-color .3s ease, transform .3s ease;
}

.rkw-st__tab:hover {
	border-color: var(--rkw-st-active-bg);
}

.rkw-st__tab:focus-visible {
	outline: 2px solid var(--rkw-st-label);
	outline-offset: 2px;
}

.rkw-st__tab.is-active {
	background: var(--rkw-st-active-bg);
	border-color: var(--rkw-st-active-bg);
	color: var(--rkw-st-active-title);
}

.rkw-st__tab-title {
	display: block;
	max-width: 100%;
	min-width: 0;
	white-space: normal;
	overflow-wrap: break-word;
	word-break: break-word;
	font-family: var(--rkw-st-serif);
	font-size: 17px;
	line-height: 1.32;
	letter-spacing: .005em;
}

.rkw-st__tab-sub {
	display: none;
	max-width: 100%;
	white-space: normal;
	overflow-wrap: break-word;
	word-break: break-word;
	font-family: var(--rkw-st-sans);
	font-size: 12.5px;
	line-height: 1.4;
	color: var(--rkw-st-active-sub);
}

.rkw-st__tab.is-active .rkw-st__tab-sub {
	display: block;
}

/* Panel ------------------------------------------------------------- */

.rkw-st__panels {
	min-width: 0;
}

.rkw-st__panel {
	background: var(--rkw-st-panel-bg);
	border: 1px solid var(--rkw-st-panel-border);
	border-radius: var(--rkw-st-radius);
	padding: 28px 30px 32px;
	color: var(--rkw-st-text);
}

.rkw-st__panel[hidden] {
	display: none;
}

.rkw-st__panel.is-animating {
	animation: rkw-st-fade .32s ease both;
}

@keyframes rkw-st-fade {
	from { opacity: 0; transform: translateY(6px); }
	to   { opacity: 1; transform: none; }
}

.rkw-st__panel:focus-visible {
	outline: 2px solid var(--rkw-st-label);
	outline-offset: 2px;
}

.rkw-st__badge {
	display: inline-block;
	margin-bottom: 18px;
	padding: 7px 16px;
	background: var(--rkw-st-badge-bg);
	color: var(--rkw-st-badge-color);
	border-radius: 999px;
	font-size: 12.5px;
	line-height: 1.2;
	letter-spacing: .01em;
}

.rkw-st__heading {
	margin: 0 0 8px;
	font-family: var(--rkw-st-serif);
	font-size: 21px;
	font-weight: 400;
	line-height: 1.3;
	color: var(--rkw-st-heading);
}

.rkw-st__meta {
	margin: 0 0 22px;
	font-size: 14px;
	font-style: italic;
	color: var(--rkw-st-meta);
}

.rkw-st__block + .rkw-st__block {
	margin-top: 20px;
}

.rkw-st__label {
	display: block;
	margin-bottom: 7px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--rkw-st-label);
}

.rkw-st__text {
	font-size: 14.5px;
	line-height: 1.62;
	color: var(--rkw-st-text);
	max-width: 62ch;
}

.rkw-st__text p {
	margin: 0 0 10px;
}

.rkw-st__text p:last-child {
	margin-bottom: 0;
}

.rkw-st__impact-value {
	display: block;
	font-family: var(--rkw-st-serif);
	font-size: 30px;
	line-height: 1.1;
	color: var(--rkw-st-impact);
}

.rkw-st__impact-caption {
	display: block;
	margin-top: 6px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--rkw-st-label);
}

.rkw-st-empty {
	padding: 14px 18px;
	border: 1px dashed #c9c9c9;
	color: #777;
	font-size: 14px;
}

/* Responsive -------------------------------------------------------- */

@media (max-width: 1024px) {
	.rkw-st,
	.rkw-st--left,
	.rkw-st--right {
		grid-template-columns: minmax(0, 1fr);
	}

	/* One single strip holding every card, left column first then right. */
	.rkw-st__tabs {
		display: flex;
		flex-direction: row;
		flex-wrap: nowrap;
		gap: 12px;
		grid-column: 1;
		grid-row: auto;
		order: 1;
		min-width: 0;
		overflow-x: auto;
		overscroll-behavior-x: contain;
		scroll-snap-type: x proximity;
		scroll-padding-left: 2px;
		padding-bottom: 10px;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: thin;
		scrollbar-color: rgba( 18, 54, 80, .25 ) transparent;
	}

	/* Columns stop being boxes so their cards join the same row. */
	.rkw-st__col,
	.rkw-st__col--left,
	.rkw-st__col--right {
		display: contents;
	}

	.rkw-st__panels {
		grid-column: 1;
		grid-row: auto;
		order: 2;
	}

	.rkw-st__tabs::-webkit-scrollbar {
		height: 6px;
	}

	.rkw-st__tabs::-webkit-scrollbar-track {
		background: transparent;
	}

	.rkw-st__tabs::-webkit-scrollbar-thumb {
		background: rgba( 18, 54, 80, .22 );
		border-radius: 999px;
	}

	.rkw-st__tab {
		flex: 0 0 auto;
		width: min( 68vw, 250px );
		min-height: 0;
		padding: 16px 18px;
		scroll-snap-align: start;
	}

	.rkw-st__tab-title {
		font-size: 15.5px;
	}

	.rkw-st__panel {
		padding: 24px 22px 26px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.rkw-st__tab,
	.rkw-st__panel.is-animating {
		transition: none;
		animation: none;
	}
}
