/* blog-page.css — the server-rendered blog (backend app5/blog/pages.py): list, post, tag, projects, about.
   No inline styles anywhere (CSP style-src 'self'). DARK ONLY (2026-10-30): a black page like
   vero's home hero, no light theme and no toggle. Code tokens are Pygments classes with the hl- prefix (mdrender.py). */
:root, [data-theme="dark"] {
  --bg: #000; --panel: #121821; --text: #e6edf3; --muted: #9aa7b4; --line: #243040;
  --accent: #6cc4ff; --accent2: #ffb347; --code-bg: #0f141b; --mark: #2a3442;
}
* { box-sizing: border-box; }
html { color-scheme: dark; background: #000; }
body.blog {
  margin: 0; background: var(--bg); color: var(--text);
  font: 17px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
}
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent2); }
.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus { left: 8px; top: 8px; z-index: 10; background: var(--panel); padding: 8px 12px; border-radius: 6px; }
:focus-visible { outline: 2px solid var(--accent2); outline-offset: 2px; }

.site-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px;
  max-width: 980px; margin: 0 auto; padding: 18px 20px; border-bottom: 1px solid var(--line);
}
.site-head .brand { font-weight: 700; font-size: 1.15rem; color: var(--text); text-decoration: none; }
.site-head .tagline { color: var(--muted); font-size: 0.9rem; }
.site-head nav { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
.site-head nav a { color: var(--text); text-decoration: none; padding: 10px 2px; }
.site-head nav a[aria-current="page"] { color: var(--accent); border-bottom: 2px solid var(--accent); }

main { display: block; max-width: 760px; margin: 0 auto; padding: 24px 20px 48px; }
main:focus { outline: none; }
h1, h2, h3, h4 { line-height: 1.25; }
h1 { font-size: 2rem; margin: 0.4em 0 0.3em; }
.meta { color: var(--muted); font-size: 0.92rem; margin: 0.2em 0 0.6em; }
.tags { margin: 0.4em 0; }
.tag {
  display: inline-block; margin: 0 6px 6px 0; padding: 2px 10px; border-radius: 999px;
  background: var(--mark); color: var(--text); text-decoration: none; font-size: 0.85rem;
}
.tag-cloud { margin: 0 0 18px; }
.tag small { color: var(--muted); }

.post-list { display: grid; gap: 14px; }
.post-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.post-card h2 { margin: 0 0 4px; font-size: 1.3rem; }
.post-card h2 a { color: var(--text); text-decoration: none; }
.post-card h2 a:hover { color: var(--accent); }
.summary { margin: 0.3em 0; }
.empty { color: var(--muted); }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 22px; gap: 12px; }
.pager a { padding: 10px 0; }

.post header { margin-bottom: 18px; }
/* the tui Blog Wizard's post template (backend app5/blog/post_template.py): 3D asset / title block / --- / post / --- */
.post-template .post-banner { margin: 0 0 20px; }
.post-template .post-banner img { max-width: 100%; height: auto; display: block; margin: 0 auto; border-radius: 12px; }
.post-template .post-foot { margin: 20px 0 0; }
.post-template header { margin-bottom: 0; }
.post-template h1 { margin-top: 0.1em; }
.post-template .subtitle { color: var(--muted); font-size: 1.18rem; margin: 0 0 0.5em; }
.post-template hr.rule { border: 0; border-top: 1px solid var(--line); margin: 18px 0 22px; }
.draft-note { background: #5a3a00; color: #ffe2b0; padding: 8px 12px; border-radius: 8px; }
.toc { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 16px; margin: 0 0 22px; font-size: 0.95rem; }
.toc ol { margin: 6px 0 0; padding-left: 20px; }
.toc .l3 { margin-left: 14px; }
.toc .l4 { margin-left: 28px; }
.post-body img { max-width: 100%; height: auto; border-radius: 8px; }
/* every picture and video in a post is centred in the column (jay, 2026-11-05): a picture narrower than the
   column used to sit at its left edge, inline in its <p>. A tui export puts each picture on its own line. */
.post-body img, .post-body video { display: block; margin-left: auto; margin-right: auto; }
/* a post's 3D header/footer (backend app5/blog/post_video.py): the whole frame on black, never cropped */
.post-video { margin: 0 0 24px; background: #000; border-radius: 12px; overflow: hidden; }
.post-video video, .post-video img, .post-video picture { display: block; width: 100%; height: auto; margin: 0 auto; border-radius: 0; }
.post-video .post-video-still { display: none; }
@media (max-width: 720px) {
  .post-video.has-still video { display: none; }
  .post-video.has-still .post-video-still { display: block; }
}
.post-body blockquote { margin: 1em 0; padding: 4px 16px; border-left: 3px solid var(--accent); color: var(--muted); }
.post-body code { background: var(--code-bg); padding: 1px 5px; border-radius: 4px; font: 0.9em/1.5 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; }
.code-block { position: relative; margin: 1em 0; }
.code-block pre { margin: 0; overflow-x: auto; background: var(--code-bg); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.code-block pre code { background: none; padding: 0; font-size: 0.86rem; }
.table-wrap { overflow-x: auto; margin: 1em 0; }
.table-wrap table { border-collapse: collapse; min-width: 100%; }
.table-wrap th, .table-wrap td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; }
.table-wrap th { background: var(--mark); }
.post-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 30px; padding-top: 14px; border-top: 1px solid var(--line); }
.intro { margin-bottom: 18px; }

.site-foot { max-width: 980px; margin: 0 auto; padding: 18px 20px 30px; color: var(--muted); border-top: 1px solid var(--line); font-size: 0.9rem; text-align: center; }
.site-foot p { margin: 0; }
/* the footer links: one line of 4 columns; 2 x 2 on a phone */
.foot-nav { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px 12px; max-width: 560px; margin: 0 auto 12px; }
.foot-nav a { color: var(--text); text-decoration: none; padding: 10px 4px; }
.foot-nav a:hover { color: var(--accent2); }
@media (max-width: 600px) { .foot-nav { grid-template-columns: repeat(2, 1fr); } }

/* Pygments token classes (classprefix hl-): a small, readable palette on black */
.hl-c, .hl-c1, .hl-cm, .hl-cs, .hl-ch, .hl-cp, .hl-cpf { color: #7d8b99; font-style: italic; }
.hl-k, .hl-kd, .hl-kn, .hl-kr, .hl-kc, .hl-kt, .hl-kp, .hl-ow { color: #c792ea; }
.hl-s, .hl-s1, .hl-s2, .hl-sb, .hl-sc, .hl-sd, .hl-se, .hl-sh, .hl-si, .hl-sx, .hl-sr, .hl-ss, .hl-sa { color: #9ece6a; }
.hl-m, .hl-mi, .hl-mf, .hl-mh, .hl-mo, .hl-mb, .hl-il { color: #ff9e64; }
.hl-nf, .hl-fm, .hl-nc, .hl-nn { color: #7aa2f7; }
.hl-nb, .hl-bp, .hl-nd, .hl-ne { color: #2ac3de; }
.hl-o, .hl-p { color: inherit; }
.hl-err { color: #ff6b6b; }

@media (max-width: 600px) {
  body.blog { font-size: 16px; }
  h1 { font-size: 1.6rem; }
  .site-head nav { margin-left: 0; width: 100%; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
@media print { .site-head nav, .site-foot { display: none; } }

/* ---- /aprvmode/blogs: the admin-only private preview (backend app5/blog/aprv_page.py, public/aprvmode.js) ---- */
.aprv-banner { display: block; margin: 0 0 1rem; padding: 0.6rem 0.8rem; border: 2px dashed #ffb547; border-radius: 8px;
  background: rgba(255, 181, 71, 0.08); font-size: 0.92rem; line-height: 1.6; }
.aprv-banner code { font-size: 0.85em; }
.aprv-approve { margin-left: 0.5rem; padding: 0.25rem 0.7rem; border-radius: 6px; border: 1px solid #33d6c8; background: #0b2a29;
  color: #e8fffd; cursor: pointer; }
.aprv-approve[disabled] { opacity: 0.5; cursor: not-allowed; }
/* [Publish Blog] (jay, 2026-11-05): leads the strip; its modal's Confirm is green, Reject red (/aprvmode.js) */
.aprv-publish { margin: 0 0.6rem 0 0; padding: 0.35rem 0.9rem; font-weight: 700; border: 1px solid #2e9d4f;
  background: #1f7a3c; color: #fff; }
.aprv-publish:hover:not([disabled]) { background: #24914a; }
.aprv-modal-back { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 1000; display: flex;
  align-items: center; justify-content: center; padding: 1rem; background: rgba(0, 0, 0, 0.65); }
.aprv-modal { width: 100%; max-width: 30rem; padding: 1.2rem 1.4rem; border-radius: 10px; border: 1px solid #30363d;
  background: #161b22; color: #e6edf3; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6); }
.aprv-modal h2 { margin: 0 0 0.6rem; font-size: 1.25rem; }
.aprv-modal p { margin: 0 0 0.7rem; }
.aprv-modal-note { color: #ffb547; font-size: 0.92rem; }
.aprv-modal-msg:empty { display: none; }
.aprv-modal-actions { display: flex; gap: 0.6rem; justify-content: flex-end; margin-top: 1rem; }
.aprv-confirm, .aprv-reject { font: inherit; font-weight: 700; padding: 0.45rem 1.2rem; border-radius: 6px;
  cursor: pointer; color: #fff; }
.aprv-confirm { background: #1f7a3c; border: 1px solid #2e9d4f; }
.aprv-confirm:hover:not([disabled]) { background: #24914a; }
.aprv-reject { background: #a32020; border: 1px solid #c84040; }
.aprv-reject:hover:not([disabled]) { background: #b82828; }
.aprv-confirm[disabled], .aprv-reject[disabled] { opacity: 0.55; cursor: wait; }
.aprv-problems { margin: 0.4rem 0 0 1.2rem; padding: 0; color: #ffb547; }
.aprv-debug { margin: 0 0 1rem; overflow-x: auto; font-size: 0.78rem; }
.aprv-debug table { border-collapse: collapse; width: 100%; }
.aprv-debug th, .aprv-debug td { border-bottom: 1px solid rgba(128, 128, 128, 0.3); padding: 0.2rem 0.4rem; text-align: left;
  vertical-align: top; word-break: break-all; }
.aprv-ok { color: #2e9d4f; font-weight: 600; }
.aprv-bad { color: #c84040; font-weight: 600; }
.aprv-ext { color: #c84040; }
.aprv-ga4 { margin: 0 0 1rem; font-size: 0.78rem; }
.aprv-ga4 pre { margin: 0.3rem 0 0; padding: 0.4rem; overflow-x: auto; white-space: pre-wrap; border: 1px solid rgba(128, 128, 128, 0.3); border-radius: 6px; }

/* /projects + /about: the bridge office desk's two tabs (pages.office_projects_section / office_about_section,
   from backend/app5/blog/office.json — the in-game version is views/lab-office.ts) */
.office-hero { margin: 0 0 32px; padding-bottom: 8px; border-radius: 12px; overflow: hidden; background: #000; }
.office-hero.is-bottom { margin: 28px 0 0; }
/* the whole frame, never cropped (2026-10-30): no max-height, no object-fit: cover */
.office-hero video, .office-hero img { display: block; width: 100%; height: auto; }
.office-name { margin: 0.2em 0 0.1em; font-size: 2rem; }
.office-title { margin: 0 0 0.8em; color: var(--muted); font-size: 1.05rem; }
.office .post-body { margin: 0.4em 0; }
.office-links, .office-socials {
  list-style: none; padding: 0; margin: 14px 0; display: grid; gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}
.office-links a, .office-socials a {
  display: block; padding: 10px 12px; min-height: 44px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel); color: var(--text); text-decoration: none;
}
.office-links a:hover, .office-socials a:hover { border-color: var(--accent); color: var(--accent); }
.office-h2 { margin: 1.4em 0 0.5em; font-size: 1.35rem; }
.office-list, .office-jobs { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.office-card, .office-jobs > li { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; }
.office-card h3, .office-jobs h3 { margin: 0 0 4px; font-size: 1.15rem; }
.office-card h3 a { color: var(--text); text-decoration: none; }
.office-card h3 a:hover { color: var(--accent); }
.office-tags { margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.office-tags span { font-size: 0.82rem; padding: 2px 8px; border-radius: 999px; background: var(--mark); color: var(--muted); }
.office-when { margin: 0 0 6px; color: var(--muted); font-size: 0.92rem; }
.office-interests { padding-left: 1.2em; }
.office-avatar-wrap { text-align: center; margin: 8px 0 12px; }
.office-avatar { width: 160px; height: 160px; border-radius: 50%; border: 4px solid #fff; object-fit: cover; }
[data-testid="office-about"] > .office-name, [data-testid="office-about"] > .office-title { text-align: center; }

/* "Send me a message" (backend app5/blog/pages.py contact_block + /contact-me.js, app5/contact.py): a button after
   the end of the article, and a panel docked bottom-right. Firefox first. */
.contact-me { margin: 28px 0 8px; text-align: center; }
.contact-open, .contact-send {
  font: inherit; padding: 10px 18px; min-height: 44px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--accent); background: var(--panel); color: var(--text);
}
.contact-open:hover, .contact-send:hover:not(:disabled) { background: var(--accent); color: #000; }
.contact-send:disabled { opacity: 0.55; cursor: not-allowed; }
.contact-panel {
  position: fixed; right: 16px; bottom: 16px; z-index: 50; width: min(420px, calc(100vw - 32px));
  max-height: calc(100vh - 32px); overflow: auto; text-align: left; padding: 14px 18px 18px;
  background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55);
}
.contact-panel[hidden] { display: none; }
.contact-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.contact-head h2 { margin: 0; font-size: 1.1rem; }
.contact-close { font: inherit; font-size: 1.4rem; line-height: 1; padding: 4px 10px; border-radius: 6px;
  border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; }
.contact-close:hover { border-color: var(--line); color: var(--text); }
.contact-rule { width: 60%; margin: 12px auto 14px; border: 0; border-top: 1px solid var(--line); }
.contact-form { display: grid; gap: 6px; }
.contact-form label { font-size: 0.9rem; color: var(--muted); margin-top: 4px; }
.contact-form input, .contact-form textarea {
  font: inherit; width: 100%; box-sizing: border-box; padding: 8px 10px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--bg, #0d1117); color: var(--text);
}
.contact-form input:focus, .contact-form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
/* resizable, at most 10 rows (line-height 1.45 x 10 + the padding) */
.contact-form textarea { resize: vertical; line-height: 1.45; min-height: calc(3 * 1.45em + 16px);
  max-height: calc(10 * 1.45em + 16px); }
.contact-math { margin-top: 4px; }
.contact-math[hidden] { display: none; }
.contact-status { min-height: 1.4em; margin: 6px 0 2px; font-size: 0.92rem; }
.contact-status.is-error { color: #e5534b; }
.contact-status.is-ok { color: #2e9d4f; }
.contact-send { justify-self: end; margin-top: 4px; }
