/* ==========================================================================
   Blog — index (blog.html) + posts (blog/*.html). Prefix blog-
   ========================================================================== */

/* ---------- Reading progress ---------- */
.blog-progress { position: fixed; left: 0; right: 0; top: 0; height: 3px; z-index: 70; pointer-events: none; }
.blog-progress span { display: block; height: 100%; background: var(--green-500); transform-origin: 0 50%; transform: scaleX(0); }

/* ---------- Post hero ---------- */
.blog-hero { padding-bottom: clamp(120px, 14vw, 190px); }
.blog-hero .container { max-width: calc(980px + var(--gutter) * 2); }
.blog-hero__cat { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.blog-hero__cat .chip { background: #fff; border: 1px solid var(--line); }
.blog-hero__title { font-size: clamp(2rem, 4.4vw, 3.4rem); line-height: 1.08; max-width: 22ch; }
.blog-hero .lead { max-width: 68ch; }
.blog-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; margin-top: 28px; font-size: .9rem; color: var(--muted); }
.blog-meta__author { display: inline-flex; align-items: center; gap: 12px; }
.blog-meta__avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--navy-800); color: #fff; font-family: var(--font-head); font-weight: 800; font-size: .9rem; flex: none; }
.blog-meta__author strong { display: block; color: var(--ink); font-family: var(--font-head); font-size: .98rem; line-height: 1.25; }
.blog-meta__item { display: inline-flex; align-items: center; gap: 7px; }
.blog-meta__item .icon { width: 16px; height: 16px; color: var(--green-600); }

/* ---------- Cover image (overlaps hero) ---------- */
.blog-cover { position: relative; z-index: 2; margin-top: clamp(-170px, -12vw, -100px); }
.blog-cover .container { max-width: calc(1100px + var(--gutter) * 2); }
.blog-cover figure { margin: 0; border-radius: 20px; overflow: hidden; aspect-ratio: 16 / 8; background: var(--ice-2); box-shadow: var(--shadow-l); }
.blog-cover img { width: 100%; height: 100%; object-fit: cover; }
.blog-cover figcaption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Layout ---------- */
.blog-body { padding-top: clamp(40px, 6vw, 72px); }
.blog-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: clamp(32px, 5vw, 72px); align-items: start; max-width: 1180px; margin-inline: auto; }
@media (max-width: 1024px) { .blog-layout { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Article typography ---------- */
.blog-article { font-size: 1.075rem; line-height: 1.8; color: var(--ink-2); max-width: 760px; min-width: 0; }
.blog-article > p:first-of-type { font-size: 1.16rem; color: var(--ink); }
.blog-article h2 { font-size: clamp(1.5rem, 2.4vw, 2rem); line-height: 1.18; margin: 2.2em 0 .6em; scroll-margin-top: calc(var(--header-h) + 24px); }
.blog-article h3 { font-size: clamp(1.15rem, 1.6vw, 1.32rem); line-height: 1.3; margin: 1.8em 0 .5em; }
.blog-article h2 + h3 { margin-top: .8em; }
.blog-article p + p { margin-top: 1.1em; }
.blog-article ul:not([class]), .blog-article ol:not([class]) { padding-left: 1.3em; margin: 1em 0; }
.blog-article ul:not([class]) li::marker { color: var(--green-600); }
.blog-article ol:not([class]) li::marker { color: var(--green-600); font-family: var(--font-head); font-weight: 800; }
.blog-article li + li { margin-top: .5em; }
.blog-article a:not(.btn) { color: var(--green-700); font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.blog-article a:not(.btn):hover { color: var(--green-600); text-decoration-thickness: 2px; }
.blog-article strong { color: var(--ink); }
.blog-article .check-list { margin: 1.1em 0; }
.blog-article figure { margin: 2em 0; }
.blog-article figure img { border-radius: var(--radius-l); width: 100%; }
.blog-article figcaption { margin-top: 10px; font-size: .86rem; color: var(--muted); }

/* Key takeaways */
.blog-tldr { margin: 0 0 2.2em; padding: clamp(22px, 3vw, 30px); background: var(--ice); border: 1px solid var(--ice-2); border-left: 4px solid var(--green-600); border-radius: var(--radius-l); }
.blog-tldr h2 { margin: 0 0 14px; font-size: 1.15rem; display: flex; align-items: center; gap: 10px; }
.blog-tldr h2 .icon { width: 22px; height: 22px; color: var(--green-600); }
.blog-tldr .check-list { margin: 0; font-size: 1rem; }

/* Callouts */
.blog-callout { display: flex; gap: 16px; align-items: flex-start; margin: 1.8em 0; padding: 20px 22px; border-radius: var(--radius-l); background: var(--green-tint); border: 1px solid var(--green-tint-2); font-size: 1rem; line-height: 1.65; }
.blog-callout .icon-badge { background: #fff; }
.blog-callout strong { display: block; font-family: var(--font-head); margin-bottom: 2px; }
.blog-callout--warn { background: #fff7e8; border-color: #f6e2b6; }
.blog-callout--warn .icon-badge { color: #b26b00; }
.blog-callout--warn strong { color: #6b4300; }
.blog-callout p + p { margin-top: .5em; }

/* Tables */
.blog-table-wrap { margin: 1.8em 0; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-l); -webkit-overflow-scrolling: touch; }
.blog-table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: .95rem; line-height: 1.5; }
.blog-table th, .blog-table td { padding: 13px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.blog-table thead th { background: var(--gray-50); font-family: var(--font-head); color: var(--ink); font-size: .9rem; }
.blog-table tbody tr:last-child td, .blog-table tbody tr:last-child th { border-bottom: 0; }
.blog-table tbody th { color: var(--ink); font-weight: 600; }

/* Inline CTA (navy accent inside article) */
.blog-cta { position: relative; overflow: hidden; margin: 2.4em 0; padding: clamp(24px, 3.4vw, 36px); border-radius: 18px; background: var(--navy-900); color: var(--muted-dark); isolation: isolate; }
.blog-cta::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px); background-size: 40px 40px; mask-image: linear-gradient(90deg, transparent, #000 70%); -webkit-mask-image: linear-gradient(90deg, transparent, #000 70%); }
.blog-cta__eyebrow { font-family: var(--font-mono); font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--green); }
.blog-article .blog-cta h3, .blog-cta h3 { margin: 8px 0 8px; color: #fff; font-size: clamp(1.25rem, 2vw, 1.55rem); }
.blog-cta p { font-size: 1rem; line-height: 1.6; max-width: 56ch; }
.blog-cta .btn-row { margin-top: 20px; }

/* FAQ inside article */
.blog-faq { margin-top: 2.4em; }
.blog-faq .acc { margin-top: 12px; }
.blog-article .blog-faq h3 { margin: 0; font-size: inherit; }
.blog-faq .acc-panel__inner { font-size: 1rem; line-height: 1.7; }

/* Author / reviewed box */
.blog-author { display: flex; gap: 18px; align-items: flex-start; margin-top: 3em; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius-l); background: var(--gray-50); font-size: .96rem; line-height: 1.6; }
.blog-author .blog-meta__avatar { width: 56px; height: 56px; font-size: 1.05rem; }
.blog-author strong { display: block; font-family: var(--font-head); color: var(--ink); font-size: 1.05rem; }
.blog-author p { margin-top: 6px; color: var(--muted); }

/* ---------- Sidebar ---------- */
.blog-side { position: sticky; top: calc(var(--header-h) + 24px); display: grid; gap: 18px; }
@media (max-width: 1024px) { .blog-side { position: static; grid-row: 1; } .blog-side .blog-side-cta { display: none; } }
.blog-toc { padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-l); font-size: .9rem; }
.blog-toc summary { list-style: none; cursor: pointer; }
.blog-toc summary::-webkit-details-marker { display: none; }
.blog-toc summary strong { display: flex; align-items: center; gap: 8px; font-family: var(--font-head); color: var(--ink); font-size: .98rem; margin-bottom: 10px; }
.blog-toc summary strong .icon { width: 18px; height: 18px; color: var(--green-600); }
.blog-toc summary strong::after { content: ""; margin-left: auto; width: 9px; height: 9px; border-right: 2px solid var(--green-600); border-bottom: 2px solid var(--green-600); transform: rotate(45deg) translateY(-3px); transition: transform .25s; }
.blog-toc details[open] summary strong::after { transform: rotate(-135deg) translateY(-2px); }
.blog-toc ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; counter-reset: toc; }
.blog-toc li { counter-increment: toc; }
.blog-toc a { display: grid; grid-template-columns: 26px 1fr; gap: 4px; padding: 7px 8px; border-radius: 8px; color: var(--muted); line-height: 1.4; transition: background .2s, color .2s; }
.blog-toc a::before { content: counter(toc, decimal-leading-zero); font-family: var(--font-mono); font-size: .74rem; color: var(--line-strong); padding-top: 2px; transition: color .2s; }
.blog-toc a:hover { background: var(--gray-50); color: var(--ink); }
.blog-toc a.is-active { background: var(--green-tint); color: var(--green-700); font-weight: 600; }
.blog-toc a.is-active::before { color: var(--green-600); }
@media (max-width: 1024px) {
  .blog-toc { padding: 16px 18px; }
  .blog-toc details:not([open]) summary strong { margin: 0; }
}
.blog-side-cta { padding: 24px; border-radius: var(--radius-l); background: var(--ice); border: 1px solid var(--ice-2); }
.blog-side-cta .icon-badge { background: #fff; }
.blog-side-cta h2 { margin-top: 16px; font-size: 1.2rem; line-height: 1.25; }
.blog-side-cta p { margin-top: 8px; font-size: .92rem; color: var(--muted); line-height: 1.55; }
.blog-side-cta .btn { margin-top: 16px; }
.blog-side-cta .call-cta { margin-top: 16px; }
.blog-side-cta ul { margin-top: 14px; display: grid; gap: 6px; font-size: .86rem; }
.blog-side-cta li { display: flex; gap: 8px; align-items: center; color: var(--ink-2); }
.blog-side-cta li .icon { width: 16px; height: 16px; color: var(--green-600); }

/* ---------- Blog cards (index + related) ---------- */
.blog-card { display: flex; flex-direction: column; height: 100%; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-l); overflow: hidden; transition: box-shadow .3s var(--ease), transform .3s var(--ease), border-color .3s; }
.blog-card:hover { box-shadow: var(--shadow-l); transform: translateY(-5px); border-color: transparent; }
.blog-card__media { display: block; position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--ice); }
.blog-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.blog-card:hover .blog-card__media img { transform: scale(1.05); }
.blog-card__cat { position: absolute; left: 12px; top: 12px; padding: 5px 11px; border-radius: 999px; background: rgba(255, 255, 255, .94); color: var(--green-700); font-size: .74rem; font-weight: 700; letter-spacing: .02em; }
.blog-card__body { display: flex; flex-direction: column; flex: 1; padding: 22px 22px 20px; }
.blog-card__body h3 { font-size: 1.16rem; line-height: 1.3; }
.blog-card:hover h3 { color: var(--green-700); }
.blog-card__body p { margin-top: 10px; font-size: .93rem; color: var(--muted); line-height: 1.6; }
.blog-card__meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: auto; padding-top: 18px; font-family: var(--font-mono); font-size: .74rem; letter-spacing: .04em; color: var(--muted); }
.blog-card__meta .link-arrow { font-family: var(--font-head); font-size: .88rem; letter-spacing: 0; }

/* Related */
.blog-related .grid-3 { margin-top: 8px; }

/* End CTA (light) */
.blog-endcta__box { display: grid; grid-template-columns: minmax(0, 1.3fr) auto; gap: 28px 48px; align-items: center; padding: clamp(28px, 4.4vw, 56px); border-radius: 22px; background: var(--ice); border: 1px solid var(--ice-2); position: relative; overflow: hidden; }
.blog-endcta__box::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(12, 27, 86, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(12, 27, 86, .05) 1px, transparent 1px); background-size: 44px 44px; mask-image: linear-gradient(90deg, transparent 30%, #000); -webkit-mask-image: linear-gradient(90deg, transparent 30%, #000); pointer-events: none; }
.blog-endcta__box > * { position: relative; }
.blog-endcta__box .lead { margin-top: 12px; }
.blog-endcta__actions { display: grid; gap: 12px; min-width: 250px; }
@media (max-width: 860px) { .blog-endcta__box { grid-template-columns: 1fr; } .blog-endcta__actions { min-width: 0; } }

/* ==========================================================================
   Blog index (blog.html)
   ========================================================================== */
.blog-index-hero .page-hero__grid { align-items: end; }
.blog-index-hero__topics { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.blog-index-hero__topics .chip { background: #fff; border: 1px solid var(--line); }
.blog-index-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-l); box-shadow: var(--shadow); overflow: hidden; }
.blog-index-stats > div { padding: 22px 20px; }
.blog-index-stats > div + div { border-left: 1px solid var(--line); }
.blog-index-stats strong { display: block; font-family: var(--font-head); font-size: 1.9rem; font-weight: 800; color: var(--ink); line-height: 1; }
.blog-index-stats span { display: block; margin-top: 8px; font-size: .86rem; color: var(--muted); line-height: 1.4; }
@media (max-width: 480px) { .blog-index-stats { grid-template-columns: 1fr; } .blog-index-stats > div + div { border-left: 0; border-top: 1px solid var(--line); } }

.blog-featured { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); background: #fff; border: 1px solid var(--line); border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); transition: box-shadow .3s var(--ease), transform .3s var(--ease); }
.blog-featured:hover { box-shadow: var(--shadow-l); transform: translateY(-4px); }
.blog-featured__media { position: relative; min-height: 340px; background: var(--ice); overflow: hidden; }
.blog-featured__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.blog-featured:hover .blog-featured__media img { transform: scale(1.04); }
.blog-featured__body { display: flex; flex-direction: column; justify-content: center; padding: clamp(26px, 4vw, 52px); }
.blog-featured__body .h2 { font-size: clamp(1.6rem, 2.8vw, 2.3rem); margin-top: 14px; }
.blog-featured:hover .h2 { color: var(--green-700); }
.blog-featured__body p { margin-top: 14px; color: var(--muted); }
.blog-featured__body .link-arrow { margin-top: 24px; }
@media (max-width: 860px) { .blog-featured { grid-template-columns: 1fr; } .blog-featured__media { min-height: 0; aspect-ratio: 16 / 10; } }

.blog-filter { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin: clamp(40px, 5vw, 64px) 0 28px; }
.blog-filter__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.blog-filter__chips button { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border: 1.5px solid var(--line-strong); border-radius: 999px; background: #fff; font-weight: 600; font-size: .9rem; color: var(--ink-2); transition: all .2s; }
.blog-filter__chips button .icon { width: 16px; height: 16px; color: var(--green-600); }
.blog-filter__chips button:hover { border-color: var(--green-600); color: var(--green-700); }
.blog-filter__chips button[aria-pressed="true"] { background: var(--green-600); border-color: var(--green-600); color: #fff; }
.blog-filter__chips button[aria-pressed="true"] .icon { color: #fff; }
.blog-filter__count { font-family: var(--font-mono); font-size: .8rem; color: var(--muted); }
.blog-grid [hidden] { display: none; }
.blog-grid > .is-hidden { display: none; }

/* Topic hubs */
.blog-hubs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.blog-hub { padding: 24px; border-radius: var(--radius-l); border: 1px solid var(--line); background: #fff; }
.blog-hub h3 { margin-top: 16px; font-size: 1.1rem; }
.blog-hub ul { list-style: none; padding: 0; margin-top: 12px; display: grid; gap: 8px; font-size: .9rem; }
.blog-hub a { color: var(--ink-2); }
.blog-hub a:hover { color: var(--green-700); }
.blog-hub .link-arrow { margin-top: 16px; font-size: .9rem; }
@media (max-width: 1024px) { .blog-hubs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .blog-hubs { grid-template-columns: 1fr; } }
