/* postly default theme — Yinwang-style restraint.
   One column, system fonts, automatic dark mode, zero JS. */

:root {
  --ink: #1a1a1a;
  --ink-soft: #6b6b6b;
  --paper: #fefefe;
  --accent: #0366d6;
  --rule: #e6e6e6;
  --code-bg: #f4f4f4;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #d8d4cf;
    --ink-soft: #8a8681;
    --paper: #16181d;
    --accent: #6ca4f8;
    --rule: #2a2d33;
    --code-bg: #1f2127;
  }
}

* { box-sizing: border-box; }

html { font-size: 17px; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC",
    "Helvetica Neue", Arial, sans-serif;
  line-height: 1.75;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: 38em;
  margin: 2.5rem auto 4rem;
  padding: 0 1.25rem;
}

/* header ------------------------------------------------------------ */

.site-header {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}

.site-nav {
  max-width: 38em;
  margin: 0 auto;
  padding: 1.1rem 1.25rem;
  display: flex;
  gap: 1.4rem;
  align-items: baseline;
  flex-wrap: wrap;
}

.site-title {
  font-weight: 700;
  margin-right: auto;
}

.site-nav a { color: var(--ink-soft); text-decoration: none; }
.site-nav a:hover { color: var(--accent); }
.site-title:hover { color: var(--ink); }

/* article ----------------------------------------------------------- */

.post-header { margin-bottom: 2.2rem; }

.post-date {
  color: var(--ink-soft);
  font-size: 0.85rem;
  margin: 0 0 0.2rem;
}

h1.post-title {
  font-size: 1.55rem;
  line-height: 1.35;
  margin: 0;
}

h1, h2, h3 { line-height: 1.35; }

article p { margin: 1.05em 0; }

article a { color: var(--accent); }

article img { max-width: 100%; height: auto; }

article blockquote {
  margin: 1.2em 0;
  padding: 0.1em 0 0.1em 1em;
  border-left: 3px solid var(--rule);
  color: var(--ink-soft);
}

article hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 2.2em 0;
}

article code {
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas,
    "Cascadia Mono", monospace;
  font-size: 0.85em;
  background: var(--code-bg);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

article pre {
  background: var(--code-bg);
  padding: 1em 1.2em;
  border-radius: 6px;
  overflow-x: auto;
  line-height: 1.5;
  font-size: 0.85rem;
}

article pre code { background: none; padding: 0; font-size: inherit; }

article table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.92rem;
}

article th, article td {
  border: 1px solid var(--rule);
  padding: 0.45em 0.7em;
  text-align: left;
}

mark {
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  color: inherit;
  padding: 0.1em 0.25em;
  border-radius: 3px;
}

/* tags --------------------------------------------------------------- */

span.tag, .post-tags .tag {
  display: inline-block;
  color: var(--ink-soft);
  background: var(--code-bg);
  padding: 0.1em 0.55em;
  margin-right: 0.4em;
  border-radius: 999px;
  font-size: 0.8rem;
}

.post-tags { margin-top: 2.5rem; }

/* callouts ------------------------------------------------------------ */

.callout {
  margin: 1.3em 0;
  padding: 0.8em 1.1em;
  border-left: 4px solid var(--accent);
  background: var(--code-bg);
  border-radius: 0 6px 6px 0;
}

.callout-title {
  font-weight: 700;
  margin: 0 0 0.3em;
  color: var(--ink);
}

.callout-title p { margin: 0; }

.callout-content > :first-child { margin-top: 0; }
.callout-content > :last-child { margin-bottom: 0; }

.callout-note    { border-left-color: #4a9eff; }
.callout-tip     { border-left-color: #34c38f; }
.callout-warning { border-left-color: #f0a020; }
.callout-danger  { border-left-color: #e5534b; }
.callout-important { border-left-color: #a371f7; }

/* task lists ---------------------------------------------------------- */

li input[type="checkbox"] { margin-right: 0.5em; }

/* post list ------------------------------------------------------------ */

.post-list-items { list-style: none; padding: 0; }

.post-list-items li {
  padding: 0.55em 0;
  border-bottom: 1px solid var(--rule);
  display: flex;
  gap: 1em;
  align-items: baseline;
}

.post-date {
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* footer ---------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--rule);
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.site-footer p {
  max-width: 38em;
  margin: 0 auto;
  padding: 1.2rem 1.25rem;
}

.site-footer a { color: var(--ink-soft); }
