/* ==========================================================================
   4GSS blog — list + article pages (rendered by src/worker.js)
   ========================================================================== */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

#blog-main { --b-ink: #0f172a; --b-muted: #475569; --b-line: rgba(15, 23, 42, .09); --b-card: #fff; --b-soft: #f1f6fb; --b-accent: var(--navy, #0369a1); --b-accent-soft: rgba(3, 105, 161, .08); }

/* ── Hero ── */
.blog-hero2 { padding: 7.25rem 0 3rem; text-align: center; background: radial-gradient(1200px 400px at 50% -10%, rgba(14, 165, 233, .12), transparent 70%), var(--b-soft); border-bottom: 1px solid var(--b-line); }
.blog-hero2 h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); line-height: 1.1; margin: .75rem auto .9rem; color: var(--b-ink); max-width: 18ch; }
.blog-hero2 h1 em { color: var(--b-accent); font-style: italic; }
.blog-hero2-sub { max-width: 58ch; margin: 0 auto 1.75rem; font-size: 1.075rem; line-height: 1.65; color: var(--b-muted); }
.blog-crumbs { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; font-size: .85rem; color: var(--b-muted); }
.blog-crumbs a { color: var(--b-muted); text-decoration: none; }
.blog-crumbs a:hover { color: var(--b-accent); text-decoration: underline; }
.post-head .blog-crumbs { justify-content: flex-start; }

.blog-search { position: relative; display: flex; align-items: center; gap: .5rem; max-width: 560px; margin: 0 auto; padding: .4rem .4rem .4rem 2.75rem; background: var(--b-card); border: 1px solid var(--b-line); border-radius: 999px; box-shadow: 0 6px 24px rgba(15, 23, 42, .06); }
.blog-search:focus-within { border-color: var(--b-accent); box-shadow: 0 0 0 4px var(--b-accent-soft); }
.blog-search-icon { position: absolute; left: 1rem; color: var(--b-muted); }
.blog-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 1rem; color: var(--b-ink); padding: .55rem 0; }
.blog-search input::-webkit-search-cancel-button { cursor: pointer; }
.blog-search .btn { border-radius: 999px; padding: .6rem 1.15rem; }

/* ── Body ── */
.blog-body { padding: 2.25rem 0 4rem; }
.blog-chips { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center; margin-bottom: 2.25rem; }
.chip { display: inline-flex; align-items: center; padding: .5rem 1rem; border-radius: 999px; border: 1px solid var(--b-line); background: var(--b-card); color: var(--b-ink); font-size: .9rem; font-weight: 500; text-decoration: none; transition: border-color .2s, background-color .2s, color .2s; }
.chip:hover { border-color: var(--b-accent); color: var(--b-accent); }
.chip.active { background: var(--b-accent); border-color: var(--b-accent); color: #fff; }
@media (max-width: 700px) {
  .blog-chips { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; margin: 0 -1.25rem 1.75rem; padding: 0 1.25rem .25rem; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .blog-chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
}

.blog-list-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin: 0 0 1.25rem; }
.blog-list-head h2 { font-size: 1.5rem; margin: 0; color: var(--b-ink); }
.blog-count { font-size: .95rem; font-weight: 400; color: var(--b-muted); margin-left: .35rem; font-family: inherit; }
.blog-clear { font-size: .9rem; color: var(--b-accent); white-space: nowrap; }

/* ── Cards ── */
.blog-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
@media (max-width: 1000px) { .blog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .blog-grid { grid-template-columns: 1fr; gap: 1.1rem; } }

.post-card { height: 100%; }
.post-card-link { display: flex; flex-direction: column; height: 100%; background: var(--b-card); border: 1px solid var(--b-line); border-radius: 20px; overflow: hidden; color: inherit; text-decoration: none; transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
.post-card-link:hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(15, 23, 42, .10); border-color: rgba(3, 105, 161, .25); }
.post-card-link:focus-visible { outline: 3px solid var(--b-accent); outline-offset: 3px; }
.post-card-img { aspect-ratio: 16 / 9; background: var(--b-soft); overflow: hidden; }
.post-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease; }
.post-card-link:hover .post-card-img img { transform: scale(1.03); }
.post-card-img-fallback { width: 100%; height: 100%; background: linear-gradient(135deg, rgba(14, 165, 233, .18), rgba(20, 184, 166, .18)); }
.post-card-body { display: flex; flex-direction: column; gap: .55rem; padding: 1.15rem 1.25rem 1.3rem; flex: 1; }
.post-card-title { font-size: 1.15rem; line-height: 1.35; margin: 0; color: var(--b-ink); font-family: inherit; font-weight: 650; letter-spacing: -.005em; }
.post-card-excerpt { margin: 0; font-size: .95rem; line-height: 1.55; color: var(--b-muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-card-more { margin-top: auto; padding-top: .35rem; display: inline-flex; align-items: center; gap: .35rem; font-size: .9rem; font-weight: 600; color: var(--b-accent); }
.post-card-more svg { transition: transform .2s; }
.post-card-link:hover .post-card-more svg { transform: translateX(3px); }

.post-meta { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem; font-size: .8rem; color: var(--b-muted); }
.post-topic { color: var(--b-accent); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; font-size: .72rem; }
.post-dot { opacity: .6; }

.blog-featured { margin-bottom: 2.75rem; }
.post-card-featured .post-card-link { display: grid; grid-template-columns: 1.15fr 1fr; }
.post-card-featured .post-card-img { aspect-ratio: auto; min-height: 320px; }
.post-card-featured .post-card-body { padding: 2rem 2.25rem; justify-content: center; gap: .8rem; }
.post-card-featured .post-card-title { font-size: clamp(1.4rem, 2.4vw, 1.9rem); line-height: 1.25; }
.post-card-featured .post-card-excerpt { font-size: 1.02rem; -webkit-line-clamp: 4; }
.post-card-featured .post-card-more { margin-top: .4rem; }
@media (max-width: 800px) {
  .post-card-featured .post-card-link { grid-template-columns: 1fr; }
  .post-card-featured .post-card-img { min-height: 0; aspect-ratio: 16 / 9; }
  .post-card-featured .post-card-body { padding: 1.25rem 1.25rem 1.4rem; }
}

.blog-empty { padding: 2.5rem 1.5rem; text-align: center; border: 1px dashed var(--b-line); border-radius: 20px; color: var(--b-muted); }
.blog-empty a { color: var(--b-accent); }
.blog-pager { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 2.5rem; }
.blog-pager-info { font-size: .9rem; color: var(--b-muted); }
.blog-note { margin: 2.75rem auto 0; max-width: 70ch; text-align: center; font-size: .85rem; line-height: 1.6; color: var(--b-muted); }

/* ── CTA band ── */
.blog-cta-band { margin-top: 3rem; border-radius: 24px; background: linear-gradient(135deg, #0c4a6e, #0f766e); color: #fff; }
.blog-cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 2rem; padding: 2.25rem 2.5rem; }
.blog-cta-band h2 { color: #fff; font-size: 1.5rem; margin: 0 0 .4rem; }
.blog-cta-band p { margin: 0; color: rgba(255, 255, 255, .85); line-height: 1.6; max-width: 52ch; }
.blog-cta-actions { display: flex; gap: .75rem; flex-wrap: wrap; flex: none; }
.blog-cta-band .btn-primary { background: #fff; color: #0c4a6e; border-color: #fff; }
.blog-cta-band .btn-outline { color: #fff; border-color: rgba(255, 255, 255, .55); background: transparent; }
.blog-cta-band .btn-outline:hover { background: rgba(255, 255, 255, .1); }
@media (max-width: 800px) { .blog-cta-inner { flex-direction: column; align-items: flex-start; padding: 1.75rem 1.5rem; } }

/* ── Article ── */
.post { padding-bottom: 1rem; }
.post-head { padding: 6.75rem 0 1.75rem; background: var(--b-soft); }
.post-narrow { max-width: 760px !important; }
.post-wide { max-width: 1000px !important; }
.post-head h1 { font-size: clamp(2rem, 4.6vw, 3rem); line-height: 1.15; margin: 1rem 0 .9rem; color: var(--b-ink); letter-spacing: -.01em; }
.post-standfirst { font-size: 1.15rem; line-height: 1.6; color: var(--b-muted); margin: 0 0 1.1rem; }
.post-meta-lg { font-size: .9rem; }
.post-read { display: inline-flex; align-items: center; gap: .3rem; }
.post-hero-img { margin: 0 0 2.25rem; border-radius: 22px; overflow: hidden; aspect-ratio: 16 / 8; background: var(--b-soft); box-shadow: 0 18px 44px rgba(15, 23, 42, .10); position: relative; top: 0; }
.post-head + .post-wide { background: linear-gradient(var(--b-soft) 45%, transparent 45%); max-width: none !important; padding: 0; }
.post-head + .post-wide .post-hero-img { max-width: 1000px; margin: 0 auto 2.25rem; width: calc(100% - 2.5rem); }
.post-hero-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

.post-content { font-size: 1.1rem; line-height: 1.78; color: #1e293b; }
.post-content > * + * { margin-top: 1.15em; }
.post-content p { margin: 1.15em 0 0; }
.post-content > :first-child { margin-top: 0; }
.post-content h2 { font-size: 1.6rem; line-height: 1.3; margin: 2.1em 0 .2em; color: var(--b-ink); }
.post-content h3 { font-size: 1.25rem; line-height: 1.35; margin: 1.7em 0 .1em; color: var(--b-ink); font-family: inherit; font-weight: 650; }
.post-content h4 { font-size: 1.05rem; margin: 1.5em 0 0; color: var(--b-ink); }
.post-content ul, .post-content ol { padding-left: 1.35em; margin-bottom: 0; }
.post-content li { margin: .45em 0; padding-left: .2em; }
.post-content li::marker { color: var(--b-accent); }
.post-content a { color: var(--b-accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.post-content a:hover { text-decoration-thickness: 2px; }
.post-content strong { color: var(--b-ink); }
.post-content blockquote { margin-left: 0; padding: .9rem 1.25rem; border-left: 4px solid var(--b-accent); background: var(--b-accent-soft); border-radius: 0 12px 12px 0; }
.post-content img { max-width: 100%; height: auto; border-radius: 14px; }
.post-content table { width: 100%; border-collapse: collapse; font-size: .97rem; display: block; overflow-x: auto; }
.post-content th, .post-content td { border-bottom: 1px solid var(--b-line); padding: .6rem .75rem; text-align: left; vertical-align: top; }
.post-content th { color: var(--b-ink); background: var(--b-soft); }
.post-content hr { border: 0; border-top: 1px solid var(--b-line); margin: 2em 0; }

.post-note { margin: 2.75rem 0 0; padding: 1.15rem 1.35rem; border-radius: 16px; background: var(--b-soft); border: 1px solid var(--b-line); font-size: .95rem; line-height: 1.6; color: var(--b-muted); }
.post-note strong { color: var(--b-ink); }
.post-note a { color: var(--b-accent); }

.post-nextprev { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 2.25rem; }
.post-nextprev a { display: block; padding: 1rem 1.2rem; border: 1px solid var(--b-line); border-radius: 16px; color: var(--b-ink); text-decoration: none; font-weight: 600; line-height: 1.4; transition: border-color .2s, background-color .2s; }
.post-nextprev a:hover { border-color: var(--b-accent); background: var(--b-accent-soft); }
.post-nextprev a span { display: block; font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--b-muted); margin-bottom: .3rem; }
.post-nextprev .post-next { text-align: right; }
@media (max-width: 640px) { .post-nextprev { grid-template-columns: 1fr; } .post-nextprev .post-next { text-align: left; } }

.blog-related { border-top: 1px solid var(--b-line); margin-top: 3rem; padding-top: 3rem; }
.blog-fallback { padding: 9rem 0 4rem; text-align: center; }

@media (max-width: 640px) {
  .blog-hero2 { padding: 6.25rem 0 2.25rem; }
  .blog-search { padding-left: 2.5rem; }
  .blog-search .btn { padding: .55rem .9rem; }
  .post-head { padding: 6rem 0 1.25rem; }
  .post-content { font-size: 1.05rem; line-height: 1.72; }
  .post-content h2 { font-size: 1.4rem; }
  .post-hero-img { border-radius: 16px; aspect-ratio: 16 / 9; }
  .post-head + .post-wide .post-hero-img { width: calc(100% - 2rem); }
}

@media (prefers-reduced-motion: reduce) {
  .post-card-link, .post-card-img img, .post-card-more svg { transition: none !important; }
  .post-card-link:hover { transform: none; }
}

/* ── Dark mode ── */
@media (prefers-color-scheme: dark) {
  #blog-main { --b-ink: #e6e8ef; --b-muted: #a3adbf; --b-line: rgba(255, 255, 255, .09); --b-card: #0f1526; --b-soft: #0b1020; --b-accent: #7dd3fc; --b-accent-soft: rgba(125, 211, 252, .08); }
  .blog-hero2 { background: radial-gradient(1200px 400px at 50% -10%, rgba(14, 165, 233, .14), transparent 70%), var(--b-soft); }
  .blog-search { box-shadow: none; }
  .chip.active { color: #062033; }
  .post-card-link:hover { box-shadow: 0 14px 34px rgba(0, 0, 0, .35); border-color: rgba(125, 211, 252, .3); }
  .post-content { color: #cdd5e1; }
  .post-hero-img { box-shadow: 0 18px 44px rgba(0, 0, 0, .4); }
  .blog-cta-band { background: linear-gradient(135deg, #0c3a56, #0d5a55); }
}
