/* ============================================================
   BLOG — archive + article
   Depends on styles.css (tokens, nav, buttons, footer)
   ============================================================ */

/* ---------- Blog hero ---------- */
.blog-hero { position: relative; overflow: hidden; padding: clamp(44px, 6vw, 76px) 0 clamp(28px, 3vw, 40px); background: var(--paper); }
.blog-hero .hero-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.blog-hero .hero-bg::before {
  content: ""; position: absolute; top: -30%; left: -10%; right: -10%; height: 100%;
  background:
    radial-gradient(at 18% 32%, rgba(99,91,255,0.16), transparent 52%),
    radial-gradient(at 74% 22%, rgba(0,212,255,0.14), transparent 55%);
  filter: blur(44px); opacity: 0.8;
}
.blog-hero .hero-bg::after { content: ""; position: absolute; bottom: -10%; left: 0; right: 0; height: 55%; background: linear-gradient(180deg, transparent, var(--paper)); }
.blog-hero .wrap { position: relative; z-index: 1; }
.blog-hero h1 { font-size: clamp(36px, 4.6vw, 56px); letter-spacing: -0.035em; line-height: 1.02; max-width: 720px; }
.blog-hero h1 .grad {
  background: linear-gradient(120deg, var(--brand) 20%, var(--brand-2) 55%, var(--brand-3) 95%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- Search ---------- */
.blog-search { margin-top: 26px; max-width: 460px; position: relative; }
.blog-search input {
  width: 100%; font: inherit; font-size: 14.5px;
  padding: 12px 14px 12px 40px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--paper); color: var(--ink);
  box-shadow: var(--shadow-1); outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.blog-search input::placeholder { color: var(--muted); }
.blog-search input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.blog-search .bs-ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; display: grid; }

/* ---------- Category filter ---------- */
.blog-cats { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 22px; }
.blog-cats button {
  font-size: 13px; font-weight: 500;
  padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--paper); color: var(--muted-2);
  transition: all 0.15s ease; white-space: nowrap;
}
.blog-cats button:hover { border-color: var(--line-2); color: var(--ink); }
.blog-cats button.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------- Featured post ---------- */
.feat-post {
  display: grid; grid-template-columns: 1.15fr 1fr; gap: 0;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-xl);
  overflow: hidden; box-shadow: var(--shadow-2);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.feat-post:hover { transform: translateY(-3px); box-shadow: var(--shadow-3); }
.feat-post .fp-img { position: relative; aspect-ratio: 4 / 3; min-height: 340px; overflow: hidden; }
.feat-post .fp-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.feat-post:hover .fp-img img { transform: scale(1.04); }
.feat-post .fp-body { padding: clamp(26px, 3.4vw, 44px); display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.feat-post .fp-badge {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  background: var(--brand-soft); color: var(--brand);
  padding: 5px 11px; border-radius: 999px;
}
.feat-post h2 { font-size: clamp(24px, 2.6vw, 34px); letter-spacing: -0.028em; line-height: 1.12; }
.feat-post .fp-ex { font-size: 15px; color: var(--muted-2); line-height: 1.6; }
@media (max-width: 900px) { .feat-post { grid-template-columns: 1fr; } .feat-post .fp-img { aspect-ratio: 16 / 9; min-height: 240px; } }

/* ---------- Post meta row ---------- */
.post-meta { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.post-meta .pm-av {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center; font-size: 10.5px; font-weight: 700; flex-shrink: 0;
}
.post-meta .pm-name { color: var(--ink); font-weight: 500; }
.post-meta .pm-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--line-2); }

/* ---------- Post grid ---------- */
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
@media (max-width: 940px) { .post-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .post-grid { grid-template-columns: 1fr; } }

.post-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-l);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: var(--line-2); }
.post-card .pc-img { aspect-ratio: 16 / 10; overflow: hidden; background: var(--paper-3); position: relative; }
.post-card .pc-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.post-card:hover .pc-img img { transform: scale(1.05); }
.post-card .pc-cat {
  position: absolute; top: 12px; left: 12px;
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  background: rgba(255,255,255,0.94); color: var(--brand);
  padding: 4px 9px; border-radius: 6px; backdrop-filter: blur(6px);
}
.post-card .pc-body { padding: 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.post-card h3 { font-size: 17.5px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.25; }
.post-card .pc-ex { font-size: 13.5px; color: var(--muted-2); line-height: 1.55; flex: 1; }
.post-card .pc-foot { margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--line); }

/* ---------- Newsletter inline ---------- */
.nl-band {
  background: linear-gradient(160deg, var(--brand) 0%, #0a0080 100%);
  border-radius: var(--r-xl); padding: clamp(30px, 4vw, 52px);
  color: #fff; position: relative; overflow: hidden;
  display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(24px, 4vw, 48px); align-items: center;
}
.nl-band::before {
  content: ""; position: absolute; inset: -40% -15% auto auto; width: 70%; height: 90%;
  background: radial-gradient(ellipse at center, rgba(0,212,255,0.38), transparent 62%);
  filter: blur(56px); pointer-events: none;
}
.nl-band > * { position: relative; }
.nl-band h3 { color: #fff; font-size: clamp(23px, 2.6vw, 32px); letter-spacing: -0.028em; line-height: 1.1; }
.nl-band p { color: rgba(255,255,255,0.78); font-size: 14.5px; line-height: 1.6; margin-top: 10px; }
.nl-form { display: flex; gap: 9px; flex-wrap: wrap; }
.nl-form input {
  flex: 1; min-width: 190px; font: inherit; font-size: 14.5px;
  padding: 12px 16px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.12); color: #fff; outline: none;
}
.nl-form input::placeholder { color: rgba(255,255,255,0.6); }
.nl-form input:focus { border-color: rgba(255,255,255,0.55); background: rgba(255,255,255,0.18); }
.nl-form .btn { background: #fff; color: var(--brand); }
.nl-form .btn:hover { background: var(--paper-2); }
.nl-note { font-size: 12px; color: rgba(255,255,255,0.6); margin-top: 11px; }
@media (max-width: 860px) { .nl-band { grid-template-columns: 1fr; } }

/* ---------- Pagination ---------- */
.pager { display: flex; justify-content: center; align-items: center; gap: 6px; }
.pager a, .pager span {
  min-width: 38px; height: 38px; padding: 0 12px;
  display: inline-grid; place-items: center;
  border: 1px solid var(--line); border-radius: 9px;
  font-size: 14px; font-weight: 500; color: var(--muted-2); background: var(--paper);
  transition: all 0.15s ease;
}
.pager a:hover { border-color: var(--brand); color: var(--brand); }
.pager .cur { background: var(--brand); border-color: var(--brand); color: #fff; }
.pager .gap { border: none; background: none; color: var(--muted); }

/* ============================================================
   ARTICLE (blog detail)
   ============================================================ */
.crumbs { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.crumbs a { color: var(--muted-2); }
.crumbs a:hover { color: var(--brand); }
.crumbs .sep { color: var(--line-2); }
.crumbs [aria-current] { color: var(--ink); font-weight: 500; }

.art-head { padding: 26px 0 0; background: var(--paper); }
.art-head .art-inner { max-width: 760px; }
.art-head h1 { font-size: clamp(31px, 4.1vw, 52px); letter-spacing: -0.035em; line-height: 1.05; margin-top: 16px; }
.art-head .art-ex { font-size: clamp(16.5px, 1.5vw, 19px); color: var(--muted-2); line-height: 1.58; margin-top: 18px; }
.art-cat {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase;
  background: var(--brand-soft); color: var(--brand);
  padding: 5px 11px; border-radius: 999px;
}
.art-byline { display: flex; align-items: center; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
.art-byline .ab-av {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center; font-size: 14px; font-weight: 700; flex-shrink: 0;
}
.art-byline .ab-name { font-size: 14.5px; font-weight: 600; }
.art-byline .ab-meta { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.art-share { margin-left: auto; display: flex; gap: 7px; }
.art-share a {
  width: 34px; height: 34px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--paper);
  display: grid; place-items: center; color: var(--muted-2);
  transition: all 0.15s ease;
}
.art-share a:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-1px); }

.art-hero-img { margin: 32px 0 0; border-radius: var(--r-l); overflow: hidden; box-shadow: var(--shadow-2); aspect-ratio: 21 / 9; }
.art-hero-img img { width: 100%; height: 100%; object-fit: cover; }
.art-hero-cap { font-size: 12px; color: var(--muted); margin-top: 10px; text-align: center; }

/* Layout: article + sticky sidebar */
.art-layout { display: grid; grid-template-columns: minmax(0,1fr) 292px; gap: clamp(32px, 5vw, 64px); align-items: start; }
@media (max-width: 1000px) { .art-layout { grid-template-columns: 1fr; } .art-side { display: none; } }
.art-side { position: sticky; top: 88px; display: grid; gap: 18px; }

/* TOC */
.toc { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-m); padding: 20px; }
.toc h4 { font-size: 11.5px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.toc ol { list-style: none; padding: 0; margin: 0; counter-reset: toc; display: grid; gap: 2px; }
.toc li { counter-increment: toc; }
.toc a {
  display: flex; gap: 9px; align-items: baseline;
  font-size: 13.5px; color: var(--muted-2); line-height: 1.45;
  padding: 7px 9px; border-radius: 7px; border-left: 2px solid transparent;
  transition: all 0.15s ease;
}
.toc a::before { content: counter(toc); font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.toc a:hover { background: var(--paper-2); color: var(--ink); }
.toc a.active { color: var(--brand); background: var(--brand-soft); border-left-color: var(--brand); font-weight: 500; }
.toc a.active::before { color: var(--brand); }

/* Sidebar CTA */
.side-cta {
  background: linear-gradient(160deg, var(--brand) 0%, #0a0080 100%);
  border-radius: var(--r-m); padding: 22px; color: #fff;
  position: relative; overflow: hidden;
}
.side-cta::before {
  content: ""; position: absolute; inset: -50% -20% auto auto; width: 90%; height: 100%;
  background: radial-gradient(ellipse at center, rgba(0,212,255,0.4), transparent 62%);
  filter: blur(40px);
}
.side-cta > * { position: relative; }
.side-cta h4 { font-size: 16px; font-weight: 600; line-height: 1.25; color: #fff; }
.side-cta p { font-size: 13px; color: rgba(255,255,255,0.78); line-height: 1.55; margin-top: 8px; }
.side-cta .btn { background: #fff; color: var(--brand); width: 100%; justify-content: center; margin-top: 16px; font-size: 14px; }
.side-cta .btn:hover { background: var(--paper-2); }
.side-cta .sc-trust { font-size: 11.5px; color: rgba(255,255,255,0.62); text-align: center; margin-top: 10px; }

/* ---------- Prose ---------- */
.prose { max-width: 720px; font-size: 17px; line-height: 1.72; color: var(--ink-2); }
.prose > * + * { margin-top: 24px; }
.prose h2 {
  font-size: clamp(24px, 2.4vw, 31px); letter-spacing: -0.028em; line-height: 1.18;
  color: var(--ink); margin-top: 46px; scroll-margin-top: 90px;
}
.prose h3 { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; color: var(--ink); margin-top: 34px; scroll-margin-top: 90px; }
.prose p { text-wrap: pretty; }
.prose a:not(.btn) { color: var(--brand); font-weight: 500; text-decoration: underline; text-decoration-color: color-mix(in oklab, var(--brand) 32%, transparent); text-underline-offset: 3px; }
.prose a:not(.btn):hover { text-decoration-color: var(--brand); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose ul, .prose ol { padding-left: 0; margin-left: 0; list-style: none; display: grid; gap: 12px; }
.prose ul li { position: relative; padding-left: 28px; }
.prose ul li::before {
  content: ""; position: absolute; left: 6px; top: 10px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--brand);
}
.prose ol { counter-reset: pl; }
.prose ol li { position: relative; padding-left: 34px; counter-increment: pl; }
.prose ol li::before {
  content: counter(pl); position: absolute; left: 0; top: 1px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand);
  font-size: 11.5px; font-weight: 700; display: grid; place-items: center;
}
.prose img { border-radius: var(--r-m); box-shadow: var(--shadow-1); width: 100%; }
.prose figure { margin: 34px 0; }
.prose figcaption { font-size: 12.5px; color: var(--muted); text-align: center; margin-top: 10px; }
.prose blockquote {
  margin: 34px 0; padding: 22px 26px;
  background: var(--paper-2); border-left: 3px solid var(--brand); border-radius: 0 var(--r-m) var(--r-m) 0;
  font-size: 18px; line-height: 1.6; color: var(--ink);
}
.prose blockquote cite { display: block; font-size: 13.5px; color: var(--muted); font-style: normal; margin-top: 12px; }
.prose hr { border: none; border-top: 1px solid var(--line); margin: 44px 0; }

/* Prose tables (comparison tables, scorecards) */
.table-wrap { margin: 34px 0; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-m); }
.prose table { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 480px; }
.prose table th, .prose table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line); }
.prose table th { background: var(--paper-2); font-weight: 600; color: var(--ink); font-size: 12.5px; letter-spacing: 0.02em; text-transform: uppercase; white-space: nowrap; }
.prose table td { color: var(--muted-2); }
.prose table tr:last-child td { border-bottom: none; }
.prose table tr:hover td { background: var(--paper-2); }

/* Key takeaway box */
.takeaway {
  background: var(--paper-2); border: 1px solid var(--line); border-left: 3px solid var(--brand);
  border-radius: 0 var(--r-m) var(--r-m) 0; padding: 22px 24px; margin: 34px 0;
}
.takeaway h4 {
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--brand); margin-bottom: 12px;
}
.takeaway ul { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.takeaway li { font-size: 14.5px; line-height: 1.55; color: var(--muted-2); padding-left: 24px; position: relative; }
.takeaway li::before {
  content: ""; position: absolute; left: 0; top: 4px; width: 15px; height: 15px;
  background: var(--brand);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>") no-repeat center / contain;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>") no-repeat center / contain;
}

/* In-article conversion CTA */
.inline-cta {
  margin: 42px 0; padding: clamp(24px, 3vw, 34px);
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-l);
  box-shadow: var(--shadow-2);
  display: grid; grid-template-columns: 1fr auto; gap: 22px; align-items: center;
}
.inline-cta h4 { font-size: 19px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.25; }
.inline-cta p { font-size: 14px; color: var(--muted-2); line-height: 1.55; margin-top: 7px; }
.inline-cta .ic-trust { font-size: 12px; color: var(--muted); margin-top: 10px; }
@media (max-width: 620px) { .inline-cta { grid-template-columns: 1fr; } .inline-cta .btn { width: 100%; justify-content: center; } }

/* Progress bar */
.read-bar { position: fixed; top: 0; left: 0; height: 3px; background: linear-gradient(90deg, var(--brand), var(--brand-3)); width: 0%; z-index: 200; transition: width 0.1s linear; }

/* Tags */
.art-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 40px; padding-top: 26px; border-top: 1px solid var(--line); }
.art-tags .tg {
  font-size: 12.5px; color: var(--muted-2); background: var(--paper-2);
  border: 1px solid var(--line); padding: 5px 12px; border-radius: 999px;
}
.art-tags .tg:hover { border-color: var(--brand); color: var(--brand); }

/* Author box */
.author-box {
  margin-top: 34px; padding: 26px;
  background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--r-l);
  display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: start;
}
.author-box .ab-av {
  width: 58px; height: 58px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center; font-size: 18px; font-weight: 700;
}
.author-box h4 { font-size: 16px; font-weight: 600; }
.author-box .ab-role { font-size: 12.5px; color: var(--brand); font-weight: 500; margin-top: 2px; }
.author-box p { font-size: 14px; color: var(--muted-2); line-height: 1.6; margin-top: 10px; }
@media (max-width: 520px) { .author-box { grid-template-columns: 1fr; } }
