/**
 * Comparison matrix + capacity explainer.
 *
 * Loaded on top of theme.css and deliberately additive: every selector here is
 * new and prefixed (.compare-* / .capacity-*), so this file can be dequeued
 * without leaving a hole in the design system. Tokens only — never a literal
 * colour, or the Customizer's brand override stops reaching this section.
 */

/* ══ Comparison matrix ══ */

.compare__sr {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.compare__scroll {
	border: 1px solid var(--border);
	border-radius: var(--r-lg);
	background: var(--surface);
	box-shadow: var(--shadow-sm);
	/* The container never exceeds its column, so the page body cannot be
	   pushed into a horizontal scrollbar by a wide matrix. */
	max-width: 100%;
}

.compare__scroll:focus-visible {
	outline: 2px solid var(--brand);
	outline-offset: 3px;
}

.compare__table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.94rem;
	text-align: left;
}

/* Header row. Sticky only on desktop: below the breakpoint the wrapper becomes
   a scroll container, and a scroll container clips top-stickiness anyway. */
.compare__table thead th {
	position: sticky;
	top: var(--header-h);
	z-index: 2;
	padding: 18px 16px;
	background: var(--bg-soft);
	border-bottom: 1px solid var(--border);
	vertical-align: bottom;
}

.compare__table thead th:first-child {
	border-top-left-radius: var(--r-lg);
}

.compare__table thead th:last-child {
	border-top-right-radius: var(--r-lg);
}

.compare__corner {
	font-size: 0.76rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--text-3);
}

.compare__plan {
	min-width: 132px;
	text-align: center;
}

.compare__plan-name {
	display: block;
	font-size: 1rem;
	font-weight: 700;
	color: var(--text);
}

.compare__plan-price {
	display: block;
	margin-top: 2px;
	font-size: 0.85rem;
	font-weight: 500;
	color: var(--text-2);
}

.compare__plan-price small {
	font-size: 0.78em;
	color: var(--text-3);
}

/* The featured plan gets the gradient hairline the pricing card uses, so the
   eye lands on the same column it landed on a screen above. */
.compare__plan--featured {
	box-shadow: inset 0 3px 0 0 var(--brand);
}

.compare__plan--featured .compare__plan-name {
	color: var(--brand);
}

.compare__group-row th {
	padding: 14px 16px;
	font-size: 0.74rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--text-2);
	background: var(--bg-mute);
	border-top: 1px solid var(--border);
	border-bottom: 1px solid var(--border-soft);
}

.compare__group:first-of-type .compare__group-row th {
	border-top: 0;
}

.compare__label {
	padding: 14px 16px;
	font-weight: 500;
	color: var(--text);
	background: var(--surface);
	border-bottom: 1px solid var(--border-soft);
}

.compare__note {
	display: block;
	margin-top: 2px;
	font-size: 0.79rem;
	font-weight: 400;
	line-height: 1.45;
	color: var(--text-3);
}

.compare__cell {
	padding: 14px 16px;
	text-align: center;
	color: var(--text-2);
	border-bottom: 1px solid var(--border-soft);
}

.compare__table tbody tr:hover .compare__label,
.compare__table tbody tr:hover .compare__cell {
	background: var(--bg-soft);
}

.compare__yes {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	border-radius: var(--r-full);
	color: var(--brand);
	background: color-mix(in srgb, var(--brand) 12%, transparent);
}

/* Muted dash, never a red cross: a tier that omits a feature is not an error
   state, and red on a pricing page reads as "something is broken". */
.compare__dash {
	color: var(--text-3);
	font-size: 1.1rem;
	line-height: 1;
}

.compare__cell--text {
	font-weight: 600;
	color: var(--text);
}

.compare__foot {
	margin-top: 24px;
	text-align: center;
	font-size: 0.9rem;
	color: var(--text-3);
}

/* Mobile plan picker — hidden by default, shown by the media query below, and
   only ever un-hidden by JS. */
.compare__chips {
	display: none;
	gap: 8px;
	margin-bottom: 16px;
	overflow-x: auto;
	padding-bottom: 4px;
	scrollbar-width: none;
}

.compare__chips::-webkit-scrollbar {
	display: none;
}

.compare__chip {
	flex: 0 0 auto;
	padding: 8px 16px;
	font: inherit;
	font-size: 0.88rem;
	font-weight: 600;
	color: var(--text-2);
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--r-full);
	cursor: pointer;
	transition: color 0.18s var(--ease), background 0.18s var(--ease), border-color 0.18s var(--ease);
}

.compare__chip:hover {
	color: var(--text);
	border-color: var(--brand);
}

.compare__chip.is-on {
	color: var(--on-brand);
	background: var(--brand-grad);
	border-color: transparent;
	box-shadow: var(--shadow-sm);
}

@media (max-width: 760px) {
	.compare__chips {
		display: flex;
	}

	/* Below the breakpoint the wrapper scrolls, which is the no-JS fallback:
	   the label column pins so a value is never orphaned from its row. */
	.compare__scroll {
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}

	.compare__table thead th {
		position: static;
	}

	.compare__label,
	.compare__corner {
		position: sticky;
		left: 0;
		z-index: 1;
		min-width: 150px;
		box-shadow: 1px 0 0 0 var(--border-soft);
	}

	.compare__corner {
		background: var(--bg-soft);
	}

	.compare__table tbody tr:hover .compare__label {
		background: var(--surface);
	}

	/* Set by the chip script. Scoped to this width on purpose — the class stays
	   on the cells at every size, but hiding columns is a small-screen answer. */
	.compare__table .is-off {
		display: none;
	}

	.compare__label,
	.compare__cell,
	.compare__table thead th {
		padding: 12px;
	}
}

@media (max-width: 400px) {
	.compare__table {
		font-size: 0.88rem;
	}

	.compare__label,
	.compare__corner {
		min-width: 132px;
	}
}

/* ══ How capacity works ══ */

.capacity-steps {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 18px;
	margin: 0 0 40px;
	padding: 0;
	list-style: none;
	counter-reset: none;
}

.capacity-step {
	position: relative;
	padding: 24px 20px 22px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--r-lg);
	box-shadow: var(--shadow-sm);
	transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease);
}

.capacity-step:hover {
	transform: translateY(-3px);
	box-shadow: var(--shadow);
}

.capacity-step__num {
	position: absolute;
	top: 18px;
	right: 18px;
	font-size: 0.78rem;
	font-weight: 700;
	color: var(--text-3);
}

.capacity-step__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	margin-bottom: 14px;
	color: var(--brand);
	background: color-mix(in srgb, var(--brand) 10%, transparent);
	border-radius: var(--r);
}

.capacity-step__title {
	margin: 0 0 6px;
	font-size: 1rem;
	font-weight: 700;
	color: var(--text);
}

.capacity-step__body {
	margin: 0;
	font-size: 0.9rem;
	line-height: 1.6;
	color: var(--text-2);
}

/* The two scope columns. This is the block that stops the support ticket, so
   it is heavier than the steps above it, not lighter. */
.capacity-scopes {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 20px;
}

.capacity-scope {
	padding: 26px 24px;
	background: var(--bg-soft);
	border: 1px solid var(--border);
	border-radius: var(--r-xl);
}

.capacity-scope--pooled {
	border-color: color-mix(in srgb, var(--brand) 35%, var(--border));
	background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 6%, var(--bg-soft)) 0%, var(--bg-soft) 60%);
}

.capacity-scope__head {
	display: flex;
	gap: 14px;
	align-items: flex-start;
	padding-bottom: 18px;
	margin-bottom: 18px;
	border-bottom: 1px solid var(--border-soft);
}

.capacity-scope__badge {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border-radius: var(--r-full);
	color: var(--brand);
	background: color-mix(in srgb, var(--brand) 12%, transparent);
}

.capacity-scope--workspace .capacity-scope__badge {
	color: var(--text-2);
	background: var(--bg-mute);
}

.capacity-scope__head h3 {
	margin: 0 0 4px;
	font-size: 1.02rem;
	font-weight: 700;
	color: var(--text);
}

.capacity-scope__head p {
	margin: 0;
	font-size: 0.88rem;
	line-height: 1.55;
	color: var(--text-2);
}

.capacity-scope__list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.capacity-scope__list li {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 7px 13px;
	font-size: 0.86rem;
	font-weight: 500;
	color: var(--text);
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--r-full);
}

.capacity-scope__list li svg {
	flex: 0 0 auto;
	color: var(--text-3);
}

.capacity-scope--pooled .capacity-scope__list li svg {
	color: var(--brand);
}

.capacity-foot {
	margin: 30px 0 0;
	text-align: center;
	font-size: 0.92rem;
	color: var(--text-3);
}

.capacity-foot__link {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	color: var(--brand);
	font-weight: 600;
	text-decoration: none;
}

.capacity-foot__link:hover {
	text-decoration: underline;
}

@media (max-width: 1000px) {
	.capacity-steps {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 760px) {
	.capacity-steps,
	.capacity-scopes {
		grid-template-columns: minmax(0, 1fr);
	}
}

@media (max-width: 400px) {
	.capacity-step {
		padding: 20px 16px;
	}

	.capacity-scope {
		padding: 22px 16px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.capacity-step,
	.compare__chip {
		transition: none;
	}

	.capacity-step:hover {
		transform: none;
	}
}
