/* base.css - element defaults and the shared legacy pieces every page loads
   (badges, the range picker, icon buttons, .card). Tokens are in tokens.css,
   which loads first. */

/* Inter 4.1, the upstream variable file unmodified (fonts/inter/LICENSE.txt).
   The URL is parent_builder.UI_FONT_HREF, which the head preloads. */
@font-face {
	font-family: "Inter";
	src: url("/static/fonts/inter/InterVariable.woff2?v=4.1") format("woff2");
	font-weight: 100 900;
	font-style: normal;
	font-display: block;
}

/* What draws until Inter arrives, or if it never does: a local Arial-metric
   face scaled to Inter's digit width (Inter's figures and its "0", the ch
   unit the numeric reserves are cut in, run about 15 per cent wider than
   Arial's; its letters 6) and given Inter's line metrics (ascent 1984,
   descent 494 of 2048 units, divided by the scale). First rows then sit
   where they sit in Inter on the dense pages; plain text runs wider. */
@font-face {
	font-family: "Inter fallback";
	src: local("Arial"), local("Liberation Sans"), local("Arimo");
	size-adjust: 115%;
	ascent-override: 84.239%;
	descent-override: 20.975%;
	line-gap-override: 0%;
}

html {
	font-family: var(--font-sans);
	background: var(--bg);
	color: var(--text);
}

/* Form controls do not inherit the page font by default. */
button, input, select, textarea {
	font-family: inherit;
}

pre, code, kbd, samp {
	font-family: var(--font-mono);
}

html, body {
	margin: 0;
	padding: 0;
}

body {
	min-height: 100svh;
	display: flex;
	flex-direction: column;
}

main {
	flex: 1 0 auto;
	background: var(--surface-2);
	padding: var(--sp-4);
	min-width: 0;
	max-width: 100%;
	/* clip, not hidden: hidden makes main a scroll container that never
	   scrolls, which stops position: sticky working anywhere inside it. */
	overflow-x: clip;
}

/* Phones: page gutters compound with per-page wrappers and card padding,
   which crowds charts badly - keep the outermost one minimal. A ui page's
   main has none (components.css body.ui main). */
@media (max-width: 600px) {
	:where(body:not(.ui)) main {
		padding: var(--sp-2) 0.35rem; /* lint: ignore[css-spacing] the FF tables (no body.ui) keep this value, DECISIONS 25 */
	}
}

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

/* Page headings are solid (a highlight on every h1 stops being a highlight,
   and gradient text reads poorly on dark). Every page h1 is 28 px. */
main h1 {
	color: var(--accent);
	font-size: var(--fs-2xl);
}

/* ─── Shared UI primitives ────────────────────────────────────────────────── */

/* Badge pill — semantic status indicators */
.badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: var(--sp-1) var(--sp-2);
	border-radius: var(--radius-sm);
	font-size: var(--fs-xs);
	font-weight: 600;
	letter-spacing: 0.04em;
	border: 1px solid transparent;
}
:where(body:not(.ui)) .badge {
	padding: 0.2rem 0.5rem; /* lint: ignore[css-spacing] the FF tables (no body.ui) keep this value, DECISIONS 25 */
	font-size: 0.75rem; /* lint: ignore[css-font-size] the FF tables (no body.ui) keep this value, DECISIONS 25 */
}
.badge--info    { background: var(--accent-soft); color: var(--accent);     border-color: var(--accent); }
.badge--muted   { background: var(--bg);          color: var(--text-muted); border-color: var(--border); }

/* Icon button — small bordered button holding a single image icon.
   Used across files, admin, share, profile, and minecraft pages. */

.icon-btn {
	flex-shrink: 0;
	padding: var(--sp-1);
	background: transparent;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	opacity: 0.55;
	transition: opacity 0.15s, border-color 0.15s;
	text-decoration: none;
}

:where(body:not(.ui)) .icon-btn {
	padding: 0.2rem 0.3rem; /* lint: ignore[css-spacing] the FF tables (no body.ui) keep this value, DECISIONS 25 */
}

.icon-btn:hover {
	opacity: 1;
	border-color: var(--accent);
}

.icon-btn--delete:hover {
	border-color: var(--danger);
}

.icon-btn__img {
	width: 14px;
	height: 14px;
	display: block;
	object-fit: contain;
}

/* Icons are dark PNGs: invert to white; tint delete buttons red */
.icon-btn__img {
	filter: invert(1);
}

.icon-btn--delete {
	background: color-mix(in srgb, var(--danger) 12%, transparent);
	border-color: color-mix(in srgb, var(--danger) 40%, transparent);
}
