/* ============================================================
   Diligent - individual /blog/<slug>/ article (redesign frame).
   Loaded via ServiceLayout head slot. Namespaced .bla-* for the
   chrome; .bla-prose styles the injected WP-clone article body
   with the redesign typography (tokens only, no new colors).
   ============================================================ */

/* ---- article header ---- */
.bla-hero { padding: 50px 0 18px; }
.bla-wrap { max-width: 760px; margin-inline: auto; }
.bla-breadcrumb { font-family: var(--mono); font-size: 12px; letter-spacing: .04em; color: var(--muted-2);
  display: flex; gap: 8px; align-items: center; margin-bottom: 22px; flex-wrap: wrap; }
.bla-breadcrumb a { color: var(--muted-2); }
.bla-breadcrumb a:hover { color: var(--coral-deep); }
.bla-breadcrumb .sep { opacity: .5; }
.bla-cat { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--coral-deep); }
.bla-hero h1 { font-size: clamp(2rem, 3.6vw, 2.9rem); letter-spacing: -.03em; line-height: 1.12; margin: 14px 0 0; }
.bla-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 20px;
  font-family: var(--mono); font-size: 12.5px; color: var(--muted-2); }
.bla-meta .by { color: var(--ink); font-weight: 600; }
.bla-meta .dot { opacity: .5; }

/* ---- featured image ---- */
.bla-feat { margin: 30px auto 0; max-width: 920px; }
.bla-feat img { width: 100%; height: auto; display: block; border-radius: var(--radius-lg);
  border: 1px solid var(--line); box-shadow: var(--shadow-md); }

/* reading progress bar = shared ReadingProgress.astro component (was .bla-progress here) */

/* ---- article body + sticky TOC rail ---- */
.bla-body { padding: 30px 0 8px; }
/* 3 columns: TOC jump-nav (left, matches case stories), reading column (middle), keep-reading rail (right) */
.bla-layout { display: grid; grid-template-columns: 200px minmax(0, 680px) 190px; column-gap: 40px; row-gap: 0;
  justify-content: center; align-items: start; }
.bla-layout--full { grid-template-columns: minmax(0, 680px) 190px; } /* posts with no TOC: content + rail */
.bla-toc { grid-column: 1; grid-row: 1; position: sticky; top: 96px; }
.bla-layout:not(.bla-layout--full) > .bla-prose,
.bla-layout:not(.bla-layout--full) > .bla-author { grid-column: 2; }
.bla-layout:not(.bla-layout--full) > .bla-rail { grid-column: 3; grid-row: 1; }
.bla-layout--full > .bla-prose,
.bla-layout--full > .bla-author { grid-column: 1; }
.bla-layout--full > .bla-rail { grid-column: 2; grid-row: 1; }
/* keep-reading rail (right sidebar) */
.bla-rail { position: sticky; top: 96px; background: var(--bone-card); border: 1px solid var(--line);
  border-radius: 14px; padding: 18px 20px; box-shadow: var(--shadow-sm); }
.bla-rail-h { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted-2); margin-bottom: 14px; }
.bla-rail ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 15px; }
.bla-rail li { margin: 0; padding: 0; border-top: 1px solid var(--line); padding-top: 15px; }
.bla-rail li:first-child { border-top: none; padding-top: 0; }
.bla-rail a { text-decoration: none; display: block; }
.bla-rail .rr-cat { display: block; font-family: var(--mono); font-size: 9.5px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--coral-deep); margin-bottom: 5px; }
.bla-rail .rr-t { display: block; font-size: .95rem; line-height: 1.3; letter-spacing: -.01em; color: var(--ink);
  transition: color .15s; }
.bla-rail li a:hover .rr-t { color: var(--coral-deep); }
.bla-rail-all { display: inline-block; margin-top: 16px; font-family: var(--mono); font-size: 11.5px;
  letter-spacing: .04em; color: var(--coral-deep); text-decoration: none; }
.bla-rail-all:hover { color: var(--coral); }
.bla-toc-h { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted-2); margin-bottom: 14px; }
.bla-toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.bla-toc li { margin: 0; }
.bla-toc a { display: block; padding: 6px 0 6px 16px; margin-left: -2px; border-left: 2px solid transparent;
  font-size: .9rem; line-height: 1.4; color: var(--muted); text-decoration: none; transition: color .15s, border-color .15s; }
.bla-toc a:hover { color: var(--coral-deep); }
.bla-toc a.is-active { color: var(--ink); font-weight: 600; border-left-color: var(--coral); }
/* TOC (mobile accordion) - hidden on desktop */
.bla-toc-m { display: none; max-width: 760px; margin: 0 auto 26px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--bone-card); overflow: hidden; }
.bla-toc-m summary { cursor: pointer; list-style: none; padding: 14px 18px; font-family: var(--mono);
  font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink); display: flex; justify-content: space-between; }
.bla-toc-m summary::-webkit-details-marker { display: none; }
.bla-toc-m summary::after { content: "+"; color: var(--coral-deep); font-weight: 700; }
.bla-toc-m[open] summary::after { content: "\2212"; }
.bla-toc-m ol { list-style: none; margin: 0; padding: 4px 18px 16px; }
.bla-toc-m a { display: block; padding: 7px 0; font-size: .95rem; color: var(--muted); text-decoration: none; border-top: 1px solid var(--line); }
.bla-toc-m a:first-child { border-top: none; }

.bla-prose { color: var(--ink); font-size: 1.08rem; line-height: 1.75; }
/* anchor offset so jumped-to headings clear the sticky nav */
.bla-prose :where(h2, h3)[id] { scroll-margin-top: 92px; }
.bla-prose > *:first-child { margin-top: 0; }
.bla-prose > *:last-child { margin-bottom: 0; } /* no trailing whitespace before the author card */
.bla-prose p { margin: 0 0 1.25em; color: #34405c; }
.bla-prose h2 { font-family: var(--display); font-weight: 700; font-size: 1.65rem; letter-spacing: -.02em;
  line-height: 1.2; color: var(--ink); margin: 1.9em 0 .55em; }
.bla-prose h3 { font-family: var(--display); font-weight: 700; font-size: 1.32rem; letter-spacing: -.015em;
  line-height: 1.25; color: var(--ink); margin: 1.7em 0 .5em; }
.bla-prose h4 { font-family: var(--display); font-weight: 700; font-size: 1.1rem; color: var(--ink); margin: 1.5em 0 .5em; }
.bla-prose a { color: var(--coral-deep); text-decoration: underline; text-underline-offset: 2px;
  text-decoration-thickness: 1px; transition: color .15s; }
.bla-prose a:hover { color: var(--coral); }
.bla-prose strong, .bla-prose b { color: var(--ink); font-weight: 700; }
.bla-prose ul, .bla-prose ol { margin: 0 0 1.25em; padding-left: 1.35em; color: #34405c; }
.bla-prose li { margin: 0 0 .5em; padding-left: .2em; }
.bla-prose ul li::marker { color: var(--coral); }
.bla-prose ol li::marker { color: var(--coral-deep); font-family: var(--mono); font-weight: 600; }
.bla-prose blockquote { margin: 1.6em 0; padding: 6px 0 6px 22px; border-left: 3px solid var(--coral);
  color: var(--muted); font-style: italic; font-size: 1.12rem; }
.bla-prose blockquote p:last-child { margin-bottom: 0; }
/* images / figures from WP block content */
.bla-prose figure { margin: 1.8em 0; }
.bla-prose img { max-width: 100%; height: auto; display: block; margin: 1.8em auto; border-radius: 12px;
  border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.bla-prose figure img { margin: 0 auto; }
.bla-prose figcaption { font-family: var(--mono); font-size: 12px; color: var(--muted-2); text-align: center; margin-top: 10px; }
/* code */
.bla-prose code { font-family: var(--mono); font-size: .9em; background: var(--bone-2); border: 1px solid var(--line);
  border-radius: 6px; padding: 2px 6px; color: var(--coral-deep); }
.bla-prose pre { background: var(--ink); color: #e8ecf5; border-radius: 12px; padding: 18px 20px; overflow-x: auto;
  margin: 1.6em 0; font-size: .92rem; line-height: 1.6; }
.bla-prose pre code { background: none; border: none; padding: 0; color: inherit; }
/* tables */
.bla-prose table { width: 100%; border-collapse: collapse; margin: 1.6em 0; font-size: .96rem; }
.bla-prose th, .bla-prose td { border: 1px solid var(--line); padding: 10px 13px; text-align: left; vertical-align: top; }
.bla-prose th { background: var(--bone-2); font-family: var(--mono); font-size: 12px; letter-spacing: .03em;
  text-transform: uppercase; color: var(--ink); }
.bla-prose hr { border: none; border-top: 1px solid var(--line); margin: 2.2em 0; }

/* ---- author card (compact, left-aligned with the article; keeps the /audit/ CTA in view) ---- */
.bla-body { padding-bottom: 14px; } /* tight gap after the author card before the CTA band */
/* blog CTA band: trim the default 96px .band top padding so the heading sits close to the author card
   (scoped: this stylesheet only loads on blog articles, so other .band.final pages are unaffected) */
.band.final { padding-top: 44px; }
.bla-author { margin: 6px 0 0; display: flex; align-items: center; gap: 14px;
  background: var(--bone-card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; box-shadow: var(--shadow-sm); }
.bla-author .ab-photo { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; object-position: center top;
  flex-shrink: 0; background: var(--bone-2); border: 1px solid var(--line); }
.bla-author .ab-mk { width: 52px; height: 52px; border-radius: 50%; background: var(--ink); color: var(--amber);
  display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 1.2rem; flex-shrink: 0; }
.bla-author .ab-t .ab-lab { font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted-2); }
.bla-author .ab-t .ab-name { font-weight: 700; color: var(--ink); font-size: 1.02rem; line-height: 1.2; margin-top: 1px; }
.bla-author .ab-t .ab-role { font-family: var(--mono); font-size: 12px; color: var(--coral-deep); margin-top: 1px; }

/* ---- related posts ---- */
.bla-related { padding: 76px 0; } /* generous space before & after the "keep reading" grid */
.bla-related .section-head { margin-bottom: 30px; }
.bla-rel-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.bla-rel-card { display: flex; flex-direction: column; background: var(--bone-card); border: 1px solid var(--line);
  border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-sm); text-decoration: none; color: inherit;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.bla-rel-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: rgba(236,106,76,.4); }
.bla-rel-img { aspect-ratio: 16 / 9; overflow: hidden; background: var(--bone-2); border-bottom: 1px solid var(--line); }
.bla-rel-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bla-rel-body { padding: 16px 18px 18px; }
.bla-rel-body .rc-cat { font-family: var(--mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--coral-deep); }
.bla-rel-body h3 { font-size: 1.02rem; line-height: 1.22; letter-spacing: -.01em; color: var(--ink); margin-top: 8px; }

/* on desktop the keep-reading rail covers related posts, so hide the bottom cards there */
@media (min-width: 1041px) { .bla-related { display: none; } }
/* below the sidebar breakpoint: single column; hide both rails, show the accordion TOC; the
   bottom "More from the blog" cards reappear (the related posts for this viewport) */
@media (max-width: 1040px) {
  .bla-layout, .bla-layout--full { grid-template-columns: minmax(0, 760px); justify-content: center; }
  .bla-layout:not(.bla-layout--full) > .bla-prose,
  .bla-layout:not(.bla-layout--full) > .bla-author,
  .bla-layout--full > .bla-prose,
  .bla-layout--full > .bla-author { grid-column: 1; }
  .bla-toc, .bla-rail { display: none; }
  .bla-toc-m { display: block; }
}
@media (max-width: 860px) {
  .bla-rel-grid { grid-template-columns: 1fr 1fr; }
  .bla-prose { font-size: 1.04rem; }
}
@media (max-width: 560px) {
  .bla-rel-grid { grid-template-columns: 1fr; }
}
