/*
 * Sections added to the money pages in the 2026-08-14 rebuild.
 *
 * WHY THIS FILE EXISTS
 * app.css is a PRE-BUILT Tailwind bundle. Tailwind does not run at request time,
 * so any class not already compiled into that bundle produces no styles at all
 * and nothing anywhere says why. `list-decimal`, `align-top`, `scroll-mt-24`,
 * `text-emerald-600` and `bg-emerald-50` are all absent from it — the ordered
 * partner ranking and the pros/cons tables need every one of them. Rather than
 * bet the layout on which utilities happen to be present, these components ship
 * as plain CSS with their own `ns-` namespace.
 *
 * Everything below reads the theme's own HSL design tokens (--primary, --border,
 * --muted-foreground …), which are defined on :root and overridden on .dark, so
 * both colour schemes are covered without a single hard-coded colour.
 */

/* ── Typography layer ──────────────────────────────────────────────────────────
 *
 * app.css ships Tailwind's preflight, which resets h1–h6 to
 * `font-size:inherit;font-weight:inherit` and zeroes every block margin. Plain
 * semantic markup therefore renders as one flat wall of text. The old pages
 * dodged this by pinning utility classes to every single element; that is what
 * made them 300–500 KB of unreadable HTML. Styling the elements once, here,
 * lets the content be clean semantic HTML instead.
 */

.ns-page {
	max-width: 60rem;
	margin-inline: auto;
}

.ns-page p,
.ns-page ul,
.ns-page ol {
	margin: 0 0 1rem;
	line-height: 1.7;
}

.ns-page h2 {
	font-family: Merriweather, Georgia, serif;
	font-size: clamp(1.5rem, 1.15rem + 1.5vw, 2rem);
	font-weight: 700;
	line-height: 1.25;
	margin: 2.75rem 0 1rem;
	padding-bottom: 0.5rem;
	border-bottom: 1px solid hsl(var(--border));
	scroll-margin-top: 6rem;
}

.ns-page h3 {
	font-family: Merriweather, Georgia, serif;
	font-size: clamp(1.1875rem, 1.05rem + 0.6vw, 1.4375rem);
	font-weight: 700;
	line-height: 1.3;
	margin: 1.875rem 0 0.75rem;
	scroll-margin-top: 6rem;
}

.ns-page h4 {
	font-size: 1.0625rem;
	font-weight: 700;
	line-height: 1.35;
	margin: 1.25rem 0 0.5rem;
}

/* The mini-review card supplies its own heading rhythm. */
.ns-page .ns-review h3 {
	margin: 0;
	font-family: Merriweather, Georgia, serif;
}

.ns-page > section > h2:first-child {
	margin-top: 2rem;
}

.ns-page ul,
.ns-page ol {
	padding-left: 1.375rem;
}

.ns-page ul {
	list-style: disc;
}

.ns-page ol {
	list-style: decimal;
}

.ns-page li {
	margin-bottom: 0.375rem;
}

.ns-page li::marker {
	color: hsl(var(--primary));
}

/* Components below bring their own list styling; keep the layer off them. */
.ns-page .ns-ranking,
.ns-page .ns-related,
.ns-page .ns-pc ul,
.ns-page .ns-toc ol {
	list-style: none;
	padding-left: 0;
}

.ns-page .ns-sources {
	list-style: disc;
	padding-left: 1.25rem;
}

/* The prose link style is wrapped in :where() so it contributes NO specificity
 * beyond `.ns-page`. Written as `.ns-page a` it scored (0,1,1) and beat every
 * single-class component rule below it — which made the mini-review CTA render
 * primary-on-primary, i.e. invisible text on a solid button, readable only on
 * hover because `.ns-review__cta:hover` scored (0,2,0) and won. Components must
 * always be able to override the prose defaults. */
.ns-page :where(a) {
	color: hsl(var(--primary));
	text-decoration: underline;
	text-underline-offset: 2px;
	text-decoration-color: hsl(var(--primary) / 0.4);
}

.ns-page :where(a):hover {
	text-decoration-color: hsl(var(--primary));
}

.ns-page strong {
	font-weight: 700;
	color: hsl(var(--foreground));
}

.ns-page .ns-lede {
	font-size: 1.125rem;
	line-height: 1.65;
	color: hsl(var(--muted-foreground));
	margin-bottom: 1.5rem;
}

.ns-page h1 {
	font-family: Merriweather, Georgia, serif;
	font-size: clamp(1.875rem, 1.3rem + 2.4vw, 3rem);
	font-weight: 700;
	line-height: 1.15;
	margin: 0 0 0.875rem;
}

.ns-page .ns-eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	border-radius: 9999px;
	border: 1px solid hsl(var(--border));
	background: hsl(var(--muted) / 0.6);
	padding: 0.25rem 0.75rem;
	margin-bottom: 0.875rem;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	color: hsl(var(--muted-foreground));
}

/* ── Byline: author, publish date, review date ─────────────────────────────── */

.ns-byline {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem 1rem;
	padding: 1rem 1.25rem;
	margin-bottom: 2rem;
	border: 1px solid hsl(var(--border));
	border-radius: var(--radius);
	background: hsl(var(--muted) / 0.4);
	font-size: 0.875rem;
	line-height: 1.4;
}

.ns-byline__avatar {
	width: 2.75rem;
	height: 2.75rem;
	border-radius: 9999px;
	object-fit: cover;
	border: 2px solid hsl(var(--primary) / 0.25);
	flex-shrink: 0;
}

.ns-byline__who {
	display: flex;
	flex-direction: column;
	gap: 0.125rem;
	margin-right: auto;
}

.ns-byline__name {
	font-weight: 600;
	color: hsl(var(--foreground));
}

.ns-byline__name a {
	color: inherit;
	text-decoration: underline;
	text-decoration-color: hsl(var(--primary) / 0.35);
	text-underline-offset: 2px;
}

.ns-byline__role,
.ns-byline__dates {
	color: hsl(var(--muted-foreground));
	font-size: 0.8125rem;
}

.ns-byline__dates {
	display: flex;
	flex-direction: column;
	gap: 0.125rem;
	text-align: right;
}

@media (max-width: 640px) {
	.ns-byline__dates {
		text-align: left;
	}
}

.ns-byline__dates time {
	font-variant-numeric: tabular-nums;
}

/* ── Author profile pages ──────────────────────────────────────────────────── */

.ns-author-head {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 1.5rem;
	margin-bottom: 1.75rem;
}

.ns-author-head__photo {
	width: 9rem;
	height: 9rem;
	border-radius: 9999px;
	object-fit: cover;
	border: 3px solid hsl(var(--primary) / 0.2);
	flex-shrink: 0;
}

.ns-author-head > div {
	flex: 1 1 18rem;
	min-width: 0;
}

.ns-author-head h1 {
	margin-bottom: 0.25rem;
}

.ns-author-head__role {
	font-size: 0.9375rem;
	font-weight: 600;
	color: hsl(var(--primary));
	margin-bottom: 0.75rem;
}

.ns-author-cards {
	list-style: none;
	margin: 0 0 2.5rem;
	padding: 0;
	display: grid;
	gap: 1rem;
}

@media (min-width: 640px) {
	.ns-author-cards {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.ns-author-cards li {
	margin: 0;
}

.ns-page .ns-author-cards a {
	display: block;
	height: 100%;
	padding: 1.25rem;
	border: 1px solid hsl(var(--border));
	border-radius: var(--radius);
	background: hsl(var(--card));
	color: hsl(var(--foreground));
	text-decoration: none;
	transition: border-color 0.15s ease;
}

.ns-page .ns-author-cards a:hover {
	border-color: hsl(var(--primary) / 0.5);
}

.ns-author-cards img {
	width: 4.5rem;
	height: 4.5rem;
	border-radius: 9999px;
	object-fit: cover;
	border: 2px solid hsl(var(--primary) / 0.2);
	margin-bottom: 0.75rem;
	display: block;
}

.ns-author-card__name {
	display: block;
	font-weight: 700;
	font-size: 1.0625rem;
}

.ns-author-card__role {
	display: block;
	font-size: 0.8125rem;
	font-weight: 600;
	color: hsl(var(--primary));
	margin-bottom: 0.5rem;
}

.ns-author-card__short {
	display: block;
	font-size: 0.875rem;
	line-height: 1.5;
	color: hsl(var(--muted-foreground));
}

/* ── Ordered partner ranking under the toplist ─────────────────────────────── */

.ns-ranking {
	counter-reset: ns-rank;
	list-style: none;
	margin: 0 0 2rem;
	padding: 0;
	display: grid;
	gap: 0.625rem;
}

@media (min-width: 768px) {
	.ns-ranking {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.ns-ranking > li {
	counter-increment: ns-rank;
	position: relative;
	display: flex;
	align-items: flex-start;
	gap: 0.75rem;
	padding: 0.75rem 0.875rem;
	border: 1px solid hsl(var(--border));
	border-radius: var(--radius);
	background: hsl(var(--card));
	transition: border-color 0.15s ease, transform 0.15s ease;
}

.ns-ranking > li:hover {
	border-color: hsl(var(--primary) / 0.45);
}

.ns-ranking > li::before {
	content: counter(ns-rank);
	flex-shrink: 0;
	width: 1.75rem;
	height: 1.75rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 9999px;
	background: hsl(var(--primary));
	color: hsl(var(--primary-foreground));
	font-size: 0.8125rem;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.ns-ranking__body {
	min-width: 0;
}

.ns-page .ns-ranking__name,
.ns-ranking__name {
	font-weight: 700;
	color: hsl(var(--foreground));
	text-decoration: none;
	border-bottom: 1px solid hsl(var(--primary) / 0.3);
}

.ns-page .ns-ranking__name:hover,
.ns-ranking__name:hover {
	color: hsl(var(--primary));
	border-bottom-color: hsl(var(--primary));
}

.ns-ranking__why {
	display: block;
	margin-top: 0.125rem;
	font-size: 0.8125rem;
	line-height: 1.45;
	color: hsl(var(--muted-foreground));
}

/* ── Mini-review block ─────────────────────────────────────────────────────── */

.ns-review {
	border: 1px solid hsl(var(--border));
	border-left: 4px solid hsl(var(--primary));
	border-radius: var(--radius);
	background: hsl(var(--card));
	padding: 1.25rem 1.25rem 1rem;
	margin-bottom: 1.75rem;
	scroll-margin-top: 6rem;
}

.ns-review__head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.5rem 0.75rem;
	margin-bottom: 0.75rem;
}

.ns-review__head h3 {
	margin: 0;
	font-size: 1.25rem;
	line-height: 1.3;
}

.ns-review__rank {
	display: inline-flex;
	align-items: center;
	border-radius: 9999px;
	padding: 0.125rem 0.625rem;
	background: hsl(var(--primary) / 0.12);
	color: hsl(var(--primary));
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.02em;
}

.ns-review__angle {
	width: 100%;
	font-size: 0.8125rem;
	color: hsl(var(--muted-foreground));
}

.ns-review__body p {
	margin-bottom: 0.75rem;
}

.ns-review__verdict {
	margin: 0.75rem 0 0;
	padding: 0.625rem 0.875rem;
	border-radius: var(--radius);
	background: hsl(var(--muted) / 0.55);
	font-size: 0.9375rem;
}

.ns-review__verdict strong {
	color: hsl(var(--foreground));
}

/* Scoped with .ns-page as well as :where() above, so the button text stays
 * readable no matter which of the two rules a future edit reorders. */
.ns-page .ns-review__cta,
.ns-review__cta {
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	margin-top: 0.875rem;
	padding: 0.5rem 1rem;
	border-radius: var(--radius);
	background: hsl(var(--primary));
	color: hsl(var(--primary-foreground));
	font-size: 0.875rem;
	font-weight: 600;
	text-decoration: none;
	transition: opacity 0.15s ease, background-color 0.15s ease;
}

.ns-page .ns-review__cta:hover,
.ns-review__cta:hover {
	background: hsl(var(--primary) / 0.88);
	color: hsl(var(--primary-foreground));
	text-decoration: none;
}

.ns-page .ns-review__cta:focus-visible,
.ns-review__cta:focus-visible {
	outline: 2px solid hsl(var(--ring));
	outline-offset: 2px;
}

/* ── Pros / cons table ─────────────────────────────────────────────────────── */

.ns-pc {
	width: 100%;
	border-collapse: collapse;
	margin: 1rem 0 0;
	font-size: 0.9375rem;
	table-layout: fixed;
}

.ns-pc caption {
	text-align: left;
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: hsl(var(--muted-foreground));
	padding-bottom: 0.5rem;
}

.ns-pc th {
	text-align: left;
	font-size: 0.8125rem;
	font-weight: 700;
	padding: 0.5rem 0.75rem;
	border: 1px solid hsl(var(--border));
}

.ns-pc thead th:first-child {
	background: hsl(140 45% 40% / 0.12);
	color: hsl(140 55% 26%);
}

.ns-pc thead th:last-child {
	background: hsl(var(--destructive) / 0.1);
	color: hsl(var(--destructive));
}

.dark .ns-pc thead th:first-child {
	color: hsl(140 45% 65%);
}

.ns-pc td {
	vertical-align: top;
	padding: 0.625rem 0.75rem;
	border: 1px solid hsl(var(--border));
	width: 50%;
}

.ns-pc ul {
	margin: 0;
	padding: 0;
	list-style: none;
	display: grid;
	gap: 0.375rem;
}

.ns-pc li {
	position: relative;
	padding-left: 1.25rem;
	line-height: 1.45;
}

.ns-pc td:first-child li::before {
	content: "✓";
	position: absolute;
	left: 0;
	color: hsl(140 55% 34%);
	font-weight: 700;
}

.dark .ns-pc td:first-child li::before {
	color: hsl(140 45% 62%);
}

.ns-pc td:last-child li::before {
	content: "×";
	position: absolute;
	left: 0;
	color: hsl(var(--destructive));
	font-weight: 700;
	font-size: 1.05em;
	line-height: 1.2;
}

@media (max-width: 560px) {
	.ns-pc,
	.ns-pc thead,
	.ns-pc tbody,
	.ns-pc tr,
	.ns-pc th,
	.ns-pc td {
		display: block;
		width: auto;
	}

	.ns-pc tr {
		display: grid;
		gap: 0;
	}

	.ns-pc td {
		border-top: 0;
	}

	.ns-pc thead th + th,
	.ns-pc td + td {
		margin-top: 0.75rem;
	}

	.ns-pc thead th + th {
		border-top: 1px solid hsl(var(--border));
	}
}

/* ── Wide data tables carried over from the editorial content ──────────────── */

.ns-table-wrap {
	overflow-x: auto;
	margin: 0 0 1.75rem;
	border: 1px solid hsl(var(--border));
	border-radius: var(--radius);
	-webkit-overflow-scrolling: touch;
}

.ns-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.875rem;
	min-width: 40rem;
}

.ns-table caption {
	caption-side: top;
	text-align: left;
	padding: 0.75rem 0.875rem 0;
	font-size: 0.8125rem;
	color: hsl(var(--muted-foreground));
}

.ns-table th {
	position: sticky;
	top: 0;
	text-align: left;
	font-weight: 700;
	padding: 0.625rem 0.875rem;
	background: hsl(var(--muted));
	border-bottom: 1px solid hsl(var(--border));
	white-space: nowrap;
}

.ns-table td {
	padding: 0.625rem 0.875rem;
	border-bottom: 1px solid hsl(var(--border) / 0.7);
	vertical-align: top;
}

.ns-table tbody tr:last-child td {
	border-bottom: 0;
}

.ns-table tbody tr:nth-child(2n) {
	background: hsl(var(--muted) / 0.35);
}

.ns-table__brand {
	font-weight: 600;
	white-space: nowrap;
}

/* ── Section anchors, callouts and the "on this page" nav ──────────────────── */

.ns-section {
	scroll-margin-top: 6rem;
}

.ns-callout {
	border: 1px solid hsl(var(--border));
	border-left: 4px solid hsl(var(--archive-gold));
	border-radius: var(--radius);
	background: hsl(var(--muted) / 0.45);
	padding: 1rem 1.25rem;
	margin: 0 0 1.75rem;
}

.ns-callout__title {
	font-weight: 700;
	margin-bottom: 0.375rem;
}

.ns-callout p:last-child {
	margin-bottom: 0;
}

.ns-callout--warn {
	border-left-color: hsl(var(--destructive));
}

.ns-toc {
	border: 1px solid hsl(var(--border));
	border-radius: var(--radius);
	background: hsl(var(--muted) / 0.35);
	padding: 1rem 1.25rem;
	margin: 0 0 2rem;
}

.ns-toc__title {
	font-weight: 700;
	margin-bottom: 0.625rem;
}

.ns-toc ol {
	counter-reset: ns-toc;
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 0.375rem 1.5rem;
	font-size: 0.9375rem;
}

@media (min-width: 768px) {
	.ns-toc ol {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.ns-toc li {
	counter-increment: ns-toc;
}

.ns-toc li::before {
	content: counter(ns-toc) ". ";
	color: hsl(var(--muted-foreground));
	font-variant-numeric: tabular-nums;
}

.ns-toc a {
	color: hsl(var(--foreground));
	text-decoration: underline;
	text-decoration-color: hsl(var(--primary) / 0.3);
	text-underline-offset: 2px;
}

.ns-toc a:hover {
	text-decoration-color: hsl(var(--primary));
}

/* ── Related-guides grid (internal linking) ────────────────────────────────── */

.ns-related {
	display: grid;
	gap: 0.75rem;
	margin: 0 0 2rem;
	padding: 0;
	list-style: none;
}

@media (min-width: 640px) {
	.ns-related {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 1024px) {
	.ns-related {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

.ns-related li {
	border: 1px solid hsl(var(--border));
	border-radius: var(--radius);
	background: hsl(var(--card));
	padding: 0.875rem 1rem;
}

.ns-related a {
	font-weight: 600;
	color: hsl(var(--foreground));
	text-decoration: none;
}

.ns-related a:hover {
	color: hsl(var(--primary));
}

.ns-related span {
	display: block;
	margin-top: 0.25rem;
	font-size: 0.8125rem;
	line-height: 1.45;
	color: hsl(var(--muted-foreground));
}

/* ── Sources list ──────────────────────────────────────────────────────────── */

.ns-sources {
	margin: 0 0 1.5rem;
	padding-left: 1.25rem;
	font-size: 0.875rem;
	color: hsl(var(--muted-foreground));
	display: grid;
	gap: 0.3125rem;
}

.ns-sources a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.ns-sources a:hover {
	color: hsl(var(--primary));
}
