/* The privacy policy and the terms (/privatnost, /uslovi), written by the web build from docs/ (build/legal-pages.mts).
   A file, not an inline <style>: the pages' Content-Security-Policy allows no inline styles. They look like the
   site: the ink header band, Onest, the same colours in light and dark mode (src/presentation/palette.ts, which
   palette.test.ts keeps in step with this file). Not web.css: that one keeps the page from scrolling, because the
   app's screens scroll inside their own views. */

/* Onest from the site's own files (SIL Open Font License, /fonts/OFL.txt), as in web.css. */
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/onest-latin-wght-normal.woff2') format('woff2');
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/onest-latin-ext-wght-normal.woff2') format('woff2');
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}

@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/onest-cyrillic-wght-normal.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/onest-cyrillic-ext-wght-normal.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

:root {
  --page: #f7f7f4;
  --surface: #ffffff;
  --surface-muted: #efefea;
  --header: #0e1b2c;
  --on-header: #ffffff;
  --on-header-muted: #b8c1cc;
  --text: #0f172a;
  --secondary: #5b6472;
  --hairline: #e2e2dc;
  --control: #7c838e;
  --accent: #0f766e;
  --accent-hover: #115e59;
  --accent-soft: #d5ece8;
  --on-accent-soft: #115e59;
  --on-accent: #ffffff;
  --live: #c81e1e;
  --on-live: #ffffff;
  --live-hover: #a51717;
  --live-soft: #fcebea;
  --focus: #0f766e;
  --focus-on-header: #5eead4;
  --font-sans:
    'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  /* The readable column, and the side space that keeps the band's content in line with it. */
  --measure: 46rem;
  --gutter: max(16px, calc((100% - var(--measure)) / 2 + 16px));
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #0b1220;
    --surface: #121b2b;
    --surface-muted: #1a2537;
    --header: #070d18;
    --on-header: #e8ecf2;
    --on-header-muted: #9aa4b2;
    --text: #e8ecf2;
    --secondary: #9aa4b2;
    --hairline: #233044;
    --control: #64728a;
    --accent: #2dd4bf;
    --accent-hover: #5eead4;
    --accent-soft: #134e4a;
    --on-accent-soft: #5eead4;
    --on-accent: #04201c;
    --live: #f05252;
    --on-live: #000000;
    --live-hover: #f47878;
    --live-soft: #3b1719;
    --focus: #2dd4bf;
    --focus-on-header: #5eead4;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--page);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  /* The body step of the app's type scale: 16/24. */
  line-height: 1.5;
  overflow-wrap: break-word;
}

a {
  color: var(--accent);
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--accent-hover);
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* The ink band, as at the top of the app: the name at the app's 24 px gutter (12 on a phone), the link back at
   its other end, and the band's content at most as wide as the app (1440). It stays at the top while the document scrolls, the
   one place with a shadow, with a hairline under it for dark mode, where the band and the page are close. */
header.site {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 16px;
  min-height: 60px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--hairline);
  background-color: var(--header);
  color: var(--on-header);
  box-shadow: 0 1px 3px rgb(0 0 0 / 18%);
}

@media (min-width: 600px) {
  header.site {
    padding: 8px max(24px, calc((100% - 1440px) / 2 + 24px));
  }
}

/* A heading opened from a link (#ko-obraduje-podatke) is not hidden under the band. */
[id] {
  scroll-margin-top: 76px;
}

header.site :focus-visible {
  outline-color: var(--focus-on-header);
}

/* The logo as in the app's band (src/presentation/brand.ts): the white book 28 high, 6 px before the name and 1 px
   above the line's middle, and the name 22 on a 28 line. In px, not rem: like the symbol, the name keeps its size. */
.brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--on-header);
  font-size: 22px;
  line-height: 28px;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand img {
  display: block;
  margin-right: 6px;
  transform: translateY(-1px);
}

/* The name's weight, BRAND_WEIGHT in brand.ts: the owner chooses between the two. */
.brand.weight-600 {
  font-weight: 600;
}

.brand.weight-700 {
  font-weight: 700;
}

.brand:hover {
  color: var(--on-header);
}

/* "Nazad na sajt" as an outlined pill on the band. The pill is 36 high and its
   transparent edge makes the tap area 44. */
.back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: 4px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
  box-shadow: inset 0 0 0 1px var(--on-header-muted);
  color: var(--on-header);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
}

.back:hover {
  background-color: rgb(255 255 255 / 10%);
  color: var(--on-header);
}

main,
footer.site {
  max-width: var(--measure);
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
}

main {
  padding-top: 16px;
  padding-bottom: 40px;
}

h1 {
  font-size: 1.75rem;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 24px 0 12px;
}

/* The version line under the title ("Verzija 1, od 24. novembra 2026."), quiet, as a source line in the app. */
h1 + p {
  margin-bottom: 28px;
  color: var(--secondary);
  font-size: 0.875rem;
}

/* A wide window: the title at the display size of the app's scale. */
@media (min-width: 768px) {
  h1 {
    font-size: 2.5rem;
    line-height: 1.1;
    margin-top: 40px;
  }
}

/* Each part starts on a hairline with a short stroke of the accent at its start. */
h2 {
  position: relative;
  font-size: 1.25rem;
  line-height: 1.3;
  font-weight: 600;
  margin: 36px 0 12px;
  padding-top: 20px;
  border-top: 1px solid var(--hairline);
}

h2::before {
  content: '';
  position: absolute;
  top: -2px;
  left: 0;
  width: 32px;
  height: 3px;
  border-radius: 2px;
  background-color: var(--accent);
}

h3 {
  font-size: 1.0625rem;
  line-height: 1.3;
  font-weight: 600;
  margin: 24px 0 8px;
}

p,
ul,
ol,
blockquote {
  margin: 0 0 14px;
}

ul,
ol {
  padding-left: 1.4em;
}

li {
  margin-bottom: 6px;
}

li::marker {
  color: var(--accent);
}

strong {
  font-weight: 600;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  overflow-wrap: anywhere;
}

blockquote {
  padding: 10px 14px;
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  background-color: var(--surface-muted);
  color: var(--secondary);
}

hr {
  border: 0;
  border-top: 1px solid var(--hairline);
  margin: 24px 0;
}

/* A table scrolls sideways inside its box if it must; the page never does. */
.table {
  overflow-x: auto;
  margin: 0 0 16px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--surface);
  font-size: 0.9375rem;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--hairline);
  text-align: left;
  vertical-align: top;
}

tr:last-child td {
  border-bottom: 0;
}

th {
  background-color: var(--surface-muted);
  color: var(--secondary);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* On a phone each row is a card, and each cell starts with its column's name. The table's roles in the HTML keep
   it a table for screen readers. */
@media (max-width: 640px) {
  .table {
    border: 0;
    border-radius: 0;
  }

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
  }

  table {
    background-color: transparent;
    border: 0;
  }

  thead tr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  tr {
    margin-bottom: 12px;
    background-color: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: 8px;
    overflow: hidden;
  }

  td {
    border: 0;
    border-top: 1px solid var(--hairline);
  }

  td:first-child {
    border-top: 0;
  }

  td::before {
    content: attr(data-label);
    display: block;
    color: var(--secondary);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
  }
}

footer.site {
  padding-top: 16px;
  padding-bottom: 32px;
  border-top: 1px solid var(--hairline);
  color: var(--secondary);
  font-size: 0.875rem;
}

/* The documents as grey pills, as the chips in the app: 36 high, with a transparent edge for a 44 tap area. The
   page itself is filled with the soft accent and outlined in the accent. */
footer.site nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 4px;
  margin: 0 0 8px -4px;
}

footer.site nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border: 4px solid transparent;
  border-radius: 999px;
  background-color: var(--surface-muted);
  background-clip: padding-box;
  box-shadow: inset 0 0 0 1px var(--hairline);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

footer.site nav a:hover {
  background-color: var(--hairline);
  color: var(--text);
}

footer.site nav a[aria-current='page'] {
  background-color: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
  color: var(--on-accent-soft);
}

footer.site p {
  margin: 0 0 6px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
