/* =====================================================================
   NotyLab reading pages — one guide, one workflow, one documentation page.

   Loaded after unica-core-home.css (tokens, bands, type voices, buttons,
   the sheet, index rows, the closing band) and unica-core-tool.css (prose,
   the contents list, questions). Scoped to `.uc-read`, which sits on the
   same element as `.uc-home` and `.uc-tool`. This file adds only what a
   page made for reading needs:

     1. The paper header: one column, no figure beside it
     2. The article grid: text at reading width, contents on the far side
     3. Figure 1, the summary, files, the side facts
     4. Workflow: the method sheet and the protocol's steps on a ruler
     5. Documentation: the manual's sections, set quieter

   Same rules as the front page: two radii, two shadows, teal for the
   instrument, amber for the measurement, nothing under 13px.
   ===================================================================== */

/* No pinned section navigation here: anchors clear the site header only. */
.uc-read {
	--nl-tool-nav-h: 0rem;
	--nl-read-top: calc(var(--header-height, 64px) + 2rem);
}

/* ── 1. Paper header ──────────────────────────────────────────────── */
.uc-read .nl-read-hero {
	padding-block: 0.5rem clamp(2.75rem, 5vw, 4.5rem);
}

.nl-read-hero .breadcrumbs {
	margin-bottom: clamp(1.25rem, 3vw, 2.75rem);
	font-size: 0.8125rem;
}

.nl-read-hero__copy {
	max-width: 48rem;
}

/* A full phrase written for search, at the head of a column of text: set
   smaller than a landing page's headline, and allowed three lines. */
.uc-read .nl-read-hero__title {
	margin-block: 1.2rem 1.1rem;
	font-size: clamp(2.1rem, 3.6vw, 3.2rem);
	line-height: 1.08;
}

[dir="rtl"] .uc-read .nl-read-hero__title {
	font-size: clamp(1.85rem, 3vw, 2.6rem);
	line-height: 1.35;
}

.nl-read-hero__lead {
	max-width: 44rem;
}

/* The tool (or kind of page) after the eyebrow's label: a name, not a label. */
.uc-read .nl-read-hero__tool {
	display: inline-flex;
	align-items: center;
	gap: 0.7rem;
	color: var(--nl-fg-dim);
	letter-spacing: 0;
	text-transform: none;
}

.nl-read-hero__tool::before {
	content: "";
	width: 0.75rem;
	border-top: 1px solid color-mix(in srgb, var(--nl-fg) 35%, transparent);
}

.uc-read a.nl-read-hero__tool:hover {
	color: var(--nl-brand);
}

/* Facts under the summary: level, time, author, date — the data voice. */
.nl-read-facts {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.3rem 0.7rem;
	margin-top: 1.5rem;
	font-family: var(--nl-f-mono);
	font-size: 0.8125rem;
	letter-spacing: 0.02em;
	color: var(--nl-fg-dim);
}

.nl-read-facts li {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
}

.nl-read-facts li + li::before {
	content: "";
	width: 0.75rem;
	margin-inline-end: 0.3rem;
	border-top: 1px solid color-mix(in srgb, var(--nl-fg) 35%, transparent);
}

.uc-read .nl-read-facts a {
	color: var(--nl-brand);
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* ── 2. Article grid ──────────────────────────────────────────────── */
.uc-read .nl-read-body {
	padding-block: clamp(2.5rem, 5vw, 4.5rem) clamp(4rem, 7.5vw, 7rem);
}

.nl-read-grid {
	display: grid;
	grid-template-columns: minmax(0, 46rem) minmax(0, 16rem);
	justify-content: space-between;
	align-items: start;
	gap: clamp(2rem, 5vw, 5rem);
}

.nl-read-main {
	min-width: 0;
}

.nl-read-prose {
	max-width: none;
}

.nl-read-side {
	position: sticky;
	top: var(--nl-read-top);
	max-height: calc(100vh - var(--nl-read-top) - 2rem);
	overflow-y: auto;
	scrollbar-width: thin;
}

.nl-read-side > :first-child .nl-tool-toc__title,
.nl-doc-tree .nl-tool-toc__title {
	margin-top: 0;
}

.nl-read-side__tool {
	display: grid;
	justify-items: start;
	gap: 0.15rem;
	margin-top: 1.75rem;
	padding-top: 1.25rem;
	border-top: 1px solid var(--nl-line);
}

.nl-read-side > .nl-read-side__tool:first-child,
.nl-read-side > .nl-read-meta:first-child {
	margin-top: 0;
	padding-top: 0;
	border-top: 0;
}

/* Tool, technique, audience: a short definition list. */
.nl-read-meta {
	display: grid;
	gap: 0.9rem;
	margin: 1.75rem 0 0;
	padding-top: 1.25rem;
	border-top: 1px solid var(--nl-line);
}

.nl-read-meta dt {
	font-family: var(--nl-f-mono);
	font-size: 0.8125rem;
	letter-spacing: 0.02em;
	color: var(--nl-fg-dim);
}

.nl-read-meta dd {
	margin: 0.1rem 0 0;
	color: var(--nl-fg);
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.45;
}

.uc-read .nl-read-meta a {
	color: var(--nl-brand);
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* ── 3. Figure 1, summary, files ──────────────────────────────────── */
.nl-read-figure {
	margin-bottom: clamp(2rem, 4vw, 3rem);
}

.nl-read-figure img {
	width: 100%;
}

.nl-read-figure .nl-sheet__caption {
	padding-bottom: 1.05rem;
}

.nl-read-video {
	margin-bottom: clamp(2rem, 4vw, 3rem);
}

.nl-read-summary {
	margin-bottom: clamp(2rem, 4vw, 3rem);
	padding: clamp(1.25rem, 2.4vw, 1.75rem);
	border: 1px solid var(--nl-line);
	border-radius: var(--nl-r-card);
	background: var(--nl-surface);
	box-shadow: var(--nl-shadow-rest);
}

.nl-read-summary__goal {
	margin-top: 0.9rem;
	color: var(--nl-fg);
	font-size: 1.125rem;
	line-height: 1.55;
	text-wrap: pretty;
}

.uc-read .nl-read-summary__list {
	display: grid;
	gap: 0.6rem;
	margin-top: 1.1rem;
	font-size: 0.9688rem;
	font-weight: 400;
	line-height: 1.5;
}

.uc-read .nl-read-summary__list li {
	display: flex;
	align-items: baseline;
	gap: 0.7rem;
	color: var(--nl-fg-dim);
}

.uc-read .nl-read-summary__list a {
	color: var(--nl-brand);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.nl-read-download {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1.5rem;
	margin-top: clamp(2.25rem, 4vw, 3.25rem);
	padding: clamp(1.25rem, 2.4vw, 1.75rem);
	border: 1px solid var(--nl-line);
	border-radius: var(--nl-r-card);
	background: var(--nl-surface);
	font-size: 0.9688rem;
	line-height: 1.55;
}

.uc-read .nl-read-download__title {
	margin-block: 0.3rem 0.2rem;
	font-size: 1.1875rem;
	font-weight: 600;
	letter-spacing: -0.012em;
}

.nl-read-download .nl-btn {
	flex: none;
}

.uc-read .page-links {
	margin-top: 2rem;
	font-size: 0.9375rem;
}

.nl-read-comments__inner {
	max-width: 46rem;
}

/* ── 4. Workflow ──────────────────────────────────────────────────── */
/* The method sheet: the workflow printed as a method — what goes in, the
   steps hanging from one rule, what comes out. */
.nl-method__plate {
	margin-bottom: 0.625rem;
}

.nl-method__plate img {
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
}

.nl-method__page {
	padding: clamp(1.25rem, 2vw, 1.75rem) clamp(1.25rem, 2.2vw, 1.9rem) clamp(1.1rem, 1.8vw, 1.5rem);
	border-radius: 3px;
	background: #f2f6f7;
}

.nl-method__meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 0.9rem;
	font-family: var(--nl-f-mono);
	font-size: 0.8125rem;
	letter-spacing: 0.02em;
	color: var(--nl-plate-dim);
}

.nl-method__tool {
	color: var(--nl-plate-brand);
}

.nl-method__io {
	display: grid;
	gap: 0.15rem;
	padding-block: 0.7rem;
	color: var(--nl-plate-fg);
	font-size: 0.9375rem;
	line-height: 1.45;
}

.nl-method__label {
	color: var(--nl-plate-dim);
	font-family: var(--nl-f-mono);
	font-size: 0.8125rem;
	letter-spacing: 0.02em;
}

/* The result is the measurement: marked in amber. */
.nl-method__io--result {
	margin-top: 0.35rem;
	padding-inline-start: 0.9rem;
	border-inline-start: 2px solid var(--nl-mark);
	font-weight: 600;
}

.nl-method__steps {
	counter-reset: nl-method;
	border-inline-start: 1px solid rgb(11 38 53 / 0.2);
}

.nl-method__steps li {
	position: relative;
	display: flex;
	align-items: baseline;
	gap: 0.75rem;
	padding: 0.5rem 0 0.5rem 1.25rem;
	padding-inline: 1.25rem 0;
	color: var(--nl-plate-fg);
	font-size: 0.9375rem;
	line-height: 1.4;
	counter-increment: nl-method;
}

.nl-method__steps li + li {
	border-top: 1px solid rgb(11 38 53 / 0.07);
}

.nl-method__steps li::before {
	content: counter(nl-method, decimal-leading-zero);
	flex: none;
	color: var(--nl-plate-brand);
	font-family: var(--nl-f-mono);
	font-size: 0.8125rem;
}

.nl-method__steps li::after {
	content: "";
	position: absolute;
	inset-inline-start: 0;
	top: 1.05rem;
	width: 0.55rem;
	border-top: 1px solid rgb(11 38 53 / 0.45);
}

.nl-method__steps .nl-method__rest {
	color: var(--nl-plate-dim);
	counter-increment: none;
}

.nl-method__steps .nl-method__rest::before {
	content: "";
}

.nl-method .nl-sheet__caption {
	padding-bottom: 1.05rem;
}

@media (min-width: 1024px) {
	.nl-method {
		width: 100%;
		max-width: 31rem;
		margin-inline-start: auto;
	}
}

/* The contents list of a workflow counts its steps. */
.nl-wf-toc {
	counter-reset: nl-wf-toc;
}

.nl-wf-toc a::before {
	content: counter(nl-wf-toc, decimal-leading-zero);
	margin-inline-end: 0.6rem;
	color: var(--nl-brand);
	font-family: var(--nl-f-mono);
	font-size: 0.8125rem;
	font-weight: 400;
	counter-increment: nl-wf-toc;
}

/* The protocol. Its markup is the theme's (unicasuite_prepare_workflow_content):
   sections, and one ordered list of steps. */
.nl-wf-prose .workflow-section + .workflow-section {
	margin-top: clamp(2.25rem, 4vw, 3.25rem);
	padding-top: clamp(2.25rem, 4vw, 3.25rem);
	border-top: 1px solid var(--nl-line);
}

.nl-wf-prose .workflow-section > :last-child {
	margin-bottom: 0;
}

.uc-read .nl-wf-prose h2 {
	font-family: var(--nl-f-display);
	font-weight: 400;
	letter-spacing: -0.018em;
	text-wrap: balance;
}

[dir="rtl"] .uc-read .nl-wf-prose h2 {
	font-weight: 700;
	letter-spacing: 0;
}

.uc-read .nl-wf-prose .workflow-kicker {
	margin-bottom: 0.6rem;
	color: var(--nl-brand);
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.09em;
	text-transform: uppercase;
}

/* Steps hang from one vertical ruler — the page's ruler turned on its side
   — and each begins at an amber tick. This undoes the prose list's own
   numbered badges: the steps carry their numerals in the markup. */
.uc-tool .nl-wf-prose .workflow-step-list {
	display: block;
	margin: 1.75rem 0 0;
	border-inline-start: 1px solid color-mix(in srgb, var(--nl-fg) 30%, transparent);
	background:
		repeating-linear-gradient(180deg, color-mix(in srgb, var(--nl-fg) 30%, transparent) 0 1px, transparent 1px 10px) left / 5px 100% no-repeat;
	counter-reset: none;
}

[dir="rtl"] .uc-tool .nl-wf-prose .workflow-step-list {
	background-position: right;
}

.uc-tool .nl-wf-prose .workflow-step-list > li {
	position: relative;
	padding: 0 0 2.5rem;
	padding-inline-start: clamp(1.75rem, 3vw, 2.5rem);
	counter-increment: none;
}

.uc-tool .nl-wf-prose .workflow-step-list > li:last-child {
	padding-bottom: 0.25rem;
}

.uc-tool .nl-wf-prose .workflow-step-list > li::before {
	content: "";
	position: absolute;
	inset-inline-start: -1px;
	top: 1.15rem;
	display: block;
	width: 1.15rem;
	height: 2px;
	border-radius: 0;
	background: var(--nl-mark);
}

.nl-wf-prose .workflow-step__number {
	display: block;
	margin-bottom: 0.5rem;
	color: color-mix(in srgb, var(--nl-brand) 62%, transparent);
	font-family: var(--nl-f-display);
	font-size: 2.5rem;
	font-variant-numeric: tabular-nums lining-nums;
	line-height: 1;
	letter-spacing: -0.02em;
}

.uc-tool .nl-wf-prose .workflow-step__body > h3 {
	margin: 0 0 0.6rem;
	font-size: 1.3125rem;
	line-height: 1.3;
}

.nl-wf-prose .workflow-step__body > :last-child {
	margin-bottom: 0;
}

/* A scientific note or a limitation is set apart, marked like a measurement. */
.nl-wf-prose .workflow-section--note {
	padding: clamp(1.25rem, 2.4vw, 1.75rem);
	border: 0;
	border-inline-start: 2px solid var(--nl-mark);
	border-radius: var(--nl-r-plate);
	background: var(--nl-tint);
}

.nl-wf-prose .workflow-section + .workflow-section--note {
	padding-top: clamp(1.25rem, 2.4vw, 1.75rem);
	border-top: 0;
}

.nl-wf-prose .workflow-section--note + .workflow-section {
	border-top: 0;
}

.nl-wf-prose .workflow-faq {
	border-bottom: 1px solid var(--nl-line);
}

.nl-wf-prose .workflow-faq:first-of-type {
	border-top: 1px solid var(--nl-line);
}

.nl-wf-prose .workflow-faq summary {
	padding: 1rem 0.25rem;
	color: var(--nl-fg);
	font-weight: 600;
	line-height: 1.4;
	cursor: pointer;
}

.uc-tool .nl-wf-prose .workflow-faq p {
	margin: 0;
	padding: 0 0.25rem 1.15rem;
}

/* ── 5. Documentation ─────────────────────────────────────────────── */
/* No wash behind the header, a smaller title: a reference, not a pitch. */
.uc-read .nl-read-hero--quiet {
	padding-bottom: clamp(2rem, 3.5vw, 3rem);
	background: var(--nl-paper);
}

.uc-read .nl-read-hero--quiet .nl-read-hero__title {
	margin-block: 1rem 0.9rem;
	font-size: clamp(1.85rem, 2.9vw, 2.6rem);
	line-height: 1.12;
}

[dir="rtl"] .uc-read .nl-read-hero--quiet .nl-read-hero__title {
	font-size: clamp(1.65rem, 2.5vw, 2.2rem);
	line-height: 1.4;
}

.nl-read-hero--quiet .nl-read-facts {
	margin-top: 1.1rem;
}

.uc-doc .nl-read-body {
	padding-top: clamp(2rem, 4vw, 3.5rem);
}

.nl-doc-grid--tree {
	grid-template-columns: minmax(0, 14rem) minmax(0, 44rem) minmax(0, 14rem);
	gap: clamp(1.75rem, 3.5vw, 3.5rem);
}

.nl-doc-tree {
	position: sticky;
	top: var(--nl-read-top);
	max-height: calc(100vh - var(--nl-read-top) - 2rem);
	overflow-y: auto;
	scrollbar-width: thin;
}

.nl-doc-tree__list {
	margin-top: 0.75rem;
	border-inline-start: 1px solid var(--nl-line);
}

.uc-read .nl-doc-tree__list a {
	display: block;
	margin-inline-start: -1px;
	padding: 0.4rem 0 0.4rem 1rem;
	padding-inline: 1rem 0;
	border-inline-start: 2px solid transparent;
	color: var(--nl-fg-dim);
	font-size: 0.9063rem;
	line-height: 1.4;
	text-wrap: pretty;
	transition: color 0.2s, border-color 0.2s;
}

.uc-read .nl-doc-tree__root a {
	color: var(--nl-fg);
	font-weight: 600;
}

.uc-read .nl-doc-tree__list a:hover {
	color: var(--nl-fg);
}

.uc-read .nl-doc-tree__list a[aria-current="page"] {
	border-inline-start-color: var(--nl-mark);
	color: var(--nl-fg);
	font-weight: 600;
}

.uc-doc .nl-tool-prose {
	font-size: 1rem;
	line-height: 1.7;
}

.uc-doc .nl-tool-prose__intro {
	font-size: 1.0625rem;
}

.uc-doc.uc-tool .nl-tool-prose h2 {
	font-size: clamp(1.4rem, 2vw, 1.7rem);
}

/* Text written in the other direction than the page keeps its own. */
.uc-read .nl-tool-prose[dir="rtl"] {
	text-align: right;
}

.uc-read .nl-tool-prose[dir="ltr"] {
	text-align: left;
}

/* ── Right-to-left ────────────────────────────────────────────────── */
/* The monospace stack has no Persian letters worth showing, and tracking
   pulls joined letters apart. */
[dir="rtl"] .uc-read :is(.nl-read-facts, .nl-read-meta dt, .nl-method__meta, .nl-method__label, .nl-eyebrow, .nl-wf-prose .workflow-kicker) {
	font-family: var(--nl-f-sans);
	letter-spacing: 0;
}

[dir="rtl"] .nl-method__steps li::before {
	content: counter(nl-method, persian);
	font-family: var(--nl-f-sans);
	font-size: 0.875rem;
	font-weight: 600;
}

[dir="rtl"] .nl-method__steps .nl-method__rest::before {
	content: "";
}

[dir="rtl"] .nl-wf-toc a::before {
	content: counter(nl-wf-toc, persian);
	font-family: var(--nl-f-sans);
}

/* The prose list's Persian numeral must not come back on the step's tick. */
[dir="rtl"] .uc-tool .nl-wf-prose .workflow-step-list > li::before {
	content: "";
}

[dir="rtl"] .nl-wf-prose .workflow-step__number {
	font-size: 2rem;
	font-weight: 700;
	letter-spacing: 0;
}

/* Tool names stay left-to-right: they are product names. */
[dir="rtl"] .nl-method__tool {
	direction: ltr;
}

/* ── Tablet ───────────────────────────────────────────────────────── */
@media (max-width: 1023.98px) {
	.nl-read-grid,
	.nl-doc-grid--tree {
		grid-template-columns: minmax(0, 1fr);
		gap: 0;
	}

	.nl-read-main {
		max-width: 46rem;
	}

	/* Above the text the contents are a short list, not a sidebar. */
	.nl-read-side,
	.nl-doc-tree {
		position: static;
		order: -1;
		max-height: none;
		overflow: visible;
		margin-bottom: 2.25rem;
	}

	.nl-doc-tree {
		order: -2;
		padding-bottom: 2rem;
		border-bottom: 1px solid var(--nl-line);
	}

	.nl-doc-tree__list {
		columns: 2;
		column-gap: 2rem;
	}

	.nl-doc-tree__list li {
		break-inside: avoid;
	}

	.nl-read-meta {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 1.25rem;
	}
}

/* ── Phone ────────────────────────────────────────────────────────── */
@media (max-width: 639.98px) {
	.uc-read .nl-read-hero__title {
		font-size: clamp(1.9rem, 8.2vw, 2.4rem);
	}

	.uc-read .nl-read-hero--quiet .nl-read-hero__title {
		font-size: clamp(1.65rem, 7vw, 2rem);
	}

	.nl-read-download {
		flex-direction: column;
		align-items: stretch;
	}

	.nl-doc-tree__list {
		columns: 1;
	}

	.nl-read-meta {
		grid-template-columns: minmax(0, 1fr);
		gap: 0.9rem;
	}

	.nl-wf-prose .workflow-step__number {
		font-size: 2rem;
	}

	.uc-tool .nl-wf-prose .workflow-step-list > li {
		padding-bottom: 2rem;
	}
}

/* ── Print ────────────────────────────────────────────────────────── */
@media print {
	.nl-read-side,
	.nl-doc-tree,
	.nl-read-comments {
		display: none;
	}

	.nl-read-grid,
	.nl-doc-grid--tree {
		grid-template-columns: minmax(0, 1fr);
	}
}
