/* letobao.com — one stylesheet for every page, no build step.
   The Content-Security-Policy forbids style attributes, so every look a post
   needs is a class here (scripts/import_wordpress.py maps WordPress's inline
   styles onto them). */

:root {
  --bg: #fbfaf7;
  --fg: #1d1c1a;
  --muted: #6b6862;
  --line: #e4e1da;
  --accent: #2f5d50;
  --code-bg: #f1efe9;
  --green: #00a36a;
  --red: #c62828;
  --measure: 42rem;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial,
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161615;
    --fg: #e9e6df;
    --muted: #a19d94;
    --line: #34322e;
    --accent: #8cc7b4;
    --code-bg: #24231f;
    --green: #3ddc97;
    --red: #ff6b6b;
  }
}

:lang(zh-TW) { --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC", "Microsoft JhengHei", "Noto Sans CJK TC", sans-serif; }
:lang(ja) { --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans CJK JP", sans-serif; }
:lang(ko) { --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans CJK KR", sans-serif; }

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 1.0625rem/1.75 var(--sans);
}

a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

.bar, main, .foot {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* The bar: the site's name, and the languages. */
.bar {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}
.bar .name { color: var(--fg); font-weight: 650; text-decoration: none; letter-spacing: 0.01em; }
.langs { display: flex; flex-wrap: wrap; gap: 0.25rem 0.9rem; font-size: 0.9rem; }
.langs a { color: var(--muted); text-decoration: none; }
.langs a:hover { color: var(--fg); }
.langs a[aria-current] { color: var(--fg); font-weight: 600; }

/* Home pages. */
.intro { padding: 2.5rem 0 1.5rem; border-bottom: 1px solid var(--line); }
.intro h1 { margin: 0; font-size: 2.25rem; line-height: 1.2; letter-spacing: -0.01em; }
.tagline { margin: 0.5rem 0 0; color: var(--muted); }
.entries { list-style: none; margin: 0; padding: 0; }
.entry { padding: 2rem 0; border-bottom: 1px solid var(--line); }
.entry h2 { margin: 0 0 0.5rem; font-size: 1.4rem; line-height: 1.35; }
.entry h2 a { color: var(--fg); text-decoration: none; }
.entry h2 a:hover { color: var(--accent); }
.excerpt { margin: 0 0 0.5rem; }
.meta { margin: 0; color: var(--muted); font-size: 0.9rem; }
.empty { color: var(--muted); padding: 2rem 0; }

/* A post. */
.post-head { padding: 2.5rem 0 1rem; }
.post-head h1 { margin: 0 0 0.75rem; font-size: 2rem; line-height: 1.3; letter-spacing: -0.01em; }
.also { margin: 0.25rem 0 0; color: var(--muted); font-size: 0.9rem; }

.content { overflow-wrap: break-word; }
.content h1, .content h2, .content h3, .content h4 { line-height: 1.35; margin: 2.25rem 0 0.75rem; }
.content h1 { font-size: 1.6rem; }
.content h2 { font-size: 1.4rem; }
.content h3 { font-size: 1.2rem; }
.content p, .content ul, .content ol, .content blockquote, .content figure, .content table { margin: 0 0 1.25rem; }
.content ul, .content ol { padding-left: 1.4rem; }
.content li { margin: 0.25rem 0; }
.content blockquote {
  margin-left: 0;
  padding: 0.25rem 0 0.25rem 1rem;
  border-left: 3px solid var(--line);
  color: var(--muted);
}
.content code { font: 0.9em var(--mono); background: var(--code-bg); padding: 0.1em 0.3em; border-radius: 4px; }
.content pre { overflow-x: auto; background: var(--code-bg); padding: 1rem; border-radius: 6px; }
.content pre code { background: none; padding: 0; }
.content hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }

.content img { max-width: 100%; height: auto; border-radius: 4px; }
.content figure { margin-left: 0; margin-right: 0; }
.content figcaption, .content .wp-element-caption { color: var(--muted); font-size: 0.85rem; text-align: center; margin-top: 0.4rem; }
.content .aligncenter { margin-left: auto; margin-right: auto; text-align: center; }
.content .img-tall img, .content img.img-tall { width: auto; max-height: 500px; }

/* Gutenberg galleries: a grid of cropped images. */
.content .wp-block-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 0.5rem; }
.content .wp-block-gallery figure { margin: 0; }
.content .wp-block-gallery img { width: 100%; height: 100%; aspect-ratio: 3 / 4; object-fit: cover; display: block; }
.content .wp-block-gallery > figcaption { grid-column: 1 / -1; }

.content .wp-block-table { overflow-x: auto; }
.content table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
.content th, .content td { border: 1px solid var(--line); padding: 0.45rem 0.6rem; text-align: left; vertical-align: top; }
.content thead th, .content tr:first-child td strong { font-weight: 650; }

.content .math { overflow-x: auto; margin: 0 0 1.25rem; }
.content .math math { font-size: 1.15em; }

.content iframe.embed { display: block; width: 100%; max-width: 660px; border: 0; overflow: hidden; background: transparent; margin: 0 0 1.25rem; }

.text-center { text-align: center; }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
mark.has-inline-color { background: transparent; }

.pager { display: flex; flex-direction: column; gap: 0.5rem; padding: 2rem 0; margin-top: 1rem; border-top: 1px solid var(--line); font-size: 0.95rem; }
.pager .older { text-align: right; }

.foot { padding-top: 2.5rem; padding-bottom: 2.5rem; color: var(--muted); font-size: 0.85rem; }
.foot a { color: var(--muted); }

@media (max-width: 30rem) {
  body { font-size: 1rem; }
  .intro h1 { font-size: 1.8rem; }
  .post-head h1 { font-size: 1.6rem; }
}
