/* The blog (SEO plan phase 2): its lists, posts and profiles, on the public site's shell.
   Colours, type and radii come from landing-home.css's tokens (--h-*); nothing new is invented.
   landing.css pads every <section> by 5rem: a section here sets its own padding-block.
   Text: headings and the prose in navy (--h-ink); secondary copy at --h-text; links --h-600. */

/* ── The hero: the inner pages' navy card, with the trail above a smaller H1 (post titles run long) ── */
.b-hero .h-phero__card { padding-bottom: 96px; }
.b-hero__title { max-width: 920px; font-size: 46px; line-height: 1.18; }
.b-hero__intro { max-width: 640px; margin: 18px auto 0; color: var(--h-on-dark-text); font-size: 17px; line-height: 28px; }
.b-crumbs ol { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 0 0 20px; padding: 0; list-style: none; font-size: 14px; line-height: 20px; }
.b-crumbs li { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; }
.b-crumbs li + li::before { content: "/"; color: var(--h-on-dark-text); opacity: 0.6; }
.b-crumbs a { color: var(--h-on-dark-text); transition: color 0.15s ease; }
.b-crumbs a:hover { color: var(--h-on-dark); }
.b-crumbs [aria-current] { max-width: 42ch; overflow: hidden; color: var(--h-on-dark); text-overflow: ellipsis; white-space: nowrap; }

/* ── Lists ── */
.b-wrap { max-width: 1216px; margin: 0 auto; padding: 48px 32px 96px; }
.b-topics { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
.b-topics a { padding: 8px 14px; border: 1px solid var(--h-border); border-radius: 999px; background: var(--h-card); color: var(--h-ink); font-size: 14px; line-height: 20px; font-weight: 500; transition: border-color 0.15s ease; }
.b-topics a:hover { border-color: var(--h-950); }
.b-topics a.is-current { border-color: var(--h-950); background: var(--h-950); color: #fff; }

.b-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.b-card {
    display: flex; flex-direction: column; overflow: hidden;
    border: 1px solid var(--h-border); border-radius: 16px; background: var(--h-card); box-shadow: var(--h-shadow-card);
    transition: transform 0.2s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.2s ease;
}
@media (hover: hover) and (pointer: fine) {
    .b-card:hover { transform: translateY(-3px); box-shadow: var(--h-shadow-card), 0 12px 24px -16px rgb(21 30 49 / 0.25); }
}
.b-card__media { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--h-fill); }
.b-card__media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.b-card__placeholder { display: grid; place-items: center; height: 100%; color: var(--h-500); font-size: 32px; }
.b-card__body { display: flex; flex: 1; flex-direction: column; gap: 10px; padding: 20px 22px 22px; }
.b-card__section { align-self: flex-start; color: var(--h-600); font-size: 13px; line-height: 18px; font-weight: 600; }
.b-card__title { margin: 0; font-family: "IBM Plex Sans", "Geist", ui-sans-serif, system-ui, sans-serif; font-size: 19px; line-height: 26px; font-weight: 600; color: var(--h-ink); }
.b-card__title a { color: inherit; transition: color 0.15s ease; }
.b-card__title a:hover { color: var(--h-600); }
.b-card__text { display: -webkit-box; overflow: hidden; margin: 0; color: var(--h-text); font-size: 15px; line-height: 24px; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.b-card__meta { display: flex; flex-wrap: wrap; gap: 6px; margin: auto 0 0; padding-top: 6px; color: var(--h-text); font-size: 13px; line-height: 18px; }

.b-pages { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; margin-top: 48px; }
.b-pages__list { display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; }
.b-pages a, .b-pages span[aria-current] {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 40px; height: 40px; padding: 0 12px;
    border: 1px solid var(--h-border); border-radius: 10px; background: var(--h-card); color: var(--h-ink); font-size: 14px; font-weight: 500;
}
.b-pages a:hover { border-color: var(--h-950); }
.b-pages span[aria-current] { border-color: var(--h-950); background: var(--h-950); color: #fff; }
.b-pages__gap { align-self: center; color: var(--h-text); }
.b-empty { padding: 48px 0; color: var(--h-text); text-align: center; }

/* ── A post: the contents beside the text, as the legal pages are laid out ── */
.b-article { display: grid; grid-template-columns: 240px minmax(0, 720px); justify-content: center; gap: 56px; max-width: 1216px; margin: 0 auto; padding: 56px 32px 64px; }
.b-article:not(:has(.b-toc)) { grid-template-columns: minmax(0, 760px); }
.b-toc { position: sticky; top: 120px; align-self: start; max-height: calc(100vh - 160px); overflow: auto; padding: 20px; border: 1px solid var(--h-border); border-radius: 16px; background: var(--h-card); }
.b-toc__label { margin: 0; color: var(--h-text); font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.b-toc__label:is(:lang(ar), :lang(ur), :lang(hi), :lang(bn)) { letter-spacing: 0; }
/* Its head folds it, and carries how far the reader has got (blog-post.js), folded or not */
.b-toc__head { position: sticky; top: -20px; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 4px 10px; margin: -20px -20px 0; padding: 20px 20px 14px; border-radius: 16px 16px 0 0; background: var(--h-card); cursor: pointer; list-style: none; }
.b-toc__head::-webkit-details-marker { display: none; }
.b-toc__head:focus-visible { outline: 2px solid var(--h-600); outline-offset: -2px; }
.b-toc__pct { color: var(--h-text); font-size: 12px; line-height: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.b-toc__chev { color: var(--h-text); font-size: 13px; transition: transform 200ms cubic-bezier(0.23, 1, 0.32, 1); }
.b-toc details[open] .b-toc__chev { transform: rotate(180deg); }
.b-toc__bar { grid-column: 1 / -1; display: block; height: 3px; margin-top: 8px; overflow: hidden; border-radius: 2px; background: var(--h-border); }
.b-toc__bar > span { display: block; height: 100%; background: var(--h-600); transform: scaleX(0); transform-origin: left center; }
[dir="rtl"] .b-toc__bar > span { transform-origin: right center; }
.b-toc:not(.is-tracking) :is(.b-toc__pct, .b-toc__bar) { display: none; }
.b-toc { interpolate-size: allow-keywords; }
.b-toc details::details-content { height: 0; overflow: clip; transition: height 200ms cubic-bezier(0.23, 1, 0.32, 1), content-visibility 200ms allow-discrete; }
.b-toc details[open]::details-content { height: auto; }
.b-toc ol { margin: 6px 0 0; padding: 0; list-style: none; }
.b-toc a { display: block; padding: 6px 0 6px 12px; border-inline-start: 2px solid var(--h-border); color: var(--h-text); font-size: 14px; line-height: 20px; transition: color 0.15s ease, border-color 0.15s ease; }
[dir="rtl"] .b-toc a { padding: 6px 12px 6px 0; }
.b-toc .is-sub a { padding-inline-start: 26px; font-size: 13px; }
.b-toc a:hover { color: var(--h-600); }
.b-toc a.is-read { border-color: var(--h-600); }
.b-toc a.is-active { border-color: var(--h-600); color: var(--h-ink); font-weight: 600; }

/* Under the featured image: who wrote it and when, and the share buttons (Rio's reference) */
.b-byline { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 32px; padding-bottom: 24px; border-bottom: 1px solid var(--h-border); }
.b-byline__who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.b-byline__photo { flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.b-byline__photo--initials { display: grid; place-items: center; background: var(--h-100); color: var(--h-700); font-size: 14px; font-weight: 600; }
.b-byline__name { display: block; color: var(--h-ink); font-size: 15px; line-height: 20px; font-weight: 600; }
.b-byline__meta { margin: 2px 0 0; color: var(--h-text); font-size: 13px; line-height: 18px; }
.b-share { display: flex; align-items: center; gap: 8px; }
.b-share__copy { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border: 1px solid var(--h-border); border-radius: 8px; background: var(--h-card); color: var(--h-ink); font: inherit; font-size: 14px; line-height: 20px; font-weight: 600; cursor: pointer; transition: border-color 0.15s ease, color 0.15s ease; }
.b-share__copy.is-done { border-color: var(--h-600); color: var(--h-600); }
.b-share__icon { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--h-border); border-radius: 8px; color: var(--h-text); font-size: 15px; transition: border-color 0.15s ease, color 0.15s ease; }
@media (hover: hover) and (pointer: fine) {
    .b-byline__name:hover { color: var(--h-600); }
    .b-share__copy:hover, .b-share__icon:hover { border-color: var(--h-600); color: var(--h-600); }
}
.b-figure { margin: 0 0 32px; overflow: hidden; border-radius: 16px; background: var(--h-fill); }
.b-figure img { display: block; width: 100%; height: auto; }

.b-prose { color: var(--h-ink); font-size: 17px; line-height: 1.75; overflow-wrap: anywhere; }
.b-prose > * { margin: 0; }
.b-prose > * + * { margin-top: 1.1em; }
.b-prose :is(h2, h3, h4, h5, h6) { font-family: "IBM Plex Sans", "Geist", ui-sans-serif, system-ui, sans-serif; font-weight: 600; color: var(--h-ink); scroll-margin-top: 110px; }
.b-prose h2 { margin-top: 1.8em; font-size: 26px; line-height: 1.3; }
.b-prose h3 { margin-top: 1.5em; font-size: 21px; line-height: 1.35; }
.b-prose :is(h4, h5, h6) { margin-top: 1.4em; font-size: 18px; line-height: 1.4; }
.b-prose a { color: var(--h-600); text-decoration: underline; text-underline-offset: 3px; }
.b-prose :is(ul, ol) { padding-inline-start: 1.4em; }
.b-prose li + li { margin-top: 0.4em; }
.b-prose blockquote { margin-inline: 0; padding: 4px 0; padding-inline-start: 20px; border-inline-start: 3px solid var(--h-400); color: var(--h-text); font-style: italic; }
.b-prose img { max-width: 100%; height: auto; border-radius: 12px; }
.b-prose figure { margin-inline: 0; }
.b-prose figcaption { margin-top: 8px; color: var(--h-text); font-size: 14px; line-height: 20px; text-align: center; }
.b-prose table { display: block; width: 100%; overflow-x: auto; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
.b-prose :is(th, td) { padding: 10px 12px; border: 1px solid var(--h-border); text-align: start; vertical-align: top; }
.b-prose th { background: var(--h-fill); font-weight: 600; }
.b-prose code { padding: 2px 6px; border-radius: 6px; background: var(--h-fill); font-size: 0.9em; }
.b-prose pre { overflow-x: auto; padding: 16px; border-radius: 12px; background: var(--h-950); color: var(--h-on-dark); }
.b-prose pre code { padding: 0; background: none; }
.b-prose hr { margin: 2em 0; border: 0; border-top: 1px solid var(--h-border); }
.b-prose iframe { width: 100%; height: auto; aspect-ratio: 16 / 9; border: 0; border-radius: 12px; }

.b-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 40px 0 0; padding: 0; list-style: none; }
.b-tags a { padding: 6px 12px; border-radius: 999px; background: var(--h-fill); color: var(--h-ink); font-size: 13px; line-height: 18px; }
.b-tags a:hover { background: var(--h-100); }
.b-author { display: flex; align-items: center; gap: 16px; margin-top: 40px; padding: 20px; border: 1px solid var(--h-border); border-radius: 16px; background: var(--h-card); }
.b-author__photo { flex-shrink: 0; width: 56px; height: 56px; border-radius: 50%; object-fit: cover; }
.b-author__photo--initials { display: grid; place-items: center; background: var(--h-100); color: var(--h-700); font-weight: 600; }
.b-author__label { margin: 0; color: var(--h-text); font-size: 12px; line-height: 16px; letter-spacing: 0.08em; text-transform: uppercase; }
.b-author__label:is(:lang(ar), :lang(ur), :lang(hi), :lang(bn)) { letter-spacing: 0; }
.b-author__name { color: var(--h-ink); font-size: 17px; line-height: 24px; font-weight: 600; }
.b-author__name:hover { color: var(--h-600); }
.b-author__role { margin: 2px 0 0; color: var(--h-text); font-size: 14px; line-height: 20px; }

.b-related { padding-block: 0; }
.b-related .b-wrap { padding-top: 24px; }
.b-related__title { margin: 0 0 24px; font-family: "IBM Plex Sans", "Geist", ui-sans-serif, system-ui, sans-serif; font-size: 26px; line-height: 1.3; font-weight: 600; color: var(--h-ink); }
.b-profile__bio { max-width: 760px; margin: 0 auto 56px; }

/* An editor's preview of a draft: a pill that stays in view, out of the menu's way */
.b-preview { position: fixed; bottom: 16px; left: 50%; z-index: 50; margin: 0; padding: 10px 18px; border-radius: 999px; background: var(--h-amber); color: var(--h-950); font-size: 14px; line-height: 20px; font-weight: 600; box-shadow: var(--h-shadow-card); transform: translateX(-50%); }

@media (max-width: 1023px) {
    .b-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .b-article { grid-template-columns: minmax(0, 1fr); gap: 32px; }
    .b-toc { position: static; max-height: none; }
    .b-hero__title { font-size: 38px; }
}
@media (max-width: 639px) {
    .b-grid { grid-template-columns: minmax(0, 1fr); }
    .b-wrap { padding: 32px 16px 64px; }
    .b-article { padding: 32px 16px 48px; }
    .b-hero__title { font-size: 30px; line-height: 1.22; }
    .b-prose { font-size: 16px; }
    .b-prose h2 { font-size: 22px; }
    .b-prose h3 { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) {
    .b-card { transition: none; }
    .b-card:hover { transform: none; }
    .b-toc__chev, .b-toc details::details-content { transition: none; }
}
