/* ============================================================
 * HSD Theme — typography + body + primitives (v3)
 *
 * UNLAYERED so it wins against Bootstrap's unlayered base rules
 * by source order (we load this AFTER bootstrap in base.html).
 * Sidebar / topbar / dashboard / workspace styles live in
 * components.css (also unlayered).
 * ============================================================ */

@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/geist/Geist-Regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/static/fonts/geist/Geist-Medium.woff2') format('woff2');
}
@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/static/fonts/geist/Geist-Bold.woff2') format('woff2');
}
@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/geist/GeistMono-Regular.woff2') format('woff2');
}

html { color-scheme: light; }

body.hsd-app {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  margin: 0;
}

/* Selection / scrollbar — pulled from mockup v5 */
.hsd-app ::selection {
  background: var(--cyan-soft);
  color: var(--navy);
}
.hsd-app ::-webkit-scrollbar { width: 8px; height: 8px; }
.hsd-app ::-webkit-scrollbar-track { background: var(--bg); }
.hsd-app ::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 3px;
}
.hsd-app ::-webkit-scrollbar-thumb:hover { background: var(--ink-faint); }

/* Headings inside the HSD chrome only — keep legacy forms alone. */
.hsd-app .page h1,
.hsd-app .page h2,
.hsd-app .page h3,
.hsd-app .page h4 {
  color: var(--navy);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.hsd-app .page h1 { font-size: 22px; letter-spacing: -0.025em; }
.hsd-app .page h2 { font-size: 16px; }

.hsd-app .page p { color: var(--ink); }

code, kbd, samp, pre { font-family: var(--font-mono); font-size: 0.92em; }
.hsd-app .page code {
  color: var(--navy);
  background: var(--bg-soft);
  padding: 1px 6px;
  border-radius: 3px;
}

/* App shell primitive */
.hsd-app {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
}
.hsd-main { display: block; }
.hsd-main--unauth {
  max-width: none;
  padding: 0;
}

/* Focus ring (accessibility) */
.hsd-app :focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

/* ============================================================
 * layout.html page shim — ~30 legacy forms still set
 * {% block page_title %} / {% block breadcrumb %}.
 * Lightweight wrapper for those until they migrate.
 * ============================================================ */
.hsd-page {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.hsd-page-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  gap: 14px;
  flex-wrap: wrap;
}
.hsd-page-title {
  font-size: 22px;
  margin: 0;
  color: var(--navy);
  font-weight: 600;
  letter-spacing: -0.02em;
}
.hsd-breadcrumb {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-muted);
}
