/* Blog index and post pages; builds on site.css */

/* index */
.blog-head { padding: 64px 0 8px; max-width: 760px; }
.blog-head h1 { font-weight: 300; font-size: clamp(40px, 5.6vw, 68px); letter-spacing: -.04em; line-height: 1.02; margin: 12px 0 18px; }
.blog-head h1 b { font-weight: 600; }
.blog-head p { color: var(--dim); font-size: 16.5px; margin: 0 0 22px; }
.blog-head p a { color: var(--fg); border-bottom: 1px solid var(--c2); }
.stats { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; font-size: 14px; color: var(--dim); }
.stats b { color: var(--fg); font-weight: 600; font-size: 16px; }
.stats .seg { margin-left: auto; }

body[data-lang="en"] [data-l="cn"], body[data-lang="cn"] [data-l="en"] { display: none; }
body:not([data-lang]) [data-l="cn"] { display: none; }

.cat { padding-top: 54px; }
.cat h2 { font-size: 22px; font-weight: 600; letter-spacing: -.01em; margin: 0 0 16px; display: flex; align-items: baseline; gap: 10px; }
.cat h2 small { font: 500 12.5px var(--mono); color: var(--faint); }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.tile { padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; border-radius: 20px; }
.tile h3 { margin: 0; font-size: 17px; font-weight: 600; line-height: 1.35; }
.tile p { margin: 0; font-size: 13.5px; color: var(--dim); line-height: 1.55; }
.tile .meta { margin-top: auto; padding-top: 8px; font: 500 11.5px var(--mono); color: var(--faint); }
.tile:hover h3 { text-decoration: underline; text-decoration-color: var(--c2); text-underline-offset: 3px; }
.notes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.nlist { padding: 14px 20px; border-radius: 20px; }
.nlist h3 { margin: 4px 0 6px; font-size: 13px; font-weight: 600; color: var(--c2); }
.nlist a { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.nlist a:first-of-type { border-top: 0; }
.nlist a small { font: 500 11.5px var(--mono); color: var(--faint); white-space: nowrap; }
.nlist a:hover span { text-decoration: underline; text-decoration-color: var(--c2); }

/* post */
.post { max-width: 820px; padding-top: 48px; }
.crumbs { font-size: 13.5px; color: var(--dim); display: flex; flex-wrap: wrap; gap: 4px; }
.crumbs a { color: var(--fg); }
.crumbs i { font-style: normal; color: var(--faint); margin: 0 4px; }
.post-head h1 { font-weight: 600; font-size: clamp(32px, 4.4vw, 48px); letter-spacing: -.03em; line-height: 1.12; margin: 14px 0 14px; }
.post .only { margin: -8px 0 16px; font-size: 14px; color: var(--dim); }
.post-head .meta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; font: 500 12.5px var(--mono); color: var(--dim); margin-bottom: 22px; }

.md { padding: 34px 40px; font-size: 16.5px; line-height: 1.8; overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md h1, .md h2, .md h3, .md h4, .md h5 { line-height: 1.3; letter-spacing: -.01em; margin: 1.8em 0 .6em; font-weight: 600; }
.md h1 { font-size: 28px; } .md h2 { font-size: 24px; } .md h3 { font-size: 20px; } .md h4, .md h5 { font-size: 17px; }
.md p { margin: 0 0 1em; }
.md a { color: var(--c2); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--c2) 40%, transparent); text-underline-offset: 3px; }
.md strong { font-weight: 600; }
.md ul, .md ol { padding-left: 1.4em; margin: 0 0 1em; }
.md li { margin: .25em 0; }
.md blockquote { margin: 1.2em 0; padding: .6em 1.1em; border-left: 3px solid var(--c2); background: var(--glass-2); border-radius: 0 12px 12px 0; color: var(--dim); }
.md img { display: block; max-width: 100%; height: auto; margin: 1.2em auto; border-radius: 12px; background: #fff; padding: 6px; }
.md table { border-collapse: collapse; margin: 1.2em 0; font-size: 14.5px; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--line); padding: 7px 12px; text-align: left; }
.md th { background: var(--glass-2); font-weight: 600; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.md code { font: 13.5px/1.6 var(--mono); background: var(--glass-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 5px; }
.md pre { margin: 1.2em 0; padding: 16px 18px; border-radius: 14px; background: #0d1018; border: 1px solid var(--line); overflow-x: auto; }
.md pre code { background: none; border: 0; padding: 0; color: #e6e9ef; font-size: 13.5px; }
.md .katex-display { overflow-x: auto; overflow-y: hidden; padding: 4px 0; }
.md .katex { font-size: 1.06em; }

/* code colors, close to Aurora's dark board */
.hljs-keyword, .hljs-selector-tag, .hljs-built_in { color: #a78bfa; }
.hljs-string, .hljs-attr { color: #4ade80; }
.hljs-number, .hljs-literal { color: #fbbf24; }
.hljs-comment, .hljs-quote { color: #7d8594; font-style: italic; }
.hljs-title, .hljs-section, .hljs-function .hljs-title { color: #5ee7ff; }
.hljs-params, .hljs-variable { color: #e6e9ef; }
.hljs-meta, .hljs-type { color: #fb7185; }

.prevnext { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 22px; }
.pn { padding: 14px 18px; border-radius: 18px; display: flex; flex-direction: column; gap: 2px; }
.pn:last-child { text-align: right; }
.pn small { font: 500 11.5px var(--mono); color: var(--faint); text-transform: uppercase; letter-spacing: .1em; }
.pn span { font-weight: 600; }
.pn:hover span { text-decoration: underline; text-decoration-color: var(--c2); }

@media (max-width: 1100px) { .tiles { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) {
  .blog-head, .post { padding-top: 72px; }
  .tiles, .notes { grid-template-columns: 1fr; }
  .stats .seg { margin-left: 0; }
  .md { padding: 22px 18px; font-size: 16px; }
  .prevnext { grid-template-columns: 1fr; }
  .pn:last-child { text-align: left; }
}
