/* =====================================================================
   blog.css: styles for the worker-rendered blog pages (listing, category, article, 404, preview).
   Copied by scripts/build-site.mjs to public/assets/blog.css and linked from every blog page
   after the site's own base.css / site.css / v2.css, so it reuses their tokens
   (--ink, --body, --muted, --line, --brand, --display, --sans, --header-h) and only adds what
   the static site has no component for. Tailwind's CDN preflight resets lists, links and
   heading margins, so long-form text rules below set them explicitly.
   ===================================================================== */

.blog-hero { min-height: 0; padding-bottom: 60px; }
.blog-hero .bg-img { position: absolute; inset: 0; z-index: 0; }
.blog-hero .bg-img img { width: 100%; height: 100%; object-fit: cover; object-position: center 45%; }
.blog-hero .bg-img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,17,26,.95) 0%, rgba(0,17,26,.86) 55%, rgba(0,17,26,.62) 100%); }
.blog-hero .hero-inner { position: relative; z-index: 2; }
.blog-hero p { color: rgba(255,255,255,.82); font-size: 1.125rem; margin: 0; max-width: 60ch; }
.blog-hero .eyebrow { color: #8fd3f7; margin-bottom: 22px; }
.blog-hero h1 { margin: 0 0 20px; }
.blog-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 26px; padding: 0; list-style: none; font-size: 14px; font-weight: 600; color: rgba(255,255,255,.6); }
.blog-crumbs a { color: rgba(255,255,255,.78); text-decoration: none; }
.blog-crumbs a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.blog-crumbs li + li::before { content: "/"; margin-right: 8px; opacity: .5; }
.blog-crumbs [aria-current="page"] { color: #8fd3f7; }
.blog-stats { display: flex; flex-wrap: wrap; gap: 6px 0; margin: 24px 0 0; padding: 0; list-style: none; color: rgba(255,255,255,.72); font-size: 15px; font-weight: 600; }
.blog-stats li + li::before { content: "·"; margin: 0 12px; color: rgba(255,255,255,.4); }
.blog-stats b { color: #fff; font-weight: 800; }

/* ---------- Listing ---------- */
.blog-index { padding: 48px 0 96px; background: #fff; }
.blog-toolbar { display: flex; align-items: center; gap: 20px; margin: 0 0 40px; padding: 0 0 28px; border-bottom: 1px solid var(--line); }
.blog-toolbar-label { flex-shrink: 0; display: flex; align-items: center; gap: 14px; font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: #006b9e; }
.blog-toolbar-label::after { content: ""; flex: 0 0 32px; height: 1px; background: currentColor; opacity: .5; }
.blog-filter { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.blog-chip { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border: 1px solid #c9d6de; border-radius: 6px; background: #fff; color: #2f4552; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; text-decoration: none; transition: border-color .2s, color .2s, background .2s; }
.blog-chip:hover { border-color: var(--brand); color: var(--brand-dark, #004d73); }
.blog-chip[aria-current="page"] { background: var(--brand-darkest, #00111a); border-color: var(--brand-darkest, #00111a); color: #fff; }
.blog-chip .count { font-weight: 700; opacity: .6; }
.blog-chip:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

.blog-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.blog-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.blog-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-media, 6px); overflow: hidden; transition: box-shadow .25s, transform .25s, border-color .25s; position: relative; }
.blog-card:hover { box-shadow: 0 18px 40px rgba(15,29,38,.10); transform: translateY(-3px); border-color: #c9d6de; }
.blog-card .media { aspect-ratio: 16 / 10; background: var(--lightBg, #f3f5f6); overflow: hidden; }
.blog-card .media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.blog-card:hover .media img { transform: scale(1.04); }
.blog-card .media.placeholder { display: flex; align-items: center; justify-content: center; color: var(--brand); font-size: 40px; background: #e6f4fa; }
.blog-card .body { display: flex; flex-direction: column; gap: 12px; flex: 1; padding: 26px 28px 24px; }
.blog-card .cat { align-self: flex-start; font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #006b9e; }
.blog-card h2 { font-family: var(--display); font-weight: 400; font-size: 1.6rem; line-height: 1.15; margin: 0; color: var(--ink); text-wrap: balance; }
.blog-card h2 a { color: inherit; text-decoration: none; }
.blog-card h2 a::after { content: ""; position: absolute; inset: 0; }
.blog-card:hover h2 a { color: var(--brand-dark, #004d73); }
.blog-card p { margin: 0; color: var(--body); font-size: 15px; line-height: 1.6; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.blog-card .more { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 14px; font-weight: 700; color: var(--brand-dark, #004d73); }
.blog-card .body > p { margin-bottom: 8px; }
.blog-card .more .read { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-weight: 600; }
.blog-card .more .go { display: inline-flex; align-items: center; font-size: 14px; }
.blog-card .more .go i { transition: transform .2s; margin-left: 8px; }
.blog-card:hover .more .go i { transform: translateX(4px); }
.blog-card a:focus-visible { outline: none; }
.blog-card:focus-within { outline: 3px solid var(--brand); outline-offset: 3px; }

/* First card of the first page: wide, image beside the text. */
.blog-grid.has-lead > .blog-card:first-child { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.blog-grid.has-lead > .blog-card:first-child .media { position: relative; aspect-ratio: auto; min-height: 400px; }
.blog-grid.has-lead > .blog-card:first-child .media img { position: absolute; inset: 0; }
.blog-grid.has-lead > .blog-card:first-child .body { justify-content: center; gap: 16px; padding: 44px 44px 40px; }
.blog-grid.has-lead > .blog-card:first-child h2 { font-size: clamp(1.75rem, 2.4vw, 2.15rem); line-height: 1.1; }
.blog-grid.has-lead > .blog-card:first-child p { font-size: 1.05rem; line-height: 1.65; -webkit-line-clamp: 4; }
.blog-grid.has-lead > .blog-card:first-child .more { margin-top: 12px; }

.blog-empty { max-width: 720px; margin: 0 auto; border: 1px solid var(--line); border-radius: 6px; background: #fff; padding: 56px 40px; text-align: center; }
.blog-empty .icon { display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 64px; margin-bottom: 20px; border-radius: 50%; background: #e6f4fa; color: var(--brand-dark, #004d73); font-size: 26px; }
.blog-empty h2 { font-size: clamp(1.8rem, 3vw, 2.2rem); margin: 0 0 12px; }
.blog-empty p { margin: 0 auto 28px; max-width: 46ch; }
.blog-empty .actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.blog-empty .actions a { min-width: 210px; }
.blog-pager { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 48px; font-weight: 700; }
.blog-pager a, .blog-pager span { display: inline-flex; min-width: 44px; height: 44px; align-items: center; justify-content: center; padding: 0 14px; border: 1px solid #c9d6de; border-radius: 6px; color: var(--ink); text-decoration: none; background: #fff; }
.blog-pager a:hover { border-color: var(--brand); }
.blog-pager [aria-current="page"] { background: var(--brand-darkest, #00111a); border-color: var(--brand-darkest, #00111a); color: #fff; }

/* ---------- Article ---------- */
.post-head { padding: calc(var(--header-h) + 56px) 0 40px; background: var(--paper, #f7f7f5); border-bottom: 1px solid var(--line); }
.post-wrap { max-width: 860px; margin: 0 auto; padding: 0 16px; }
.post-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 22px; padding: 0; list-style: none; font-size: 14px; color: var(--muted); }
.post-crumbs a { color: var(--muted); text-decoration: none; font-weight: 600; }
.post-crumbs a:hover { color: var(--brand); }
.post-crumbs li + li::before { content: "/"; margin-right: 8px; opacity: .5; }
.post-cat { display: inline-flex; padding: 6px 12px; border-radius: 999px; background: #e6f4fa; color: #004d73; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; text-decoration: none; margin-bottom: 18px; }
.post-cat:hover { background: #d3ecf8; }
.post-head h1 { font-size: clamp(2.3rem, 4.6vw, 3.7rem); line-height: 1.08; margin: 0 0 20px; color: var(--ink); }
.post-lead { font-size: 1.2rem; line-height: 1.65; color: var(--body); margin: 0 0 22px; max-width: none; font-weight: 500; }
.post-meta { display: flex; flex-wrap: wrap; gap: 18px; color: var(--muted); font-size: 14px; font-weight: 600; }
.post-meta i { color: var(--brand); margin-right: 6px; }
.post-cover { max-width: 1120px; margin: 40px auto 0; padding: 0 16px; }
.post-cover img { width: 100%; max-height: 600px; object-fit: cover; border-radius: var(--radius-media, 6px); background: var(--lightBg, #f3f5f6); }
.post-cover figcaption { margin-top: 10px; font-size: 14px; color: var(--muted); text-align: center; }
.post-main { padding: 48px 0 80px; }

.post-body { max-width: 720px; margin: 0 auto; padding: 0 16px; font-size: 1.125rem; line-height: 1.78; color: var(--body); overflow-wrap: break-word; }
.post-body > :first-child { margin-top: 0; }
.post-body p { margin: 0 0 1.3em; max-width: none; }
.post-body h2 { font-family: var(--display); font-weight: 400; font-size: clamp(1.75rem, 3vw, 2.25rem); line-height: 1.15; color: var(--ink); margin: 2.1em 0 .7em; }
.post-body h3 { font-family: var(--sans); font-weight: 800; font-size: 1.32rem; line-height: 1.35; color: var(--ink); margin: 1.9em 0 .6em; }
.post-body h4 { font-family: var(--sans); font-weight: 800; font-size: 1.1rem; line-height: 1.4; color: var(--ink); margin: 1.7em 0 .5em; }
.post-body strong { color: var(--ink); font-weight: 800; }
.post-body a { color: #004d73; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; overflow-wrap: anywhere; }
.post-body a:hover { color: var(--brand); }
.post-body ul, .post-body ol { margin: 0 0 1.4em; padding-left: 1.4em; }
.post-body ul { list-style: disc; }
.post-body ol { list-style: decimal; }
.post-body li { margin: 0 0 .55em; padding-left: .25em; }
.post-body li::marker { color: var(--brand); font-weight: 700; }
.post-body blockquote { margin: 2em 0; padding: 4px 0 4px 24px; border-left: 3px solid var(--brand); font-family: var(--display); font-size: 1.4rem; line-height: 1.45; color: var(--ink); }
.post-body blockquote p { margin: 0 0 .5em; }
.post-body hr { border: 0; border-top: 1px solid var(--line); margin: 2.6em 0; }
.post-body figure { margin: 2.2em 0; }
.post-body img { border-radius: var(--radius-media, 6px); }
.post-body figcaption { margin-top: 10px; font-size: 15px; color: var(--muted); text-align: center; }

.post-cta { max-width: 720px; margin: 56px auto 0; padding: 0 16px; }
.post-cta .box { display: flex; gap: 24px; align-items: center; justify-content: space-between; padding: 32px; border-radius: 6px; background: var(--brand-darkest, #00111a); color: #fff; }
.post-cta h2 { color: #fff; font-size: 1.8rem; margin: 0 0 8px; }
.post-cta p { color: rgba(255,255,255,.75); margin: 0; font-size: 1rem; }
.post-cta .actions { display: flex; flex-direction: column; gap: 10px; flex-shrink: 0; }

.post-related { padding: 80px 0 96px; background: var(--lightBg, #f3f5f6); border-top: 1px solid var(--line); }
.post-related .head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 36px; }
.post-related .head h2 { margin: 0; }
.post-related .head a { font-weight: 700; color: #004d73; text-decoration: none; white-space: nowrap; }

.blog-404 { padding: calc(var(--header-h) + 80px) 0 96px; text-align: center; }
.blog-404 h1 { margin: 0 0 16px; }
.blog-404 p { margin: 0 auto 28px; }

.blog-preview-bar { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 90; display: flex; gap: 14px; align-items: center; padding: 12px 18px; border-radius: 6px; background: #1a1a1a; color: #fff; font-size: 14px; font-weight: 700; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.blog-preview-bar a { color: #8fd3f7; text-decoration: underline; }

@media (max-width: 1023px) {
  .blog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
  .blog-grid.has-lead > .blog-card:first-child { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .blog-grid.has-lead > .blog-card:first-child .media { min-height: 320px; }
  .blog-grid.has-lead > .blog-card:first-child .body { padding: 36px 32px 32px; }
}
@media (max-width: 768px) {
  .blog-index { padding: 32px 0 64px; }
  .blog-toolbar { flex-direction: column; align-items: flex-start; gap: 14px; margin-bottom: 28px; padding-bottom: 24px; }
  .blog-filter { gap: 8px; }
  .blog-chip { padding: 9px 13px; font-size: 12.5px; }
  .blog-grid.has-lead > .blog-card:first-child { display: flex; }
  .blog-grid.has-lead > .blog-card:first-child .media { aspect-ratio: 16 / 10; min-height: 0; }
  .blog-grid.has-lead > .blog-card:first-child .body { padding: 26px 24px 24px; }
  .blog-hero { padding-top: calc(var(--header-h) + 28px); padding-bottom: 40px; }
  .blog-hero p { font-size: 1.0625rem; }
  .blog-stats { margin-top: 18px; font-size: 14px; }
  .blog-crumbs { margin-bottom: 16px; }
  .post-head { padding: calc(var(--header-h) + 32px) 0 28px; }
  .post-lead { font-size: 1.08rem; }
  .post-cover { margin-top: 24px; }
  .post-main { padding: 36px 0 56px; }
  .post-body { font-size: 1.0625rem; line-height: 1.75; }
  .post-cta .box { flex-direction: column; align-items: stretch; padding: 26px 22px; }
  .post-related { padding: 56px 0 64px; }
  .post-related .head { flex-direction: column; align-items: start; gap: 8px; }
}
@media (max-width: 640px) {
  .blog-hero h1 { font-size: 2.25rem; margin-bottom: 14px; }
  .blog-toolbar-label { display: none; }
  .blog-grid, .blog-grid.cols-2 { grid-template-columns: 1fr; }
  .blog-card .body { padding: 22px; }
  .blog-grid.has-lead > .blog-card:first-child .body { padding: 22px; }
  .blog-grid.has-lead > .blog-card:first-child h2 { font-size: 1.75rem; }
  .blog-empty { padding: 40px 22px; }
  .blog-preview-bar { left: 12px; right: 12px; transform: none; bottom: 12px; flex-wrap: wrap; }
}
