/*
Theme Name: Aff Base
Description: Parent theme for the buying-guide sites. Child themes set the palette, type and art.
Version: 1.1.0
Requires PHP: 8.0
Text Domain: aff-base
*/

/* ---------- Tokens (child themes override these) ---------- */
:root {
	--bg: #fbfaf7;
	--surface: #ffffff;
	--surface-2: #f2efe8;
	--ink: #1c1d1f;
	--ink-2: #3d4046;
	--muted: #6b6f76;
	--line: #e3dfd6;
	--accent: #2f6b4f;
	--accent-ink: #ffffff;
	--accent-soft: #e4efe8;
	--accent-2: #c9862c;
	--accent-2-ink: #ffffff;
	--good: #2f7a4b;
	--bad: #b2402f;
	--radius: 14px;
	--radius-sm: 8px;
	--shadow: 0 1px 2px rgba(20, 20, 20, .04), 0 8px 24px rgba(20, 20, 20, .06);
	--font-display: Georgia, "Times New Roman", serif;
	--font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--display-weight: 700;
	--display-tracking: -0.01em;
	--wrap: 1180px;
	--narrow: 760px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.65 var(--font-body); -webkit-font-smoothing: antialiased; }
img, svg { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: var(--display-weight); letter-spacing: var(--display-tracking); line-height: 1.18; color: var(--ink); margin: 0 0 .5em; }
p { margin: 0 0 1em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 6px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.wrap--narrow { max-width: calc(var(--narrow) + 48px); }
.kicker { font: 600 12.5px/1.2 var(--font-body); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin: 0 0 14px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 999px; font: 600 15.5px/1 var(--font-body); text-decoration: none; transition: transform .15s, background .15s, color .15s, border-color .15s; }
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { filter: brightness(1.06); }
.btn--ghost { border: 1.5px solid var(--ink); color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--bg); }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand__mark { display: inline-flex; width: 36px; height: 36px; color: var(--accent); }
.brand__mark svg { width: 100%; height: 100%; }
.brand__name { font: var(--display-weight) 20px/1 var(--font-display); letter-spacing: var(--display-tracking); }
.nav__list { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; flex-wrap: wrap; }
.nav__list a { display: block; padding: 9px 13px; border-radius: 999px; color: var(--ink-2); font-size: 15px; font-weight: 500; text-decoration: none; }
.nav__list a:hover, .nav__list .current-menu-item a { background: var(--surface-2); color: var(--ink); }
.nav-toggle { display: none; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; position: relative; }
.nav-toggle__bar, .nav-toggle__bar::before, .nav-toggle__bar::after { position: absolute; left: 12px; right: 12px; height: 2px; background: var(--ink); border-radius: 2px; content: ""; }
.nav-toggle__bar { top: 21px; }
.nav-toggle__bar::before { top: -6px; left: 0; right: 0; }
.nav-toggle__bar::after { top: 6px; left: 0; right: 0; }

/* ---------- Hero ---------- */
.hero { padding: 64px 0 56px; border-bottom: 1px solid var(--line); background: radial-gradient(1200px 400px at 85% -10%, var(--accent-soft), transparent 70%); }
.hero__inner { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.hero__title { font-size: clamp(36px, 5vw, 60px); margin-bottom: 18px; }
.hero__text { font-size: 19px; color: var(--ink-2); max-width: 34em; margin-bottom: 28px; }
.hero__actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero__art svg { width: 100%; height: auto; display: block; }
.hero-center .hero__inner { grid-template-columns: 1fr; text-align: center; }
.hero-center .hero__text { margin-left: auto; margin-right: auto; }
.hero-center .hero__actions { justify-content: center; }
.hero-center .hero__art { width: 100%; max-width: 760px; margin: 8px auto 0; }

/* ---------- Sections ---------- */
.section { padding: 56px 0; }
.section + .section { padding-top: 8px; }
.section__head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.section__head h2 { font-size: clamp(26px, 3vw, 34px); margin: 0; }

.silos__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.silo { display: flex; flex-direction: column; gap: 6px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); text-decoration: none; transition: transform .15s, box-shadow .15s, border-color .15s; }
.silo:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: transparent; }
.silo__icon { width: 48px; height: 48px; color: var(--accent); margin-bottom: 6px; }
.silo__icon svg { width: 100%; height: 100%; }
.silo__name { font: var(--display-weight) 19px/1.2 var(--font-display); }
.silo__count { font-size: 14px; color: var(--muted); }

.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.cards--feature .card--lg { grid-column: span 1; }
.cards--feature { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.cards--feature .card { grid-column: span 2; }
.cards--feature .card--lg { grid-column: span 3; }
.card__link { display: flex; flex-direction: column; gap: 10px; height: 100%; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); text-decoration: none; transition: transform .15s, box-shadow .15s, border-color .15s; }
.card__link:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: transparent; }
.card__icon { width: 40px; height: 40px; color: var(--accent); }
.card__icon svg { width: 100%; height: 100%; }
.card__meta { font-size: 12.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.card__title { font: var(--display-weight) 20px/1.25 var(--font-display); letter-spacing: var(--display-tracking); }
.card--lg .card__title { font-size: 25px; }
.card--lg .card__link { padding: 28px; background: linear-gradient(160deg, var(--accent-soft), var(--surface) 60%); }
.card__excerpt { color: var(--ink-2); font-size: 15.5px; }
.card__more { margin-top: auto; font-size: 14.5px; font-weight: 600; color: var(--accent); }

.teaser__inner { display: grid; grid-template-columns: .9fr 1.1fr; gap: 40px; align-items: center; padding: 40px; background: var(--surface-2); border-radius: calc(var(--radius) * 1.6); }
.teaser__art svg { width: 100%; height: auto; display: block; }
.teaser__copy h2 { font-size: clamp(26px, 3vw, 34px); }

.promise__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.promise__item { padding: 24px; border-top: 3px solid var(--accent); background: var(--surface); border-radius: 0 0 var(--radius) var(--radius); }
.promise__item h3 { font-size: 19px; }
.promise__item p { color: var(--ink-2); margin: 0; font-size: 15.5px; }

/* ---------- Silo page ---------- */
.silo-head { padding: 44px 0 36px; border-bottom: 1px solid var(--line); background: radial-gradient(900px 300px at 90% -20%, var(--accent-soft), transparent 70%); }
.silo-head__icon { display: block; width: 64px; height: 64px; color: var(--accent); margin: 18px 0 12px; }
.silo-head h1 { font-size: clamp(32px, 4.5vw, 50px); }
.silo-head__intro { font-size: 18px; color: var(--ink-2); }
.crumbs { font-size: 14px; color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }

/* ---------- Article ---------- */
.article__head { padding: 40px 0 28px; border-bottom: 1px solid var(--line); }
.article__head .kicker { margin-top: 22px; }
.article__title { font-size: clamp(32px, 4.4vw, 50px); margin-bottom: 14px; }
.article__meta { font-size: 14.5px; color: var(--muted); margin: 0; }
.article__layout { display: grid; grid-template-columns: 250px minmax(0, var(--narrow)); gap: 56px; justify-content: center; padding-top: 36px; padding-bottom: 32px; }
.article__sticky { position: sticky; top: 92px; }
.aff-toc { font-size: 14px; }
.aff-toc__title { font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.aff-toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.aff-toc li a { display: block; padding: 6px 0 6px 14px; margin-left: -2px; border-left: 2px solid transparent; color: var(--ink-2); text-decoration: none; line-height: 1.35; }
.aff-toc li a:hover { color: var(--ink); }
.aff-toc li a.is-active { border-left-color: var(--accent); color: var(--ink); font-weight: 600; }

/* ---------- Prose ---------- */
.prose { font-size: 18px; line-height: 1.72; }
.prose > h1:first-child { display: none; } /* the template prints the title */
.prose h2 { font-size: clamp(25px, 2.6vw, 31px); margin: 2.1em 0 .6em; }
.prose h3 { font-size: 22px; margin: 1.8em 0 .5em; }
.prose h4 { font-size: 18px; margin: 1.5em 0 .4em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.prose li { margin: .35em 0; }
.prose li::marker { color: var(--accent); }
.prose strong { color: var(--ink); }
.prose blockquote { margin: 1.5em 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--accent); color: var(--ink-2); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.2em 0; }
.table-wrap { margin: 1.4em 0 1.8em; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.prose table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 15px; line-height: 1.45; }
.prose table:not(:has(th:nth-child(4))) { min-width: 0; } /* up to 3 columns fit a phone without sideways scrolling */
.prose th, .prose td { padding: 11px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.prose th { background: var(--surface-2); font-weight: 700; color: var(--ink); position: relative; }
.prose tr:last-child td { border-bottom: 0; }
.prose tbody tr:hover td { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.prose td:first-child { font-weight: 600; color: var(--ink); }

.aff-disclosure { font-size: 14px; line-height: 1.5; color: var(--muted); padding: 12px 16px; background: var(--surface-2); border-radius: var(--radius-sm); margin-bottom: 1.6em; }
.aff-disclosure a { color: inherit; }

/* Quick picks */
.quick-picks { margin: 1em 0 2em; padding: 6px 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.quick-picks ul { list-style: none; margin: 0; padding: 0; }
.quick-picks li { margin: 0; padding: 14px 20px; border-bottom: 1px solid var(--line); font-size: 16px; line-height: 1.5; }
.quick-picks li:last-child { border-bottom: 0; }
.quick-picks li strong { display: block; font-family: var(--font-display); font-size: 18px; color: var(--ink); }

/* Pros and cons */
.proscons { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 1.2em 0 1.4em; }
.proscons__col { padding: 16px 18px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); }
.proscons__title { font: 700 13px/1 var(--font-body); letter-spacing: .1em; text-transform: uppercase; margin: 0 0 10px; }
.proscons__col--pros .proscons__title { color: var(--good); }
.proscons__col--cons .proscons__title { color: var(--bad); }
.proscons ul { list-style: none; margin: 0; padding: 0; font-size: 15.5px; line-height: 1.5; }
.proscons li { position: relative; padding-left: 22px; margin: 6px 0; }
.proscons__col--pros li::before { content: "+"; position: absolute; left: 0; font-weight: 700; color: var(--good); }
.proscons__col--cons li::before { content: "–"; position: absolute; left: 2px; font-weight: 700; color: var(--bad); }

/* Product box */
.aff-product { display: grid; grid-template-columns: 64px 1fr auto; gap: 18px; align-items: center; margin: 1.4em 0 2em; padding: 18px 20px; background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.aff-product__icon { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 12px; background: var(--accent-soft); color: var(--accent); padding: 10px; }
.aff-product__icon svg { width: 100%; height: 100%; }
.aff-product__badge { display: inline-block; font: 700 11.5px/1 var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--accent-ink); background: var(--accent); padding: 5px 9px; border-radius: 999px; margin-bottom: 7px; }
.aff-product__name { font: var(--display-weight) 18px/1.3 var(--font-display); margin: 0; color: var(--ink); }
.aff-product__brand { margin: 3px 0 0; font-size: 14px; color: var(--muted); }
.aff-product__btn, .aff-cta__btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 20px; border-radius: 999px; background: var(--accent-2); color: var(--accent-2-ink, #fff); font: 700 15px/1 var(--font-body); text-decoration: none; white-space: nowrap; transition: filter .15s, transform .15s; }
.aff-product__btn:hover, .aff-cta__btn:hover { filter: brightness(1.07); transform: translateY(-1px); }

.aff-cta { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 1.6em 0; padding: 18px 20px; border-left: 4px solid var(--accent-2); background: var(--surface); border-radius: 0 var(--radius) var(--radius) 0; box-shadow: var(--shadow); }
.aff-cta__text { display: flex; flex-direction: column; gap: 3px; font-size: 15.5px; line-height: 1.45; }
.aff-cta__label { font: 700 11.5px/1 var(--font-body); letter-spacing: .1em; text-transform: uppercase; color: var(--accent-2); }
.aff-cta strong { font-family: var(--font-display); font-size: 18px; }

/* Amazon photos. Each child theme sets --photo-stage (the frame around the white tile) and --photo-radius. */
.aff-product--photo { grid-template-columns: 176px 1fr auto; gap: 24px; }
.aff-product__photo, .aff-pick__img {
	display: block;
	padding: var(--photo-frame, 7px);
	background: var(--photo-stage, var(--accent-soft));
	background-size: var(--photo-stage-size, auto);
	background-color: var(--photo-stage-color, transparent);
	border-radius: var(--photo-radius, 14px);
	overflow: hidden;
}
.aff-product__photo { width: 176px; height: 176px; }
.aff-product__photo img, .aff-pick__img img { display: block; width: 100%; height: 100%; padding: 10px; object-fit: contain; background: #fff; border-radius: max(0px, calc(var(--photo-radius, 14px) - 5px)); transition: transform .25s ease; }
.aff-product__photo:hover img, .aff-pick:hover .aff-pick__img img { transform: scale(1.05); }

.aff-cta--photo { justify-content: flex-start; }
.aff-cta--photo .aff-cta__text { flex: 1; }
.aff-cta--photo .aff-cta__btn { margin-left: auto; }
.aff-cta__photo { flex: none; display: block; width: 84px; height: 84px; padding: 6px; background: #fff; border-radius: var(--radius-sm); box-shadow: 0 0 0 1px var(--line); }
.aff-cta__photo img { display: block; width: 100%; height: 100%; object-fit: contain; }

.aff-picks { margin: 1.8em 0 2.2em; }
.aff-picks__title { margin: 0 0 14px; font: var(--display-weight) 21px/1.25 var(--font-display); color: var(--ink); }
.aff-picks__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.prose .aff-pick, .aff-pick { display: flex; flex-direction: column; gap: 11px; padding: 13px; background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; transition: transform .15s, border-color .15s; }
.aff-pick:hover { transform: translateY(-3px); border-color: var(--accent); }
.aff-pick .aff-product__badge { align-self: flex-start; margin: 0; }
.aff-pick__img { aspect-ratio: 1; }
.aff-pick__name { flex: 1; font: var(--display-weight) 15.5px/1.3 var(--font-display); }
.aff-pick .aff-pick__btn { min-height: 40px; padding-left: 12px; padding-right: 12px; font-size: 14px; }

.aff-cmp__thumb { float: left; display: block; width: 54px; height: 54px; margin: 0 12px 0 0; padding: 4px; background: #fff; border-radius: var(--radius-sm); box-shadow: 0 0 0 1px var(--line); }
.aff-cmp__colphoto { display: block; width: 92px; height: 92px; margin: 0 0 9px; padding: 6px; background: #fff; border-radius: var(--radius-sm); box-shadow: 0 0 0 1px var(--line); }
.aff-cmp__thumb img, .aff-cmp__colphoto img { display: block; width: 100%; height: 100%; object-fit: contain; }

@media (max-width: 640px) {
	.aff-picks__grid { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 64%; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; }
	.aff-pick { scroll-snap-align: start; }
	.aff-cmp__thumb { width: 46px; height: 46px; }
	.aff-cmp__colphoto { width: 72px; height: 72px; }
}
@media (prefers-reduced-motion: reduce) {
	.aff-product__photo img, .aff-pick__img img, .aff-pick { transition: none; }
	.aff-product__photo:hover img, .aff-pick:hover .aff-pick__img img, .aff-pick:hover { transform: none; }
}

.aff-product__stock { margin: 5px 0 0; font-size: 13.5px; color: var(--muted); }
.aff-product__price { margin: 6px 0 0; font: 700 17px/1.3 var(--font-body); color: var(--ink); }
.aff-product__asof { display: inline; font: 400 12px/1.3 var(--font-body); color: var(--muted); cursor: help; }
@media (max-width: 760px) {
	.aff-product.aff-product--photo { grid-template-columns: 116px 1fr; gap: 16px; }
	.aff-product__photo { width: 116px; height: 116px; --photo-frame: 5px; }
	.aff-product__photo img { padding: 6px; }
}

/* Product-type illustration (until the Amazon photo is available) */
.aff-product:has(.aff-product__icon--art) { grid-template-columns: 132px 1fr auto; }
.aff-product__icon--art { width: 132px; height: 132px; padding: 10px; background: var(--surface-2); color: var(--ink); }
.aff-product__icon--art svg { width: 100%; height: 100%; }
@media (max-width: 760px) {
	.aff-product:has(.aff-product__icon--art) { grid-template-columns: 96px 1fr; }
	.aff-product__icon--art { width: 96px; height: 96px; }
}

/* FAQ */
.faq { margin: 1em 0 2em; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; padding: 18px 40px 18px 0; position: relative; font: var(--display-weight) 19px/1.35 var(--font-display); color: var(--ink); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 6px; top: 14px; font: 400 26px/1 var(--font-body); color: var(--accent); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq__a { padding: 0 0 18px; color: var(--ink-2); }
.faq__a p:last-child { margin: 0; }

/* Shared sortable/filterable table */
.aff-tablefilter__bar { display: flex; gap: 10px; align-items: center; margin: 1.2em 0 -0.6em; flex-wrap: wrap; }
.aff-tablefilter__bar input { flex: 1 1 220px; min-height: 44px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 999px; font: inherit; font-size: 15px; background: var(--surface); color: var(--ink); }
.aff-tablefilter__bar span { font-size: 13.5px; color: var(--muted); }
.prose th[data-sort] { cursor: pointer; padding-right: 26px; }
.prose th[data-sort]::after { content: "↕"; position: absolute; right: 9px; opacity: .35; font-size: 12px; }
.prose th[data-sort="asc"]::after { content: "↑"; opacity: 1; }
.prose th[data-sort="desc"]::after { content: "↓"; opacity: 1; }

/* Tools (child themes style their own internals) */
.aff-tool { margin: 1.6em 0 2em; padding: 22px; background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.aff-tool h3 { margin-top: 0; }
.aff-tool label { display: block; font-size: 14px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.aff-tool select, .aff-tool input:not([type="checkbox"]):not([type="radio"]):not([type="range"]) { width: 100%; min-height: 44px; padding: 0 12px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); font: inherit; font-size: 16px; background: var(--bg); color: var(--ink); }
.aff-tool__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 16px; }
.aff-tool__result { padding: 16px 18px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--ink); font-size: 16px; }
.aff-tool__result strong { font-family: var(--font-display); font-size: 22px; }

.prose .aff-tool table { min-width: 0; }
/* Tools own their lists: undo article list styling inside them */
.prose .aff-tool ul, .prose .aff-tool ol { list-style: none; padding-left: 0; margin: 0; }
.prose .aff-tool li { margin: 0; }
.prose .aff-tool li::marker { content: none; }

/* ---------- Simple pages ---------- */
.page-simple { padding: 48px 0 64px; }

/* ---------- Related ---------- */
.related { border-top: 1px solid var(--line); padding-top: 48px; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 48px; background: var(--ink); color: color-mix(in srgb, var(--bg) 78%, transparent); padding: 56px 0 28px; font-size: 15px; }
.site-footer a { color: inherit; text-decoration: none; display: block; padding: 4px 0; }
.site-footer a:hover { color: var(--bg); }
.site-footer__grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 40px; }
.site-footer .brand { color: var(--bg); display: inline-flex; margin-bottom: 14px; }
.site-footer .brand__mark { color: var(--accent-2); }
.site-footer__title { font-weight: 700; letter-spacing: .1em; text-transform: uppercase; font-size: 12px; color: var(--bg); margin-bottom: 10px; }
.site-footer__legal { margin-top: 40px; padding-top: 22px; border-top: 1px solid rgba(255, 255, 255, .12); font-size: 13px; display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.site-footer__legal p { margin: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
	.article__layout { grid-template-columns: minmax(0, var(--narrow)); }
	.article__aside { display: none; }
}
@media (max-width: 900px) {
	.hero__inner, .teaser__inner { grid-template-columns: 1fr; }
	.hero__art { max-width: 520px; }
	.cards, .promise__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.cards--feature { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.cards--feature .card, .cards--feature .card--lg { grid-column: span 1; }
	.site-footer__grid { grid-template-columns: 1fr 1fr; }
	.site-footer__about { grid-column: 1 / -1; }
}
@media (max-width: 1120px) {
	.nav-toggle { display: inline-block; }
	.nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--bg); border-bottom: 1px solid var(--line); padding: 10px 24px 18px; display: none; box-shadow: var(--shadow); }
	.nav.is-open { display: block; }
	.nav__list { flex-direction: column; }
	.nav__list a { padding: 12px 10px; font-size: 16px; }
}
@media (max-width: 760px) {
	body { font-size: 16.5px; }
	.wrap { padding: 0 16px; }
	.nav { padding: 10px 16px 18px; }
	.hero { padding: 40px 0; }
	.hero__text { font-size: 17.5px; }
	.section { padding: 40px 0; }
	.cards, .cards--feature, .promise__grid { grid-template-columns: 1fr; }
	.teaser__inner { padding: 24px; }
	.prose { font-size: 17px; }
	.proscons { grid-template-columns: 1fr; }
	.aff-product { grid-template-columns: 52px 1fr; }
	.aff-product__icon { width: 52px; height: 52px; padding: 8px; }
	.aff-product__btn { grid-column: 1 / -1; width: 100%; }
	.aff-cta { flex-direction: column; align-items: stretch; }
	.aff-cta__btn { width: 100%; }
	.site-footer__grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
	* { transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Custom diagrams (aff-core: child theme diagrams/) ---------- */
.aff-diagram { margin: 1.8em 0 2em; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.aff-diagram__art > svg { display: block; width: 100%; height: auto; overflow: visible; }
.aff-diagram figcaption { margin-top: 12px; font-size: 14.5px; line-height: 1.5; color: var(--muted); }
.aff-diagram__art > svg { font-family: var(--font-body); fill: var(--ink); }
.aff-diagram .t-head { font-family: var(--font-display); font-weight: var(--display-weight); letter-spacing: var(--display-tracking); }
.aff-diagram .t-b { font-weight: 700; }
.aff-diagram .t-muted { fill: var(--muted); }
.aff-diagram .t-acc { fill: var(--accent); }
.aff-diagram .t-acc2 { fill: var(--accent-2); }
.aff-diagram .t-inv { fill: var(--accent-ink); }
.aff-diagram .f-ink { fill: var(--ink); }
.aff-diagram .f-ink2 { fill: var(--ink-2); }
.aff-diagram .f-muted { fill: var(--muted); }
.aff-diagram .f-line { fill: var(--line); }
.aff-diagram .f-bg { fill: var(--bg); }
.aff-diagram .f-surf { fill: var(--surface); }
.aff-diagram .f-surf2 { fill: var(--surface-2); }
.aff-diagram .f-acc { fill: var(--accent); }
.aff-diagram .f-acc2 { fill: var(--accent-2); }
.aff-diagram .f-soft { fill: var(--accent-soft); }
.aff-diagram .f-good { fill: var(--good); }
.aff-diagram .f-bad { fill: var(--bad); }
.aff-diagram .f-none { fill: none; }
.aff-diagram .s-ink { stroke: var(--ink); }
.aff-diagram .s-ink2 { stroke: var(--ink-2); }
.aff-diagram .s-muted { stroke: var(--muted); }
.aff-diagram .s-line { stroke: var(--line); }
.aff-diagram .s-surf { stroke: var(--surface); }
.aff-diagram .s-acc { stroke: var(--accent); }
.aff-diagram .s-acc2 { stroke: var(--accent-2); }
.aff-diagram .s-good { stroke: var(--good); }
.aff-diagram .s-bad { stroke: var(--bad); }
@media (max-width: 560px) {
	.aff-diagram { padding: 10px; }
}

/* ---------- Comparison tables: "Check price" column (aff-core) ---------- */
.aff-cmp td:first-child a { color: inherit; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.aff-cmp td:first-child a:hover { color: var(--accent); }
.prose .aff-cmp { font-size: 14.5px; }
.prose .aff-cmp th { font-size: 13px; line-height: 1.3; vertical-align: bottom; }
.prose .aff-cmp td { vertical-align: middle; }
.prose .aff-cmp th, .prose .aff-cmp td { padding-left: 10px; padding-right: 10px; }
.prose .aff-cmp td:has(.aff-cmp__thumb) { min-width: 172px; }
.prose .aff-cmp__btn { min-height: 36px; padding: 0 14px; font-size: 13px; width: auto; }
/* If a table is still wider than the column, the button column stays pinned on the right. */
.aff-cmp .aff-cmp__h, .aff-cmp .aff-cmp__cell { position: sticky; right: 0; z-index: 1; text-align: center; white-space: nowrap; vertical-align: middle; padding-left: 10px; padding-right: 10px; border-left: 1px solid var(--line); }
.prose .aff-cmp tbody tr td.aff-cmp__cell { background: var(--surface); } /* opaque, so scrolled cells never show through */
.prose .aff-cmp tbody tr:hover td.aff-cmp__cell { background: color-mix(in srgb, var(--accent-soft) 45%, var(--surface)); }

/* Phones: each row becomes a card, so comparison tables never scroll sideways. */
@media (max-width: 640px) {
	.prose .aff-cmp, .prose .aff-cmp tbody { display: block; width: 100%; min-width: 0; }
	.prose .aff-cmp thead, .aff-tablefilter__bar span { display: none; } /* no column headers to tap on phones */
	.prose .aff-cmp tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; padding: 14px; border-bottom: 1px solid var(--line); }
	.prose .aff-cmp tbody tr:last-child { border-bottom: 0; }
	.prose .aff-cmp td { display: block; min-width: 0; padding: 0; border: 0; }
	.prose .aff-cmp td:first-child { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; font-size: 16px; }
	.prose .aff-cmp td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 2px; font: 700 11.5px/1.25 var(--font-body); letter-spacing: .03em; color: var(--muted); }
	.prose .aff-cmp tbody tr td.aff-cmp__cell { grid-column: 1 / -1; position: static; padding: 2px 0 0; border: 0; background: transparent; }
	.prose .aff-cmp tbody tr td.aff-cmp__cell:empty { display: none; }
	.prose .aff-cmp tbody tr:hover td, .prose .aff-cmp tbody tr:hover td.aff-cmp__cell { background: transparent; }
	.prose .aff-cmp .aff-cmp__btn { width: 100%; min-height: 42px; font-size: 14px; }
	.prose .aff-cmp .aff-cmp__thumb { flex: none; margin: 0; }
}

/* ---------- Footer: YouTube channel button ---------- */
.site-footer .aff-yt { display: inline-flex; align-items: center; gap: 9px; margin-top: 14px; min-height: 42px; padding: 0 18px 0 14px; border-radius: 999px; border: 1.5px solid currentColor; color: inherit; font: 700 14.5px/1 var(--font-body); text-decoration: none; transition: background .15s, color .15s, border-color .15s; }
.site-footer .aff-yt svg { width: 24px; height: 17px; flex: none; }
.site-footer .aff-yt:hover { background: #ff0033; border-color: #ff0033; color: #fff; }
.site-footer .aff-yt:hover svg path:first-child { fill: #fff; }
.site-footer .aff-yt:hover svg path:last-child { fill: #ff0033; }

/* ==========================================================================
   1.1 additions: search, reading progress, top pick, trust note, all guides
   ========================================================================== */
h1, h2, h3 { text-wrap: balance; }
.prose p, .prose li { text-wrap: pretty; }
::selection { background: var(--accent); color: var(--accent-ink); }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.aff-disclosure { color: var(--ink-2); }

/* ---------- Header tools + search ---------- */
.site-header__inner .nav { margin-left: auto; }
.site-header__tools { display: flex; align-items: center; gap: 8px; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); cursor: pointer; transition: border-color .15s, color .15s; }
.icon-btn:hover, .icon-btn[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }
.site-search { position: absolute; left: 0; right: 0; top: 100%; padding: 14px 0 16px; background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
.site-search[hidden] { display: none; }
.search-form { display: flex; gap: 10px; }
.search-form input { flex: 1; min-width: 0; min-height: 48px; padding: 0 18px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font: inherit; font-size: 16px; }
.search-form input:focus { border-color: var(--accent); }
.search-form .btn { border: 0; cursor: pointer; }
.search-form--page { max-width: 560px; margin-top: 22px; }
.pager .nav-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 32px; }
.pager .page-numbers { min-width: 42px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); text-align: center; text-decoration: none; }
.pager .page-numbers.current { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.section__more { font-size: 15px; font-weight: 600; color: var(--accent); text-decoration: none; white-space: nowrap; }
.section__more:hover { text-decoration: underline; }

/* ---------- Reading progress + back to top ---------- */
.progress { position: absolute; left: 0; right: 0; top: 100%; height: 3px; pointer-events: none; }
.progress span { display: block; height: 100%; background: var(--accent); transform: scaleX(0); transform-origin: 0 50%; }
.to-top { position: fixed; right: 18px; bottom: 18px; z-index: 44; display: grid; place-items: center; width: 46px; height: 46px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); cursor: pointer; opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity .2s, transform .2s, bottom .2s, visibility 0s .2s; }
.to-top.is-on { opacity: 1; visibility: visible; transform: none; transition: opacity .2s, transform .2s, bottom .2s; }
.to-top:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Article: phone table of contents, top pick, trust note ---------- */
.article__main { min-width: 0; }
.article__sticky { max-height: calc(100vh - 112px); overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line) transparent; padding: 2px 4px 4px 0; }
.toc-mobile { display: none; margin: 0 0 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.toc-mobile summary { position: relative; padding: 14px 46px 14px 16px; font-size: 15px; font-weight: 700; color: var(--ink); cursor: pointer; list-style: none; }
.toc-mobile summary::-webkit-details-marker { display: none; }
.toc-mobile summary::after { content: ""; position: absolute; right: 19px; top: 50%; width: 9px; height: 9px; border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: translateY(-70%) rotate(45deg); transition: transform .2s; }
.toc-mobile[open] summary::after { transform: translateY(-25%) rotate(225deg); }
.toc-mobile .aff-toc { padding: 0 16px 14px; font-size: 15px; }
.toc-mobile .aff-toc__title { display: none; }
.toc-mobile .aff-toc li a { padding-top: 9px; padding-bottom: 9px; }

.aff-sidepick { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 10px 12px; align-items: center; margin-top: 22px; padding: 12px; background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius); color: var(--ink); text-decoration: none; transition: border-color .15s, transform .15s; }
.aff-sidepick:not(:has(.aff-sidepick__img)) { grid-template-columns: minmax(0, 1fr); }
.aff-sidepick:hover { border-color: var(--accent); transform: translateY(-2px); }
.aff-sidepick__img, .aff-sticky__img { display: block; background: #fff; border-radius: var(--radius-sm); box-shadow: 0 0 0 1px var(--line); }
.aff-sidepick__img { width: 56px; height: 56px; padding: 4px; }
.aff-sidepick__img img, .aff-sticky__img img { display: block; width: 100%; height: 100%; object-fit: contain; }
.aff-sidepick__text, .aff-sticky__text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.aff-sidepick__label, .aff-sticky__label { font: 700 10.5px/1.2 var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.aff-sidepick__name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font: var(--display-weight) 14px/1.3 var(--font-display); }
.aff-sidepick .aff-sidepick__btn { grid-column: 1 / -1; width: auto; min-height: 38px; padding: 0 12px; font-size: 13.5px; }

.trust { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 16px; margin: 2.4em 0 0; padding: 20px 22px; background: var(--surface-2); border-radius: var(--radius); font-size: 15.5px; line-height: 1.6; color: var(--ink-2); }
.trust__mark { display: block; width: 44px; height: 44px; color: var(--accent); }
.trust__mark svg { width: 100%; height: 100%; }
.trust__title { margin: 0 0 6px; font: var(--display-weight) 18px/1.3 var(--font-display); letter-spacing: var(--display-tracking); color: var(--ink); }
.trust p { margin: 0 0 8px; }
.trust p:last-child { margin: 0; }
.trust__links a { font-weight: 600; color: var(--ink); text-decoration-color: var(--accent); text-decoration-thickness: 2px; }

/* Phone bar with the article's first in-stock pick. Hidden on larger screens (the sidebar card does the job). */
.aff-sticky { display: none; }

/* ---------- Home: recently updated ---------- */
.updates { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 36px; border-top: 1px solid var(--line); }
.updates li { border-bottom: 1px solid var(--line); }
.updates a { display: flex; flex-direction: column; gap: 4px; padding: 16px 0; color: var(--ink); text-decoration: none; }
.updates__title { font: var(--display-weight) 18px/1.3 var(--font-display); letter-spacing: var(--display-tracking); transition: color .15s; }
.updates a:hover .updates__title { color: var(--accent); }
.updates__meta { font-size: 13.5px; color: var(--ink-2); }

/* ---------- All guides ---------- */
.allguides { margin-bottom: 44px; }
.allguides__title { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); font-size: clamp(22px, 2.4vw, 28px); }
.allguides__title a { color: inherit; text-decoration: none; }
.allguides__title a:hover { color: var(--accent); }
.allguides__icon { flex: none; width: 36px; height: 36px; color: var(--accent); }
.allguides__icon svg { width: 100%; height: 100%; }
.allguides__list { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 44px; }
.allguides__list li { break-inside: avoid; padding: 7px 0; line-height: 1.4; }
.allguides__list a { color: var(--ink); text-decoration-color: var(--line); }
.allguides__list a:hover { color: var(--accent); text-decoration-color: currentColor; }
.allguides__type { margin-left: 6px; font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap; }
.site-footer .site-footer__all { margin-top: 6px; font-weight: 600; }

@media (max-width: 1080px) {
	.toc-mobile { display: block; }
}
@media (max-width: 760px) {
	.updates { grid-template-columns: 1fr; }
	.allguides__list { columns: 1; }
	.search-form .btn { padding: 0 18px; }
	.trust { grid-template-columns: 1fr; gap: 10px; padding: 18px; }
	.trust__mark { width: 36px; height: 36px; }
	.aff-sticky { display: flex; align-items: center; gap: 4px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; padding: 8px 4px calc(8px + env(safe-area-inset-bottom, 0px)) 12px; background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -6px 24px rgba(20, 20, 20, .12); transform: translateY(110%); visibility: hidden; transition: transform .25s ease, visibility 0s .25s; }
	.aff-sticky.is-on { transform: none; visibility: visible; transition: transform .25s ease; }
	.aff-sticky__link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
	.aff-sticky__img { flex: none; width: 44px; height: 44px; padding: 3px; }
	.aff-sticky__text { flex: 1; }
	.aff-sticky__name { overflow: hidden; font: 600 14px/1.25 var(--font-body); white-space: nowrap; text-overflow: ellipsis; }
	.aff-sticky .aff-sticky__btn { flex: none; width: auto; min-height: 42px; padding: 0 16px; font-size: 14px; }
	.aff-sticky__close { flex: none; width: 36px; height: 44px; padding: 0; border: 0; background: none; color: var(--ink-2); font-size: 24px; line-height: 1; cursor: pointer; }
	.to-top { right: 12px; bottom: 14px; }
	body.has-sticky .to-top { bottom: 80px; }
}

/* Soft cross-fade between pages where the browser supports it. */
@media (prefers-reduced-motion: no-preference) {
	@view-transition { navigation: auto; }
}

@media print {
	.site-header, .site-footer, .aff-sticky, .to-top, .related, .article__aside, .toc-mobile, .aff-tablefilter__bar, .skip { display: none !important; }
	body { background: #fff; }
	.article__layout { display: block; }
	.prose { font-size: 12pt; }
}
