/*
 * Editorial design language (base 0.35.0, 14 Nov 2026; first built on Fernrain's Frond page).
 * The store-wide look every newsite store gets: serif headlines with an italic payoff in the accent tone,
 * section openers on a hairline with a small numbered label, a highlighter for the one line that matters,
 * hairline lists and tables instead of boxed cards, a paper page colour.
 *
 * Everything reads tokens. The store's theme.json is the master:
 *   settings.custom.editorial.{paper, italic, highlighter, rule, headingWeight, headingTracking}
 *   font families: evidence = the serif for headings and quotes, body/display = the sans for text and buttons.
 * Base defaults derive from the palette, so a new store looks right before it sets any of these.
 * Colours here are always palette or theme.json tokens, never a mix or a see-through tint (tej 14 Nov).
 *
 * Opt-in building blocks (any page, any section):
 *   .nsb-numbered            container whose .nsb-opener labels count up: "No. 01", "No. 02"…
 *   .nsb-opener              a section label on a hairline (numbered inside .nsb-numbered)
 *   mark, .nsb-hl            highlighter on the one phrase that matters
 *   .nsb-quote-row           quotes side by side on desktop, a swipe row on phones; pair with
 *   .nsb-dots[data-nsb-dots] one dot per item under a swipe row (assets/js/editorial.js)
 *   .nsb-ed-table            comparison table on hairlines, the first value column tinted
 *   .nsb-close               dark closing strip with the buy button
 */

:root {
	--nsb-ed-paper: var(--wp--custom--editorial--paper, var(--wp--preset--color--surface));
	--nsb-ed-italic: var(--wp--custom--editorial--italic, var(--wp--preset--color--accent));
	--nsb-ed-hl: var(--wp--custom--editorial--highlighter, var(--wp--preset--color--highlight));
	--nsb-ed-rule: var(--wp--custom--editorial--rule, var(--wp--preset--color--accent));
	--nsb-ed-serif: var(--wp--preset--font-family--evidence);
	--nsb-ed-weight: var(--wp--custom--editorial--heading-weight, 400);
	--nsb-ed-tracking: var(--wp--custom--editorial--heading-tracking, -0.025em);
}

/* ---- Headlines: the serif, upright, with the italic payoff in the accent tone ---- */
.wp-site-blocks main :is(h1, h2, h3) {
	font-family: var(--nsb-ed-serif);
	font-weight: var(--nsb-ed-weight);
	letter-spacing: var(--nsb-ed-tracking);
}
/* Zero specificity on purpose: a page or section that colours its own payoff (lime on a dark band) keeps it. */
:where(.wp-site-blocks main) :where(h1, h2, h3) :where(em, i) {
	font-family: var(--nsb-ed-serif);
	font-style: italic;
	font-weight: var(--nsb-ed-weight);
	color: var(--nsb-ed-italic);
}
/* On dark bands the payoff takes the highlight colour, as the band's own text does. */
:where(.wp-site-blocks main) :where(.nsb-cta, .nsb-close, .nsb-on-dark, .has-accent-background-color) :where(h1, h2, h3) :where(em, i) { color: var(--wp--preset--color--highlight); }
/* Product names, prices and form headings stay in the sans: they are labels, not headlines. */
.wp-site-blocks main :is(.wc-block-components-product-name, .wc-block-components-title, .wc-block-checkout, .wc-block-cart, .woocommerce-MyAccount-content, .nsb-bundle, .nsb-sticky) :is(h1, h2, h3) {
	font-family: var(--wp--preset--font-family--display);
	font-weight: 800;
	letter-spacing: -0.02em;
}
.wp-site-blocks main .nsb-cta h2 { font-family: var(--nsb-ed-serif); font-weight: var(--nsb-ed-weight); letter-spacing: var(--nsb-ed-tracking); }

/* ---- Section openers: a hairline with a small label; numbered inside .nsb-numbered ---- */
.nsb-numbered { counter-reset: nsb-ed; }
.nsb-opener {
	display: flex; gap: 0.9rem; align-items: center;
	margin: 0 0 1.6rem; padding-top: 1.1rem; border-top: 1px solid var(--nsb-ed-rule);
	font-family: var(--wp--preset--font-family--body); font-size: 0.7rem; font-weight: 800; letter-spacing: 0.2em; text-transform: uppercase;
	color: var(--wp--preset--color--accent);
}
/* Inside a numbered page the opener's spacing wins over a section's own label class. */
.nsb-numbered .nsb-opener { counter-increment: nsb-ed; margin-bottom: 1.6rem; }
.nsb-numbered .nsb-opener::before { content: "No. " counter(nsb-ed, decimal-leading-zero); opacity: 0.75; }
.has-accent-background-color .nsb-opener, .nsb-on-dark .nsb-opener { color: var(--wp--preset--color--highlight); border-top-color: var(--wp--preset--color--border); }

/* ---- Highlighter ---- */
mark, .nsb-hl {
	background: linear-gradient(transparent 58%, var(--nsb-ed-hl) 58%);
	color: inherit; padding: 0 0.04em;
}

/* ---- Quotes: serif, hairlines; a swipe row with dots on phones ---- */
.nsb-quote-row { display: grid; gap: 0 2.75rem; }
.nsb-quote-row > figure { margin: 0; padding: 1.75rem 0; border-top: 1px solid var(--wp--preset--color--line); display: grid; gap: 0.9rem; grid-template-rows: 1fr auto; }
.nsb-quote-row blockquote { margin: 0; }
.nsb-quote-row blockquote p { margin: 0; font-family: var(--nsb-ed-serif); font-size: clamp(1.1rem, 1rem + 0.35vw, 1.3rem); line-height: 1.5; color: var(--wp--preset--color--accent); }
.nsb-quote-row blockquote b { font-weight: inherit; background: linear-gradient(transparent 58%, var(--nsb-ed-hl) 58%); }
.nsb-quote-row figcaption { font: 800 11px/1 var(--wp--preset--font-family--body); letter-spacing: 0.2em; text-transform: uppercase; color: var(--nsb-ed-italic); }
@media (min-width: 782px) { .nsb-quote-row { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); } }
.nsb-dots { display: none; }
@media (max-width: 781px) {
	.nsb-quote-row {
		display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none;
		margin: 1.25rem calc(-1 * var(--wp--custom--gutter, 16px)) 0; padding: 0 var(--wp--custom--gutter, 16px) 6px; scroll-padding: 0 var(--wp--custom--gutter, 16px);
	}
	.nsb-quote-row::-webkit-scrollbar { display: none; }
	.nsb-quote-row > figure {
		flex: 0 0 86%; scroll-snap-align: start; display: flex; flex-direction: column; justify-content: space-between;
		padding: 20px 18px; border: 1px solid var(--wp--preset--color--line); border-radius: 18px; background: var(--wp--preset--color--base);
	}
	.nsb-quote-row blockquote p { font-size: 17px; }
	.nsb-quote-row figcaption { margin-top: 14px; }
	.nsb-dots { display: flex; justify-content: center; gap: 8px; margin-top: 16px; }
	/* --stack: keep every quote in view on phones (no swipe), as cards one under another. */
	.nsb-quote-row--stack { display: grid; gap: 12px; overflow: visible; margin: 1.25rem 0 0; padding: 0; }
	.nsb-quote-row--stack > figure { flex: none; }
	.nsb-quote-row--stack + .nsb-dots { display: none; }
	.nsb-dots button { all: unset; cursor: pointer; width: 8px; height: 8px; border-radius: 99px; background: var(--wp--preset--color--muted); transition: width 0.25s, background 0.25s; }
	.nsb-dots button[aria-current="true"] { width: 22px; background: var(--wp--preset--color--accent); }
	.nsb-dots button:focus-visible { outline: 2px solid var(--wp--preset--color--accent); outline-offset: 3px; }
}

/* ---- Comparison table on hairlines ---- */
.nsb-ed-table { border-top: 1px solid var(--nsb-ed-rule); border-bottom: 1px solid var(--nsb-ed-rule); }
.nsb-ed-table > div { display: grid; grid-template-columns: 0.9fr 1fr 1fr; }
.nsb-ed-table > div + div { border-top: 1px solid var(--wp--preset--color--line); }
.nsb-ed-table > div > * { padding: 0.9rem 1rem; }
.nsb-ed-table > div > :nth-child(2) { background: var(--nsb-ed-hl); font-weight: 700; }
.nsb-ed-table .is-head > * { font: 800 11px/1.2 var(--wp--preset--font-family--body); letter-spacing: 0.12em; text-transform: uppercase; color: var(--nsb-ed-italic); }

/* ---- Questions: serif questions on hairlines (base quick-answers and any .nsb-faq) ---- */
.nsb-faq details { border-bottom: 1px solid var(--wp--preset--color--line); }
.nsb-faq details:first-of-type { border-top: 1px solid var(--nsb-ed-rule); }
.nsb-faq summary { font-family: var(--nsb-ed-serif); font-weight: 400; font-size: clamp(1.15rem, 1rem + 0.5vw, 1.45rem); letter-spacing: -0.015em; color: var(--wp--preset--color--accent); }

/* ---- Dark closing strip ---- */
.nsb-close {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 28px;
	background: var(--wp--preset--color--accent); color: var(--wp--preset--color--on-accent);
	border-radius: var(--wp--custom--radius--panel, 18px); padding: 28px 32px;
}
.nsb-close p { margin: 0; font-family: var(--nsb-ed-serif); font-size: clamp(1.4rem, 1.2rem + 0.8vw, 2rem); line-height: 1.15; }
.nsb-close p i, .nsb-close p em { color: var(--wp--preset--color--highlight); }
.nsb-close small { display: block; font: 600 1rem/1.4 var(--wp--preset--font-family--body); opacity: 0.9; margin-top: 8px; }
@media (max-width: 781px) { .nsb-close { padding: 24px 22px; } .nsb-close .wp-block-button__link, .nsb-close button { width: 100%; } }

/*
 * More building blocks (base 0.35.25, 15 Nov 2026; first built on Fernrain's About page). Tokens only.
 *   .nsb-ledger    a "receipt" card of big numbers and what they mean:
 *                  <aside class="nsb-ledger"><p class="nsb-ledger__h"><span>Title</span><span>Brand</span></p>
 *                  <dl><div><dd>490</dd><dt>Label</dt></div>…</dl><p class="nsb-ledger__f"><a>Link</a></p></aside>
 *                  Add .is-em on a row for an italic number.
 *   .nsb-bigstat   one big serif number with the highlight bar under it: <p class="nsb-bigstat"><b>98</b><span>label</span></p>
 *   .nsb-promises  numbered promise rows, two columns on desktop: <ol class="nsb-promises"><li><i>01</i><h3>…</h3><p>…</p><a>…</a></li></ol>
 *   .nsb-terms     label and detail on hairlines: <ul class="nsb-terms"><li><b>Label.</b><p>Detail</p></li></ul>
 * All four read the editorial tokens above and adapt on dark bands (.nsb-on-dark / .has-accent-background-color).
 */
.nsb-ledger {
	background: var(--wp--preset--color--panel, var(--wp--preset--color--base)); border: 1px solid var(--wp--preset--color--line); border-radius: 4px;
	padding: 26px 28px 22px; box-shadow: 0 1px 0 var(--wp--preset--color--line), 0 24px 48px -32px var(--wp--preset--color--accent);
}
:where(.nsb-ledger) :where(p, dl, dt, dd) { margin: 0; padding: 0; }
.nsb-ledger .nsb-ledger__h {
	display: flex; justify-content: space-between; gap: 12px; padding-bottom: 14px; border-bottom: 2px solid var(--nsb-ed-rule);
	font: 800 11px/1 var(--wp--preset--font-family--body); letter-spacing: 0.2em; text-transform: uppercase; color: var(--wp--preset--color--accent);
}
.nsb-ledger__h span + span { color: var(--nsb-ed-italic); font-weight: 700; }
.nsb-ledger dl > div { display: grid; grid-template-columns: 76px 1fr; gap: 18px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--wp--preset--color--line); }
.nsb-ledger dd {
	font-family: var(--nsb-ed-serif); font-size: 40px; line-height: 0.9; letter-spacing: -0.03em; text-align: right;
	font-variant-numeric: lining-nums tabular-nums; color: var(--wp--preset--color--accent);
}
.nsb-ledger dt { font-size: 15.5px; line-height: 1.3; color: var(--wp--preset--color--contrast-soft, var(--wp--preset--color--contrast)); }
.nsb-ledger .is-em dd { font-style: italic; color: var(--nsb-ed-italic); }
.nsb-ledger .nsb-ledger__f { margin-top: 16px; font-size: 15px; font-weight: 700; }
.nsb-ledger__f a { color: var(--wp--preset--color--accent); text-underline-offset: 4px; text-decoration-thickness: 1px; }
@media (max-width: 781px) {
	.nsb-ledger { padding: 20px 20px 16px; }
	.nsb-ledger dl > div { grid-template-columns: 64px 1fr; }
	.nsb-ledger dd { font-size: 34px; }
}

.nsb-bigstat { display: flex; align-items: flex-end; gap: 18px; margin: 0; }
.nsb-bigstat b {
	position: relative; flex: none; font-family: var(--nsb-ed-serif); font-weight: 400; font-size: clamp(96px, 10vw, 140px);
	line-height: 0.78; letter-spacing: -0.04em; color: var(--wp--preset--color--accent);
}
.nsb-bigstat b::after { content: ""; position: absolute; left: -4px; right: -4px; bottom: -10px; height: 8px; border-radius: 9px; background: var(--nsb-ed-hl); }
.nsb-bigstat span { max-width: 12em; padding-bottom: 4px; font-size: 18px; font-weight: 600; line-height: 1.3; color: var(--wp--preset--color--accent); }
:is(.nsb-on-dark, .has-accent-background-color) .nsb-bigstat :is(b, span) { color: var(--wp--preset--color--base); }
:is(.nsb-on-dark, .has-accent-background-color) .nsb-bigstat b::after { background: var(--wp--preset--color--highlight); }

.nsb-promises { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 64px; margin: 0; padding: 0; list-style: none; }
.nsb-promises > li { display: grid; grid-template-columns: auto 1fr; gap: 4px 24px; padding: 30px 0; border-top: 1px solid var(--wp--preset--color--line); list-style: none; }
.nsb-promises > li:nth-child(-n+2) { border-top-color: var(--nsb-ed-rule); }
.nsb-promises i { grid-row: span 3; font-family: var(--nsb-ed-serif); font-style: italic; font-size: 56px; line-height: 0.8; letter-spacing: -0.04em; color: var(--nsb-ed-italic); }
.nsb-promises h3 { margin: 0; font-size: clamp(1.5rem, 1.25rem + 0.6vw, 1.85rem); line-height: 1.1; }
.nsb-promises p { margin: 8px 0 0; font-size: 16px; line-height: 1.55; }
.nsb-promises a { margin-top: 12px; justify-self: start; font-weight: 700; font-size: 15px; color: var(--wp--preset--color--accent); text-underline-offset: 4px; text-decoration-thickness: 1px; }
@media (max-width: 781px) {
	.nsb-promises { grid-template-columns: minmax(0, 1fr); }
	.nsb-promises > li:nth-child(2) { border-top-color: var(--wp--preset--color--line); }
	.nsb-promises i { font-size: 44px; }
}

.nsb-terms { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--nsb-ed-rule); }
.nsb-terms > li { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 8px 28px; padding: 20px 0; border-bottom: 1px solid var(--wp--preset--color--line); list-style: none; }
.nsb-terms b { font-family: var(--nsb-ed-serif); font-weight: 400; font-size: 21px; line-height: 1.2; color: var(--wp--preset--color--accent); }
.nsb-terms p { margin: 0; font-size: 16px; line-height: 1.55; }
.nsb-terms a { color: var(--wp--preset--color--accent); text-underline-offset: 4px; text-decoration-thickness: 1px; }
@media (max-width: 781px) { .nsb-terms > li { grid-template-columns: minmax(0, 1fr); } }
