/* obs wiki — minimal dark reading theme */

:root {
  --bg: #1a1b1e;
  --bg-elevated: #25262b;
  --bg-code: #2c2d31;
  --fg: #e6e6e6;
  --fg-muted: #9aa0a6;
  --fg-faint: #6c7178;
  --accent: #7aa2f7;
  --accent-dim: #4d6ba6;
  --link-broken: #c93e3e;
  --border: #2f3036;
  --table-stripe: #202124;
  --max-width: 760px;
}

* { box-sizing: border-box; }

html { font-size: 16px; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.layout {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

header.topbar {
  font-size: 0.9rem;
  color: var(--fg-muted);
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

header.topbar a { color: var(--fg-muted); }
header.topbar a:hover { color: var(--accent); }

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  margin: 2rem 0 0.75rem;
  color: var(--fg);
}

h1 { font-size: 1.9rem; margin-top: 0; }
h2 { font-size: 1.4rem; padding-top: 0.5rem; border-top: 1px solid var(--border); }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; color: var(--fg-muted); }

p, ul, ol, blockquote, table, pre { margin: 0.75rem 0; }

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease;
}
a:hover { border-bottom-color: var(--accent); }

a.wikilink { color: var(--accent); }
a.wikilink:hover { border-bottom-color: var(--accent); }

span.broken-link {
  color: var(--link-broken);
  border-bottom: 1px dashed var(--link-broken);
  cursor: help;
}

code {
  font-family: "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.9em;
  background: var(--bg-code);
  padding: 0.1em 0.35em;
  border-radius: 3px;
  color: #d4cfc0;
}

pre {
  background: var(--bg-code);
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.55;
}
pre code { background: transparent; padding: 0; font-size: inherit; }

blockquote {
  border-left: 3px solid var(--accent-dim);
  padding: 0.25rem 1rem;
  color: var(--fg-muted);
  background: var(--bg-elevated);
  border-radius: 0 4px 4px 0;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.92rem;
}
th, td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  text-align: left;
  vertical-align: top;
}
th { background: var(--bg-elevated); font-weight: 600; }
tbody tr:nth-child(even) { background: var(--table-stripe); }

ul, ol { padding-left: 1.5rem; }
li { margin: 0.25rem 0; }

hr { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }

/* Frontmatter card */
.frontmatter {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin: 1rem 0 1.5rem;
  font-size: 0.85rem;
  color: var(--fg-muted);
}
.frontmatter dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 0.25rem 1rem; }
.frontmatter dt { color: var(--fg-faint); font-weight: 500; }
.frontmatter dd { margin: 0; color: var(--fg-muted); word-break: break-word; }

/* Backlinks footer */
footer.backlinks {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--fg-muted);
}
footer.backlinks h2 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  color: var(--fg-muted);
  border-top: none;
  padding-top: 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
footer.backlinks ul { list-style: none; padding: 0; }
footer.backlinks li { margin: 0.25rem 0; }
footer.backlinks .none { color: var(--fg-faint); font-style: italic; }

/* Section anchor on hover */
h1, h2, h3, h4, h5, h6 { position: relative; }
h1:hover .anchor, h2:hover .anchor, h3:hover .anchor,
h4:hover .anchor, h5:hover .anchor, h6:hover .anchor { opacity: 0.6; }
.anchor {
  opacity: 0;
  position: absolute;
  left: -1.25em;
  text-decoration: none;
  color: var(--fg-faint);
  font-weight: 400;
  transition: opacity 0.15s ease;
}
.anchor:hover { opacity: 1 !important; }

/* index list density */
.layout > article > ul li { margin: 0.15rem 0; }
