/* GoConsent theme - Compare (template-goconsent-compare.php). */

.compare-table--wide {
	width: max-content;
	min-width: 0;
	table-layout: fixed;
	border-collapse: separate; /* Sticky cells keep their borders. */
	border-spacing: 0;
}

/* Feature + GoConsent columns stay put; rivals scroll under them. */
.compare-table--wide {
	--lock: 16rem;
}

.compare-table--wide td,
.compare-table--wide thead th {
	width: 30ch;
	font-size: var(--site-size-xs);
	line-height: 1.45;
	white-space: normal;
}

.compare-table--wide th:first-child,
.compare-table--wide .compare-table__ours {
	position: sticky;
	z-index: 1;
	width: var(--lock);
	border-bottom: 0;
	box-shadow: inset 0 1px 0 var(--site-border); /* Top line: the next row paints over any bottom line. */
}

.compare-table--wide th:first-child {
	left: 0;
	background: var(--site-surface);
}

.compare-table--wide thead th:first-child {
	background: var(--site-bg-tinted);
}

.compare-table--wide .compare-table__ours {
	left: var(--lock);
}

/* Edge line on the locked GoConsent column and row line, painted as backgrounds so they stay crisp while sticky. */
.compare-table--wide .compare-table__ours,
.compare-table--wide thead .compare-table__ours {
	background:
		linear-gradient(var(--site-border), var(--site-border)) top / 100% 1px no-repeat,
		linear-gradient(var(--site-brand), var(--site-brand)) right / 2px 100% no-repeat,
		var(--site-brand-soft);
}

@media (max-width: 600px) {
	.compare-table--wide {
		--lock: 7.5rem;
	}

	.compare-table--wide th:first-child,
	.compare-table--wide .compare-table__ours {
		padding-right: 10px;
		padding-left: 10px;
		hyphens: auto;
	}
}

.compare-table--wide thead .compare-table__ours {
	color: var(--site-brand-deep);
}

.compare-table__yes,
.compare-table__no,
.compare-table__paid {
	align-items: flex-start;
}

.compare-table__paid {
	display: inline-flex;
	gap: 6px;
	color: var(--site-warn);
	font-weight: 600;
}

.compare-table__info {
	color: var(--site-text-muted);
}

.compare-table__mark {
	margin-top: 1px;
}

.compare-scroll:focus-visible {
	outline: 3px solid var(--site-focus);
	outline-offset: 3px;
}

.compare-honest {
	margin: 36px 0 0;
}

.compare-sources__title {
	font-size: var(--site-size-lg);
}

.compare-sources {
	display: grid;
	gap: 8px;
	margin: 0 0 18px;
	padding: 0;
	font-size: var(--site-size-sm);
	list-style: none;
	overflow-wrap: anywhere;
}

.compare-sources__url {
	color: var(--site-text-muted);
}

.compare-sources__note {
	color: var(--site-text-faint);
	font-size: var(--site-size-xs);
}

.compare-note {
	margin: 14px 0 0;
	color: var(--site-text-faint);
	font-size: var(--site-size-xs);
}


/* "Scroll for more" hint: shown while the table can scroll and hasn't been scrolled yet. */
.compare-wrap {
	position: relative;
}

.scroll-hint {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 2;
	display: inline-flex;
	gap: 6px;
	align-items: center;
	padding: 7px 14px;
	border-radius: var(--site-radius-pill);
	background: var(--site-text);
	color: var(--site-white);
	box-shadow: var(--site-shadow);
	font-size: var(--site-size-xs);
	font-weight: 600;
	pointer-events: none;
	transition: opacity 0.3s ease, transform 0.3s ease;
}

.scroll-hint__icon {
	width: 16px;
	height: 16px;
	animation: scroll-hint-nudge 1.4s ease-in-out infinite;
}

.compare-wrap::after {
	content: "";
	position: absolute;
	top: 1px;
	right: 1px;
	bottom: 1px;
	width: 56px;
	border-radius: 0 var(--site-radius-lg) var(--site-radius-lg) 0;
	background: linear-gradient(to right, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.95));
	pointer-events: none;
	transition: opacity 0.3s ease;
}

.compare-wrap.is-scrolled .scroll-hint,
.compare-wrap.no-overflow .scroll-hint {
	opacity: 0;
	transform: translateX(8px);
}

.compare-wrap.at-end::after,
.compare-wrap.no-overflow::after {
	opacity: 0;
}

@keyframes scroll-hint-nudge {
	0%,
	100% {
		transform: translateX(0);
	}

	50% {
		transform: translateX(4px);
	}
}

/* Rival names in the hub table link to their one-on-one page. */
.compare-table__rival {
	color: inherit;
	text-decoration: underline;
	text-decoration-color: var(--site-border);
	text-underline-offset: 3px;
}

.compare-table__rival:hover,
.compare-table__rival:focus-visible {
	color: var(--site-brand-deep);
	text-decoration-color: currentColor;
}

/* One-on-one page (single-compare.php): three columns, fits without scrolling. */
.compare-table--vs {
	min-width: 0;
	table-layout: fixed;
}

.compare-table--vs th:first-child {
	width: 34%;
}

.compare-table--vs thead th {
	white-space: normal;
}

@media (max-width: 600px) {
	.compare-table--vs th,
	.compare-table--vs td {
		padding: 12px 10px;
		font-size: var(--site-size-xs);
		hyphens: auto;
	}
}

.compare-diff {
	margin: 0;
}

.compare-both {
	margin: 18px 0 0;
	color: var(--site-text-muted);
	font-size: var(--site-size-sm);
}

/* Links to every one-on-one page. */
.compare-alts {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 12px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.compare-alts__link {
	display: flex;
	flex-direction: column;
	gap: 2px;
	position: relative;
	min-height: 44px;
	padding: 16px 44px 16px 18px;
	border: 1px solid var(--site-border);
	border-radius: var(--site-radius);
	background: var(--site-surface);
	color: var(--site-text);
	text-decoration: none;
}

.compare-alts__link:hover,
.compare-alts__link:focus-visible {
	border-color: var(--site-brand);
}

.compare-alts__vs {
	color: var(--site-text-muted);
	font-size: var(--site-size-xs);
}

.compare-alts__name {
	font-weight: 600;
}

.compare-alts__icon {
	position: absolute;
	top: 50%;
	right: 16px;
	width: 18px;
	height: 18px;
	transform: translateY(-50%);
	color: var(--site-brand-deep);
}

/* Free / Paid switch (partials/compare-switch.php). */
.plan-switch {
	display: flex;
	width: max-content;
	max-width: 100%;
	margin: 0 auto 22px;
	padding: 4px;
	border: 1px solid var(--site-border);
	border-radius: var(--site-radius-pill);
	background: var(--site-bg-tinted);
}

.plan-switch__btn {
	min-height: 44px;
	padding: 0 22px;
	border: 0;
	border-radius: var(--site-radius-pill);
	background: transparent;
	color: var(--site-text-muted);
	font-family: inherit;
	font-size: var(--site-size-sm);
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
}

.plan-switch__btn:hover {
	color: var(--site-text);
}

.plan-switch__btn[aria-selected="true"] {
	background: var(--site-brand-deep);
	color: var(--site-on-brand);
	box-shadow: var(--site-shadow);
}

.plan-switch__btn:focus-visible {
	outline: 3px solid var(--site-focus);
	outline-offset: 2px;
}

/* Without JS: no switch, both panels show. */
.no-js .plan-switch {
	display: none;
}

.no-js .plan-panel[hidden] {
	display: block;
	margin-top: 48px;
}

/* Plan name under each column heading. */
.compare-table__plan {
	display: block;
	margin-top: 2px;
	color: var(--site-text-muted);
	font-size: var(--site-size-xs);
	font-weight: 500;
	white-space: normal;
}

.plan-panel__diff {
	margin-top: 40px;
}

.plan-panel__diff .compare-honest {
	margin-top: 24px;
}

.plan-panel__diff-title {
	margin: 0 0 16px;
	font-size: var(--site-size-lg);
}
