/* Väkikivien juurilla: one small stylesheet, light and dark. */
:root {
  /* Granite greys with rock-painting ochre. --accent (ochre) is for the title, rules,
     pictograms and markers; --link (rust) is the darker red for links and small text. */
  --bg: #e9e7e3; --surface: #f6f5f2; --text: #24262a; --muted: #585c63; --line: #c3c0ba;
  --accent: #a3411f; --accent-soft: #f0d9cd; --link: #7d2f15;
  --display: "Young Serif", Georgia, "Times New Roman", serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1b1d; --surface: #232528; --text: #ebe8e2; --muted: #a5a39d; --line: #3b3d41;
    --accent: #cf6d47; --accent-soft: #3b2620; --link: #e59c7a;
  }
}
/* Young Serif (SIL Open Font License, see fonts/OFL.txt): site title and headings only. */
@font-face { font-family: "Young Serif"; font-weight: 400; font-style: normal; font-display: swap;
  src: url(fonts/young-serif-latin-400-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: "Young Serif"; font-weight: 400; font-style: normal; font-display: swap;
  src: url(fonts/young-serif-latin-ext-400-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; }
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--link); }
.wrap { max-width: 64rem; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 1.25rem; padding-bottom: 2.5rem; }
h1 { font-family: var(--display); font-weight: 400; font-size: 1.9rem; line-height: 1.2; margin: 0.25rem 0 1rem; text-wrap: balance; }
h2 { font-family: var(--display); font-weight: 400; font-size: 1.3rem; line-height: 1.25; margin: 2rem 0 0.75rem; border-bottom: 2px solid var(--accent); padding-bottom: 0.3rem; }
h3 { font-size: 1.05rem; margin: 0 0 0.5rem; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.note { color: var(--muted); font-style: italic; }

.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1.5rem; padding-top: 0.75rem; padding-bottom: 0.75rem; }
.brand { text-decoration: none; color: var(--text); display: flex; align-items: center; gap: 0.6rem; }
.brand-mark { flex: none; width: 1.65rem; height: 2.75rem; color: var(--accent); }
.brand-text { display: flex; flex-direction: column; }
.brand-title { font-family: var(--display); font-size: 1.45rem; font-weight: 400; line-height: 1.2; color: var(--accent); }
.brand-sub { font-size: 0.85rem; color: var(--muted); }
nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; font-size: 0.95rem; }
nav a { text-decoration: none; color: var(--text); padding: 0.2rem 0; border-bottom: 2px solid transparent; display: inline-flex; align-items: center; gap: 0.3rem; }
.ico { width: 1.15em; height: 1.15em; flex: none; color: var(--accent); }
nav a[aria-current="page"] { border-color: var(--accent); }
nav a.lang { color: var(--muted); }

.site-footer { border-top: 1px solid var(--line); background: var(--surface); font-size: 0.85rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; padding-top: 1rem; padding-bottom: 1rem; }

.lead { font-size: 1.1rem; max-width: 46rem; }
.counts { color: var(--muted); }
.map-large { height: 62vh; min-height: 320px; border: 1px solid var(--line); border-radius: 8px; margin: 1rem 0 0.5rem; }
.map-small { height: 260px; border: 1px solid var(--line); border-radius: 8px; }
.stone-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
@media (max-width: 720px) { .stone-top { grid-template-columns: minmax(0, 1fr); } }
.crumbs { margin: 0; font-size: 0.9rem; }

table { border-collapse: collapse; width: 100%; }
.facts th { text-align: left; vertical-align: top; color: var(--muted); font-weight: 600; padding: 0.35rem 1rem 0.35rem 0; white-space: nowrap; width: 1%; }
.facts td { padding: 0.35rem 0; vertical-align: top; overflow-wrap: anywhere; }
.list { font-size: 0.95rem; }
.list th { text-align: left; font-weight: 600; color: var(--muted); border-bottom: 2px solid var(--line); padding: 0.4rem 0.6rem 0.4rem 0; }
.list td { border-bottom: 1px solid var(--line); padding: 0.45rem 0.6rem 0.45rem 0; vertical-align: top; overflow-wrap: anywhere; }
.list .num { text-align: right; }
.list td:first-child { overflow-wrap: normal; }
.sortable th { cursor: pointer; user-select: none; }
.sortable th[aria-sort="ascending"]::after { content: " ▲"; font-size: 0.7em; }
.sortable th[aria-sort="descending"]::after { content: " ▼"; font-size: 0.7em; }
@media (max-width: 600px) { .list { display: block; overflow-x: auto; } }
.filter { width: 100%; max-width: 24rem; font: inherit; padding: 0.45rem 0.6rem; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--text); margin-bottom: 0.75rem; }

.badge { display: inline-flex; align-items: center; gap: 0.25rem; vertical-align: middle; font-size: 0.75rem; font-weight: 600; padding: 0.05rem 0.5rem; border-radius: 999px; background: var(--accent-soft); color: var(--link); white-space: nowrap; }
.badge .ico { color: inherit; }
.badge-probable, .badge-possible { background: transparent; border: 1px dashed var(--muted); color: var(--muted); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 0.9rem 1rem; margin: 0 0 0.75rem; }
.card p { margin: 0.35rem 0; }
.excerpt { border-left: 3px solid var(--accent); padding: 0.1rem 0 0.1rem 0.9rem; margin: 0 0 1.25rem; }
.excerpt header { display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; font-size: 0.9rem; }
.excerpt blockquote { margin: 0.5rem 0; white-space: pre-line; }
.excerpt details { margin: 0.25rem 0 0.5rem; font-size: 0.95rem; }
.excerpt summary { cursor: pointer; color: var(--muted); }
.src-page { text-decoration: none; }
.plain { padding-left: 1.1rem; }
.plain li { margin-bottom: 0.5rem; }
.suggest { margin-top: 2rem; }
.report-new { margin-top: 1.5rem; }
.prose { max-width: 44rem; }
/* long texts with tables (the source analysis): wide tables scroll sideways inside the page */
.prose-wide { max-width: 72rem; }
.prose li, .prose p { overflow-wrap: anywhere; }
.prose-wide > :not(table) { max-width: 44rem; }
.prose table { display: block; overflow-x: auto; font-size: 0.92rem; margin: 1rem 0 1.5rem; }
.prose th { text-align: left; font-weight: 600; color: var(--muted); border-bottom: 2px solid var(--line); padding: 0.4rem 0.8rem 0.4rem 0; }
.prose td { border-bottom: 1px solid var(--line); padding: 0.45rem 0.8rem 0.45rem 0; vertical-align: top; min-width: 7rem; }

/* map markers and popups */
.stone-dot { width: 16px; height: 16px; border-radius: 50%; background: #a3411f; border: 2.5px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.5); }
.stone-dot.private { background: rgba(255,255,255,.35); border: 2px dashed #a3411f; width: 24px; height: 24px; box-shadow: none; }
.stone-dot.uncertain { background: rgba(255,255,255,.35); border: 2px solid rgba(163,65,31,.45); width: 24px; height: 24px; box-shadow: none; }
.map-legend { list-style: none; margin: 0.6rem 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; font-size: 0.9rem; }
.map-legend li { display: flex; align-items: center; gap: 0.5rem; }
.map-legend .stone-dot { flex: none; }
.map-legend .stone-dot:not(.private):not(.uncertain) { margin: 0 4px; }
/* Tone the background map down a little so the ochre markers stand out. */
.leaflet-tile-pane { filter: grayscale(0.55); }
.leaflet-popup-content { font: 14px/1.4 system-ui, sans-serif; }
.leaflet-popup-content h3 { margin: 0 0 0.25rem; font-size: 1rem; }
.leaflet-popup-content p { margin: 0.2rem 0; }
.nowrap { white-space: nowrap; }
