/* === File: styles/main.css === */

/* tokens */
:root {
	/* kept (harmless), but layout no longer uses it */
	--maxw: 740px;
	--measure: 66ch;

	--s0: 6px;
	--s1: 10px;
	--s2: 14px;
	--s3: 18px;
	--s4: 26px;
	--s5: 38px;

	--r0: 12px;
	--rule-w: 1px;

	--h1: 1.55rem;
	--h2: 1.45rem;
	--h3: 1.00rem;
	--h4: 0.92rem;
}

/* base */
html {
	background: var(--bg);
}
body {
	background: var(--bg);
	color: var(--ink);
	font-family: var(--font-body);
	line-height: 1.45;
	-webkit-text-size-adjust: 100%;
	font-size: 1.2rem;
}
ul li, p {
	font-size: 1.2rem;
}
.mono {
	font-family: var(--font-mono);
}
.muted {
	color: var(--muted);
}
.dim {
	color: var(--muted);
	opacity: 0.92;
}

a {
	color: var(--accent);
	text-decoration: none;
}
a:hover {
	text-decoration: underline;
}

/* layout (FULL WIDTH) */
.page {
	min-height: 100vh;
}

.flow {
	max-width: none;
	width: 100%;
	margin: 0;
	padding: var(--s4) var(--s2) var(--s5); /* set var(--s2) to 0 for true edge-to-edge */
}

.topbar {
	max-width: none;
	width: 100%;
	margin: 0;
	padding: var(--s3) var(--s2) var(--s1);
}

.topbar-left {
	display: flex;
	flex-direction: column;
	gap: 4px;
	align-items: flex-start;
}
.top-kicker {
	font-family: var(--font-ui);
	color: var(--muted);
	font-weight: 700;
	letter-spacing: 0.02em;
}
.top-meta {
	font-family: var(--font-ui);
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	font-size: 1rem;
	color: var(--muted);
}
.top-link {
	font-weight: 700;
	font-size: 1.2rem;
}
.dot {
	color: var(--rule);
}

/* headings */
.title {
	margin: var(--s2) 0 var(--s1);
	font-size: var(--h1);
	line-height: 1.15;
}
.sec-title {
	margin: var(--s3) 0 var(--s1);
	font-family: var(--font-ui);
	font-weight: 800;
	font-size: var(--h4);
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: color-mix(in srgb, var(--accent) 70%, var(--muted));
}

/* panels (REMOVE “COLUMN BOX” LOOK) */
.panel-box {
	margin-top: var(--s3);
	border: 0;
	border-radius: 0;
	box-shadow: none;
	background: transparent; /* change to var(--paper) if you still want a filled section */
}

.panel-title {
	font-family: var(--font-ui);
	font-weight: 900;
	font-size: var(--h2);
	margin: 0 0 4px;
}
.panel-sub {
	margin: 0 0 var(--s2);
	color: var(--muted);
	font-family: var(--font-ui);
}

/* tree */
.tree {
	margin-top: var(--s2);
	padding-top: var(--s2);
	border-top: var(--rule-w) solid var(--rule);
}
.tree-row {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 12px;

	/* keep rows as “cards” (optional). Remove border if you want totally flat. */
	border: var(--rule-w) solid var(--rule);
	border-radius: 2px;

	background: color-mix(in srgb, var(--paper) 86%, var(--chip-bg));
	margin-bottom: 10px;
}
.tree-indent {
	width: var(--indent, 0px);
	flex: 0 0 auto;
}
.tree-ico {
	width: 20px;
	flex: 0 0 auto;
	opacity: 0.95;
}
.tree-name {
	flex: 1;
	min-width: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.tree-row.is-active {
	border-color: color-mix(in srgb, var(--accent) 50%, var(--rule));
	background: color-mix(in srgb, var(--accent) 10%, var(--paper));
	outline: 2px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
.tree-row:hover {
	border-color: color-mix(in srgb, var(--accent) 35%, var(--rule));
	background: color-mix(in srgb, var(--accent) 7%, var(--paper));
}

/* code + read blocks */
.pre {
	margin: var(--s1) 0;
	padding: 12px 12px;
	border: var(--rule-w) solid var(--rule);
	background: var(--code-bg);
	border-radius: 10px;
	overflow: auto;
}
pre, code {
	font-family: var(--font-mono);
}
pre {
	white-space: pre;
	tab-size: 2;
}

.readblock {
	margin: var(--s1) 0 var(--s2);
	padding: 12px 12px;
	border: var(--rule-w) solid var(--rule);
	background: var(--code-bg);
	border-radius: 10px;
	white-space: pre-wrap;
	word-break: break-word;
}
.readblock.is-empty {
	opacity: 0.75;
	border-style: dashed;
	background: var(--chip-bg);
}

/* key/value meta lines */
.kvline {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	padding: 10px 12px;
	border: var(--rule-w) solid var(--rule);
	background: var(--chip-bg);
	border-radius: 10px;
	margin: var(--s1) 0;
}
.kvline .k {
	font-weight: 900;
}

/* pills */
.pill {
	display: inline-block;
	padding: 4px 8px;
	border: var(--rule-w) solid var(--rule);
	background: color-mix(in srgb, var(--paper) 80%, var(--chip-bg));
	border-radius: 2px;
	font-size: 0.85rem;
}

/* status (keep it subtle) */
#statusbar {
	position: fixed;
	top: 10px;
	right: 10px;
	z-index: 9999;
	padding: 6px 10px;
	font-size: 0.85rem;
	background: color-mix(in srgb, var(--paper) 88%, transparent);
	border: var(--rule-w) solid color-mix(in srgb, var(--rule) 70%, transparent);
	border-radius: 2px;
	pointer-events: none;
	max-width: min(78vw, 520px);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	font-family: var(--font-ui);
	color: var(--muted);
}

/* stacked title metadata lines */
.title-meta {
	margin: 4px 0 0;
	font-family: var(--font-ui);
	font-size: 0.92rem;
	color: var(--muted);
}
.title-meta + .title-meta {
	margin-top: 2px;
}

/* non-link tree rows */
.tree-row.is-disabled {
	opacity: 0.55;
	cursor: default;
}
.tree-row.is-disabled:hover {
	background: color-mix(in srgb, var(--paper) 86%, var(--chip-bg));
	border-color: var(--rule);
}

.theme-btn {
	cursor: pointer;
	border: var(--rule-w) solid var(--accent);
	background: color-mix(in srgb, var(--paper) 86%, var(--chip-bg));
	color: var(--ink);
	padding: 8px 10px;
	border-radius: 2px;
	font-weight: 800;
	font-size: 0.9rem;
}
.theme-btn:active {
	transform: translateY(1px);
}

.meta-line {
	display: none;
}

/* example hook: method name is the h4 inside .method-block */
.method-block > h4.method-name {
	color: var(--method-ink);
}

/* --- theme toggle blink --- */
@keyframes themeBlink {
	0% {
		opacity: 1;
	}
	35% {
		opacity: 0.0;
	}
	100% {
		opacity: 1;
	}
}
@media (prefers-reduced-motion: no-preference) {
	body.theme-blink {
		animation: themeBlink 770ms ease-out;
	}
}

/* --- charts: FULL WIDTH / NO “INNER BOX” BORDERS --- */

/* keep chart section consistent with panel changes */
.panel-box.jdoc-home-charts {
	background: transparent;
	border: 0;
}

/* canvas wrapper: no border/padding, and relative for empty overlay */
.jdoc-home-charts .chart-wrap {
	height: 220px;
	position: relative;
	background: transparent;
	border: 0;
	padding: 0;
}

.jdoc-home-charts canvas {
	width: 100% !important;
	height: 100% !important;
	display: block;
}

/* Empty overlay (class matches HTML: .chart-empty) */
.chart-empty {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	pointer-events: none;
	font-weight: 800;
	font-size: 16px;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
	opacity: 0.70;
}
