/* Plaintext style: a single monospace column, lots of whitespace, no framework. */
:root {
  --fg: #1a1a1a;
  --muted: #6a6a6a;
  --bg: #fbfbf9;
  --accent: #0b5cad;
  --rule: #e2e2dd;
  --measure: 46rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fg: #d8d8d2;
    --muted: #8f8f88;
    --bg: #16171a;
    --accent: #6fb3ff;
    --rule: #2c2d31;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
  max-width: var(--measure);
  font-family: ui-monospace, "SF Mono", "JetBrains Mono", "Fira Mono", Menlo, Consolas, monospace;
  font-size: 16px;
  line-height: 1.6;
  color: var(--fg);
  background: var(--bg);
  /* Break long words / URLs instead of forcing horizontal scroll. */
  overflow-wrap: break-word;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header: logo on the left, navigation on the right */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-bottom: 1.25rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--rule);
}
.logo { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--fg); }
.logo:hover { text-decoration: none; }
.logo img {
  height: 40px; width: 40px; display: block;
  border-radius: 8px; background: #fff;
}
.logo-text { font-weight: 600; font-size: 1.05rem; }
.site-nav { display: flex; gap: 1rem; flex-wrap: wrap; font-size: 0.9rem; }
.site-nav .lang { color: var(--muted); }

/* Post list */
.intro { margin-bottom: 2rem; color: var(--muted); }
.post-list { list-style: none; margin: 0; padding: 0; }
.post-list li { display: flex; gap: 1rem; padding: 0.35rem 0; }
.post-list time { color: var(--muted); flex: 0 0 6.5rem; }
.post-list .empty { color: var(--muted); }

/* Single post / page */
.post h1, .page h1 { line-height: 1.2; margin-bottom: 0.25rem; }
.meta { color: var(--muted); margin-top: 0; font-size: 0.9rem; }
.post img, .page img { max-width: 100%; height: auto; }
.back { margin-top: 3rem; }

pre {
  overflow-x: auto;
  padding: 0.9rem 1rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
  line-height: 1.45;
  font-size: 0.9rem;
}
code { font-size: 0.9em; }
p code { background: var(--rule); padding: 0.1em 0.35em; border-radius: 3px; }
blockquote {
  margin: 1rem 0; padding-left: 1rem;
  border-left: 3px solid var(--rule); color: var(--muted);
}

/* Keep wide content within the viewport (no page-level horizontal scroll on mobile). */
table { display: block; max-width: 100%; overflow-x: auto; }   /* wide tables scroll inside themselves */
math { max-width: 100%; }
math[display="block"] { overflow-x: auto; overflow-y: hidden; } /* long block formulas scroll internally */
.post-list a { min-width: 0; }                                  /* let long post titles wrap in the list */

/* Definition lists */
dl { margin: 1rem 0; }
dt { font-weight: 600; }
dd { margin: 0 0 0.6rem 1.2rem; color: var(--muted); }

/* GitHub-style alert callouts (> [!NOTE] etc.). Zola emits only a
   `markdown-alert-<type>` class with no title, so the label is added via
   ::before — German by default, English on `html[lang="en"]`. */
[class*="markdown-alert-"] {
  margin: 1rem 0;
  padding: 0.5rem 1rem;
  border-left: 4px solid var(--muted);
  border-radius: 0 4px 4px 0;
}
[class*="markdown-alert-"] > :first-child { margin-top: 0; }
[class*="markdown-alert-"] > :last-child { margin-bottom: 0; }
[class*="markdown-alert-"]::before { display: block; font-weight: 600; margin-bottom: 0.25rem; }

.markdown-alert-note      { border-left-color: #2f81f7; }
.markdown-alert-tip       { border-left-color: #3fb950; }
.markdown-alert-warning   { border-left-color: #d29922; }
.markdown-alert-important { border-left-color: #a371f7; }
.markdown-alert-caution   { border-left-color: #f85149; }

.markdown-alert-note::before      { content: "Hinweis";  color: #2f81f7; }
.markdown-alert-tip::before       { content: "Tipp";     color: #3fb950; }
.markdown-alert-warning::before   { content: "Warnung";  color: #d29922; }
.markdown-alert-important::before { content: "Wichtig";  color: #a371f7; }
.markdown-alert-caution::before   { content: "Vorsicht"; color: #f85149; }

html[lang="en"] .markdown-alert-note::before      { content: "Note"; }
html[lang="en"] .markdown-alert-tip::before       { content: "Tip"; }
html[lang="en"] .markdown-alert-warning::before   { content: "Warning"; }
html[lang="en"] .markdown-alert-important::before { content: "Important"; }
html[lang="en"] .markdown-alert-caution::before   { content: "Caution"; }

/* Footnotes: keep the number and its text on one line. */
.footnote-definition { font-size: 0.9rem; color: var(--muted); margin: 0.4rem 0; }
.footnote-definition-label { vertical-align: baseline; font-size: inherit; margin-right: 0.4rem; }
.footnote-definition p { display: inline; margin: 0; }

.site-footer {
  margin-top: 4rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.85rem;
}
