/* Blog index and posts. Loads after styles.css and pages.css. */

/* ---------- shared ---------- */
.bmeta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin: 0; font-family: var(--ui); font-size: .84rem; color: var(--muted); }
.bmeta li { display: inline-flex; align-items: center; gap: 6px; }
.bmeta svg { width: 15px; height: 15px; color: var(--teal-ink); }
.cat { display: inline-block; font-family: var(--display); font-weight: 800; font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; padding: 5px 11px; border-radius: 50px; background: var(--teal-tint); color: var(--teal-ink); }

/* ---------- index ---------- */
.blog-hero { padding-bottom: clamp(110px, 14vw, 170px); }
.blog-hero .lead { max-width: 56ch; }
.blog-main { padding-top: 0; }
.featured { position: relative; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); margin-top: clamp(-130px, -10vw, -80px); background: #fff; border: 1px solid var(--line); border-radius: 28px; box-shadow: var(--shadow-lg); overflow: hidden; text-decoration: none; color: var(--ink); transition: transform .2s ease, border-color .2s ease; }
.featured:hover { transform: translateY(-4px); border-color: var(--teal); color: var(--ink); }
.featured img { width: 100%; height: 100%; object-fit: cover; background: var(--navy); }
.featured-body { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: clamp(24px, 3.4vw, 44px); }
.featured-flag { font-family: var(--ui); font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.featured h2 { font-size: clamp(1.6rem, 2.6vw, 2.2rem); margin: 0; }
.featured p { margin: 0; color: var(--muted); }
.featured .link-arrow { margin-top: auto; padding-top: 8px; }
.blog-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; margin: clamp(48px, 7vw, 84px) 0 26px; }
.blog-head h2 { margin: 0; }
.blog-head .chips { margin: 0; }
.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.bcard { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 22px; overflow: hidden; box-shadow: var(--shadow); text-decoration: none; color: var(--ink); transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.bcard:hover { transform: translateY(-4px); border-color: var(--teal); box-shadow: var(--shadow-lg); color: var(--ink); }
.bcard img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--navy); }
.bcard-body { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 20px 22px 22px; flex: 1; }
.bcard h3 { font-size: 1.25rem; margin: 0; }
.bcard p { margin: 0; font-size: 1rem; line-height: 1.5; color: var(--muted); }
.bcard .bmeta { margin-top: auto; padding-top: 6px; font-size: .78rem; }
.post-soon { display: grid; place-content: center; gap: 8px; text-align: center; padding: 28px; border: 2px dashed #c6d3de; border-radius: 22px; font-family: var(--ui); color: var(--muted); min-height: 220px; }
.post-soon strong { font: 800 1.1rem var(--display); color: var(--navy); }
.post-soon span { font-size: .88rem; }

/* ---------- post header ---------- */
.post-hero { padding-bottom: clamp(120px, 17vw, 240px); }
.post-hero .wrap { max-width: 900px; }
.post-hero h1 { font-size: clamp(2.1rem, 4.6vw, 3.5rem); margin: 16px 0 14px; }
.post-hero .lead { max-width: none; }
.post-hero .bmeta { margin-top: 22px; color: #c9dbe8; }
.post-hero .bmeta svg { color: var(--aqua); }
.post-hero .cat { background: rgb(135 209 214 / 14%); color: var(--aqua); box-shadow: inset 0 0 0 1px rgb(135 209 214 / 28%); }
.post-cover { position: relative; z-index: 1; width: min(100% - 40px, 1040px); margin: clamp(-200px, -14vw, -90px) auto 0; }
.post-cover img { width: 100%; border-radius: 28px; box-shadow: 0 0 0 8px rgb(135 209 214 / 14%), var(--shadow-lg); background: var(--navy); }
.post-cover figcaption { margin-top: 12px; text-align: center; font-family: var(--ui); font-size: .8rem; color: var(--muted); }

/* ---------- post layout ---------- */
.post-wrap { padding: clamp(36px, 5vw, 64px) 0 var(--pad); }
.post-layout { display: grid; grid-template-columns: 230px minmax(0, 720px); justify-content: center; gap: clamp(28px, 5vw, 72px); }
.toc { position: sticky; top: 112px; align-self: start; font-family: var(--ui); }
.toc p { margin: 0 0 10px; font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.toc ol { display: grid; gap: 2px; border-left: 2px solid var(--line); }
.toc a { display: block; margin-left: -2px; padding: 6px 0 6px 14px; border-left: 2px solid transparent; font-size: .86rem; line-height: 1.35; color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--navy); border-left-color: var(--teal); }
.toc .btn { margin-top: 20px; width: 100%; justify-content: center; }

/* ---------- article typography ---------- */
.prose { font-size: 1.09rem; line-height: 1.75; }
.prose > * + * { margin-top: 1.15em; }
.prose h2 { font-size: clamp(1.6rem, 2.6vw, 2rem); margin-top: 1.9em; scroll-margin-top: 110px; }
.prose h3 { font-size: 1.3rem; margin-top: 1.6em; }
.prose p { margin-bottom: 0; }
.prose a { color: var(--teal-ink); font-weight: 600; text-underline-offset: 3px; }
.prose a:hover { color: var(--navy); }
.prose strong { color: var(--navy); }
.prose ul, .prose ol { display: grid; gap: .5em; padding-left: 1.3em; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li::marker { color: var(--teal); font-weight: 700; }
.prose blockquote { margin-inline: 0; padding: 4px 0 4px 22px; border-left: 4px solid var(--teal); font-size: 1.3rem; line-height: 1.5; color: var(--navy); font-style: italic; }
.prose figure { margin-inline: 0; }
.prose figure img, .prose figure svg { width: 100%; height: auto; border-radius: 18px; }
.prose figcaption { margin-top: 10px; font-family: var(--ui); font-size: .82rem; line-height: 1.45; color: var(--muted); text-align: center; }
.prose code { font: 600 .86em ui-monospace, "SF Mono", Menlo, Consolas, monospace; padding: 2px 7px; border-radius: 7px; background: var(--teal-tint); color: var(--teal-ink); }
.prose hr { border: 0; height: 1px; background: var(--line); margin: 2.2em 0; }

.takeaways { padding: 22px 24px; border-radius: 20px; background: var(--mist); border: 1px solid var(--line); font-family: var(--ui); font-size: .98rem; line-height: 1.55; }
.takeaways h2 { margin: 0 0 10px; font: 800 .74rem var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--teal-ink); }
.takeaways ul { margin: 0; }
.callout { display: grid; grid-template-columns: auto 1fr; gap: 14px; padding: 18px 20px; border-radius: 18px; background: #eefaf5; border: 1px solid #bfe8d4; font-family: var(--ui); font-size: .98rem; line-height: 1.55; }
.callout svg { width: 22px; height: 22px; margin-top: 2px; color: #1f8d62; }
.callout p { margin: 0; }
.callout-warn { background: #fdf6e7; border-color: #f1d9a0; }
.callout-warn svg { color: #9a6a0b; }

.formula { display: grid; grid-template-columns: auto 1fr; gap: 6px 20px; align-items: center; padding: 20px 22px; border-radius: 20px; background: var(--navy) url("/assets/img/map-lines.svg") 80% 30% / 420px; background-blend-mode: soft-light; color: #c9dbe8; font-family: var(--ui); }
.formula b { grid-row: span 2; font: 800 clamp(2.2rem, 5vw, 3rem)/1 var(--display); color: #fff; font-variant-numeric: tabular-nums; }
.formula strong { color: var(--aqua); font: 800 .74rem var(--display); letter-spacing: .12em; text-transform: uppercase; align-self: end; }
.formula span { font-size: .95rem; line-height: 1.45; align-self: start; }

.prose table { width: 100%; border-collapse: collapse; font-family: var(--ui); font-size: .92rem; line-height: 1.45; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; display: table; }
.prose th { text-align: left; padding: 12px 14px; background: var(--navy); color: #fff; font: 800 .82rem var(--display); letter-spacing: .04em; }
.prose td { padding: 12px 14px; border-top: 1px solid var(--line); vertical-align: top; }
.prose tr:nth-child(even) td { background: var(--mist); }
.table-scroll { overflow-x: auto; }

.grid-fig { background: var(--navy); border-radius: 18px; padding: 14px; }
.grid-fig svg { border-radius: 0; display: block; max-width: 420px; margin-inline: auto; }

.prose .faq-list { margin-top: 1.2em; }
.prose .faq-list details p { font-size: 1.02rem; }

/* ---------- post footer ---------- */
.byline { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; margin-top: 2.6em; padding: 20px 22px; border-radius: 20px; border: 1px solid var(--line); font-family: var(--ui); font-size: .92rem; line-height: 1.5; color: var(--muted); }
.byline img { width: 56px; height: 56px; padding: 8px; border-radius: 50%; background: var(--mist); }
.byline strong { display: block; font: 800 1.05rem var(--display); color: var(--navy); }
.post-cta { margin-top: 1.6em; display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center; padding: 26px 28px; border-radius: 24px; background: var(--navy) url("/assets/img/map-lines.svg") 80% 30% / 420px; background-blend-mode: soft-light; color: #c9dbe8; font-family: var(--ui); }
.post-cta strong { display: block; font: 800 1.4rem/1.25 var(--display); color: #fff; margin-bottom: 4px; }
.post-cta p { margin: 0; font-size: .95rem; }
.more-posts { background: var(--mist); }

@media (max-width: 1000px) {
  .post-layout { grid-template-columns: minmax(0, 720px); }
  .toc { position: static; padding: 18px 20px; border: 1px solid var(--line); border-radius: 18px; }
  .toc .btn { display: none; }
  .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .featured { grid-template-columns: minmax(0, 1fr); }
  .featured img { aspect-ratio: 16 / 9; }
  .post-grid { grid-template-columns: minmax(0, 1fr); }
  .post-cta { grid-template-columns: minmax(0, 1fr); }
  .prose { font-size: 1.03rem; }
  .post-cover img { border-radius: 18px; }
  .formula { grid-template-columns: minmax(0, 1fr); }
  .formula b { grid-row: auto; }
}
.grid-fig figcaption { color: #a9c2d6; }
.prose .faq-list > * + * { margin-top: 10px; }

/* ---------- video covers and posts without a table of contents ---------- */
.post-cover video, .post-cover iframe { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border: 0; border-radius: 28px; background: var(--navy); box-shadow: 0 0 0 8px rgb(135 209 214 / 14%), var(--shadow-lg); }
.post-layout.no-toc { grid-template-columns: minmax(0, 720px); }
.prose > :first-child { margin-top: 0; }
.prose h4 { font-size: 1.12rem; margin-top: 1.4em; }
.prose figure img { box-shadow: var(--shadow); }
@media (max-width: 760px) { .post-cover video, .post-cover iframe { border-radius: 18px; } }
