/* Public area bundle (FRAMEWORK.md 9): what the public pages need beyond the
   vocabulary, loaded as their area bundle (ui/areas.py AREA_CSS). One section
   per round 7 lane; a lane edits only inside its own. */

/* -- Public pages (pages/public.py, public_load.py; landing.js, resume.js, server_metrics.js; lane L) -- */
/* The resume PDF sits in a Frame(fit=FrameFit.PAGE) (components.css).
   resume.js swaps its iframe for .rs-pages (pdf.js canvases, .rs-sheet)
   where the browser has no inline PDF viewer; they scroll inside the same
   box, so nothing below moves. */
.rs-pages {
	position: relative;
	display: grid;
	gap: var(--sp-2);
}
/* Where the source line double-clicked in the owner's editor landed. */
[data-rs-mark] {
	position: absolute;
	background: var(--accent);
	opacity: 0.3;
	pointer-events: none;
}

.rs-sheet {
	display: block;
	inline-size: 100%;
	block-size: auto;
	background: #fff;
}

/* The owner's Replace source field: its label is the button that opens the
   picker (a pick uploads at once and the Updated age says so); the
   browser's "Choose File / No file chosen" stays for a screen reader and
   the keyboard, which open the picker from the field itself. */
[data-page="resume"] .l-field:has(> #rs-file) { position: relative; }
body.ui #rs-file {
	position: absolute;
	inline-size: 1px;
	min-inline-size: 0;
	block-size: 0;
	min-block-size: 0;
	padding: 0;
	border: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}
[data-page="resume"] label[for="rs-file"] {
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	block-size: var(--ctl-h-btn);
	padding: 0 var(--sp-3);
	border: 1px solid var(--border-strong);
	border-radius: var(--radius-md);
	background: var(--bg);
	color: var(--text);
	font-size: var(--ctl-fs);
	font-weight: 500;
	white-space: nowrap;
	cursor: pointer;
}
[data-page="resume"] label[for="rs-file"]:hover { background: var(--surface-3); }
[data-page="resume"] .l-field:has(> #rs-file:focus-visible) > label { outline: 2px solid var(--accent); outline-offset: 2px; }

/* The owner's LaTeX editor: source text, so monospace and never wrapped,
   as tall as the PDF box beside it (.c-frame--page). */
#rs-source {
	block-size: max(20rem, calc(100dvh - var(--header-h) - 12rem));
	font-family: var(--font-mono);
	font-size: var(--fs-sm);
	white-space: pre;
	overflow: auto;
	resize: none;
}
/* The same box for the Monaco editor resume_editor.js puts in its place. */
[data-rs-editor] {
	box-sizing: border-box;
	block-size: max(20rem, calc(100dvh - var(--header-h) - 12rem));
	border: 1px solid var(--border-strong);
	border-radius: var(--radius-md);
	overflow: hidden;
}

/* Printed, the resume page is the PDF's address, not page one of the box:
   the PDF itself is what prints whole. */
[data-rs-print] { display: none; }
@media print {
	[data-rs-print] { display: block; }
	[data-page="resume"] .c-panel:has([data-rs-frame]) { display: none; }
}

/* /server-metrics: the KPIs sit in equal columns from the first paint, so
   the strip does not rewrap when server_metrics.js fills the "-"
   placeholders. */
#sm-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr)); }

/* The charts name their ratio, so the reserve (components.css) and the
   drawn canvas (charts_uplot.js chartHeight, which takes the phone ratio
   below 480 px of chart width unless --plot-ratio is set) agree at every
   width. */
[data-sm-chart] { --plot-ratio: 1.7778; }

@media (max-width: 600px) {
	[data-sm-chart] { --plot-ratio: 1.389; }
}

/* The head's meta holds the live word or the averages' age (the longer,
   about 29 characters), so it keeps the age's size when it shows the word
   or nothing, and a range switch never rewraps the head. */
[data-page="metrics"] .l-page__meta { min-inline-size: min(100%, 30ch); min-block-size: 1lh; align-self: center; }

/* /: the live line has a row of its own under the h1, whatever its figures'
   widths (it never moves between reloads), with the head's links beside the
   h1. Tools is a KV, its keys as wide as the longest; at 600 px and under a
   key stands over its chips. */
[data-page="landing"] .l-page__meta { order: 1; flex-basis: 100%; font-variant-numeric: tabular-nums; }
[data-page="landing"] .c-kv { grid-template-columns: max-content minmax(0, 1fr); }

@media (max-width: 600px) {
	/* The head's links wrap under the h1: they start at its left edge. */
	[data-page="landing"] .l-page__actions { margin-inline-start: 0; }
	[data-page="landing"] .c-kv { grid-template-columns: minmax(0, 1fr); }
	[data-page="landing"] .c-kv__key:not(:first-child) { padding-block-start: var(--sp-2); }
	/* The join field takes its own lines: its label, then the squares with
	   Join beside them. */
	[data-page="landing"] .c-form--inline[data-landing-join] { flex: 1 1 100%; }
	[data-page="landing"] [data-landing-join] .l-field--inline { display: contents; }
	[data-page="landing"] [data-landing-join] .l-field__label { flex: 1 1 100%; }
}

/* -- end Public pages -- */
