/*
Theme Name: PeptidesView Ledger
Template: twentytwentyfive
Description: "Ledger" — the PeptidesView comparison look: cream, clay and slate, Fraunces + Manrope. Design plan 2026-09-29.
Version: 0.4.2
Requires at least: 6.7
License: GNU General Public License v2 or later
Text Domain: peptidesview
*/

/* ---------- tokens ----------
   Every colour, shadow and radius lives in theme.json (Site Editor → Styles changes the light look; a file in
   styles/ is a whole new look). Dark mode swaps in the settings.custom.dark values below; nothing here is a raw colour. */
@media (prefers-color-scheme: dark) {
	:root {
		--wp--preset--color--base: var(--wp--custom--dark--base);
		--wp--preset--color--contrast: var(--wp--custom--dark--contrast);
		--wp--preset--color--accent: var(--wp--custom--dark--accent);
		--wp--preset--color--accent-2: var(--wp--custom--dark--accent-2);
		--wp--preset--color--slate: var(--wp--custom--dark--slate);
		--wp--preset--color--tint: var(--wp--custom--dark--tint);
		--wp--preset--color--rule: var(--wp--custom--dark--rule);
		--wp--preset--color--muted: var(--wp--custom--dark--muted);
		--wp--preset--color--surface: var(--wp--custom--dark--surface);
		--wp--preset--color--on-accent: var(--wp--custom--dark--on-accent);
		--wp--preset--color--hover: var(--wp--custom--dark--hover);
		--wp--preset--color--footer: var(--wp--custom--dark--footer);
		--wp--preset--color--footer-text: var(--wp--custom--dark--footer-text);
		--wp--preset--color--footer-muted: var(--wp--custom--dark--footer-muted);
		--wp--preset--color--footer-rule: var(--wp--custom--dark--footer-rule);
		--wp--custom--ev--lab--bg: var(--wp--custom--dark--ev--lab--bg);
		--wp--custom--ev--lab--fg: var(--wp--custom--dark--ev--lab--fg);
		--wp--custom--ev--animal--bg: var(--wp--custom--dark--ev--animal--bg);
		--wp--custom--ev--animal--fg: var(--wp--custom--dark--ev--animal--fg);
		--wp--custom--ev--human--bg: var(--wp--custom--dark--ev--human--bg);
		--wp--custom--ev--human--fg: var(--wp--custom--dark--ev--human--fg);
		--wp--custom--ev--rct--bg: var(--wp--custom--dark--ev--rct--bg);
		--wp--custom--ev--rct--fg: var(--wp--custom--dark--ev--rct--fg);
		--wp--custom--ev--approved--bg: var(--wp--custom--dark--ev--approved--bg);
		--wp--custom--ev--approved--fg: var(--wp--custom--dark--ev--approved--fg);
	}
}

/* ---------- reading ---------- */
body { -webkit-font-smoothing: antialiased; }
.wp-block-post-content > * { max-width: min(700px, 100%); }
.wp-block-post-content > figure.wp-block-table { max-width: min(860px, 100%); }
.wp-block-post-content > p.answer {
	font-family: var(--wp--preset--font-family--heading); font-weight: 350;
	font-size: var(--wp--preset--font-size--large); line-height: 1.5;
	border-top: 2px solid var(--wp--preset--color--contrast); padding-top: 1.25rem;
}
:focus-visible { outline: 2px solid var(--wp--preset--color--accent); outline-offset: 2px; }

/* ---------- tables: rounded cards, sand header, scroll inside ---------- */
figure.wp-block-table {
	margin-block: 2rem; overflow-x: auto;
	border: 1px solid var(--wp--preset--color--rule); border-radius: var(--wp--custom--radius--card);
	background:
		linear-gradient(to right, var(--wp--preset--color--base) 30%, transparent) left / 40px 100% no-repeat local,
		linear-gradient(to left, var(--wp--preset--color--base) 30%, transparent) right / 40px 100% no-repeat local,
		radial-gradient(farthest-side at 0 50%, var(--wp--custom--shadow--scroll), transparent) left / 12px 100% no-repeat scroll,
		radial-gradient(farthest-side at 100% 50%, var(--wp--custom--shadow--scroll), transparent) right / 12px 100% no-repeat scroll;
}
figure.wp-block-table table {
	width: 100%; border-collapse: collapse;
	font-size: var(--wp--preset--font-size--small); line-height: 1.5; font-variant-numeric: tabular-nums;
}
figure.wp-block-table th, figure.wp-block-table td {
	border: 0; border-bottom: 1px solid var(--wp--preset--color--rule);
	padding: .7rem .9rem; text-align: left; vertical-align: top;
}
figure.wp-block-table tbody tr:last-child td { border-bottom: 0; }
figure.wp-block-table thead th {
	background: var(--wp--preset--color--tint); color: var(--wp--preset--color--contrast);
	font-weight: 700; font-size: .8125rem;
}
figure.wp-block-table td:first-child { color: var(--wp--preset--color--muted); font-weight: 600; }
@media (max-width: 600px) {
	figure.wp-block-table table { min-width: 34rem; }
}

/* ---------- side by side: column A clay, column B slate, names pinned ---------- */
.compare-table thead th:nth-child(2) { box-shadow: inset 0 3px 0 var(--wp--preset--color--accent-2); }
.compare-table thead th:nth-child(3) { box-shadow: inset 0 3px 0 var(--wp--preset--color--slate); }
.compare-table thead th:nth-child(4) { box-shadow: inset 0 3px 0 var(--wp--preset--color--muted); }
.compare-table thead th:not(:first-child) { font-family: var(--wp--preset--font-family--heading); font-weight: 500; font-size: 1rem; }
.compare-table th:first-child, .compare-table td:first-child {
	position: sticky; left: 0; z-index: 1; background: var(--wp--preset--color--base); min-width: 8.5rem;
}
.compare-table thead th:first-child { background: var(--wp--preset--color--tint); }

/* ---------- status box: the verdict card under the answer ---------- */
figure.wp-block-table.status-box { background: var(--wp--preset--color--tint); border-color: transparent; }
.status-box td:first-child { background: transparent !important; }
.status-box tr:last-child td { font-family: var(--wp--preset--font-family--mono); font-size: .8125rem; }

/* ---------- evidence badges: slate ramp, darker = stronger, dots + words ---------- */
.ev {
	display: inline-flex; align-items: center; gap: .4em;
	font-family: var(--wp--preset--font-family--mono); font-size: .75rem; line-height: 1.3;
	padding: .15rem .55rem; border-radius: 999px; white-space: nowrap;
}
.ev::before { font-size: .6rem; letter-spacing: .12em; flex: none; }
.ev-lab      { background: var(--wp--custom--ev--lab--bg);      color: var(--wp--custom--ev--lab--fg); }
.ev-animal   { background: var(--wp--custom--ev--animal--bg);   color: var(--wp--custom--ev--animal--fg); }
.ev-human    { background: var(--wp--custom--ev--human--bg);    color: var(--wp--custom--ev--human--fg); }
.ev-rct      { background: var(--wp--custom--ev--rct--bg);      color: var(--wp--custom--ev--rct--fg); }
.ev-approved { background: var(--wp--custom--ev--approved--bg); color: var(--wp--custom--ev--approved--fg); }
.ev-lab::before      { content: "●○○○○"; }
.ev-animal::before   { content: "●●○○○"; }
.ev-human::before    { content: "●●●○○"; }
.ev-rct::before      { content: "●●●●○"; }
.ev-approved::before { content: "●●●●●"; }

/* ---------- key points ---------- */
.key-points {
	border: 1px solid var(--wp--preset--color--rule); border-radius: var(--wp--custom--radius--card);
	padding: 1.2rem 1.5rem 1.3rem; margin-block: 2rem;
}
.key-points > p:first-child { margin: 0 0 .5rem; }
.key-points > p:first-child strong { font-family: var(--wp--preset--font-family--heading); font-weight: 500; font-size: 1.25rem; }
.key-points ul { margin: 0; padding-left: 1.1rem; }
.key-points li + li { margin-top: .45rem; }
.key-points li::marker { color: var(--wp--preset--color--accent-2); }

/* ---------- FAQ ---------- */
.faq h3 { font-family: var(--wp--preset--font-family--body); font-weight: 700; font-size: 1.0625rem; margin-top: 1.6rem; }
.faq h3::before { content: "Q"; font-family: var(--wp--preset--font-family--heading); color: var(--wp--preset--color--accent-2); margin-right: .5rem; }
.faq h3 + p { margin-top: .35rem; }

/* ---------- references and change log ---------- */
.references, .changelog { font-size: var(--wp--preset--font-size--small); line-height: 1.55; color: var(--wp--preset--color--muted); }
.references h2, .changelog h2 { font-size: var(--wp--preset--font-size--large); color: var(--wp--preset--color--contrast); }
.references ol { padding-left: 1.4rem; }
.references li { margin-bottom: .5rem; overflow-wrap: anywhere; }
.changelog { background: var(--wp--preset--color--tint); border-radius: var(--wp--custom--radius--card); padding: .25rem 1.25rem .75rem; margin-top: 2.5rem; }

/* ================= site chrome (week 2) ================= */
.eyebrow, .eyebrow a { font-size: .875rem; font-weight: 700; color: var(--wp--preset--color--accent); text-decoration: none; margin: 0 0 .4rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.section-title { font-size: var(--wp--preset--font-size--x-large); font-weight: 400; margin: 0 0 1.5rem; }
.section-lede { color: var(--wp--preset--color--muted); margin: -.75rem 0 2rem; max-width: 42rem; }
.hero > *, .band > * { margin-inline-start: 0 !important; }

/* header */
.site-header { background: var(--wp--preset--color--base); }
.site-header__row { padding-block: 1.1rem; gap: 1.5rem; border-bottom: 1px solid var(--wp--preset--color--contrast); }
.brand { display: inline-flex; align-items: center; gap: .55rem; color: var(--wp--preset--color--accent-2); text-decoration: none; }
.brand__name { font-family: var(--wp--preset--font-family--heading); font-weight: 500; font-size: 1.5rem; letter-spacing: -.02em; color: var(--wp--preset--color--contrast); }
.site-nav { font-size: .9375rem; font-weight: 600; gap: 1.75rem; }
.site-nav a { text-decoration: none; color: var(--wp--preset--color--contrast); }
.site-nav a:hover { color: var(--wp--preset--color--accent); }
.site-header__nav { gap: 1.25rem; align-items: center; }
.site-search .wp-block-search__button { background: transparent; color: var(--wp--preset--color--contrast); border: 1px solid var(--wp--preset--color--rule); border-radius: 999px; padding: .45rem; }
.site-search .wp-block-search__input { border: 1px solid var(--wp--preset--color--rule); border-radius: 999px; background: var(--wp--preset--color--base); color: inherit; }

/* homepage */
.home > * + * { margin-block-start: 0; }
.hero { padding-block: clamp(3rem, 7vw, 5.5rem) clamp(2.5rem, 6vw, 4.5rem); display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.hero__title { font-size: clamp(2.5rem, 1.5rem + 3.6vw, 4.25rem); line-height: 1.04; letter-spacing: -.03em; margin: 0 0 1.5rem; font-weight: 400; }
.hero__lede { font-size: var(--wp--preset--font-size--large); line-height: 1.55; color: var(--wp--preset--color--muted); max-width: 36rem; margin: 0 0 2rem; }
.hero__search { max-width: 34rem; }

/* the scoreboard: one real pair, counted */
.scoreboard { margin: 0; background: var(--wp--preset--color--surface); border: 1px solid var(--wp--preset--color--contrast); border-radius: 4px; padding: 1.5rem 1.5rem 1.25rem; box-shadow: var(--wp--custom--shadow--board) var(--wp--preset--color--tint); }
.scoreboard__title { font-family: var(--wp--preset--font-family--heading); font-size: 1.75rem; line-height: 1.1; margin-bottom: 1rem; }
.scoreboard__a { color: var(--wp--preset--color--accent); }
.scoreboard__b { color: var(--wp--preset--color--slate); }
.scoreboard__vs { font-size: 1rem; color: var(--wp--preset--color--muted); margin-inline: .2rem; }
.scoreboard table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.scoreboard th, .scoreboard td { padding: .6rem 0; border-bottom: 1px solid var(--wp--preset--color--rule); text-align: left; vertical-align: middle; }
.scoreboard thead th { font-size: .8125rem; color: var(--wp--preset--color--muted); font-weight: 700; padding-top: 0; }
.scoreboard thead th:nth-child(2) { color: var(--wp--preset--color--accent); }
.scoreboard thead th:nth-child(3) { color: var(--wp--preset--color--slate); }
.scoreboard tbody th { font-weight: 400; color: var(--wp--preset--color--muted); width: 46%; }
.scoreboard td { font-weight: 700; width: 27%; }
.scoreboard .count { font-family: var(--wp--preset--font-family--heading); font-weight: 400; font-size: 1.75rem; line-height: 1; font-variant-numeric: tabular-nums; }
.scoreboard__link { display: inline-block; margin-top: 1rem; font-weight: 700; }
@media (max-width: 900px) { .hero { grid-template-columns: minmax(0, 1fr); } }

/* latest comparisons as ledger rows, not cards */
.ledger { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--wp--preset--color--contrast); }
.ledger__row { display: grid; grid-template-columns: 11rem minmax(0, 1.2fr) minmax(0, 1.4fr) 7rem; gap: 1.5rem; align-items: start; padding: 1.25rem 0; border-bottom: 1px solid var(--wp--preset--color--rule); }
.ledger__row > * { margin: 0 !important; }
.ledger__title { font-size: 1.5rem; font-weight: 400; line-height: 1.15; }
.ledger__title a { text-decoration: none; color: var(--wp--preset--color--contrast); }
.ledger__title a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.ledger__excerpt { font-size: .9375rem; line-height: 1.55; color: var(--wp--preset--color--muted); }
.ledger__excerpt .wp-block-post-excerpt__more-text { display: none; }
.ledger__date { font-size: .8125rem; color: var(--wp--preset--color--muted); text-align: right; }
@media (max-width: 900px) { .ledger__row { grid-template-columns: 1fr; gap: .4rem; } .ledger__date { text-align: left; } }
.hero__search .wp-block-search__inside-wrapper { border: 1px solid var(--wp--preset--color--rule); border-radius: 999px; background: var(--wp--preset--color--surface); padding: .35rem; box-shadow: var(--wp--custom--shadow--field); }
.hero__search .wp-block-search__input { border: 0; font-size: 1.0625rem; padding: .7rem 1.1rem; background: transparent; color: var(--wp--preset--color--contrast); }
.hero__search .wp-block-search__button { background: var(--wp--preset--color--contrast); color: var(--wp--preset--color--base); border-radius: 999px; padding: .7rem 1.6rem; font-weight: 700; margin-left: .35rem; }
.band { padding-block: clamp(2.5rem, 6vw, 4.5rem); border-top: 1px solid var(--wp--preset--color--rule); }
.band__link { margin-top: 2rem; font-weight: 700; }
.band__link a { text-decoration: none; }

.card-grid { gap: 1.25rem !important; }
.entry-card { background: var(--wp--preset--color--surface); border: 1px solid var(--wp--preset--color--rule); border-radius: var(--wp--custom--radius--card); padding: 1.35rem 1.4rem 1.2rem; display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; }

.entry-card__title { font-size: 1.375rem; font-weight: 400; line-height: 1.2; margin: .25rem 0 .6rem; }
.entry-card__title a { text-decoration: none; color: var(--wp--preset--color--contrast); }
.entry-card__excerpt { font-size: .9375rem; line-height: 1.55; color: var(--wp--preset--color--muted); flex: 1; }
.entry-card__excerpt .wp-block-post-excerpt__more-text { display: none; }
.entry-card__date { font-family: var(--wp--preset--font-family--mono); font-size: .75rem; color: var(--wp--preset--color--muted); border-top: 1px solid var(--wp--preset--color--rule); padding-top: .75rem; margin-top: .5rem; }
.entry-card__date::before { content: "Updated "; }

.goal-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: .75rem; }
.goal-grid li { margin: 0; }
.goal-grid a { display: block; font-size: .875rem; padding: 1.1rem 1.25rem; border-radius: var(--wp--custom--radius--card); background: var(--wp--preset--color--tint); text-decoration: none; color: var(--wp--preset--color--muted); transition: background .15s; }
.goal-grid a:hover { background: var(--wp--preset--color--hover); }
.goal-grid strong { display: block; margin-bottom: .25rem; color: var(--wp--preset--color--contrast); font-family: var(--wp--preset--font-family--heading); font-weight: 500; font-size: 1.25rem; }

.scale { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; }
.scale li { border-top: 1px solid var(--wp--preset--color--contrast); padding-top: 1rem; }
.scale p { font-size: .875rem; line-height: 1.5; margin: .75rem 0 0; color: var(--wp--preset--color--muted); }

.method { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.method li { border-top: 1px solid var(--wp--preset--color--contrast); padding-top: 1.1rem; }
.method strong { display: block; color: var(--wp--preset--color--contrast); line-height: 1.3; font-family: var(--wp--preset--font-family--heading); font-size: 1.375rem; font-weight: 400; margin-bottom: .5rem; }
.method li { color: var(--wp--preset--color--muted); font-size: .9375rem; line-height: 1.6; margin: 0; }

/* article */
.article { padding-block: clamp(2rem, 5vw, 3.5rem) 0; }
.article__head { margin-bottom: 2rem; }
.article__title { font-size: clamp(2.25rem, 1.5rem + 3vw, 3.5rem); font-weight: 400; line-height: 1.05; letter-spacing: -.03em; margin: 0 0 1.25rem; }
.article__meta { gap: .35rem 1.1rem; font-size: .875rem; color: var(--wp--preset--color--muted); }
.article__meta p, .article__meta .wp-block-post-date { margin: 0; }
.article__published::before { content: "Published "; }
.article__updated::before { content: "Updated "; }
.article__foot { margin-top: 3rem; }
.article__disclaimer { font-size: .875rem; line-height: 1.6; color: var(--wp--preset--color--muted); background: var(--wp--preset--color--tint); border-radius: var(--wp--custom--radius--card); padding: 1rem 1.25rem; }
.related { margin-top: 4rem; padding-block: 3rem; border-top: 1px solid var(--wp--preset--color--rule); }

/* footer */
.site-footer { background: var(--wp--preset--color--footer); color: var(--wp--preset--color--footer-text); margin-top: 4rem; padding-block: 3.5rem 2rem; }
.site-footer a { color: var(--wp--preset--color--footer-text); }
.site-footer__lede { max-width: 26rem; margin-top: 1rem; font-family: var(--wp--preset--font-family--heading); font-size: 1.25rem; line-height: 1.4; }
.site-footer__disclaimer { font-size: .8125rem; line-height: 1.6; color: var(--wp--preset--color--footer-muted); max-width: 26rem; }
.site-footer__title { font-family: var(--wp--preset--font-family--body); font-size: .9375rem; font-weight: 700; margin: 0 0 .75rem; }
.site-footer__links { list-style: none; padding: 0; margin: 0; font-size: .9375rem; line-height: 2; }
.site-footer__links a { text-decoration: none; }
.site-footer__links a:hover { text-decoration: underline; }
.site-footer__base { border-top: 1px solid var(--wp--preset--color--footer-rule); margin-top: 2.5rem; padding-top: 1.5rem; font-size: .8125rem; color: var(--wp--preset--color--footer-muted); }

@media (max-width: 900px) {
	.scale { grid-template-columns: 1fr 1fr; }
	.method { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
	.scale { grid-template-columns: 1fr; }
	.site-header .site-search { display: none; }
	.brand__name { font-size: 1.25rem; }
}
/* ---------- hubs: category pages, search results, 404 ---------- */
.hub { padding-block: clamp(2.5rem, 6vw, 4.5rem) 1rem; }
.hub__head { margin-bottom: 2.5rem; }
.hub__head > * { margin-inline-start: 0 !important; }
.hub__title { font-size: clamp(2.25rem, 1.5rem + 3vw, 3.5rem); line-height: 1.05; margin: 0 0 1rem; }
.hub__lede, .hub__lede p { font-size: var(--wp--preset--font-size--large); line-height: 1.55; color: var(--wp--preset--color--muted); max-width: 40rem; margin: 0 0 1.5rem; }
.hub__empty { color: var(--wp--preset--color--muted); padding: 1.5rem 0; border-top: 1px solid var(--wp--preset--color--rule); }
.pager { margin-top: 2.5rem; font-weight: 600; }
.pager a { text-decoration: none; }
.ledger__date::before { content: "Updated "; }

/* motion support: pre-paint hide of the hero card (only while js-motion is set), reading bar */
.js-motion .scoreboard { visibility: hidden; }
.read-progress { position: fixed; inset: 0 0 auto 0; height: 3px; background: var(--wp--preset--color--accent); transform: scaleX(0); transform-origin: 0 50%; z-index: 100; pointer-events: none; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
