/* ==========================================================================
   blog.css — the index, the category pages and the article.

   Type-led by decision (2026-09-20): the 350 posts carry no artwork, so
   nothing here invents any. What carries the page instead is the same
   gradient recipe the marketing sections use — one .cx-art band behind the
   index hero — and after that it is type, rules and space.

   Every size is a role from tokens.css. The one liberty is prose
   line-height: body copy is 16/24 across the site, and 16/28 here, because a
   2,000-word article is a different reading job from a feature caption. The
   SIZE does not move, so the six-role scale still holds.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Masthead — a title on the page ground, no band
   -------------------------------------------------------------------------- */
.cx-bmast { padding: 96px 0 56px; }
.cx-bmast__h1 { margin: 0; max-width: 900px; color: var(--cx-ink); }

/* --------------------------------------------------------------------------
   2. Featured — visual left, the reading of it right
   -------------------------------------------------------------------------- */
.cx-bfeat { padding: 0 0 72px; }
.cx-bfeat__link {
  display: grid; grid-template-columns: 696px 1fr; gap: 56px; align-items: center;
  color: inherit; text-decoration: none;
}
.cx-bfeat__tile { aspect-ratio: 696 / 522; }
.cx-bfeat__body { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; }
.cx-bfeat__title { margin: 0; color: var(--cx-ink); text-wrap: pretty; }
.cx-bfeat__desc { margin: 0; color: var(--cx-ink-2); max-width: 520px; text-wrap: pretty; }
.cx-bfeat__link:hover .cx-bfeat__title { text-decoration: underline; text-underline-offset: 4px; }

/* --------------------------------------------------------------------------
   3. The grid — two horizontal cards to a row
   -------------------------------------------------------------------------- */
.cx-bgrid { padding: 0 0 96px; }
.cx-bgrid__head { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; padding: 0 0 28px; }
.cx-bgrid__items {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 56px 40px;
}
.cx-bcard__link {
  display: grid; grid-template-columns: 245px 1fr; gap: 24px; align-items: center;
  color: inherit; text-decoration: none;
}
.cx-bcard__tile { aspect-ratio: 245 / 184; }
.cx-bcard__body { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; min-width: 0; }
.cx-bcard__title { margin: 0; color: var(--cx-ink); text-wrap: pretty;
  font-family: var(--cx-sans); font-weight: 400; font-size: 24px; line-height: 30px; letter-spacing: -0.4px; }
.cx-bcard__link:hover .cx-bcard__title { text-decoration: underline; text-underline-offset: 3px; }

/* ---- the meta line both use: category, then date -------------------------- */
.cx-bmeta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.cx-bmeta__cat {
  display: inline-flex; padding: 5px 12px; border-radius: var(--cx-r-full);
  border: 1px solid var(--cx-line-strong); color: var(--cx-ink);
}
.cx-bmeta__date { color: var(--cx-ink-3); }

/* ---- "Read more" — a button on the featured, a link on the cards ---------- */
.cx-bmore { margin-top: 4px; }
.cx-bmore__link { color: var(--cx-ink); text-decoration: underline; text-underline-offset: 3px;
  text-decoration-color: var(--cx-line-strong); }
.cx-bcard__link:hover .cx-bmore__link { text-decoration-color: var(--cx-ink); }

/* ---- the gradient tile ----------------------------------------------------
   Type-led means no photography, so what fills the visual slot is the gradient
   the rest of the site is built from — the same baked render, cropped to the
   tile and rotated round the wheel per card so a grid of them does not read as
   one image repeated. Same trick as the E2E carousel, same reason. */
.cx-btile { position: relative; overflow: hidden; border-radius: var(--cx-r-lg); background: #4582ec; }
.cx-btile > img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 0 0; max-width: none; display: block;
}
.cx-btile[data-hue="1"] > img { filter: hue-rotate(-45deg); transform: scaleX(-1); }
.cx-btile[data-hue="2"] > img { filter: hue-rotate(90deg); }
.cx-btile[data-hue="3"] > img { filter: hue-rotate(150deg); transform: scaleX(-1); }
.cx-btile[data-hue="4"] > img { filter: hue-rotate(35deg); }
.cx-btile[data-hue="5"] > img { filter: hue-rotate(-100deg); transform: scaleX(-1); }

/* --------------------------------------------------------------------------
   3b. The rest — a plain index of everything else
   fin.ai has about twenty posts and needs no such thing. This has 350, so the
   tail stays a list rather than 340 more tiles.
   -------------------------------------------------------------------------- */
.cx-blist { padding: 0 0 120px; }
.cx-blist__head { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; padding: 0 0 8px; }
.cx-blist__items { list-style: none; margin: 0; padding: 0; }
.cx-bitem { border-top: 1px solid var(--cx-line); }
.cx-bitem__link {
  display: grid; grid-template-columns: 200px 1fr auto; gap: 40px; align-items: baseline;
  padding: 22px 0; color: inherit; text-decoration: none;
}
.cx-bitem__link:hover .cx-bitem__title { text-decoration: underline; text-underline-offset: 3px; }
.cx-bitem__meta { display: flex; flex-direction: column; gap: 4px; color: var(--cx-ink-3); }
.cx-bitem__cat { color: var(--cx-ink-2); }
.cx-bitem__body { min-width: 0; }
.cx-bitem__title { margin: 0; color: var(--cx-ink); text-wrap: pretty;
  font-family: var(--cx-sans); font-weight: 400; font-size: 20px; line-height: 28px; letter-spacing: -0.18px; }
.cx-bitem__read { color: var(--cx-ink-3); white-space: nowrap; }

/* ---- category rail -------------------------------------------------------- */
.cx-brail { padding: 0 0 56px; }
.cx-brail__list { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.cx-brail__link {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: var(--cx-r-full);
  border: 1px solid var(--cx-line-strong); color: var(--cx-ink); text-decoration: none;
  transition: background-color .15s ease, border-color .15s ease;
}
.cx-brail__link:hover { background: var(--cx-subtle); }
.cx-brail__link.is-on { background: var(--cx-ink); color: var(--cx-inverse); border-color: var(--cx-ink); }
.cx-brail__n { opacity: 0.45; font-variant-numeric: tabular-nums; }
.cx-brail__link.is-on .cx-brail__n { opacity: 0.6; }

/* --------------------------------------------------------------------------
   4. The article
   -------------------------------------------------------------------------- */
.cx-post { padding: 96px 0 0; }
.cx-post__head { max-width: 760px; display: flex; flex-direction: column; gap: 20px; }
.cx-post__cat {
  align-self: flex-start; display: inline-flex; padding: 6px 12px;
  border-radius: var(--cx-r-full); border: 1px solid var(--cx-line-strong);
  color: var(--cx-ink-2); text-decoration: none;
}
.cx-post__cat:hover { background: var(--cx-subtle); }
.cx-post__h1 { margin: 0; color: var(--cx-ink); text-wrap: pretty; }
.cx-post__standfirst { margin: 0; color: var(--cx-ink-2); max-width: 680px; text-wrap: pretty; }
.cx-post__meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding-top: 8px; color: var(--cx-ink-3);
}
.cx-post__sep { opacity: 0.5; }
.cx-post__rule { margin: 48px 0 0; border: 0; border-top: 1px solid var(--cx-line); }

/* ---- prose ---------------------------------------------------------------
   One measure, one rhythm. Headings step down through the same roles the rest
   of the site uses rather than inventing blog-only sizes. */
.cx-prose { max-width: 680px; padding: 48px 0 96px; color: var(--cx-ink); }
.cx-prose > * { margin: 0 0 24px; }
.cx-prose > *:last-child { margin-bottom: 0; }
.cx-prose p, .cx-prose li {
  font-family: var(--cx-sans); font-weight: 400;
  font-size: 16px; line-height: 28px; letter-spacing: -0.09px;
  color: var(--cx-ink-2); text-wrap: pretty;
}
.cx-prose h2 {
  margin: 48px 0 16px;
  font-family: var(--cx-sans); font-weight: 400;
  font-size: 24px; line-height: 32px; letter-spacing: -0.4px; color: var(--cx-ink);
}
.cx-prose h3 {
  margin: 36px 0 12px;
  font-family: var(--cx-sans); font-weight: 500;
  font-size: 18px; line-height: 28px; letter-spacing: -0.18px; color: var(--cx-ink);
}
.cx-prose ul, .cx-prose ol { padding-left: 22px; display: flex; flex-direction: column; gap: 10px; }
.cx-prose ul { list-style: disc; }
.cx-prose ol { list-style: decimal; }
.cx-prose li::marker { color: var(--cx-ink-3); }
.cx-prose a { color: var(--cx-ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--cx-line-strong); }
.cx-prose a:hover { text-decoration-color: var(--cx-ink); }
.cx-prose strong { font-weight: 500; color: var(--cx-ink); }
.cx-prose blockquote {
  margin: 32px 0; padding: 4px 0 4px 20px;
  border-left: 2px solid var(--cx-line-strong); color: var(--cx-ink);
}
.cx-prose code {
  font-family: var(--cx-mono); font-size: 14px;
  padding: 2px 6px; border-radius: var(--cx-r-sm); background: var(--cx-subtle);
}
.cx-prose pre {
  padding: 20px; border-radius: var(--cx-r-lg); overflow-x: auto;
  background: var(--cx-dark); color: var(--cx-inverse);
}
.cx-prose pre code { padding: 0; background: none; color: inherit; }
.cx-prose img { border-radius: var(--cx-r-lg); }
.cx-prose hr { border: 0; border-top: 1px solid var(--cx-line); margin: 48px 0; }

/* ---- related -------------------------------------------------------------- */
.cx-brel { padding: 0 0 120px; border-top: 1px solid var(--cx-line); }
.cx-brel__head { padding: 56px 0 8px; }

/* --------------------------------------------------------------------------
   5. Narrow
   -------------------------------------------------------------------------- */
@media (max-width: 1279px) {
  .cx-bfeat__link { grid-template-columns: 1fr; gap: 24px; }
  .cx-bfeat__tile { aspect-ratio: 16 / 9; }
}
@media (max-width: 1023px) {
  .cx-bmast { padding: 64px 0 40px; }
  .cx-bgrid__items { grid-template-columns: 1fr; gap: 32px; }
  .cx-bitem__link { grid-template-columns: 1fr; gap: 8px; padding: 20px 0; }
  .cx-bitem__meta { flex-direction: row; align-items: center; gap: 8px; }
  .cx-bitem__read { display: none; }
  .cx-post { padding: 64px 0 0; }
  .cx-blist, .cx-brel { padding-bottom: 72px; }
}
@media (max-width: 767px) {
  .cx-bmast { padding: 48px 0 32px; }
  .cx-bcard__link { grid-template-columns: 120px 1fr; gap: 16px; }
  .cx-bcard__title { font-size: 18px; line-height: 26px; }
  .cx-bitem__title { font-size: 18px; line-height: 26px; }
  .cx-prose { padding: 32px 0 64px; }
  .cx-prose h2 { font-size: 20px; line-height: 28px; margin-top: 36px; }
  .cx-prose h3 { font-size: 16px; line-height: 24px; }
}
