/* LakeBlog — one stylesheet, no animations. */
:root {
  color-scheme: light;
  --bg: #ececec;
  --fg: #1a1a1a;
  --muted: #6a6a6a;
  --link: #0645ad;
  --border: #d8d8d8;
  --code-bg: #f4f4f4;
}
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #222222;
  --fg: #e6e6e6;
  --muted: #9a9a9a;
  --link: #82aaff;
  --border: #3a3a3a;
  --code-bg: #1e1e1e;
}

body {
  font-family: var(--font-body);
  font-size: 1.15rem;
  line-height: 1.65;
  color: var(--fg);
  background: var(--bg);
  max-width: 42em;
  margin: 2em auto;
  padding: 0 1em;
}

@media (max-width: 40em) {
  body { font-size: 1rem; margin: 1em auto; }
  h1 { font-size: 1.5em; }
  h2 { font-size: 1.25em; }
}

a { color: var(--link); }
h1, h2, h3, h4 { line-height: 1.25; }
img { display: block; margin: 0 auto; max-width: 100%; height: auto; }
/* ![alt](src){.inline} keeps an image inside a line of text at text height */
img.inline { display: inline; margin: 0 0.15em; width: auto; height: 1.1em; vertical-align: -0.15em; }
hr { border: none; border-top: 1px solid var(--border); margin: 2em 0; }

blockquote {
  margin: 1em 0;
  padding-left: 1em;
  border-left: 3px solid var(--border);
  color: var(--muted);
}

code, pre { font-family: var(--font-mono); font-size: 0.9em; }
:not(pre) > code { background: var(--code-bg); padding: 0.1em 0.3em; }
pre {
  background: var(--code-bg);
  padding: 0.8em 1em;
  overflow-x: auto;
}
pre code { background: none; padding: 0; }

.mermaid-rendered svg { display: block; margin: 0 auto; max-width: 100%; height: auto; }
.mermaid-rendered text { font-family: var(--font-body), system-ui, sans-serif; }
.mermaid-rendered [data-shape="state-start"] > circle,
.mermaid-rendered [data-shape="state-end"] > circle {
  fill: none;
  stroke: var(--_node-stroke);
  stroke-width: 0.75px;
}
.mermaid-rendered [data-shape="state-end"] > circle + circle {
  fill: var(--_arrow);
  stroke: none;
}

table { border-collapse: collapse; margin: 1em auto; }
th, td { border: 1px solid var(--border); padding: 0.3em 0.7em; }

header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5em;
  margin-bottom: 1.5em;
}
.header-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.site-title { font-weight: bold; font-size: 1.2em; text-decoration: none; color: var(--fg); }
header nav { color: var(--muted); font-size: 0.9em; }
header .site-desc { margin: 0.2em 0 0; font-size: 0.9em; }

#theme-toggle, .copy-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--muted);
  text-decoration: underline;
  cursor: pointer;
}
#theme-toggle { margin-left: 0.5em; }

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 2.5em;
  padding-top: 0.5em;
  color: var(--muted);
  font-size: 0.85em;
}
.site-footer p { margin: 0.2em 0; }

.code-wrap { position: relative; }
.copy-btn {
  position: absolute;
  top: 0.25em;
  right: 0.5em;
  font-size: 0.8em;
  z-index: 1;
}

.post-list { list-style: none; padding: 0; }
.post-list li { margin: 0.4em 0; }
.post-list time { color: var(--muted); font-size: 0.85em; margin-right: 0.6em; }
.tag { color: var(--muted); font-size: 0.85em; text-decoration: none; margin-left: 0.4em; }
.meta, .site-desc { color: var(--muted); }

.post-list .post-item { margin: 1.2em 0; }
.post-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1em;
}
.post-head time { margin-right: 0; white-space: nowrap; }
.post-desc {
  margin: 0.15em 0 0;
  color: var(--muted);
  font-size: 0.92em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* post page: banner between header and article, description under title */
.banner { display: block; width: 100%; margin-bottom: 1.5em; }
p.description { color: var(--muted); margin: 0; }

.task-list-item { list-style: none; margin-left: -1.4em; }
.task-list-item input { margin-right: 0.4em; }

.footnotes { font-size: 0.85em; }
.footnotes-list { list-style: none; padding-left: 0; }
.math { overflow-x: auto; }

/* mermaid diagrams: code-box styling until rendered, then plain */
pre.mermaid[data-processed] { background: none; padding: 0; }

#search-input {
  font: inherit;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 0.3em 0.6em;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 1em;
}
