/* ==========================================================================
   Blog post pages, v2 -- bigger, easier reading, and the same look as the
   blog home and the main home page.

   This whole file is an add-on: it loads after blog.css, on post pages only,
   and every rule starts with .blog-post so it can't touch any other page.
   To go back to the old post design, set ARTICLE_V2 = false in
   blog-src/build.mjs and rebuild; that also brings back the category pill
   above the title and the plain author name in the byline.

   What changes:
     - Header sits on the home page's box grid (lines and dots, no colour),
       and the title is bold like the blog home headline.
     - Body text 14px -> 18px, headings 19/16px -> 30/22px, one ~70-character
       reading column.
     - The cover is wider and lifts off the page.
     - Contents list, byline, tables, callouts and quotes all scaled up.
     - "Keep reading" uses the same cards as the blog home.
   ========================================================================== */

/* ---- Header on the box grid (grid lines and dots only, no colour washes) ---- */
.blog-post { padding-top: 1.5rem; }
.blog-post .article-head { position: relative; max-width: 50rem; margin: 0 auto 2.5rem; padding-top: 2rem; }
.blog-post .article-head::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  top: -12rem; bottom: -4rem; left: 50%; width: 100vw; transform: translateX(-50%);
  background:
    linear-gradient(rgba(20,30,60,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20,30,60,0.045) 1px, transparent 1px),
    url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='28'%20height='28'%20viewBox='0%200%2028%2028'%3E%3Ccircle%20cx='2'%20cy='2'%20r='1.4'%20fill='rgba(10,10,20,0.07)'/%3E%3C/svg%3E");
  background-size: 3.5rem 3.5rem, 3.5rem 3.5rem, 1.75rem 1.75rem;
  background-position: center top;
  -webkit-mask-image: linear-gradient(#000 60%, transparent);
  mask-image: linear-gradient(#000 60%, transparent);
}
.blog-post .crumbs { font-size: 0.8125rem; margin-bottom: 1.25rem; }
.blog-post .crumb-current { max-width: 22rem; }
.blog-post .cat-pill { font-size: 0.8125rem; font-weight: 600; padding: 0.3125rem 0.9375rem; background: #fff; border: 1px solid rgba(139,92,246,0.3); box-shadow: 0 0.25rem 0.75rem -0.375rem rgba(80,60,140,0.35); }
.blog-post .article-head h1 { font-family: var(--head); font-size: 3.25rem; line-height: 1.05; font-weight: 800; letter-spacing: -0.04em; margin-top: 1.125rem; max-width: 48rem; }
.blog-post .deck { font-size: 1.1875rem; line-height: 1.6; color: rgba(10,10,20,0.62); margin-top: 1.125rem; max-width: 40rem; }
.blog-post .byline-row { max-width: 42rem; margin-top: 2rem; padding: 1.125rem 0; }
.blog-post .byline-mark { width: 2.75rem; height: 2.75rem; }
.blog-post .byline-text strong { font-size: 1rem; }
.blog-post .byline-role, .blog-post .byline-date { font-size: 0.875rem; }
.blog-post .verified-note { font-size: 0.9375rem; max-width: 42rem; }

/* ---- Layout: rails either side of a ~70-character reading column ---- */
.blog-post .article-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 42rem) minmax(0, 1fr); gap: 2.5rem; }
.blog-post .rail-left { max-width: 15rem; }
.blog-post .rail-right { max-width: 15rem; }
.blog-post .rail-back { font-size: 0.875rem; }

/* Contents list */
.blog-post .toc-title { font-size: 0.875rem; font-weight: 700; margin-bottom: 0.875rem; }
.blog-post .toc ol { gap: 0.6875rem; }
.blog-post .toc a { font-size: 0.875rem; line-height: 1.4; }
.blog-post .toc a.is-current { color: #7C3AED; }

/* ---- Cover: a little wider than the text, lifted off the page ---- */
.blog-post .article-body > .post-cover.is-article { width: calc(100% + 4rem); margin-left: -2rem; border-radius: 1.25rem; box-shadow: 0 1.5rem 3rem -1.75rem rgba(40,30,80,0.45); }

/* ---- The text ---- */
.blog-post .prose { margin-top: 2.5rem; font-size: 1.125rem; line-height: 1.75; color: #1b1b22; }
.blog-post .prose > * + * { margin-top: 1.25rem; }
.blog-post .prose h2 { font-size: 1.875rem; line-height: 1.18; font-weight: 800; letter-spacing: -0.03em; margin-top: 3.25rem; }
.blog-post .prose h3 { font-size: 1.375rem; line-height: 1.3; font-weight: 700; letter-spacing: -0.02em; margin-top: 2.25rem; }
.blog-post .prose h2 + *, .blog-post .prose h3 + * { margin-top: 0.875rem; }
.blog-post .prose ul, .blog-post .prose ol { padding-left: 1.5rem; }
.blog-post .prose li + li { margin-top: 0.625rem; }
.blog-post .prose li::marker { color: #8B5CF6; font-weight: 700; }
.blog-post .prose a { text-decoration-color: rgba(139,92,246,0.5); text-decoration-thickness: 0.09em; }
.blog-post .prose a:hover { text-decoration-color: #8B5CF6; }
.blog-post .prose blockquote { border-left: 0.1875rem solid #8B5CF6; padding: 0.25rem 0 0.25rem 1.375rem; font-size: 1.25rem; line-height: 1.6; font-style: normal; font-weight: 500; color: #0a0a0a; }
.blog-post .prose code { font-size: 0.9em; }

/* Tables: same framed, side-scrolling box, readable size */
.blog-post .prose table { font-size: 0.9375rem; border-radius: 0.875rem; }
.blog-post .prose th, .blog-post .prose td { padding: 0.8125rem 1rem; }

/* Callouts (TIP / NOTE / WARNING) */
.blog-post .callout { font-size: 1.0625rem; line-height: 1.7; padding: 1.25rem 1.5rem; border-radius: 1rem; }
.blog-post .callout-tip { background: rgba(179,235,213,0.28); border-color: rgba(16,150,110,0.25); }
.blog-post .callout-note { background: rgba(196,182,250,0.2); border-color: rgba(139,92,246,0.28); }
.blog-post .callout-warning { background: rgba(255,205,150,0.25); border-color: rgba(220,130,40,0.3); }
.blog-post .callout-label { font-size: 0.8125rem; }

/* ---- Keep reading: the blog home's cards ---- */
.blog-post .related { margin-top: 5.5rem; padding-top: 3.5rem; }
.blog-post .related h2 { font-size: 2rem; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 1.5rem; }
.blog-post .post-grid.is-related { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.blog-post .is-related .post-card { border: 0; border-radius: 0.25rem; background: #fff; box-shadow: 0 0.0625rem 0.1875rem rgba(10,10,20,0.06), 0 0.5rem 1.5rem -0.5rem rgba(10,10,20,0.16); transition: transform 0.18s ease, box-shadow 0.18s ease; }
.blog-post .is-related .post-card:hover { background: #fff; transform: translateY(-0.1875rem); }
.blog-post .is-related .post-card-link { padding: 0; }
.blog-post .is-related .post-card-link .post-cover { aspect-ratio: 16 / 9; border-radius: 0; }
.blog-post .is-related .post-card-body { padding: 1.25rem 1.375rem 1.5rem; }
.blog-post .is-related .post-card-body h3 { font-family: var(--sans); font-size: 1.125rem; line-height: 1.3; font-weight: 700; display: block; -webkit-line-clamp: unset; line-clamp: none; overflow: visible; min-height: 0; }
.blog-post .is-related .post-card-body p { display: none; }
/* Four related posts in a row of three would leave one alone. */
.blog-post .post-grid.is-related .post-card:nth-child(4) { display: none; }

/* ---- Narrower screens ---- */
@media (max-width: 1180px) {
  .blog-post .article-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 40rem) minmax(0, 1fr); gap: 1.75rem; }
  .blog-post .article-body > .post-cover.is-article { width: 100%; margin-left: 0; }
}
@media (max-width: 960px) {
  .blog-post .article-layout { grid-template-columns: minmax(0, 1fr); }
  .blog-post .article-head h1 { font-size: 2.625rem; }
  .blog-post .post-grid.is-related { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .blog-post .post-grid.is-related .post-card:nth-child(4) { display: block; }
}
@media (max-width: 640px) {
  .blog-post .article-head { padding-top: 0.5rem; margin-bottom: 1.75rem; }
  .blog-post .article-head h1 { font-size: 2rem; line-height: 1.1; }
  .blog-post .deck { font-size: 1.0625rem; }
  .blog-post .crumb-current { max-width: 7.5rem; }
  .blog-post .prose { margin-top: 1.75rem; font-size: 1.0625rem; line-height: 1.72; }
  .blog-post .prose h2 { font-size: 1.5rem; margin-top: 2.5rem; }
  .blog-post .prose h3 { font-size: 1.1875rem; }
  .blog-post .prose blockquote { font-size: 1.125rem; }
  .blog-post .related h2 { font-size: 1.5rem; }
  .blog-post .post-grid.is-related { grid-template-columns: 1fr; }
}

/* "Written by" before the author's name: lighter than the name itself. */
.blog-post .byline-by { font-weight: 400; color: rgba(10,10,20,0.6); }
/* No category pill now, so the title sits a little closer to the breadcrumb. */
.blog-post .crumbs + h1 { margin-top: 0.5rem; }

/* ==========================================================================
   Round 2: calmer sizes, and no sales box on the right.
   The title and text come down a step (title 52 -> 40px, text 18 -> 16px,
   headings 30/22 -> 26/20px). With the "Relax" box gone, the contents list
   stays on the left and the text fills everything to its right.
   ========================================================================== */
.blog-post .article-head h1 { font-size: 2.5rem; line-height: 1.1; letter-spacing: -0.035em; max-width: 44rem; }
.blog-post .article-head { margin-bottom: 2.25rem; }
.blog-post .byline-row { margin-top: 1.5rem; }

/* Contents on the left, the text across the rest. */
.blog-post .article-layout.no-cta { grid-template-columns: minmax(0, 14rem) minmax(0, 1fr); gap: 3rem; max-width: 68rem; margin: 0 auto; }
.blog-post .article-layout.no-cta .rail-left { grid-column: 1; max-width: none; }
.blog-post .article-layout.no-cta .article-body { grid-column: 2; }
.blog-post .article-layout.no-cta .article-body > .post-cover.is-article { width: 100%; margin-left: 0; }

.blog-post .prose { margin-top: 2.25rem; font-size: 1rem; line-height: 1.75; }
.blog-post .prose > * + * { margin-top: 1.125rem; }
.blog-post .prose h2 { font-size: 1.625rem; margin-top: 2.75rem; }
.blog-post .prose h3 { font-size: 1.25rem; margin-top: 2rem; }
.blog-post .prose blockquote { font-size: 1.0625rem; }
.blog-post .prose table { font-size: 0.875rem; }
.blog-post .callout { font-size: 0.96875rem; padding: 1.125rem 1.375rem; }
.blog-post .toc a { font-size: 0.84375rem; }

@media (max-width: 960px) {
  .blog-post .article-layout.no-cta { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .blog-post .article-layout.no-cta .article-body { grid-column: 1; }
  .blog-post .article-head h1 { font-size: 2.125rem; }
}
@media (max-width: 640px) {
  .blog-post .article-head h1 { font-size: 1.75rem; }
  .blog-post .prose { font-size: 1rem; }
  .blog-post .prose h2 { font-size: 1.375rem; }
  .blog-post .prose h3 { font-size: 1.125rem; }
}

/* The header stays centred over the page (title, then the byline as one
   centred row); below it, the contents list and the text sit side by side as
   one centred block. */
.blog-post .article-head { max-width: 50rem; }
.blog-post .byline-row { max-width: 40rem; margin-left: auto; margin-right: auto; }
/* The cover sits centred under the header, above the two columns. */
.blog-post .article-cover { max-width: 56rem; margin: 0 auto 3rem; }
.blog-post .article-cover .post-cover.is-article { border-radius: 1.25rem; box-shadow: 0 1.5rem 3rem -1.75rem rgba(40,30,80,0.45); }
.blog-post .article-layout.no-cta .prose { margin-top: 0; }
@media (max-width: 640px) { .blog-post .article-cover { margin-bottom: 1.75rem; } }

/* Text on the left, "On this page" on the right (wide screens). The contents
   rail keeps its markup; only its column moves, and its divider line moves to
   the side that faces the text. */
@media (min-width: 961px) {
  .blog-post .article-layout.no-cta { grid-template-columns: minmax(0, 1fr) minmax(0, 14rem); }
  .blog-post .article-layout.no-cta .article-body { grid-column: 1; grid-row: 1; }
  .blog-post .article-layout.no-cta .rail-left { grid-column: 2; grid-row: 1; justify-self: stretch; }
  .blog-post .article-layout.no-cta .toc { border-right: 0; border-left: 1px solid rgba(10,10,20,0.1); padding: 0 0 0 1rem; }
  .blog-post .article-layout.no-cta .rail-back { padding-left: 1rem; }
}
/* Cover and the two columns share one width, so their edges line up. */
@media (min-width: 961px) {
  .blog-post .article-layout.no-cta { max-width: 60rem; }
  .blog-post .article-cover { max-width: 60rem; }
}

/* One width for the whole post (wide screens): the header, the byline rule,
   the cover, the two columns and "Keep reading" all span the same 960px, so
   every edge on the page lines up. The title stays centred inside it. */
@media (min-width: 961px) {
  .blog-post .article-head { max-width: 60rem; }
  .blog-post .article-head h1 { max-width: 52rem; }
  .blog-post .byline-row { max-width: none; width: 100%; }
  .blog-post .related { max-width: 60rem; }
}

/* A tidier right edge without justifying (justified text left uneven gaps
   between words and was hard to read). Text stays left-aligned with normal
   word spacing; hyphenation splits long words at the end of a line, and
   text-wrap: pretty lets the browser balance line lengths across the whole
   paragraph, so the edge is far less jagged. Not headings, tables or code. */
@media (min-width: 641px) {
  .blog-post .prose p, .blog-post .prose li, .blog-post .callout p {
    text-align: left;
    -webkit-hyphens: auto; hyphens: auto; hyphenate-limit-chars: 8 4 4;
    text-wrap: pretty;
  }
}

/* All black inside the post: text, list bullets and numbers, link
   underlines, the quote bar, the current item in "On this page" and the
   callouts (TIP / NOTE / WARNING) -- no purple or coloured tints. */
.blog-post .prose { color: #0a0a0a; }
.blog-post .prose li::marker { color: #0a0a0a; }
.blog-post .prose a { color: #0a0a0a; text-decoration-color: rgba(10,10,20,0.4); }
.blog-post .prose a:hover { text-decoration-color: #0a0a0a; }
.blog-post .prose blockquote { border-left-color: #0a0a0a; color: #0a0a0a; }
.blog-post .toc a.is-current { color: #0a0a0a; }
.blog-post .callout-tip, .blog-post .callout-note, .blog-post .callout-warning { background: rgba(10,10,20,0.035); border-color: rgba(10,10,20,0.14); }
.blog-post .callout, .blog-post .callout-label { color: #0a0a0a; }

/* Byline: one plain line, "Written by Arun, Marketing Head, BlipDM" -- the
   name is not bolded or set apart from the rest. */
.blog-post .byline-line { font-size: 0.9375rem; font-weight: 400; color: rgba(10,10,20,0.7); }
/* "Written by Arun · November 3, 2026 · 12 min read", all on one line. */
.blog-post .byline-sep { margin: 0 0.5rem; color: rgba(10,10,20,0.35); }
.blog-post .byline-row { justify-content: flex-start; }
/* Byline row: date and read time on the left, photo + "Written by Arun" on
   the right. */
.blog-post .byline-row { justify-content: space-between; }
.blog-post .byline-meta { font-size: 0.9375rem; color: rgba(10,10,20,0.7); }
@media (max-width: 640px) { .blog-post .byline-meta, .blog-post .byline-line { font-size: 0.875rem; } }
/* Phones: a smaller photo and text so the date and "Written by" still share
   one row. */
@media (max-width: 640px) {
  .blog-post .byline-row { flex-wrap: nowrap; gap: 0.75rem; }
  .blog-post .byline { gap: 0.5rem; }
  .blog-post .byline-mark { width: 1.75rem; height: 1.75rem; }
  .blog-post .byline-meta, .blog-post .byline-line { font-size: 0.8125rem; white-space: nowrap; }
  .blog-post .byline-sep { margin: 0 0.3125rem; }
}
@media (max-width: 640px) {
  .blog-post .byline-row { gap: 0.5rem; }
  .blog-post .byline-meta, .blog-post .byline-line { font-size: 0.78125rem; }
  .blog-post .byline-sep { margin: 0 0.25rem; }
}

/* Tables that scroll sideways: the scrollbar under them is thin and invisible
   until the pointer is over the table (or it has keyboard focus). Scrolling
   still works the whole time -- trackpad, wheel, swipe or keys. */
.blog-post .prose table { scrollbar-width: thin; scrollbar-color: transparent transparent; transition: scrollbar-color 0.2s ease; }
.blog-post .prose table:hover, .blog-post .prose table:focus-within { scrollbar-color: rgba(10,10,20,0.35) transparent; }

/* Byline: one centred line, "November 3, 2026 · 12 min read · Written by
   Arun" -- no photo, and no rules above or below it. */
.blog-post .byline-row { justify-content: center; gap: 0; border-top: 0; border-bottom: 0; padding: 0; margin-top: 1.25rem; flex-wrap: wrap; }
.blog-post .byline-line::before { content: "·"; margin: 0 0.5rem; color: rgba(10,10,20,0.35); }
@media (max-width: 640px) {
  .blog-post .byline-row { gap: 0; flex-wrap: wrap; }
  .blog-post .byline-line::before { margin: 0 0.25rem; }
}

/* "On this page" pops in (a quick fade, slide and slight scale) when the
   reader scrolls into the cover, and stays visible from then on. */
.blog-post .rail { transform: translateY(0.75rem) scale(0.98); transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1); }
.blog-post .article-layout.is-scrolled .rail { transform: none; }
@media (prefers-reduced-motion: reduce) { .blog-post .rail { transform: none; transition: opacity 0.2s linear; } }

/* Tables in black too: header row text, cell text and borders in the same
   near-black as the post, with only a faint grey header band. */
.blog-post .prose th, .blog-post .prose td { color: #0a0a0a; }
.blog-post .prose thead th { background: rgba(10,10,20,0.04); color: #0a0a0a; font-weight: 600; }
.blog-post .prose table { border-color: rgba(10,10,20,0.16); }
.blog-post .prose th, .blog-post .prose td { border-bottom-color: rgba(10,10,20,0.1); }

/* Home page fonts on post pages too (Fredoka headings, Mulish text): heavier
   letter-spacing from the old heading font loosened to suit Fredoka. */
.blog-post .article-head h1 { font-weight: 650; letter-spacing: -0.015em; }
.blog-post .prose h2 { font-weight: 650; letter-spacing: -0.01em; }
.blog-post .prose h3 { font-weight: 600; letter-spacing: 0; }
.blog-post .related h2 { font-weight: 650; letter-spacing: -0.01em; }
.blog-post .is-related .post-card-body h3 { font-family: var(--head); font-weight: 600; letter-spacing: 0; }
