/* =========================================================================
   CoLateral blog
   -------------------------------------------------------------------------
   Styles for every page apps/web/scripts/blog-pages.mjs renders, and for the
   "From the blog" strip it hands the home page (the home page does not load
   public.css, so everything the strip needs lives here under .blog-latest and
   .blog- classes).

   The look is the site's own, set for reading: white surfaces, Office Blue,
   Inter, the atm-card surface and the dot-grid canvas behind it. The one
   idea this sheet adds is the canvas card: a post is a card on the canvas,
   its category is the card's title, and a post with no capture gets a drawn
   stand-in rather than a gap. Dated sequences (the timeline block, the
   history band) share one vertical rail so "when" always looks the same.

   Theme rules, as on the rest of the site: dark values live ONLY under
   html[data-site-theme="dark"], and light output is the fallback literal of
   every token below, so a page that never receives the dark palette still
   renders light. The --bl-* tokens are the one place those fallbacks are
   written; everything else reads them.
   ========================================================================= */

.blog-page,
.blog-latest {
  --bl-ink: var(--ink, #182130);
  --bl-text: color-mix(in srgb, var(--ink, #182130) 84%, var(--muted, #42597a));
  --bl-muted: var(--muted, #42597a);
  --bl-quiet: var(--quiet, #526988);
  --bl-line: var(--atm-card-line, rgba(15, 23, 42, 0.09));
  --bl-line-hover: var(--atm-card-line-hover, rgba(0, 103, 192, 0.35));
  --bl-line-blue: color-mix(in srgb, var(--blue, #0067c0) 26%, var(--atm-card-line, rgba(15, 23, 42, 0.09)));
  --bl-blue: var(--blue, #0067c0);
  --bl-blue-ink: var(--blue-ink, #005a9e);
  --bl-on-blue: var(--on-blue, #ffffff);
  --bl-surface: var(--surface, #ffffff);
  --bl-tint: color-mix(in srgb, var(--blue, #0067c0) 7%, var(--surface, #ffffff));
  --bl-tint-strong: color-mix(in srgb, var(--blue, #0067c0) 13%, var(--surface, #ffffff));
  --bl-paper: color-mix(in srgb, var(--surface, #ffffff) 92%, transparent);
  --bl-card: var(--atm-card, linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%));
  --bl-shadow: var(--atm-card-shadow, 0 1px 2px rgba(15, 23, 42, 0.04), 0 18px 44px -18px rgba(15, 23, 42, 0.18));
  --bl-shadow-hover: var(--atm-card-shadow-hover, 0 1px 2px rgba(15, 23, 42, 0.05), 0 26px 60px -20px rgba(15, 23, 42, 0.22), 0 0 0 1px rgba(0, 103, 192, 0.12));
  --bl-focus: var(--focus-ring, #00437c);
  --bl-radius: var(--atm-radius, 18px);
  --bl-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

.blog-page *,
.blog-latest * { box-sizing: border-box; }

.blog-page :is(a, button, summary, [tabindex="0"]):focus-visible,
.blog-latest a:focus-visible {
  outline: 2px solid var(--bl-focus);
  outline-offset: 3px;
  border-radius: 6px;
}

.blog-icon {
  width: 16px;
  height: 16px;
  flex: none;
}

/* ---- Small shared parts ------------------------------------------------ */

.blog-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--bl-blue-ink);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.13em;
  line-height: 1.3;
  text-transform: uppercase;
  text-decoration: none;
}

.blog-eyebrow.is-large { font-size: 12.5px; letter-spacing: 0.14em; }
.blog-eyebrow .blog-icon { width: 15px; height: 15px; }
.blog-eyebrow-dim { color: var(--bl-quiet); }
.blog-eyebrow-dim::before { content: "/"; margin-right: 8px; opacity: 0.6; }
a.blog-eyebrow:hover span { text-decoration: underline; text-underline-offset: 4px; }

.blog-sep {
  display: inline-block;
  width: 3px;
  height: 3px;
  flex: none;
  border-radius: 50%;
  background: var(--bl-quiet);
  opacity: 0.7;
}

.blog-more-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--bl-blue-ink);
  font-size: 14px;
  font-weight: 750;
  text-decoration: none;
}

.blog-more-link .blog-icon { width: 15px; height: 15px; transition: transform 0.25s ease; }
a:hover > .blog-more-link .blog-icon,
a.blog-more-link:hover .blog-icon,
.blog-feature:hover .blog-more-link .blog-icon { transform: translateX(3px); }

.blog-follow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--bl-line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bl-surface) 82%, transparent);
  color: var(--bl-ink);
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.25s ease, background-color 0.25s ease, color 0.25s ease;
}

.blog-follow .blog-icon { width: 16px; height: 16px; color: var(--bl-blue-ink); }
.blog-follow:hover { border-color: var(--bl-line-hover); background: var(--bl-tint); }
.blog-follow[hidden] { display: none; }

.blog-subscribe,
.blog-share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.blog-subscribe-label {
  margin-right: 4px;
  color: var(--bl-quiet);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.blog-chips { display: flex; flex-wrap: wrap; gap: 8px; }

.blog-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 0 8px 0 15px;
  border: 1px solid var(--bl-line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bl-surface) 82%, transparent);
  color: var(--bl-muted);
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  transition: border-color 0.25s ease, background-color 0.25s ease, color 0.25s ease;
}

.blog-chip span {
  min-width: 24px;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--bl-tint);
  color: var(--bl-blue-ink);
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.blog-chip:hover { border-color: var(--bl-line-hover); color: var(--bl-ink); }
.blog-chip[aria-current="page"] {
  border-color: transparent;
  background: var(--bl-blue);
  color: var(--bl-on-blue);
}
.blog-chip[aria-current="page"] span { background: rgba(255, 255, 255, 0.22); color: inherit; }

.blog-empty {
  margin: 0;
  padding: 28px;
  border: 1px dashed var(--bl-line-blue);
  border-radius: var(--bl-radius);
  color: var(--bl-muted);
  text-align: center;
}

.blog-empty a { color: var(--bl-blue-ink); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* ---- Page frame -------------------------------------------------------- */

.blog-page main { padding-bottom: 8px; }

.blog-section { padding: 22px 0 28px; }

.blog-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 18px;
}

.blog-section-head h2 {
  margin: 0;
  color: var(--bl-ink);
  font-size: clamp(1.35rem, 1.1rem + 0.8vw, 1.7rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.blog-count { color: var(--bl-quiet); font-size: 13px; font-weight: 700; }

/* Index, category and author heroes. */
.blog-hero { padding: 64px 0 24px; }
.blog-hero .tool-breadcrumb { margin-bottom: 26px; }
.blog-hero h1 { max-width: 15ch; margin: 18px 0 18px; }
.blog-hero-lede {
  max-width: 58ch;
  margin: 0;
  color: var(--bl-muted);
  font-size: clamp(1.05rem, 1rem + 0.35vw, 1.25rem);
  line-height: 1.55;
  text-wrap: pretty;
}

.blog-hero-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 28px;
  margin-top: 34px;
}

.blog-author-head { display: flex; align-items: flex-start; gap: 28px; }
.blog-author-hero h1 { max-width: none; margin: 14px 0 6px; }
.blog-author-role { margin: 0 0 12px; color: var(--bl-quiet); font-size: 14px; font-weight: 700; }
.blog-author-hero .blog-profile-links { margin-top: 22px; }

.blog-avatar {
  display: block;
  flex: none;
  border: 1px solid var(--bl-line-blue);
  border-radius: 50%;
  background: var(--bl-tint);
  object-fit: cover;
  width: 32px;
  height: 32px;
}

.blog-avatar.is-lg { width: 72px; height: 72px; }
.blog-avatar.is-xl { width: 112px; height: 112px; box-shadow: var(--bl-shadow); }

/* ---- Images ------------------------------------------------------------ */

.blog-img { display: block; max-width: 100%; height: auto; }
.blog-img-dark { display: none; }
html[data-site-theme="dark"] .blog-img-dark { display: block; }
html[data-site-theme="dark"] .blog-img-light { display: none; }

/* ---- Cards ------------------------------------------------------------- */

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.blog-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 10px;
  background: var(--bl-card);
}

.blog-card:hover,
.blog-card:focus-within {
  transform: translateY(-4px);
  border-color: var(--bl-line-hover);
  box-shadow: var(--bl-shadow-hover);
}

.blog-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  padding: 14px 8px 8px;
}

.blog-card h2,
.blog-card h3 {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 770;
  letter-spacing: -0.02em;
  line-height: 1.28;
  text-wrap: balance;
}

.blog-card h2 a,
.blog-card h3 a,
.blog-feature h2 a {
  color: var(--bl-ink);
  text-decoration: none;
  transition: color 0.25s ease;
}

/* The title link covers the whole card, so the card is one target and the
   category eyebrow inside it stays plain text. */
.blog-card h2 a::after,
.blog-card h3 a::after,
.blog-feature h2 a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}

.blog-card h2 a:focus-visible,
.blog-card h3 a:focus-visible,
.blog-feature h2 a:focus-visible { outline: none; }
.blog-card h2 a:focus-visible::after,
.blog-card h3 a:focus-visible::after,
.blog-feature h2 a:focus-visible::after {
  outline: 2px solid var(--bl-focus);
  outline-offset: 3px;
  border-radius: var(--bl-radius);
}

.blog-card:hover h2 a,
.blog-card:hover h3 a,
.blog-feature:hover h2 a { color: var(--bl-blue-ink); }

.blog-card-desc {
  display: -webkit-box;
  flex: 1;
  margin: 0;
  overflow: hidden;
  color: var(--bl-muted);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.blog-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 9px;
  margin: 2px 0 0;
  color: var(--bl-quiet);
  font-size: 12.5px;
  font-weight: 600;
}

.blog-thumb {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--bl-line);
  border-radius: calc(var(--bl-radius) - 6px);
  background: var(--bl-tint);
}

.blog-thumb .blog-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
  transition: transform 0.6s var(--bl-ease);
}

.blog-card:hover .blog-thumb .blog-img,
.blog-feature:hover .blog-thumb .blog-img { transform: scale(1.025); }

/* The stand-in for a post with no capture: a patch of the canvas with the
   category's icon on it. Each category leans a little off Office Blue. */
.blog-thumb.is-plain {
  --th: var(--bl-blue);
  display: grid;
  place-items: center;
  background:
    radial-gradient(color-mix(in srgb, var(--th) 32%, transparent) 1px, transparent 1.5px) 0 0 / 18px 18px,
    radial-gradient(120% 90% at 20% 0%, color-mix(in srgb, var(--th) 16%, transparent), transparent 70%),
    var(--bl-tint);
}

.blog-thumb.is-plain[data-cat="history"] { --th: #7060ff; }
.blog-thumb.is-plain[data-cat="models"] { --th: #0a8aa6; }
.blog-thumb.is-plain[data-cat="packs"] { --th: #0a7a3a; }
.blog-thumb.is-plain[data-cat="founder"] { --th: #c97f00; }

.blog-thumb-icon {
  width: 44px;
  height: 44px;
  padding: 14px;
  box-sizing: content-box;
  border: 1px solid color-mix(in srgb, var(--th, var(--bl-blue)) 35%, var(--bl-line));
  border-radius: 18px;
  background: var(--bl-surface);
  color: var(--th, var(--bl-blue-ink));
  box-shadow: var(--bl-shadow);
}

.blog-thumb.is-plain span {
  position: absolute;
  left: 14px;
  bottom: 12px;
  color: color-mix(in srgb, var(--th) 70%, var(--bl-ink));
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

/* Featured post */
.blog-feature {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 8px;
  padding: 12px;
  background: var(--bl-card);
}

.blog-feature:hover { transform: translateY(-3px); }
.blog-feature .blog-thumb { border-radius: calc(var(--bl-radius) - 6px); }
.blog-feature .blog-thumb.is-plain { min-height: 280px; }

.blog-feature-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 14px;
  padding: clamp(18px, 3vw, 36px) clamp(14px, 3vw, 40px);
}

.blog-feature h2 {
  margin: 0;
  font-size: clamp(1.7rem, 1.2rem + 1.7vw, 2.6rem);
  font-weight: 820;
  letter-spacing: -0.045em;
  line-height: 1.06;
  text-wrap: balance;
}

.blog-feature-desc {
  margin: 0;
  color: var(--bl-muted);
  font-size: clamp(1rem, 0.95rem + 0.2vw, 1.1rem);
  line-height: 1.55;
}

.blog-feature .blog-card-meta { margin: 0; }
.blog-feature .blog-more-link { margin-top: 6px; }
.blog-feature-section { padding-top: 18px; }

/* History band: the same dated rail the timeline block uses. */
.blog-history {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  align-items: center;
  gap: clamp(24px, 4vw, 56px);
  padding: clamp(22px, 3.4vw, 38px);
  background: var(--bl-card);
}

.blog-history-copy { display: grid; justify-items: start; gap: 12px; }
.blog-history-copy h2 { margin: 0; font-size: clamp(1.5rem, 1.2rem + 1vw, 2.1rem); font-weight: 820; letter-spacing: -0.04em; line-height: 1.08; }
.blog-history-copy p:not(.blog-eyebrow) { margin: 0; max-width: 46ch; color: var(--bl-muted); line-height: 1.55; }
.blog-history-copy .blog-more-link { margin-top: 6px; }

.blog-history-rail {
  position: relative;
  margin: 0;
  padding: 0 0 0 26px;
  list-style: none;
}

.blog-history-rail::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--bl-blue), var(--bl-line-blue));
}

.blog-history-rail li { position: relative; }
.blog-history-rail li + li { margin-top: 4px; }
.blog-history-rail li::before {
  content: "";
  position: absolute;
  left: -26px;
  top: 17px;
  width: 14px;
  height: 14px;
  border: 2px solid var(--bl-blue);
  border-radius: 50%;
  background: var(--bl-surface);
}

.blog-history-rail a {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 12px;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.blog-history-rail a:hover { background: var(--bl-tint); }
.blog-history-when { color: var(--bl-blue-ink); font-size: 11.5px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.blog-history-title { color: var(--bl-ink); font-size: 1rem; font-weight: 720; letter-spacing: -0.015em; line-height: 1.3; }

/* Archive list */
.blog-archive { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--bl-line); }
.blog-archive li {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 16px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--bl-line);
}
.blog-archive time { color: var(--bl-quiet); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.blog-archive a { color: var(--bl-ink); font-weight: 720; letter-spacing: -0.01em; text-decoration: none; }
.blog-archive a:hover { color: var(--bl-blue-ink); text-decoration: underline; text-underline-offset: 4px; }
.blog-archive span { color: var(--bl-quiet); font-size: 12.5px; font-weight: 700; }

/* ---- Post head --------------------------------------------------------- */

.blog-post-head { padding: 56px 0 6px; }
.blog-post-head .tool-breadcrumb { margin-bottom: 28px; }

.blog-kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.blog-kicker-series {
  padding: 4px 11px;
  border: 1px solid var(--bl-line-blue);
  border-radius: 999px;
  background: var(--bl-tint);
  color: var(--bl-muted);
  font-size: 12px;
  font-weight: 700;
}

.blog-post-head h1 {
  max-width: 21ch;
  margin: 18px 0 20px;
  font-size: clamp(2.25rem, 1.3rem + 3.4vw, 4rem);
}

.blog-lede {
  max-width: 60ch;
  margin: 0;
  color: var(--bl-text);
  font-size: clamp(1.15rem, 1.05rem + 0.45vw, 1.4rem);
  font-weight: 480;
  letter-spacing: -0.012em;
  line-height: 1.5;
  text-wrap: pretty;
}

.blog-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-top: 26px;
  color: var(--bl-muted);
  font-size: 14px;
  font-weight: 560;
}

.blog-meta > span { display: inline-flex; align-items: center; }
.blog-meta .blog-icon { width: 15px; height: 15px; margin-right: 6px; color: var(--bl-quiet); }
.blog-byline { display: inline-flex; align-items: center; gap: 9px; color: var(--bl-ink); font-weight: 700; text-decoration: none; }
.blog-byline:hover span { text-decoration: underline; text-underline-offset: 4px; }

.blog-period {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 0;
  padding: 7px 13px;
  border: 1px solid var(--bl-line-blue);
  border-radius: 999px;
  background: var(--bl-tint);
  color: var(--bl-blue-ink);
  font-size: 13px;
  font-weight: 750;
}
.blog-period .blog-icon { width: 15px; height: 15px; }

.blog-hero-figure { margin: 36px 0 0; }
.blog-hero-figure .blog-img {
  width: 100%;
  border: 1px solid var(--bl-line-blue);
  border-radius: 20px;
  background: var(--bl-surface);
  box-shadow: var(--bl-shadow);
}

/* ---- Reading layout ---------------------------------------------------- */

.blog-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 248px;
  gap: 48px;
  align-items: start;
  padding-top: 40px;
  padding-bottom: 8px;
}

.blog-article { grid-column: 1; grid-row: 1; min-width: 0; }

.blog-toc {
  grid-column: 2;
  grid-row: 1;
  position: sticky;
  top: 96px;
  max-height: calc(100vh - 124px);
  max-height: calc(100dvh - 124px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--bl-line-blue) transparent;
}

.blog-toc summary {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--bl-quiet);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.13em;
  list-style: none;
  text-transform: uppercase;
  cursor: default;
}
.blog-toc summary::-webkit-details-marker { display: none; }
.blog-toc summary .blog-icon { width: 15px; height: 15px; }

.blog-toc ol {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  border-left: 2px solid var(--bl-line);
}

.blog-toc a {
  display: block;
  margin-left: -2px;
  padding: 6px 4px 6px 14px;
  border-left: 2px solid transparent;
  color: var(--bl-muted);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.blog-toc a:hover { color: var(--bl-ink); }
.blog-toc a[aria-current="true"] { border-left-color: var(--bl-blue); color: var(--bl-ink); font-weight: 720; }

.blog-progress {
  display: none;
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 30;
  height: 3px;
  background: var(--bl-blue);
  pointer-events: none;
}

@supports (animation-timeline: scroll()) {
  .blog-progress {
    display: block;
    transform: scaleX(0);
    transform-origin: 0 50%;
    animation: blog-progress linear both;
    animation-timeline: scroll(root);
  }
}

@keyframes blog-progress { to { transform: scaleX(1); } }

/* ---- Prose ------------------------------------------------------------- */

.blog-prose {
  padding: clamp(22px, 4.4vw, 56px);
  border: 1px solid var(--bl-line);
  border-radius: 22px;
  background: var(--bl-paper);
  box-shadow: var(--bl-shadow);
  color: var(--bl-text);
  font-size: 18px;
  line-height: 1.72;
  overflow-wrap: break-word;
}

.blog-prose > :first-child { margin-top: 0; }
.blog-prose p { margin: 0 0 1.25em; color: inherit; font-size: inherit; line-height: inherit; text-wrap: pretty; }

.blog-prose .blog-lede-rest {
  color: var(--bl-ink);
  font-size: 1.12em;
  font-weight: 480;
  letter-spacing: -0.01em;
  line-height: 1.62;
}

.blog-prose h2 {
  position: relative;
  margin: 2em 0 0.65em;
  padding-top: 1.2em;
  border-top: 1px solid var(--bl-line);
  color: var(--bl-ink);
  font-size: clamp(1.55rem, 1.2rem + 1.3vw, 2.05rem);
  font-weight: 800;
  letter-spacing: -0.038em;
  line-height: 1.14;
  scroll-margin-top: 96px;
  text-wrap: balance;
}

.blog-prose h3 {
  margin: 2em 0 0.55em;
  color: var(--bl-ink);
  font-size: clamp(1.15rem, 1.08rem + 0.35vw, 1.3rem);
  font-weight: 760;
  letter-spacing: -0.025em;
  line-height: 1.25;
}

.blog-anchor {
  display: inline-block;
  margin-left: 0.4em;
  color: var(--bl-quiet);
  font-weight: 600;
  opacity: 0;
  text-decoration: none;
  transition: opacity 0.2s ease;
}
.blog-anchor::before { content: "#"; }
.blog-prose h2:hover .blog-anchor,
.blog-anchor:focus-visible { opacity: 1; }

.blog-prose ul,
.blog-prose ol { margin: 0 0 1.4em; padding-left: 1.35em; }
.blog-prose li { margin-bottom: 0.55em; padding-left: 0.3em; }
.blog-prose li::marker { color: var(--bl-blue-ink); font-weight: 700; }
.blog-prose li > p { margin: 0; }

.blog-prose a:not(.blog-anchor):not(.blog-yt):not(.blog-series a) {
  color: var(--bl-blue-ink);
  font-weight: 620;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--bl-blue-ink) 35%, transparent);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s ease;
}
.blog-prose a:not(.blog-anchor):hover { text-decoration-color: currentColor; }
.blog-prose strong { color: var(--bl-ink); font-weight: 700; }

/* Key takeaways */
.blog-prose .blog-takeaways {
  margin: 1.8em 0 2em;
  padding: 22px 24px 8px;
  border: 1px solid var(--bl-line-blue);
  border-radius: 16px;
  background: linear-gradient(180deg, var(--bl-tint-strong) 0%, var(--bl-tint) 100%);
  box-shadow: inset 0 3px 0 var(--bl-blue);
}

.blog-prose .blog-takeaways h2 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 14px;
  padding: 0;
  border: 0;
  color: var(--bl-blue-ink);
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 1.3;
  text-transform: uppercase;
}

.blog-takeaways-icon { width: 16px; height: 16px; }
.blog-prose .blog-takeaways ul { margin: 0; padding: 0; list-style: none; }
.blog-prose .blog-takeaways li {
  position: relative;
  margin: 0 0 14px;
  padding: 0 0 0 22px;
  color: var(--bl-ink);
  font-size: 0.94em;
  font-weight: 540;
  line-height: 1.55;
}
.blog-prose .blog-takeaways li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.62em;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--bl-blue);
  transform: rotate(45deg);
}

/* Series */
.blog-prose .blog-series {
  margin: 0 0 0.6em;
  padding: 16px 20px 8px;
  border: 1px solid var(--bl-line);
  border-radius: 16px;
  background: var(--bl-surface);
  font-size: 15.5px;
  line-height: 1.45;
}
.blog-series-head {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 9px;
  margin: 0 0 8px !important;
  color: var(--bl-quiet) !important;
  font-size: 11.5px !important;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.blog-series-head .blog-icon { width: 15px; height: 15px; }
.blog-series-head strong { color: var(--bl-ink); font-size: 14px; letter-spacing: -0.01em; text-transform: none; }
.blog-prose .blog-series ol { margin: 0; padding: 0; list-style: none; }
.blog-prose .blog-series li {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 10px;
  margin: 0;
  padding: 10px 0;
  border-top: 1px solid var(--bl-line);
}
.blog-series-part { color: var(--bl-quiet); font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.blog-series a { color: var(--bl-ink); font-weight: 700; text-decoration: none; }
.blog-series a:hover { color: var(--bl-blue-ink); text-decoration: underline; text-underline-offset: 3px; }
.blog-series li[aria-current="page"] .blog-series-name { color: var(--bl-blue-ink); font-weight: 780; }

/* ---- Blocks ------------------------------------------------------------ */

.blog-callout {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  margin: 1.8em 0;
  padding: 18px 22px;
  border: 1px solid var(--bl-line-blue);
  border-left: 4px solid var(--bl-blue);
  border-radius: 14px;
  background: var(--bl-tint);
}
.blog-callout-icon { width: 20px; height: 20px; margin-top: 2px; color: var(--bl-blue-ink); }
.blog-prose .blog-callout p { margin: 0; color: var(--bl-ink); font-size: 0.93em; font-weight: 540; line-height: 1.6; }

.blog-quote { margin: 2.2em 0; padding: 4px 0 4px 28px; border-left: 3px solid var(--bl-blue); }
.blog-quote blockquote { margin: 0; }
.blog-prose .blog-quote p {
  margin: 0;
  color: var(--bl-ink);
  font-size: clamp(1.3rem, 1.1rem + 0.9vw, 1.7rem);
  font-weight: 650;
  letter-spacing: -0.028em;
  line-height: 1.32;
  text-wrap: balance;
}
.blog-quote figcaption { margin-top: 14px; color: var(--bl-quiet); font-size: 13px; font-weight: 700; letter-spacing: 0.04em; }
.blog-quote figcaption::before { content: "- "; }

.blog-table-wrap {
  margin: 1.9em 0;
  overflow-x: auto;
  border: 1px solid var(--bl-line);
  border-radius: 14px;
  background: var(--bl-surface);
  -webkit-overflow-scrolling: touch;
}
.blog-table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 15.5px; line-height: 1.5; }
.blog-table caption { padding: 12px 16px; border-top: 1px solid var(--bl-line); color: var(--bl-quiet); caption-side: bottom; font-size: 13px; text-align: left; }
.blog-table th,
.blog-table td { padding: 12px 16px; border-bottom: 1px solid var(--bl-line); text-align: left; vertical-align: top; }
.blog-table thead th { background: var(--bl-tint); color: var(--bl-ink); font-size: 12px; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase; white-space: nowrap; }
.blog-table tbody th { color: var(--bl-ink); font-weight: 720; }
.blog-table td { color: var(--bl-muted); }
.blog-table tbody tr:last-child > * { border-bottom: 0; }
.blog-table tbody tr:hover > * { background: color-mix(in srgb, var(--bl-blue) 4%, transparent); }

.blog-figure,
.blog-video,
.blog-youtube { margin: 2em 0; }
.blog-figure .blog-img {
  width: 100%;
  border: 1px solid var(--bl-line-blue);
  border-radius: 14px;
  background: var(--bl-surface);
  box-shadow: var(--bl-shadow);
}
.blog-figure figcaption,
.blog-video figcaption,
.blog-youtube figcaption { margin-top: 11px; color: var(--bl-quiet); font-size: 13.5px; line-height: 1.5; }
.blog-video figcaption strong { color: var(--bl-ink); font-weight: 700; }

.blog-video video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--bl-line-blue);
  border-radius: 14px;
  background: #05080f;
  box-shadow: var(--bl-shadow);
}

/* YouTube facade: a link to the video until blog.js swaps it for the player. */
.blog-yt {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--bl-line-blue);
  border-radius: 14px;
  background: #0b111e;
  box-shadow: var(--bl-shadow);
  color: #fff;
  text-decoration: none;
}
.blog-yt img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--bl-ease); }
.blog-yt:hover img { transform: scale(1.03); }
.blog-yt::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(5, 8, 15, 0.1) 30%, rgba(5, 8, 15, 0.86) 100%);
  pointer-events: none;
}
.blog-yt-play {
  position: absolute;
  left: 50%;
  top: 46%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin: -36px 0 0 -36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  color: #0067c0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  transition: transform 0.3s var(--bl-ease);
}
.blog-yt:hover .blog-yt-play { transform: scale(1.08); }
.blog-yt-icon { width: 28px; height: 28px; margin-left: 3px; stroke: none; }
.blog-yt-title {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 14px;
  z-index: 2;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}
.blog-yt-kicker { display: block; margin-bottom: 3px; color: #cfe6ff; font-size: 11px; font-weight: 800; letter-spacing: 0.13em; text-transform: uppercase; }
.blog-yt.is-playing { background: #000; }
.blog-yt.is-playing::after { display: none; }
.blog-yt.is-playing iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Timeline: the dated rail. */
.blog-timeline {
  position: relative;
  margin: 2.2em 0 !important;
  padding: 0 0 0 30px !important;
  list-style: none;
}
.blog-timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--bl-blue), var(--bl-line-blue));
}
.blog-prose .blog-timeline li { position: relative; margin: 0 0 1.6em; padding: 0; }
.blog-prose .blog-timeline li:last-child { margin-bottom: 0; }
.blog-timeline li::before {
  content: "";
  position: absolute;
  left: -30px;
  top: 0.24em;
  width: 16px;
  height: 16px;
  border: 2px solid var(--bl-blue);
  border-radius: 50%;
  background: var(--bl-surface);
  box-shadow: 0 0 0 4px var(--bl-tint);
}
.blog-timeline time { display: block; color: var(--bl-blue-ink); font-size: 12px; font-weight: 800; letter-spacing: 0.12em; line-height: 1.5; text-transform: uppercase; }
.blog-prose .blog-timeline .blog-tl-title { margin: 2px 0 4px; color: var(--bl-ink); font-size: 1.14em; font-weight: 760; letter-spacing: -0.02em; line-height: 1.3; }
.blog-prose .blog-timeline .blog-tl-text { margin: 0; font-size: 0.94em; line-height: 1.6; }

/* Stats */
.blog-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 2em 0;
}
.blog-stats > div {
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-end;
  gap: 6px;
  padding: 20px 20px 18px;
  border: 1px solid var(--bl-line-blue);
  border-radius: 16px;
  background: var(--bl-tint);
}
.blog-stats dd {
  margin: 0;
  color: var(--bl-blue-ink);
  font-size: clamp(2rem, 1.5rem + 1.8vw, 2.9rem);
  font-weight: 820;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.05em;
  line-height: 1;
}
.blog-stats dt { margin: 0; color: var(--bl-muted); font-size: 13.5px; font-weight: 650; line-height: 1.35; }

/* Release */
.blog-release {
  margin: 2em 0;
  padding: 20px 24px 8px;
  border: 1px solid var(--bl-line);
  border-radius: 16px;
  background: var(--bl-card);
  box-shadow: var(--bl-shadow);
}
.blog-release header { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 12px; }
.blog-release-label { display: inline-flex; align-items: center; gap: 7px; color: var(--bl-quiet); font-size: 11.5px; font-weight: 800; letter-spacing: 0.13em; text-transform: uppercase; }
.blog-release-icon { width: 15px; height: 15px; }
.blog-ver {
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--bl-blue);
  color: var(--bl-on-blue);
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  line-height: 1.3;
}
.blog-release time { margin-left: auto; color: var(--bl-muted); font-size: 13.5px; font-weight: 650; }
.blog-prose .blog-release .blog-release-summary { margin: 0 0 12px; color: var(--bl-ink); font-size: 1.04em; font-weight: 700; letter-spacing: -0.015em; line-height: 1.4; }
.blog-prose .blog-release ul { margin: 0 0 14px; font-size: 0.94em; }

/* Definition */
.blog-definition {
  margin: 2em 0;
  padding: 20px 24px 6px;
  border: 1px solid var(--bl-line-blue);
  border-radius: 16px;
  background: var(--bl-tint);
}
.blog-prose .blog-definition p { margin: 0 0 14px; }
.blog-prose .blog-definition .blog-def-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  color: var(--bl-blue-ink);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.blog-def-icon { width: 15px; height: 15px; }
.blog-prose .blog-definition .blog-def-term { margin-bottom: 6px; }
.blog-definition dfn { color: var(--bl-ink); font-size: 1.32em; font-style: normal; font-weight: 820; letter-spacing: -0.03em; }
.blog-prose .blog-definition .blog-def-text { color: var(--bl-ink); font-size: 0.96em; line-height: 1.62; }

/* ---- End matter -------------------------------------------------------- */

.blog-end { margin-top: 28px; }

.blog-faq .blog-eyebrow { margin-bottom: 10px; }
.blog-faq h2 { margin: 0 0 16px; color: var(--bl-ink); font-size: clamp(1.45rem, 1.2rem + 0.9vw, 1.85rem); font-weight: 800; letter-spacing: -0.035em; line-height: 1.15; scroll-margin-top: 96px; }
.blog-faq .faq-item summary h3 { font-size: 16px; line-height: 1.4; }

.blog-author-box { display: flex; align-items: flex-start; gap: 20px; padding: 24px; background: var(--bl-card); }
.blog-author-box > div { min-width: 0; }
.blog-author-name { margin: 6px 0 2px; font-size: 1.3rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.2; }
.blog-author-name a { color: var(--bl-ink); text-decoration: none; }
.blog-author-name a:hover { color: var(--bl-blue-ink); text-decoration: underline; text-underline-offset: 4px; }
.blog-author-box .blog-author-role { margin: 0 0 10px; }
.blog-author-bio { margin: 0; color: var(--bl-muted); font-size: 15px; line-height: 1.6; }
.blog-profile-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

.blog-share { margin-top: 20px; padding: 0 4px; }

.blog-neighbours { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.blog-neighbour { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; background: var(--bl-card); text-decoration: none; }
.blog-neighbour.is-older { text-align: right; grid-column: 2; }
.blog-neighbour.is-newer { grid-column: 1; }
.blog-neighbour-label { display: inline-flex; align-items: center; gap: 8px; color: var(--bl-quiet); font-size: 11.5px; font-weight: 800; letter-spacing: 0.13em; text-transform: uppercase; }
.blog-neighbour.is-older .blog-neighbour-label { justify-content: flex-end; }
.blog-neighbour-label .blog-icon { width: 15px; height: 15px; color: var(--bl-blue-ink); }
.blog-neighbour-title { color: var(--bl-ink); font-size: 1rem; font-weight: 740; letter-spacing: -0.015em; line-height: 1.3; }
.blog-neighbour:hover .blog-neighbour-title { color: var(--bl-blue-ink); }

.blog-related { padding-top: 40px; }

/* Closing call to action */
.blog-cta-section { padding: 28px 0 56px; }
.blog-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 22px 36px; padding: clamp(22px, 3.4vw, 36px); background: var(--bl-card); }
.blog-cta > div:first-child { flex: 1 1 360px; }
.blog-cta h2 { margin: 0 0 8px; color: var(--bl-ink); font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); font-weight: 820; letter-spacing: -0.04em; line-height: 1.1; }
.blog-cta p { max-width: 54ch; margin: 0; color: var(--bl-muted); line-height: 1.55; }
.blog-cta-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---- Home strip -------------------------------------------------------- */

.blog-latest {
  position: relative;
  padding: 44px 0 56px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

.blog-latest-wrap { position: relative; z-index: 1; width: min(1120px, calc(100% - 36px)); margin: 0 auto; }
.blog-latest-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.blog-latest h2 { margin: 12px 0 0; color: var(--bl-ink); font-size: clamp(26px, 3.1vw, 38px); font-weight: 800; letter-spacing: -0.04em; line-height: 1.08; text-wrap: balance; }
.blog-latest-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.blog-latest .blog-card p { margin: 0; }
.blog-latest .blog-card-body { gap: 7px; }

/* ---- Responsive -------------------------------------------------------- */

@media (max-width: 1040px) {
  .blog-grid,
  .blog-latest-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .blog-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .blog-toc,
  .blog-article { grid-column: 1; }
  .blog-article { grid-row: 2; }
  .blog-toc {
    position: static;
    max-height: none;
    overflow: visible;
    padding: 4px 18px;
    border: 1px solid var(--bl-line);
    border-radius: 14px;
    background: var(--bl-paper);
  }
  .blog-toc summary { min-height: 48px; cursor: pointer; }
  .blog-toc summary::after {
    content: "";
    width: 8px;
    height: 8px;
    margin: -3px 2px 0 auto;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.2s ease;
  }
  .blog-toc[open] summary::after { margin-top: 3px; transform: rotate(225deg); }
  .blog-toc ol { margin: 0 0 12px; }
  .blog-toc a { padding-block: 10px; }
  .blog-feature { grid-template-columns: minmax(0, 1fr); }
  .blog-history { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 760px) {
  .blog-hero { padding-top: 40px; }
  .blog-post-head { padding-top: 36px; }
  .blog-author-head { flex-direction: column; gap: 18px; }
  .blog-avatar.is-xl { width: 88px; height: 88px; }
  .blog-hero-tools { gap: 18px; }
}

@media (max-width: 640px) {
  .blog-grid,
  .blog-latest-grid { grid-template-columns: minmax(0, 1fr); }
  .blog-prose { font-size: 17px; line-height: 1.7; border-radius: 18px; }
  .blog-prose .blog-takeaways { padding: 18px 18px 4px; }
  .blog-neighbours { grid-template-columns: minmax(0, 1fr); }
  .blog-neighbour.is-older,
  .blog-neighbour.is-newer { grid-column: 1; text-align: left; }
  .blog-neighbour.is-older .blog-neighbour-label { justify-content: flex-start; }
  .blog-author-box { flex-direction: column; padding: 20px; }
  .blog-archive li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .blog-cta-actions { width: 100%; }
  .blog-cta-actions .btn { flex: 1 1 160px; }
  .blog-release time { margin-left: 0; }
  .blog-quote { padding-left: 18px; }
  .blog-latest-head { align-items: flex-start; flex-direction: column; }
  .blog-subscribe { gap: 8px; }
  .blog-subscribe-label { flex-basis: 100%; }
}

@media (max-width: 560px) {
  .blog-meta .blog-sep { display: none; }
  .blog-meta { gap: 8px 16px; }
}

@media (max-width: 400px) {
  .blog-follow { padding: 0 12px; }
  .blog-chip { padding-left: 12px; }
}

/* ---- Dark -------------------------------------------------------------- */

html[data-site-theme="dark"] .blog-hero-figure .blog-img,
html[data-site-theme="dark"] .blog-figure .blog-img {
  border-color: rgba(124, 192, 255, 0.3);
  box-shadow: 0 1px 0 rgba(230, 237, 245, 0.08) inset, 0 20px 48px -22px rgba(0, 0, 0, 0.72);
}

html[data-site-theme="dark"] .blog-prose {
  background: color-mix(in srgb, #0b111e 88%, transparent);
}

html[data-site-theme="dark"] .blog-prose .blog-takeaways,
html[data-site-theme="dark"] .blog-callout,
html[data-site-theme="dark"] .blog-definition,
html[data-site-theme="dark"] .blog-stats > div { background: rgba(77, 166, 255, 0.09); }

html[data-site-theme="dark"] .blog-prose .blog-takeaways { background: linear-gradient(180deg, rgba(77, 166, 255, 0.16) 0%, rgba(77, 166, 255, 0.06) 100%); }

html[data-site-theme="dark"] .blog-thumb.is-plain { background-color: #0e1524; }
html[data-site-theme="dark"] .blog-thumb.is-plain span { color: color-mix(in srgb, var(--th) 55%, #e6edf5); }

/* ---- Motion and print -------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .blog-card,
  .blog-card:hover,
  .blog-card:focus-within,
  .blog-feature:hover { transform: none; transition: none; }
  .blog-thumb .blog-img,
  .blog-yt img,
  .blog-yt-play,
  .blog-more-link .blog-icon,
  .blog-toc a,
  .blog-anchor { transition: none; }
  .blog-card:hover .blog-thumb .blog-img,
  .blog-feature:hover .blog-thumb .blog-img,
  .blog-yt:hover img,
  .blog-yt:hover .blog-yt-play { transform: none; }
  .blog-progress { animation: none; display: none; }
}

@media print {
  .blog-progress,
  .blog-toc,
  .blog-share,
  .blog-neighbours,
  .blog-cta-section,
  .blog-related { display: none; }
  .blog-prose { border: 0; box-shadow: none; background: none; padding: 0; }
}
