/* ============================================================================
   base.css — fonts, reset, typography globals, interaction globals, utilities.
   Reads tokens only (tokens.css is the sole place raw values may be defined).
   ============================================================================ */

/* base.css §1 — self-hosted fonts. URLs are relative to /assets/css/ and
   deliberately un-versioned: they must byte-match the preload in layout.php.
   If a font file ever changes, RENAME it (inter-var-2.woff2) everywhere. */
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-var.woff2") format("woff2") tech("variations"),
       url("../fonts/inter-var.woff2") format("woff2-variations");
  font-weight: 400 700;   /* matches the instanced axis in tools/fonts/build-fonts.sh */
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/plex-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* base.css §2 — reset */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
img, svg, video { display: block; max-width: 100%; }
input, button, select, textarea { font: inherit; color: inherit; }
p, h1, h2, h3, h4 { overflow-wrap: break-word; }
h1, h2, h3, h4 { color: var(--ink); font-weight: 600; line-height: 1.3; }
ul[class], ol[class] { list-style: none; padding: 0; }
table { border-spacing: 0; }

/* base.css §3 — typography globals */
body {
  font-family: var(--font-ui);
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--body);
  background: var(--canvas);
  /* The ONLY global font-feature-settings in the app. Explicit "1" values —
     bare feature names silently fail in some parsers. NEVER add "tnum" here:
     a blanket font-feature-settings would override font-variant-numeric on
     descendants in engines that resolve both on the same element. */
  font-feature-settings: "cv11" 1;   /* Inter single-storey a — the modern cut */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Mono values: IBAN, reference (sklic), internal numbers, QR payload fields.
   Slashed zero ("zero" 1) ONLY here — O vs 0 matters in IBANs. */
.mono {
  font-family: var(--font-mono);
  font-size: 0.93em;
  font-feature-settings: "zero" 1;
}

/* base.css §4 — interaction globals */
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
/* WCAG 1.4.1: a link INSIDE a block of text may not be distinguishable by colour alone.
   Measured 1.64:1 between the link ink and the surrounding body ink on /izvoz/navodila
   (axe sweep, round 9), which is nowhere near the 3:1 that would let colour do the job
   by itself. Prose links are underlined; a link that is a button, a breadcrumb, a menu
   item or a table cell's identity is not prose and keeps the app's quiet style. */
p a:not(.btn), li:not(.dz-item) a:not(.btn):not([role="menuitem"]),
dd a, .report-body a, .empty-body a {
  text-decoration: underline;
  text-underline-offset: 2px;
}
.crumbs a, .menu a, .tbl a, .stat-card a, .tabs a { text-decoration: none; }
.crumbs a:hover, .tbl a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--selection); }

.skip-link {
  position: absolute;
  left: -9999px;
  z-index: var(--z-skip);
  padding: var(--sp-2) var(--sp-4);
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-ctl);
}
.skip-link:focus-visible { left: var(--sp-4); top: var(--sp-4); }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* base.css §5 — utilities */
/* Tabular figures: THE utility. Applied to every amount, date, count and
   internal-number cell, stat figure, badge and running balance. */
.num   { font-variant-numeric: tabular-nums lining-nums; }
.right { text-align: right; }
.muted { color: var(--muted); }
.ico   { flex: none; vertical-align: -2px; }
.print-footer { display: none; }

/* base.css §6 — reduced motion: kill everything animated */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
