/* Colours live here. Graph colours per section are in config.js (all greens). */
:root {
  --bg: #ffffff;
  --text: #222222;
  --muted: #6b6b6b;
  --line: #e7e7e7;
  --soft: #f4f7f5;
  --accent: #2b8a5a;
  --link-line: #d5e4da;
  --notice: #fff6dc;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Merriweather", "Iowan Old Style", Georgia, serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.6 var(--font); }
a { color: var(--accent); text-underline-offset: 2px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: var(--bg); padding: 6px 10px; z-index: 10; }
.muted { color: var(--muted); }

/* menu | page | graph, like Obsidian Publish */
.layout { display: grid; grid-template-columns: 290px minmax(0, 1fr) 340px; min-height: 100vh; }
.sidebar { border-right: 1px solid var(--line); padding: 56px 28px 40px 40px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
main { padding: 56px 56px 80px; min-width: 0; outline: none; }
.right { padding: 56px 32px 40px 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; }

.brand { display: block; font-family: var(--serif); font-size: 1.15rem; line-height: 1.2; color: var(--text); text-decoration: none; margin-bottom: 28px; }
.search-wrap { position: relative; margin-bottom: 28px; }
.search { width: 100%; padding: 7px 12px; font: inherit; font-size: .9rem; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
.search:focus { outline: none; border-color: var(--accent); }
.search-results { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 5; list-style: none; margin: 0; padding: 6px 0; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .08); font-size: .9rem; }
.search-results li { padding: 4px 12px; line-height: 1.35; }
.nav { display: flex; flex-direction: column; }
.nav a { color: var(--text); text-decoration: none; font-family: var(--serif); font-size: .98rem; padding: 3px 16px; }
.nav a:hover { color: var(--accent); }
.nav a[aria-current="page"] { color: var(--accent); }
.nav-hubs { margin-top: 18px; }
.nav-hubs a { font-size: .9rem; color: var(--muted); }

.page { max-width: 760px; }
.page-wide { max-width: none; }
h1, h2, h3, h4 { font-family: var(--serif); line-height: 1.25; margin: 0; font-weight: 600; }
h1 { font-size: clamp(1.7rem, 3vw, 2.2rem); margin-bottom: 16px; }
.page > h2 { font-size: 1.25rem; margin: 36px 0 8px; }
.lead { color: var(--muted); font-size: 1rem; margin: -8px 0 12px; }
.crumb { margin: 0 0 6px; font-size: .9rem; }
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--accent); }
.add { margin: 0 0 24px; font-size: .95rem; }

.prose h2 { font-size: 1.4rem; margin: 32px 0 0; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.prose h3 { font-size: 1.2rem; margin: 30px 0 0; }
.prose h4 { font-size: 1.02rem; margin: 24px 0 0; }
.prose h2, .prose h3, .prose h4 { scroll-margin-top: 24px; }
.prose ul { padding-left: 1.4em; }
.prose li { margin: 6px 0; }
.prose li::marker, .index li::marker { color: #9a9a9a; }
.prose a { overflow-wrap: anywhere; }

.index { padding-left: 1.4em; margin: 8px 0; }
.index li { margin: 6px 0; }

.notice { background: var(--notice); padding: 10px 14px; border-radius: 8px; font-size: .9rem; }

/* list pages and the full map use the right-hand column too */
.layout.is-wide main { grid-column: 2 / 4; }
.layout.is-wide .right { display: none; }

/* graph */
.graph-card { position: relative; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.graph-expand { position: absolute; top: 6px; right: 6px; z-index: 1; }
.icon-btn { display: inline-flex; background: var(--bg); border: 0; cursor: pointer; color: var(--muted); padding: 6px; border-radius: 6px; line-height: 0; }
.icon-btn:hover { background: var(--soft); color: var(--text); }
.graph-box { height: 320px; touch-action: none; }
.map .graph-box { height: calc(100vh - 260px); min-height: 420px; }
.graph-box svg { width: 100%; height: 100%; display: block; cursor: grab; user-select: none; }
.graph-box svg:active { cursor: grabbing; }
.graph-empty { color: var(--muted); font-size: .9rem; text-align: center; padding-top: 130px; margin: 0; }
.g-links line { stroke: var(--link-line); stroke-width: 1.2; transition: stroke .15s, opacity .15s; }
.g-node { cursor: pointer; transition: opacity .15s; }
.g-node circle { stroke: #fff; stroke-width: 1.5; }
.g-node text { font: 11px var(--font); fill: #5b5b5b; pointer-events: none; paint-order: stroke; stroke: #fff; stroke-width: 3px; }
.g-node.is-center text, .g-node.k-home text { fill: var(--text); font-weight: 600; font-size: 12px; }
.g-node.is-center:not(.k-home) circle { stroke: #1f5c40; stroke-width: 2; }
.g-node.is-faded { opacity: .55; }
/* the home node, after the ring logo */
.g-node .home-halo { fill: #e8f9e9; stroke: none; }
.g-node .home-ring { fill: #84cb71; stroke: #2bb274; stroke-width: 1.6; }
.g-node .home-core { fill: #e8f9e9; stroke: #35b574; stroke-width: 1.6; }
.g-node.label-hidden text { opacity: 0; }
svg.small .g-node:not(.is-center):not(.k-home):not(.k-country) text { opacity: 0; }
svg.zoomed .g-node.label-hidden text { opacity: 1; }
svg.has-hover .g-node { opacity: .25; }
svg.has-hover .g-links line { opacity: .2; }
svg.has-hover .g-node.is-lit { opacity: 1; }
svg.has-hover .g-node.is-lit text { opacity: 1; fill: var(--text); }
svg.has-hover .g-links line.is-lit { opacity: 1; stroke: #8fbf9f; }

.toc { margin-top: 32px; }
.toc-title { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 600; margin: 0 0 10px; }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc button { font: inherit; font-family: var(--serif); font-size: .88rem; color: var(--muted); background: none; border: 0; cursor: pointer; text-align: left; padding: 5px 14px; line-height: 1.35; }
.toc button:hover { color: var(--accent); }
.toc-h3 button { padding-left: 24px; }
.toc-h4 button { padding-left: 36px; }

@media (max-width: 1200px) {
  .layout { grid-template-columns: 240px minmax(0, 1fr); }
  .layout.is-wide main { grid-column: 2; }
  .right { grid-column: 2; position: static; height: auto; padding: 0 56px 48px; }
  .toc { display: none; }
}
@media (max-width: 760px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 16px; }
  .brand { margin-bottom: 12px; font-size: 1.15rem; }
  .search-wrap { margin-bottom: 8px; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav a { padding: 2px 12px 2px 0; }
  .nav-hubs { margin-top: 2px; }
  main { padding: 28px 16px 40px; }
  .layout.is-wide main { grid-column: 1; }
  .right { grid-column: 1; padding: 0 16px 32px; }
  .props { grid-template-columns: minmax(0, 1fr); gap: 2px; padding: 18px; }
  .props dd { margin-bottom: 12px; }
  table.data th, table.data td { padding-left: 10px; padding-right: 10px; }
}

/* list pages, after the old Obsidian Publish tables */
.callout { background: #fafafa; border: 1px solid #e3e3e3; border-radius: 4px; padding: 14px 18px; font-family: var(--serif); font-size: .9rem; margin: 8px 0 10px; }
.ext { font-size: .7em; vertical-align: super; margin-left: 1px; }
.table-search { width: 100%; padding: 10px 14px; font: inherit; font-size: .92rem; color: var(--text); border: 1px solid #e3e3e3; border-radius: 4px; background: var(--bg); margin-bottom: 24px; }
.table-search:focus { outline: none; border-color: var(--accent); }
.group-bar { display: flex; align-items: center; gap: 16px; margin: 0 0 8px; }
.group-label { font-size: .85rem; font-weight: 600; color: var(--muted); }
.segmented { display: inline-flex; background: #f1f1f1; border-radius: 999px; padding: 4px; gap: 2px; flex-wrap: wrap; }
.segmented button { font: inherit; font-size: .85rem; border: 0; background: none; color: #555; padding: 6px 16px; border-radius: 999px; cursor: pointer; }
.segmented button[aria-pressed="true"] { background: #fff; color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.group-title { font-family: var(--serif); font-weight: 400; font-size: 1.3rem; margin: 40px 0 0; padding-bottom: 14px; border-bottom: 1px solid #e3e3e3; }
.table-wrap { overflow-x: auto; margin-top: 16px; }
table.data { width: 100%; table-layout: fixed; border-collapse: collapse; font-family: var(--serif); font-size: .88rem; }
table.data th { text-align: left; font-weight: 400; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: #8a8a8a; padding: 16px 16px 12px; border-bottom: 1px solid #e3e3e3; }
table.data td { padding: 12px 16px; border-bottom: 1px solid #eeeeee; vertical-align: top; overflow-wrap: anywhere; }
table.data tbody tr { cursor: pointer; }
table.data tbody tr:hover { background: #fafafa; }
.row-link { color: var(--text); text-decoration: none; }
.row-link:hover { color: var(--accent); }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { display: inline-block; font-size: .9em; line-height: 1.5; padding: 1px 11px; border: 1px solid #dddddd; background: #f6f6f6; border-radius: 999px; color: var(--text); text-decoration: none; white-space: nowrap; }
a.pill:hover { border-color: var(--accent); color: var(--accent); }
.plain-list { list-style: none; padding: 0; margin: 12px 0 0; font-family: var(--serif); font-size: .9rem; }
.plain-list li { padding: 11px 16px; border-bottom: 1px solid #eeeeee; }
.plain-list li:last-child { border-bottom: 0; }

/* item pages: property box, description under it */
.props { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 18px 32px; background: #fafafa; border: 1px solid #e3e3e3; border-radius: 4px; padding: 20px 24px; margin: 8px 0 24px; font-family: var(--serif); font-size: .9rem; }
.props dt { text-transform: uppercase; letter-spacing: .06em; font-size: .78rem; color: #6b6b6b; padding-top: 2px; }
.props dd { margin: 0; overflow-wrap: anywhere; }
.props a { text-decoration: none; }
.props a:hover { text-decoration: underline; }
.description p { margin: 0 0 1em; }
.modified { color: var(--muted); font-size: .8rem; margin: 28px 0 0; }
.g-links line.is-faded { stroke-dasharray: 3 3; }
