/* Visual code: colour = gender of the noun, symbol = case of the preposition.
   Akkusativ always left (solid line), Dativ always right (dotted line). Bold only for real emphasis. */

:root {
  --bg: #fbfaf7;
  --card: #ffffff;
  --fg: #1f2328;
  --muted: #5d636c;
  --line: #e2e0d9;
  --head: #f2f0ea;
  --m: #1d4ed8;
  --f: #d42020;
  --n: #15803d;
  --pl: #7c3aed;
  --exc: #a16207;
  --mark: #6b7280;
  --fi-vowel: #0e7490;
  --fi-strong: #c2410c;
  --fi-cons: #be185d;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171b;
    --card: #1d2025;
    --fg: #e7e6e1;
    --muted: #a0a5ad;
    --line: #2f333a;
    --head: #24282e;
    --m: #7eaaff;
    --f: #ff7d7d;
    --n: #5fd18a;
    --pl: #bc9fff;
    --exc: #e2b552;
    --mark: #a0a5ad;
    --fi-vowel: #22d3ee;
    --fi-strong: #fb923c;
    --fi-cons: #f472b6;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: 8px 16px;
}

nav { display: flex; align-items: center; gap: 14px; font-size: 15px; }
nav a { color: var(--muted); text-decoration: none; padding: 2px 0; white-space: nowrap; }
/* first row: the app's header (same as frontend/public/app.css), second row: the page menu */
.app-nav { flex-wrap: wrap; gap: 6px 14px; margin-bottom: 6px; }
.app-nav a[aria-current] { color: var(--fg); font-weight: 600; }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.nav-settings { font-size: 20px; line-height: 1; }
nav .page-menu { flex: 1; min-width: 0; max-width: 420px; font: inherit; font-size: 15px; font-weight: 600; padding: 6px 10px;
  border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--fg); }

.legend { font-size: 13px; margin-top: 4px; display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: center; }
.legend .sep { width: 1px; height: 12px; background: var(--line); }

main { max-width: 1040px; margin: 0 auto; padding: 8px 16px 64px; }

h1 { font-size: 30px; line-height: 1.2; margin: 24px 0 8px; }
h2 { font-size: 23px; margin: 40px 0 8px; padding-top: 8px; border-top: 1px solid var(--line); }
h3 { font-size: 19px; margin: 28px 0 6px; }
.lead { color: var(--muted); font-size: 18px; }

a { color: inherit; }

/* gender colours */
.g-m { color: var(--m); }
.g-f { color: var(--f); }
.g-n { color: var(--n); }
.g-pl { color: var(--pl); }

/* case markers after a preposition */
.akk::after, .dat::after, .wp::after, .gen::after {
  color: var(--mark);
  margin-left: 2px;
  font-weight: normal;
}
.akk::after { content: "→"; }
.dat::after { content: "●"; font-size: 0.75em; vertical-align: 0.1em; margin-left: 3px; }
.wp::after { content: "→●"; font-size: 0.85em; }
.gen::after { content: "◆"; font-size: 0.7em; vertical-align: 0.1em; margin-left: 3px; }

.exc { color: var(--exc); }

/* Finnish stem families: weak-grade vowel stems, strong-grade stems, consonant stems */
.fi-vowel { color: var(--fi-vowel); }
.fi-strong { color: var(--fi-strong); }
.fi-cons { color: var(--fi-cons); }
.st { font-weight: 800; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.end { font-weight: 800; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.fi { font-family: Georgia, "Times New Roman", serif; font-size: 1.05em; }
.legend .grad::before { content: "kk/k"; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; margin-right: 4px; font-size: 12px; }

/* two columns: Akkusativ left, Dativ right */
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.col-akk { border-top: 3px solid var(--fg); padding-top: 4px; }
.col-dat { border-top: 3px dotted var(--fg); padding-top: 4px; }
.col-akk > h2, .col-dat > h2 { border-top: 0; margin-top: 8px; }
@media (max-width: 760px) {
  .cols { grid-template-columns: 1fr; }
}

/* table cells that belong to a case column */
th.c-akk, td.c-akk { border-left: 3px solid var(--fg); }
th.c-dat, td.c-dat { border-left: 3px dotted var(--fg); }

.table-wrap { overflow-x: auto; margin: 8px 0 16px; }
table { border-collapse: collapse; width: 100%; background: var(--card); font-size: 16px; }
th, td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; vertical-align: top; }
th { background: var(--head); font-weight: 600; }
.gloss { display: block; color: var(--muted); font-size: 14px; }

.note {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--muted);
  padding: 10px 14px;
  margin: 12px 0;
}
.note.exc-note { border-left-color: var(--exc); }

blockquote { margin: 12px 0; padding: 4px 16px; border-left: 4px solid var(--line); color: var(--muted); }

img.diagram { width: 100%; height: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; }

.jump { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 16px; }
.jump a { text-decoration: none; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin: 16px 0; }
.card {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  text-decoration: none;
}
.card strong { display: block; font-size: 18px; margin-bottom: 4px; }
.card span.desc { color: var(--muted); font-size: 15px; }

@media (max-width: 600px) {
  body { font-size: 16px; }
  h1 { font-size: 26px; }
  table { font-size: 15px; }
  th, td { padding: 5px 7px; }
}

/* Body-part schematic (koerper.html): shapes and labels coloured by gender */
svg.body { display: block; width: 100%; max-width: 700px; margin: 16px auto; font-size: 16px; font-weight: 700; }
svg.body .leader line { stroke: var(--mark); stroke-width: 1; opacity: .55; }
svg.body .p-m { fill: var(--m); fill-opacity: .22; stroke: var(--m); stroke-width: 2; }
svg.body .p-f { fill: var(--f); fill-opacity: .22; stroke: var(--f); stroke-width: 2; }
svg.body .p-n { fill: var(--n); fill-opacity: .22; stroke: var(--n); stroke-width: 2; }
svg.body .a-m, svg.body .a-n { stroke-width: 24; stroke-linecap: round; fill: none; opacity: .75; }
svg.body .a-m { stroke: var(--m); }
svg.body .a-n { stroke: var(--n); }
svg.body .l-m { fill: none; stroke: var(--m); stroke-width: 2.5; stroke-linecap: round; }
svg.body .l-f { fill: none; stroke: var(--f); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
svg.body .f-m line { stroke: var(--m); stroke-width: 5; stroke-linecap: round; }
svg.body .t-f circle { fill: var(--f); }
svg.body text.t-m { fill: var(--m); }
svg.body text.t-f { fill: var(--f); }
svg.body text.t-n { fill: var(--n); }
svg.body .t-mark { fill: var(--muted); font-weight: 400; font-size: 13px; }
svg.body .lbl-l text { text-anchor: end; }
