/* The blog's public pages (TKF-327). The shell — tokens, #nav, footer, .btn —
   comes from tokens.css and style.css; this is only the reading column, the
   post list and the article body. Loaded after style.css. */

.blog-main { max-width: 760px; margin: 0 auto; padding: 112px 20px 64px; }

.blog-main h1 { font-size: var(--fs-xxl); line-height: 1.2; font-weight: 700; color: var(--txt-hi, var(--txt)); margin: 0 0 12px; letter-spacing: -0.01em; }
.blog-lede { color: var(--dim); font-size: var(--fs-md); line-height: 1.55; margin: 0 0 28px; }
.blog-meta { color: var(--dim2); font-size: var(--fs-sm); margin: 0 0 32px; }
.blog-meta .kind { color: var(--amber); text-transform: uppercase; letter-spacing: .06em; font-size: var(--fs-xs); font-weight: 600; margin-right: 8px; }

/* Preview banner: the page as a rider will see it, marked as not public. */
.blog-preview { position: sticky; top: 84px; z-index: 5; margin: 0 0 24px; padding: 10px 14px;
  border: 1px solid var(--amber); border-radius: 8px; background: var(--amber-wash, rgba(245,158,11,.1));
  color: var(--txt); font-size: var(--fs-sm); }

/* ── The article ───────────────────────────────────────────────────────── */
.blog-article { font-size: 1.075rem; line-height: 1.72; color: var(--txt); overflow-wrap: break-word; }
.blog-article > :first-child { margin-top: 0; }
.blog-article p, .blog-article ul, .blog-article ol, .blog-article blockquote,
.blog-article figure, .blog-article .table-wrap, .blog-article pre { margin: 0 0 1.25em; }
.blog-article h2 { font-size: var(--fs-xl); line-height: 1.3; margin: 2em 0 .6em; color: var(--txt-hi, var(--txt)); }
.blog-article h3 { font-size: var(--fs-lg); line-height: 1.35; margin: 1.7em 0 .5em; color: var(--txt-hi, var(--txt)); }
.blog-article h4 { font-size: var(--fs-md); margin: 1.5em 0 .4em; }
.blog-article h2[id], .blog-article h3[id] { scroll-margin-top: 96px; }
.blog-article a { color: var(--amber); text-decoration: underline; text-underline-offset: 2px; }
.blog-article a:hover { text-decoration-thickness: 2px; }
.blog-article strong { color: var(--txt-hi, var(--txt)); }
.blog-article ul, .blog-article ol { padding-left: 1.4em; }
.blog-article li { margin: .3em 0; }
.blog-article blockquote { border-left: 3px solid var(--amber); padding: .2em 0 .2em 1em; color: var(--dim); }
.blog-article hr { border: 0; border-top: 1px solid var(--bdr); margin: 2.5em 0; }
.blog-article code { font-family: var(--font-data); font-size: .9em; background: var(--bg1); border: 1px solid var(--bdr); border-radius: 4px; padding: .05em .35em; }
.blog-article pre { background: var(--bg1); border: 1px solid var(--bdr); border-radius: 8px; padding: 14px 16px; overflow-x: auto; line-height: 1.5; }
.blog-article pre code { background: none; border: 0; padding: 0; }
.blog-article img { max-width: 100%; height: auto; border-radius: 6px; }
.blog-article figure { margin-left: 0; margin-right: 0; }
/* A tall portrait (a map of a north-south route, a phone-shaped screenshot)
   would otherwise run 1,300 px at full column width; cap it and centre it. */
.blog-article figure img { display: block; margin: 0 auto; width: auto; max-height: 900px; }
.blog-article figcaption { color: var(--dim); font-size: var(--fs-sm); text-align: center; margin-top: 8px; line-height: 1.45; }

/* Zoom (TKF-784, assets/blog-zoom.js). The backdrop is dark in both themes:
   a chart card and a map screenshot both read best on it. */
.blog-article figure img { cursor: zoom-in; }
.blog-article figure img:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
html.blog-zoom-open { overflow: hidden; }
.blog-zoom { position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; background: #0a0c10; }
.blog-zoom[hidden] { display: none; }
/* margin:auto (not justify-content) centres the image, so when it is larger
   than the stage it can still be scrolled to every edge. */
.blog-zoom-stage { flex: 1; min-height: 0; display: flex; overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.blog-zoom-img { display: block; margin: auto; max-width: none; cursor: zoom-in; user-select: none; -webkit-user-select: none; }
.blog-zoom.is-zoomed .blog-zoom-img { cursor: grab; }
.blog-zoom.is-dragging .blog-zoom-img { cursor: grabbing; }
.blog-zoom-img:focus-visible { outline: 2px solid #f59e0b; outline-offset: -2px; }
.blog-zoom-cap { margin: 0; padding: 10px 64px 16px; color: #c2c9d1; font-size: var(--fs-sm); line-height: 1.45; text-align: center; }
.blog-zoom-cap[hidden] { display: none; }
.blog-zoom-close { position: absolute; top: 12px; right: 12px; z-index: 2; width: 44px; height: 44px; padding: 0;
  border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.22); background: rgba(15, 19, 26, 0.85);
  color: #f6f7f9; font: 400 28px/1 system-ui, sans-serif; cursor: pointer; }
.blog-zoom-close:hover { background: rgba(38, 44, 54, 0.95); }
.blog-zoom-close:focus-visible { outline: 2px solid #f59e0b; outline-offset: 2px; }

/* Tables: the numbers posts are made of. They scroll inside the column on a
   phone instead of widening the page. */
.blog-article .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--bdr); border-radius: 8px; }
.blog-article table { border-collapse: collapse; width: 100%; font-size: var(--fs-sm); line-height: 1.45; }
.blog-article th, .blog-article td { padding: 8px 12px; border-bottom: 1px solid var(--bdr); text-align: left; white-space: nowrap; }
.blog-article td { font-variant-numeric: tabular-nums; }
.blog-article th { background: var(--bg1); color: var(--txt-hi, var(--txt)); font-weight: 600; }
.blog-article tr:last-child td { border-bottom: 0; }

.blog-updated { color: var(--dim2); font-size: var(--fs-sm); margin: 2em 0 0; }

/* The call to action under a post. */
.blog-cta { margin: 48px 0 0; padding: 22px 24px; border: 1px solid var(--bdr); border-radius: 10px; background: var(--bg1);
  display: flex; gap: 18px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.blog-cta p { margin: 0; flex: 1 1 320px; color: var(--dim); line-height: 1.55; }
.blog-cta strong { color: var(--txt); }

/* ── The index ─────────────────────────────────────────────────────────── */
.blog-tabs { display: flex; gap: 8px; margin: 0 0 28px; flex-wrap: wrap; }
.blog-tabs a { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--bdr); color: var(--dim); text-decoration: none; font-size: var(--fs-sm); }
.blog-tabs a:hover { color: var(--txt); border-color: var(--dim2); }
.blog-tabs a[aria-current="page"] { background: var(--amber); border-color: var(--amber); color: var(--on-amber, #0f172a); font-weight: 600; }

.blog-list { list-style: none; margin: 0; padding: 0; }
.blog-list li { border-top: 1px solid var(--bdr); }
.blog-list li:last-child { border-bottom: 1px solid var(--bdr); }
.blog-list a { display: block; padding: 22px 0; text-decoration: none; color: inherit; }
.blog-list a:hover h2 { color: var(--amber); }
.blog-list h2 { font-size: var(--fs-lg); line-height: 1.35; margin: 0 0 6px; color: var(--txt-hi, var(--txt)); transition: color .15s; }
.blog-list p { margin: 0 0 8px; color: var(--dim); line-height: 1.55; }
.blog-list time { color: var(--dim2); font-size: var(--fs-sm); }
.blog-empty { color: var(--dim); padding: 32px 0; }

.blog-pager { display: flex; justify-content: space-between; margin-top: 28px; font-size: var(--fs-sm); }
.blog-pager a { color: var(--amber); text-decoration: none; }

@media (max-width: 640px) {
  .blog-main { padding: 96px 16px 48px; }
  .blog-main h1 { font-size: var(--fs-xl); }
  .blog-article { font-size: 1rem; }
  .blog-preview { top: 76px; }
}
