/* ==========================================================================
   Cybergen — blog listing and article pages (loaded after site.css)
   ========================================================================== */

/* ---------- Shared page hero (dark band under the fixed header) ---------- */
.page-hero { position: relative; background: var(--navy); color: #fff; overflow: hidden; padding: 150px 0 80px; }
.page-hero .hero-bg { position: absolute; inset: 0; }
.page-hero .wrap { position: relative; z-index: 1; }

/* ==========================================================================
   Listing
   ========================================================================== */
.blog-hero h1 { font-size: clamp(36px, 5.4vw, 64px); font-weight: 800; max-width: 900px; margin-bottom: 18px; text-wrap: balance; }
.blog-hero h1 .shimmer { opacity: 1; animation: shimmer 5s linear infinite; }
.blog-hero p { color: rgba(255,255,255,.7); font-size: 18px; max-width: 640px; margin-bottom: 34px; }
.search { position: relative; max-width: 560px; }
.search svg { position: absolute; left: 18px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--accent); pointer-events: none; }
.search input {
  width: 100%; height: 56px; border-radius: 10px; border: 1px solid rgba(148,212,244,.3);
  background: rgba(0,21,52,.6); backdrop-filter: blur(6px); color: #fff; font: inherit; font-size: 16px; padding: 0 18px 0 50px;
  transition: border-color .2s, box-shadow .2s;
}
.search input::placeholder { color: rgba(255,255,255,.45); }
.search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(148,212,244,.15); }
.hero-stats { display: flex; gap: 34px; margin-top: 34px; font-size: 14px; color: rgba(255,255,255,.6); flex-wrap: wrap; }
.hero-stats strong { display: block; font-size: 26px; font-weight: 800; color: #fff; line-height: 1.2; }

/* Featured + trending */
.featured-band { background: var(--light); padding: 64px 0; }
.featured-grid { display: grid; grid-template-columns: 1.55fr 1fr; gap: 30px; align-items: stretch; }
.feature { display: grid; grid-template-rows: auto 1fr; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; transition: box-shadow .3s, transform .3s; }
.feature:hover { box-shadow: 0 26px 50px rgba(0,21,52,.12); transform: translateY(-4px); }
.feature .thumb { aspect-ratio: 16 / 8.4; overflow: hidden; background: var(--navy); }
.feature .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease); }
.feature:hover .thumb img { transform: scale(1.05); }
.feature .body { padding: 28px 30px 30px; display: flex; flex-direction: column; gap: 12px; }
.feature .label { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; letter-spacing: .14em; color: var(--blue-2); }
.feature h2 { font-size: clamp(22px, 2.4vw, 30px); font-weight: 700; color: var(--blue); line-height: 1.22; text-wrap: balance; }
.feature p { color: var(--muted); }
.meta-line { font-size: 13px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.meta-line .sep { opacity: .5; }
.trending { background: var(--navy); color: #fff; border-radius: var(--radius-lg); padding: 28px; display: flex; flex-direction: column; }
.trending h3 { font-size: 13px; letter-spacing: .16em; font-weight: 700; color: var(--accent); margin-bottom: 8px; display: flex; align-items: center; gap: 10px; }
.trending ol { list-style: none; margin: 0; padding: 0; counter-reset: t; display: flex; flex-direction: column; flex: 1; }
.trending li { counter-increment: t; border-top: 1px solid var(--line-dark); flex: 1; }
.trending li:first-child { border-top: 0; }
.trending a { display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding: 16px 0; height: 100%; align-content: center; }
.trending a::before { content: counter(t, decimal-leading-zero); font-size: 14px; font-weight: 800; color: rgba(148,212,244,.55); padding-top: 2px; }
.trending a span { display: block; font-size: 11px; letter-spacing: .12em; color: var(--accent); font-weight: 600; margin-bottom: 4px; }
.trending a b { font-weight: 600; font-size: 15px; line-height: 1.35; transition: color .2s; }
.trending a:hover b { color: var(--accent); }

/* Filters */
.filters-wrap { position: sticky; top: 72px; z-index: 20; background: rgba(255,255,255,.94); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.filters { display: flex; gap: 8px; overflow-x: auto; padding: 14px 0; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; height: 36px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: #fff;
  font-size: 13px; font-weight: 600; color: var(--muted); transition: all .2s; display: inline-flex; align-items: center; gap: 8px;
}
.chip small { font-weight: 600; font-size: 11px; color: #9aa7b8; }
.chip:hover { border-color: var(--blue-2); color: var(--blue); }
.chip[aria-current="page"] { background: var(--blue); border-color: var(--blue); color: #fff; }
.chip[aria-current="page"] small { color: rgba(255,255,255,.7); }

.listing { padding: 56px 0 100px; }
.listing-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 30px; flex-wrap: wrap; }
.listing-head h2 { font-size: 26px; font-weight: 700; color: var(--blue); }
.listing-head p { font-size: 14px; color: var(--muted); }
.grid-posts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.grid-posts .post[hidden] { display: none; }
.grid-posts .post { animation: fade-in .45s var(--ease) both; }
.empty { text-align: center; padding: 60px 0; color: var(--muted); }
.empty[hidden] { display: none; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 52px; flex-wrap: wrap; }
.pagination[hidden] { display: none; }
.pagination ol { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.pg-num, .pg-step {
  height: 42px; min-width: 42px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line); background: #fff;
  font-size: 14px; font-weight: 600; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: border-color .2s, color .2s, background .2s, box-shadow .2s; font-variant-numeric: tabular-nums;
}
a.pg-num:hover, a.pg-step:hover { border-color: var(--blue-2); color: var(--blue); }
.pg-num[aria-current="page"] { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 8px 18px rgba(0,84,133,.25); }
.pg-step { padding: 0 16px; }
.pg-step svg { width: 16px; height: 16px; }
.pg-step.is-disabled { opacity: .4; }
.pg-num:focus-visible, .pg-step:focus-visible { outline: 2px solid var(--blue-2); outline-offset: 2px; }
.pg-gap { width: 26px; display: grid; place-items: center; color: var(--muted); }

/* Inline newsletter band on listing */
.brief { background: var(--navy); color: #fff; border-radius: var(--radius-lg); padding: 40px; display: grid; grid-template-columns: 1.2fr 1fr; gap: 30px; align-items: center; margin: 70px 0 0; position: relative; overflow: hidden; }
.brief::after { content: ""; position: absolute; right: -120px; top: -120px; width: 340px; height: 340px; border-radius: 50%; background: radial-gradient(circle, rgba(11,106,163,.6), transparent 65%); }
.brief > * { position: relative; z-index: 1; min-width: 0; }
.brief .nl-form { flex: initial; width: 100%; }
.brief .nl-form input { min-width: 0; }
.brief h3 { font-size: 26px; font-weight: 700; margin-bottom: 8px; }
.brief p { color: rgba(255,255,255,.7); }
.brief .nl-form { flex: 1; }

/* ==========================================================================
   Article
   ========================================================================== */
.read-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: linear-gradient(90deg, var(--blue-2), var(--accent)); z-index: 60; transition: width .1s linear; }
.article-hero { padding: 140px 0 0; }
.article-hero .wrap { max-width: 1040px; }
.article-hero .chip-cat { display: inline-flex; font-size: 11px; font-weight: 700; letter-spacing: .14em; color: var(--navy); background: var(--accent); padding: 6px 12px; border-radius: 99px; margin-bottom: 20px; }
.article-hero h1 { font-size: clamp(32px, 4.8vw, 54px); font-weight: 800; line-height: 1.1; text-wrap: balance; margin-bottom: 24px; }
.byline { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 14px; color: rgba(255,255,255,.7); padding-bottom: 46px; }
.byline .avatar { width: 40px; height: 40px; border-radius: 50%; background: rgba(148,212,244,.15); border: 1px solid rgba(148,212,244,.35); display: grid; place-items: center; }
.byline .avatar img { width: 22px; height: 22px; }
.byline b { color: #fff; font-weight: 600; display: block; }
.byline .sep { opacity: .4; }
.cover { position: relative; z-index: 2; margin: 0 0 -120px; }
.cover img { display: block; width: 100%; height: auto; aspect-ratio: 1920 / 1008; object-fit: contain; border-radius: var(--radius-lg); box-shadow: 0 30px 70px rgba(0,21,52,.45); background: var(--navy-2); }
.article-wrap { padding: 170px 0 90px; }
.article-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 64px; max-width: 1040px; margin: 0 auto; padding: 0 24px; align-items: start; }

/* Prose */
.prose { font-size: 18px; line-height: 1.78; color: #26354b; min-width: 0; }
.prose > * + * { margin-top: 1.15em; }
.prose h2 { font-size: 28px; font-weight: 700; color: var(--blue); line-height: 1.25; margin-top: 2.1em; scroll-margin-top: 100px; text-wrap: balance; }
.prose h3 { font-size: 21px; font-weight: 700; color: var(--ink); margin-top: 1.8em; scroll-margin-top: 100px; }
.prose h2 + *, .prose h3 + * { margin-top: .7em; }
.prose > p:first-child { font-size: 21px; line-height: 1.65; color: var(--ink); }
.prose > p:first-child::first-letter { float: left; font-size: 64px; line-height: .9; font-weight: 800; color: var(--blue); padding: 6px 10px 0 0; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose a { color: var(--blue-2); text-decoration: underline; text-decoration-color: rgba(11,106,163,.35); text-underline-offset: 3px; transition: text-decoration-color .2s; }
.prose a:hover { text-decoration-color: var(--blue-2); }
.prose ul, .prose ol { padding-left: 0; list-style: none; display: grid; gap: .55em; }
.prose ul li { position: relative; padding-left: 28px; }
.prose ul li::before { content: ""; position: absolute; left: 4px; top: .7em; width: 8px; height: 8px; border-radius: 2px; background: var(--accent); transform: rotate(45deg); }
.prose ol { counter-reset: o; }
.prose ol li { counter-increment: o; position: relative; padding-left: 40px; }
.prose ol li::before { content: counter(o); position: absolute; left: 0; top: .15em; width: 26px; height: 26px; border-radius: 50%; background: rgba(148,212,244,.25); color: var(--blue); font-size: 13px; font-weight: 700; display: grid; place-items: center; line-height: 1; }
.prose figure { margin: 2em 0; }
.prose figure img { border-radius: 12px; border: 1px solid var(--line); width: 100%; height: auto; }
.prose code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .86em; background: var(--light); border: 1px solid var(--line); padding: 2px 6px; border-radius: 5px; }
.prose .takeaway { background: var(--light); border-left: 3px solid var(--accent); border-radius: 0 12px 12px 0; padding: 22px 26px; }

/* Inline CTA inside the article */
.inline-cta { margin: 2.4em 0; background: var(--navy); color: #fff; border-radius: 14px; padding: 28px 30px; display: flex; gap: 22px; align-items: center; justify-content: space-between; flex-wrap: wrap; position: relative; overflow: hidden; }
.inline-cta::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(148,212,244,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(148,212,244,.06) 1px, transparent 1px); background-size: 28px 28px; }
.inline-cta > * { position: relative; }
.inline-cta b { display: block; font-size: 19px; margin-bottom: 4px; }
.inline-cta span { color: rgba(255,255,255,.7); font-size: 15px; }

/* Sidebar */
.aside { position: sticky; top: 100px; display: grid; gap: 22px; }
.toc { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px 22px 18px; background: #fff; }
.toc h4, .share h4 { font-size: 11px; letter-spacing: .16em; font-weight: 700; color: var(--muted); margin-bottom: 14px; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; max-height: 50vh; overflow-y: auto; }
.toc a { display: block; font-size: 14px; line-height: 1.4; color: var(--muted); padding: 7px 0 7px 14px; border-left: 2px solid var(--line); transition: color .2s, border-color .2s; }
.toc a:hover { color: var(--blue); }
.toc a.active { color: var(--blue); border-left-color: var(--blue-2); font-weight: 600; }
.share { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px 22px; }
.share-row { display: flex; gap: 8px; }
.share-row a, .share-row button { width: 40px; height: 40px; border-radius: 9px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; color: var(--blue); transition: background .2s, border-color .2s; }
.share-row a:hover, .share-row button:hover { background: var(--light); border-color: var(--blue-2); }
.share-row svg { width: 17px; height: 17px; }
.copied { font-size: 12px; color: var(--blue-2); min-height: 16px; margin-top: 8px; }
.aside-cta { background: var(--navy); color: #fff; border-radius: var(--radius-lg); padding: 24px; }
.aside-cta .live { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; letter-spacing: .12em; color: var(--accent); margin-bottom: 10px; }
.aside-cta b { display: block; font-size: 18px; line-height: 1.3; margin-bottom: 8px; }
.aside-cta p { font-size: 14px; color: rgba(255,255,255,.7); margin-bottom: 18px; }
.aside-cta .btn { width: 100%; }

/* After the article */
.tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 3em; padding-top: 2em; border-top: 1px solid var(--line); }
.tags a { font-size: 13px; padding: 6px 12px; border-radius: 99px; background: var(--light); color: var(--muted); text-decoration: none; }
.tags a:hover { color: var(--blue); }
.author-box { display: flex; gap: 18px; align-items: center; margin-top: 2em; padding: 24px; border-radius: var(--radius-lg); background: var(--light); }
.author-box .mark { width: 56px; height: 56px; flex-shrink: 0; border-radius: 12px; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; }
.author-box .mark img { width: 30px; height: 30px; }
.author-box b { display: block; color: var(--ink); font-size: 16px; }
.author-box p { font-size: 14px; color: var(--muted); margin: 2px 0 0; line-height: 1.55; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 2em; }
.pager a { border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; text-decoration: none; transition: border-color .2s, box-shadow .2s; }
.pager a:hover { border-color: var(--blue-2); box-shadow: 0 12px 26px rgba(0,21,52,.07); }
.pager small { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.pager b { font-size: 15px; color: var(--blue); font-weight: 600; line-height: 1.35; display: block; }
.pager .next { text-align: right; grid-column: 2; }
.related { background: var(--light); padding: 80px 0; }
.related .posts { margin-top: 34px; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1080px) {
  .featured-grid, .brief { grid-template-columns: 1fr; }
  .grid-posts { grid-template-columns: 1fr 1fr; }
  .article-grid { grid-template-columns: minmax(0, 1fr); max-width: 760px; }
  .aside { position: static; grid-row: 1; }
  .toc ol { max-height: none; }
  .aside .share, .aside .aside-cta { display: none; }
  .cover { margin-bottom: -60px; }
  .article-wrap { padding-top: 100px; }
}
@media (max-width: 760px) {
  .page-hero { padding: 120px 0 56px; }
  .article-hero { padding-top: 116px; }
  .grid-posts { grid-template-columns: 1fr; }
  .feature .body { padding: 22px; }
  .brief { padding: 28px 22px; }
  .prose { font-size: 17px; }
  .prose > p:first-child { font-size: 19px; }
  .prose h2 { font-size: 24px; }
  .pager { grid-template-columns: 1fr; }
  .pager .next { grid-column: 1; }
  .pg-step span { display: none; }
  .pg-step { padding: 0 12px; }
  .pagination { gap: 4px; flex-wrap: nowrap; }
  .pagination ol { gap: 3px; }
  .pg-num, .pg-step { min-width: 36px; height: 40px; padding: 0 6px; }
  .pg-gap { width: 16px; }
  .cover { margin-bottom: -40px; }
  .article-wrap { padding: 76px 0 70px; }
  .filters-wrap { top: 72px; }
}

/* Tables inside articles */
.prose .table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
.prose th, .prose td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose thead th, .prose tr:first-child td { background: var(--light); font-weight: 600; color: var(--ink); }
.prose tr:last-child td { border-bottom: 0; }
.prose blockquote { margin: 1.6em 0; padding: 6px 0 6px 24px; border-left: 3px solid var(--accent); font-size: 20px; color: var(--ink); font-weight: 500; }
.feature-more { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--blue-2); }
.feature-more svg { width: 15px; height: 15px; transition: transform .25s; }
.feature:hover .feature-more svg { transform: translateX(3px); }

/* Compact hero on topic pages and page 2+ */
.blog-hero.is-compact { padding-bottom: 56px; }
.blog-hero.is-compact h1 { font-size: clamp(32px, 4.4vw, 52px); }
[data-page-nav][hidden], [data-search-grid][hidden], .featured-band[hidden] { display: none; }

/* Article cover overlap: the hero's last strip is page-white, so the cover hangs over the
   edge of the dark band without negative margins or clipping. */
.article-hero { overflow: hidden; padding-bottom: var(--shadow-room, 48px); }
.article-hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--cover-overlap, 120px) + var(--shadow-room, 48px)); background: var(--white); z-index: 1; }
.article-hero .hero-bg { bottom: calc(var(--cover-overlap, 120px) + var(--shadow-room, 48px)); }
.article-hero > .wrap { z-index: 2; }
.article-hero .cover { margin: 0; position: relative; z-index: 2; }
.article-hero + .article-wrap, .article-wrap { padding-top: 24px; }
@media (max-width: 1080px) { .article-hero { --cover-overlap: 70px; } .article-wrap { padding-top: 16px; } }
@media (max-width: 760px) { .article-hero { --cover-overlap: 44px; --shadow-room: 28px; } .article-wrap { padding-top: 12px; } }
