/* dd ui-theme: the shared look of Darjan's projects (from the Astra service book).
   Copy this file into the project unchanged; project styles use only these variables.
   Light and dark follow the system, and <html data-theme="light|dark"> forces one. */

:root {
  color-scheme: light dark;
  --surface: #f7f7f8;   /* page background */
  --card: #ffffff;      /* cards, bars, sheets */
  --ink: #1c1a2e;       /* text */
  --muted: #6c6880;     /* secondary text, icons */
  --line: #e6e3ee;      /* borders and dividers */
  --accent: #166f4c;    /* links, the current item, buttons */
  --on-accent: #ffffff; /* text and icons on --accent */
  --danger: #e23b5a;
  --warning: #d98415;
  --info: #2f7fe0;
  --success: #1ba672;
  --shadow: 0 1px 2px rgb(28 26 46 / .04), 0 10px 30px rgb(28 26 46 / .06);
  --radius: 12px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* Derived from the colours above; never set them to a colour of their own. */
  --tint: color-mix(in srgb, var(--accent) 12%, var(--card));  /* background of the current item */
  --hover: color-mix(in srgb, var(--ink) 5%, var(--card));     /* background on hover */
  --bar: color-mix(in srgb, var(--card) 94%, transparent);     /* fixed bars over the page */
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --surface: #14121c;
    --card: #1c1926;
    --ink: #ece9f6;
    --muted: #a49fb8;
    --line: #322d47;
    --accent: #86c65b;
    --on-accent: #14121c;
    --danger: #f2688a;
    --warning: #e89b3c;
    --info: #66a3ec;
    --success: #37b581;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 10px 30px rgb(0 0 0 / .4);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --surface: #14121c;
  --card: #1c1926;
  --ink: #ece9f6;
  --muted: #a49fb8;
  --line: #322d47;
  --accent: #86c65b;
  --on-accent: #14121c;
  --danger: #f2688a;
  --warning: #e89b3c;
  --info: #66a3ec;
  --success: #37b581;
  --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 10px 30px rgb(0 0 0 / .4);
}

:root[data-theme="light"] { color-scheme: light; }

body {
  margin: 0;
  font-family: var(--font);
  line-height: 1.5;
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
}

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

/* A white (dark: raised) box on the page. */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* The light/dark switch (theme.js), as in snimanjeprocesa: a plain icon button showing the
   mode it switches to, a moon in light mode and a sun in dark mode, grey, with a round
   background on hover. Every project has one, in the top right of its header. */
/* .icon-button is the same look for the other header buttons, e.g. the language switch. */
.theme-toggle, .icon-button {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; padding: 0; flex: none; cursor: pointer;
  border: 0; border-radius: 50%; background: transparent; color: var(--muted);
  transition: background-color .15s;
}
.theme-toggle:hover, .icon-button:hover { background: var(--hover); }
.theme-toggle:focus:not(:focus-visible), .icon-button:focus:not(:focus-visible) { outline: none; }
.theme-toggle svg, .icon-button svg {
  width: 20px; height: 20px;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: none; }
}
a.icon-button { text-decoration: none; }
@media print { .theme-toggle, .icon-button { display: none; } }
