/* ============================================================
   IamVector — Blog pages
   Design tokens mapped from the --iav-* system in v3-design.css.
   All blog styles are scoped to .blog-page to avoid conflicts.
   ============================================================ */

/* --- token bridge (resolves on any page, falls back to hardcoded values) --- */
.blog-page {
  --brand:        var(--iav-brand, #14a3a3);
  --brand-ink:    var(--iav-brand-deep, #0c6e6e);
  --brand-deep:   var(--iav-brand-deep, #0c6e6e);
  --brand-deep-2: #0a5c5c;
  --brand-soft:   var(--iav-brand-soft, #e6f4f4);
  --brand-soft-2: #d4eded;
  --line:         var(--iav-line, #e7ecef);
  --line-soft:    rgba(231, 236, 239, .55);
  --text:         var(--iav-text, #44555f);
  --ink:          var(--iav-ink, #15252b);
  --muted:        var(--iav-muted, #8794a0);
  --faint:        var(--iav-faint, #aab4bd);
  --bg-soft:      var(--iav-bg-soft, #f3f7f8);
  --shadow-sm:    0 1px 4px rgba(0, 0, 0, .06), 0 1px 2px rgba(0, 0, 0, .04);
  --shadow-md:    0 4px 16px rgba(0, 0, 0, .10), 0 2px 6px rgba(0, 0, 0, .06);
  --shadow-lg:    0 8px 32px rgba(0, 0, 0, .14), 0 3px 10px rgba(0, 0, 0, .08);
  --radius:       12px;
  --radius-sm:    9px;
  --radius-lg:    18px;
  --font-body:    'Mulish', 'Inter', sans-serif;
  --font-display: 'Poppins', 'Mulish', sans-serif;
}

/* --- container --- */
.blog-wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ---------- intro ---------- */
.blog-top {
  background: radial-gradient(110% 130% at 50% -20%, #eaf6f6 0%, #f3fafa 45%, #ffffff 80%);
  border-bottom: 1px solid var(--line-soft);
  padding: 50px 0 38px;
}
.blog-top__inner { text-align: center; }
.blog-top__eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 13px;
  letter-spacing: .06em; text-transform: uppercase; color: var(--brand-ink); white-space: nowrap;
  background: var(--brand-soft); padding: 7px 14px; border-radius: 30px;
}
.blog-top__eyebrow svg { width: 15px; height: 15px; }
.blog-top h1 { font-size: 46px; line-height: 1.1; margin: 18px auto 14px; max-width: 760px; }
.blog-top h1 span { color: var(--brand); }
.blog-top p { font-size: 17px; color: var(--text); max-width: 620px; margin: 0 auto; line-height: 1.6; }
.blog-top--compact { padding: 40px 0 30px; }

/* ---------- featured: shared cover ---------- */
.feat-cover { position: relative; overflow: hidden; background: var(--brand-soft); }
.feat-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.feat-cover__placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.feat-cover__scrim {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(180deg, rgba(8,40,42,0) 30%, rgba(8,40,42,.30) 55%, rgba(8,40,42,.86) 100%);
}
.feat-cover__body { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; padding: 30px 32px; color: #fff; }
.feat-cover__body h2, .feat-cover__body h3 { color: #fff !important; text-wrap: pretty; margin: 0; }
.cover-badge {
  display: inline-flex; align-items: center; gap: 7px; font-weight: 800; font-size: 12px;
  letter-spacing: .04em; text-transform: uppercase; color: #fff; white-space: nowrap;
  background: var(--brand); padding: 6px 12px; border-radius: 8px;
}
.cover-meta { display: flex; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 600; color: rgba(255,255,255,.9); margin-top: 12px; }
.cover-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: rgba(255,255,255,.6); }

/* featured cluster: lead + minis */
.feat-cluster { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; }
.feat-cluster .lead {
  position: relative; border-radius: var(--radius-lg); overflow: hidden; min-height: 452px;
  cursor: pointer; box-shadow: var(--shadow-md); border: 1px solid var(--line); display: block; text-decoration: none;
}
.feat-cluster .lead .feat-cover { position: absolute; inset: 0; }
.feat-cluster .lead h2 { font-size: 29px; line-height: 1.12; }
.feat-cluster .lead .feat-cover__body { padding: 32px 34px; }
.feat-cluster .lead .feat-cover__body p { color: rgba(255,255,255,.9); font-size: 15px; margin: 10px 0 0; line-height: 1.5; }
.feat-cluster .lead:hover { box-shadow: var(--shadow-lg); }

.feat-cluster__minis { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; gap: 16px; }
.feat-cluster__minis[data-count="1"],
.feat-cluster__minis[data-count="2"] { grid-template-columns: 1fr; }

.feat-cluster .mini {
  position: relative; border-radius: var(--radius-lg); overflow: hidden; min-height: 210px;
  cursor: pointer; box-shadow: var(--shadow-sm); border: 1px solid var(--line); display: block; text-decoration: none;
}
.feat-cluster .mini .feat-cover { position: absolute; inset: 0; }
.feat-cluster .mini h3 { font-size: 17px; line-height: 1.2; }
.feat-cluster .mini .feat-cover__body { padding: 18px 20px; }
.feat-cluster .mini .cover-meta { font-size: 12px; margin-top: 8px; }
.feat-cluster .mini:hover { box-shadow: var(--shadow-md); }

/* ---------- post grid ---------- */
.blog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.blog-grid--2 { grid-template-columns: repeat(2, 1fr); }

.postcard {
  display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius-lg); overflow: hidden; transition: .16s; text-decoration: none;
}
.postcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--brand-soft-2); }

.postcard__cover {
  position: relative; aspect-ratio: 1.7 / 1; background: var(--brand-soft); overflow: hidden;
}
.postcard__cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.postcard__cover-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--brand-ink); opacity: .45; }
.postcard__badge {
  position: absolute; top: 12px; left: 12px; z-index: 3;
  display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 11px;
  letter-spacing: .04em; text-transform: uppercase; color: var(--brand-ink);
  background: rgba(255,255,255,.94); padding: 5px 10px; border-radius: 7px; box-shadow: var(--shadow-sm);
}
.postcard__body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.postcard__body h3 { font-size: 18px; line-height: 1.28; text-wrap: pretty; color: var(--ink); margin: 0; }
.postcard__excerpt { font-size: 14px; color: var(--text); margin: 10px 0 0; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.postcard__spacer { flex: 1; min-height: 12px; }
.postcard__meta { display: flex; align-items: center; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-soft); font-size: 12.5px; color: var(--muted); font-weight: 600; flex-wrap: wrap; }
.postcard__author { font-weight: 700; color: var(--ink); text-decoration: none; }
.postcard__author:hover { color: var(--brand-ink); }
.meta-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--faint); flex-shrink: 0; }

.blog-empty { text-align: center; padding: 60px 0; color: var(--muted); }

/* ---------- pagination ---------- */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 44px; flex-wrap: wrap; }
.pager__pages { display: flex; gap: 8px; flex-wrap: wrap; }
.pager__btn {
  min-width: 42px; height: 42px; padding: 0 12px; border: 1px solid var(--line); background: #fff;
  border-radius: 10px; font-weight: 700; font-size: 14.5px; color: var(--text); display: grid; place-items: center; transition: .12s; text-decoration: none;
}
.pager__btn:hover { border-color: var(--brand); color: var(--brand-ink); }
.pager__btn.is-on { background: var(--brand); color: #fff !important; border-color: var(--brand); box-shadow: 0 6px 16px rgba(20,163,163,.28); }
.pager__btn.is-disabled { opacity: .4; pointer-events: none; }
.pager__ellipsis { display: grid; place-items: center; min-width: 30px; color: var(--faint); font-weight: 700; }
.pager__count { font-size: 14px; color: var(--muted); font-weight: 600; }

/* ---------- classic landing / category / author (main + sidebar) ---------- */
.blog-archive-head { padding-top: 26px; }
.archive-title { font-size: 40px; margin: 14px 0 6px; text-transform: capitalize; }
.archive-sub { font-size: 15px; color: var(--muted); font-weight: 600; margin: 0; }

.blog-shell { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; align-items: start; }
.blog-main { min-width: 0; }
.blog-main .grid-head { margin-bottom: 18px; }
.blog-main .grid-head h2 { font-size: 22px; margin: 0; }

/* ---------- sidebar ---------- */
.blog-aside { display: flex; flex-direction: column; gap: 30px; }
.side-block { }
.side-head { border-bottom: 3px solid var(--brand); margin-bottom: 18px; line-height: 0; }
.side-head span {
  display: inline-block; background: var(--brand-deep); color: #fff; font-family: var(--font-display);
  font-weight: 800; font-size: 13px; letter-spacing: .05em; text-transform: uppercase;
  padding: 9px 16px; border-radius: 7px 7px 0 0; line-height: 1;
}

.mostread { display: flex; flex-direction: column; gap: 16px; }
.mr-item { display: flex; gap: 12px; align-items: center; text-align: left; text-decoration: none; }
.mr-thumb {
  width: 76px; height: 58px; border-radius: 9px; overflow: hidden; flex-shrink: 0;
  background: var(--brand-soft); position: relative; display: grid; place-items: center; color: var(--brand-ink);
}
.mr-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mr-body b { font-size: 14px; font-weight: 700; color: var(--ink); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mr-item:hover .mr-body b { color: var(--brand-ink); }
.mr-body span { font-size: 12px; color: var(--muted); font-weight: 600; display: block; margin-top: 4px; }

.cat-buttons { display: flex; flex-direction: column; gap: 10px; }
.cat-button {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--brand-deep); color: #fff; border: 0; border-radius: 8px;
  padding: 13px 16px; font-weight: 700; font-size: 14.5px; transition: .14s; text-align: left;
  text-decoration: none;
}
.cat-button:hover { background: var(--brand-ink); transform: translateX(2px); color: #fff; }
.cat-button.is-on { background: var(--brand); }
.cat-button__count { background: rgba(255,255,255,.22); border-radius: 20px; padding: 1px 9px; font-size: 12.5px; font-weight: 800; }

.top-authors { display: flex; flex-direction: column; gap: 4px; }
.ta-item { display: flex; align-items: center; gap: 12px; background: transparent; border: 0; padding: 8px; border-radius: 11px; text-align: left; transition: .12s; text-decoration: none; }
.ta-item:hover { background: var(--bg-soft); }
.ta-item.is-on { background: var(--brand-soft); }
.ta-avatar { width: 44px; height: 44px; border-radius: 50%; overflow: hidden; flex-shrink: 0; background: var(--brand-soft); display: grid; place-items: center; color: var(--brand-ink); }
.ta-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ta-body b { font-size: 14.5px; font-weight: 700; color: var(--ink); display: block; }
.ta-badges { display: flex; gap: 6px; margin-top: 5px; }
.ta-badge { font-size: 10.5px; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; background: var(--ink); color: #fff; padding: 2px 7px; border-radius: 4px; white-space: nowrap; }
.ta-badge--ghost { background: var(--bg-soft); color: var(--muted); }

/* ---------- author card (author page) ---------- */
.author-card { display: flex; gap: 22px; align-items: flex-start; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 26px; background: #fff; box-shadow: var(--shadow-sm); }
.author-card__avatar { width: 92px; height: 92px; border-radius: 50%; overflow: hidden; flex-shrink: 0; background: var(--brand-soft); display: grid; place-items: center; color: var(--brand-ink); }
.author-card__avatar img { width: 100%; height: 100%; object-fit: cover; }
.author-card__badges { display: flex; gap: 8px; margin-bottom: 12px; }
.author-card__badge { font-size: 11px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; background: var(--ink); color: #fff; padding: 4px 10px; border-radius: 5px; white-space: nowrap; }
.author-card__badge--ghost { background: var(--bg-soft); color: var(--muted); }
.author-card__bio { font-size: 15px; color: var(--text); line-height: 1.6; margin: 0 0 16px; max-width: 640px; }
.author-card__social { display: flex; gap: 8px; }
.author-soc { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; color: var(--text); transition: .14s; text-decoration: none; }
.author-soc:hover { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); }
.author-soc svg { width: 17px; height: 17px; }

/* ============================================================
   ARTICLE DETAIL
   ============================================================ */
.art-head { padding-top: 30px; }
.art-head__cat {
  display: inline-flex; align-items: center; gap: 7px; font-weight: 800; font-size: 12px;
  letter-spacing: .05em; text-transform: uppercase; color: var(--brand-ink); white-space: nowrap;
  background: var(--brand-soft); padding: 7px 13px; border-radius: 8px; margin-bottom: 16px;
  text-decoration: none;
}
.art-head h1 { font-size: 42px; line-height: 1.1; max-width: 880px; text-wrap: pretty; }
.art-head__sub { font-size: 18px; color: var(--text); max-width: 720px; margin: 16px 0 0; line-height: 1.55; }

.art-meta { display: flex; align-items: center; gap: 16px; margin-top: 24px; flex-wrap: wrap; }
.art-meta__author { display: flex; align-items: center; gap: 11px; }
.art-meta__avatar { width: 44px; height: 44px; border-radius: 50%; overflow: hidden; background: var(--brand-soft); display: grid; place-items: center; color: var(--brand-ink); flex-shrink: 0; }
.art-meta__avatar img { width: 100%; height: 100%; object-fit: cover; }
.art-meta__name { display: block; font-weight: 700; color: var(--ink); font-size: 15px; text-decoration: none; }
.art-meta__name:hover { color: var(--brand-ink); }
.art-meta__role { font-size: 13px; color: var(--muted); font-weight: 600; }
.art-meta__facts { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); font-weight: 600; }
.art-meta__facts .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--faint); }
.art-meta__spacer { flex: 1; }

.sharebar { display: flex; align-items: center; gap: 8px; }
.sharebar__label { font-size: 13px; font-weight: 700; color: var(--muted); margin-right: 2px; }
.share-btn { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; color: var(--text); transition: .14s; cursor: pointer; }
.share-btn:hover { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); }
.share-btn svg { width: 17px; height: 17px; }

.art-hero { margin: 30px 0 0; border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 2.3 / 1; background: var(--brand-soft); border: 1px solid var(--line); }
.art-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.art-hero-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--brand-ink); opacity: .4; }

.art-layout { display: grid; grid-template-columns: 1fr 240px; gap: 56px; align-items: start; padding-top: 44px; }
.art-body { max-width: 760px; min-width: 0; }
.art-body > * { margin: 0 0 22px; }
.art-body p { font-size: 17.5px; line-height: 1.7; color: #33424b; }
.art-body p strong { color: var(--ink); }
.art-body h2 { font-size: 27px; margin: 40px 0 4px !important; scroll-margin-top: 150px; }
.art-body h3 { font-size: 21px; margin: 28px 0 0 !important; }
.art-body img { max-width: 100%; border-radius: var(--radius); }
.art-body ul, .art-body ol { font-size: 17px; line-height: 1.7; color: #33424b; padding-left: 4px; display: flex; flex-direction: column; gap: 10px; }
.art-body ul { list-style: none; }
.art-body ul li { position: relative; padding-left: 30px; }
.art-body ul li::before { content: ""; position: absolute; left: 4px; top: 11px; width: 8px; height: 8px; border-radius: 3px; background: var(--brand); }
.art-body ol { list-style: none; counter-reset: step; }
.art-body ol li { position: relative; padding-left: 44px; min-height: 30px; padding-top: 2px; }
.art-body ol li::before {
  counter-increment: step; content: counter(step); position: absolute; left: 0; top: 0;
  width: 30px; height: 30px; border-radius: 9px; background: var(--brand-soft); color: var(--brand-ink);
  font-family: var(--font-display); font-weight: 800; font-size: 14px; display: grid; place-items: center;
}
.art-body blockquote { border-left: 4px solid var(--brand); padding: 6px 0 6px 26px; margin: 32px 0; }
.art-body blockquote p { font-family: var(--font-display); font-size: 22px; line-height: 1.35; color: var(--ink); font-weight: 600; margin: 0; }
.art-body a { color: var(--brand-ink); text-decoration: underline; text-underline-offset: 2px; }
.art-body a:hover { color: var(--brand); }

.art-toc { position: sticky; top: 102px; }
.art-toc__label { font-family: var(--font-display); font-weight: 800; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.art-toc__list { display: flex; flex-direction: column; gap: 2px; border-left: 2px solid var(--line); }
.art-toc__item {
  display: block; border-left: 2px solid transparent; padding: 8px 0 8px 16px; margin-left: -2px;
  font-size: 13.5px; font-weight: 600; color: var(--muted); transition: .14s; line-height: 1.4; text-decoration: none;
}
.art-toc__item:hover { color: var(--brand-ink); }
.art-toc__item.is-on { color: var(--brand-ink); border-left-color: var(--brand); font-weight: 800; }
.art-toc__share { display: flex; gap: 8px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }

.art-tags { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin: 28px 0 0; }
.art-tags__label { font-size: 13px; font-weight: 700; color: var(--muted); }
.art-tag { border: 1px solid var(--line); background: #fff; border-radius: 20px; padding: 7px 14px; font-size: 13px; font-weight: 600; color: var(--text); transition: .14s; text-decoration: none; display: inline-block; }
.art-tag:hover { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); }

.art-author {
  display: flex; gap: 18px; align-items: flex-start; background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 24px 26px; margin: 16px 0 0;
}
.art-author__avatar { width: 64px; height: 64px; border-radius: 50%; overflow: hidden; flex-shrink: 0; background: var(--brand-soft); display: grid; place-items: center; color: var(--brand-ink); }
.art-author__avatar img { width: 100%; height: 100%; object-fit: cover; }
.art-author__role { font-size: 12.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--brand-ink); }
.art-author__name { font-family: var(--font-display); font-size: 21px; font-weight: 700; color: var(--ink); margin: 3px 0 8px; display: block; text-decoration: none; }
.art-author__name:hover { color: var(--brand-ink); }
.art-author__bio { font-size: 14.5px; color: var(--text); line-height: 1.6; margin: 0; }
.art-author__link { display: inline-flex; align-items: center; gap: 7px; margin-top: 14px; font-family: var(--font-display); font-weight: 800; font-size: 14px; color: var(--brand-ink); text-decoration: none; transition: gap .14s; }
.art-author__link:hover { gap: 11px; }
.art-author__link svg { width: 16px; height: 16px; }

.art-related { margin-top: 56px; padding-bottom: 60px; }
.art-related h2 { font-size: 26px; margin-bottom: 20px; }

/* --- breadcrumbs --- */
.blog-breadcrumbs { display: flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--muted); margin-bottom: 16px; flex-wrap: wrap; }
.blog-breadcrumbs a { color: var(--muted); text-decoration: none; }
.blog-breadcrumbs a:hover { color: var(--brand-ink); }
.blog-breadcrumbs .sep { color: var(--faint); }
.blog-breadcrumbs .cur { color: var(--text); }

/* --- section spacing --- */
.blog-section { padding: 34px 0 56px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1080px) {
  .blog-shell { grid-template-columns: 1fr; gap: 44px; }
  .blog-aside { display: grid; grid-template-columns: repeat(2, 1fr); gap: 30px 40px; align-items: start; }
  .blog-aside .side-block:first-child { grid-column: 1 / -1; }
}
@media (max-width: 980px) {
  .art-layout { grid-template-columns: 1fr; gap: 0; }
  .art-toc { display: none; }
  .feat-cluster { grid-template-columns: 1fr; }
  .feat-cluster__minis { grid-template-columns: 1fr 1fr; }
  .blog-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 820px) {
  .feat-cluster { grid-template-columns: 1fr; }
  .feat-cluster__minis { grid-template-columns: 1fr 1fr; }
  .archive-title { font-size: 32px; }
}
@media (max-width: 680px) {
  .blog-grid { grid-template-columns: 1fr; }
  .blog-grid--2 { grid-template-columns: 1fr; }
  .blog-aside { grid-template-columns: 1fr; }
  .feat-cluster__minis { grid-template-columns: 1fr; }
  .art-head h1 { font-size: 30px; }
  .blog-top h1 { font-size: 32px; }
  .author-card { flex-direction: column; }
  .blog-wrap { padding: 0 16px; }
}
