/* ============================================================
   APTR GLOBAL — Blog (directory + article)
   Loads AFTER styles.css + homepage-v2.css + pages-v2.css.
   Brand-locked: navy #00276A · blue #305FB0 · amber #FFA600.
   ============================================================ */

/* ============================================================
   DIRECTORY — head + filter chips
   ============================================================ */
.blog-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.blog-head .section-head { max-width: 640px; }

.blog-filter { display: flex; flex-wrap: wrap; gap: 10px; margin-top: clamp(30px, 3.5vw, 46px); position: relative; z-index: 2; }
.chip {
  font-family: var(--ff-text); font-weight: 600; font-size: 14.5px; color: var(--ink-soft);
  background: #fff; border: 1px solid var(--line); border-radius: 100px;
  padding: 10px 20px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  transition: color .3s var(--ease), background .3s var(--ease), border-color .3s var(--ease), transform .3s var(--ease);
}
.chip .chip-n { font-size: 12px; font-weight: 700; color: var(--muted-2); transition: color .3s var(--ease); }
.chip:hover { border-color: var(--blue); color: var(--navy); transform: translateY(-2px); }
.chip.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip.active .chip-n { color: var(--amber); }

/* ============================================================
   FEATURED POST
   ============================================================ */
.feature-post {
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 0;
  margin-top: clamp(28px, 3vw, 40px); border: 1px solid var(--line); border-radius: var(--radius-xl);
  overflow: hidden; background: #fff; position: relative; z-index: 2;
  transition: transform .42s var(--ease), box-shadow .42s var(--ease), border-color .42s var(--ease);
}
.feature-post:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: transparent; }
.feature-post .fp-media { position: relative; overflow: hidden; min-height: 340px; }
.feature-post image-slot { width: 100%; height: 100%; display: block; border-radius: 0; }
.feature-post .fp-badge {
  position: absolute; top: 20px; left: 20px; z-index: 3;
  font-family: var(--ff-display); font-weight: 700; font-size: 12.5px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--navy); background: var(--amber); padding: 8px 16px; border-radius: 100px;
}
.feature-post .fp-body { padding: clamp(30px, 3.4vw, 50px); display: flex; flex-direction: column; }
.feature-post .post-meta { margin-bottom: 18px; }
.feature-post h2 { font-size: clamp(26px, 2.9vw, 38px); color: var(--navy); line-height: 1.1; }
.feature-post .fp-excerpt { color: var(--ink-soft); font-size: 16.5px; line-height: 1.6; margin-top: 18px; max-width: 52ch; }
.feature-post .fp-author { display: flex; align-items: center; gap: 12px; margin-top: auto; padding-top: 28px; }
.feature-post .fp-avatar {
  width: 44px; height: 44px; border-radius: 50%; flex: none; background: var(--navy); color: var(--amber);
  display: grid; place-items: center; font-family: var(--ff-display); font-weight: 700; font-size: 16px;
}
.feature-post .fp-author .fa-name { font-weight: 700; color: var(--navy); font-size: 14.5px; }
.feature-post .fp-author .fa-role { font-size: 13px; color: var(--muted); }
.feature-post .link-arrow { margin-top: 24px; }

/* ============================================================
   POST GRID (extends homepage .post)
   ============================================================ */
.blog-list { margin-top: clamp(28px, 3vw, 40px); }
.blog-list .blog-grid { margin-top: 0; }
.post { position: relative; }
.post .post-tag { cursor: default; }
/* fade for filtering */
.post.is-hidden { display: none; }
.post { animation: postIn .5s var(--ease) both; }
@keyframes postIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.post image-slot { transition: transform .5s var(--ease); }
.post:hover image-slot { transform: scale(1.04); }
.post .post-media { overflow: hidden; }
.post .reading-time { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; }
.reading-time { display: inline-flex; align-items: center; gap: 6px; }
.reading-time svg { width: 14px; height: 14px; flex: none; }

.blog-empty {
  display: none; text-align: center; padding: 60px 20px; color: var(--muted);
  font-size: 16px; grid-column: 1 / -1;
}
.blog-empty.show { display: block; }

/* ============================================================
   ARTICLE — reading progress bar
   ============================================================ */
.read-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: linear-gradient(90deg, var(--blue), var(--amber)); z-index: 200;
  transition: width .1s linear;
}

/* ---------- article hero ---------- */
.article-hero { padding: clamp(34px, 4vw, 52px) 0 clamp(28px, 3vw, 40px); position: relative; }
.article-hero .breadcrumb { color: var(--muted); margin-bottom: 26px; }
.article-hero .breadcrumb a { color: var(--muted); }
.article-hero .breadcrumb a:hover { color: var(--navy); }
.article-hero .breadcrumb .sep { color: var(--muted-2); opacity: 1; }
.article-hero .breadcrumb .here { color: var(--blue); }
.article-hero .ah-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 20px; }
.article-hero h1 { font-size: clamp(30px, 4.4vw, 52px); line-height: 1.06; max-width: 18ch; }
.article-hero .ah-lede { font-size: clamp(17px, 1.7vw, 20px); color: var(--ink-soft); line-height: 1.55; margin-top: 22px; max-width: 60ch; }
.article-hero .ah-byline { display: flex; align-items: center; gap: 14px; margin-top: 30px; }
.article-hero .ah-avatar {
  width: 52px; height: 52px; border-radius: 50%; flex: none; background: var(--navy); color: var(--amber);
  display: grid; place-items: center; font-family: var(--ff-display); font-weight: 700; font-size: 19px;
}
.article-hero .ah-byline .ab-name { font-weight: 700; color: var(--navy); font-size: 15.5px; }
.article-hero .ah-byline .ab-role { font-size: 13.5px; color: var(--muted); }

.article-cover {
  position: relative; border-radius: var(--radius-xl); overflow: hidden; border: 1px solid var(--line);
  margin-top: clamp(28px, 3vw, 40px);
}
.article-cover image-slot { width: 100%; height: clamp(280px, 42vw, 520px); display: block; border-radius: 0; }

/* ============================================================
   ARTICLE — body + sticky sidebar
   ============================================================ */
.article-wrap {
  display: grid; grid-template-columns: 1fr minmax(260px, 300px); gap: clamp(40px, 5vw, 80px);
  align-items: start; padding-top: clamp(40px, 5vw, 64px); padding-bottom: clamp(50px, 6vw, 80px);
}

/* ---- prose ---- */
.prose { max-width: 720px; font-size: 18px; line-height: 1.75; color: var(--ink); }
.prose > * + * { margin-top: 24px; }
.prose h2 {
  font-size: clamp(24px, 2.6vw, 32px); color: var(--navy); margin-top: 52px; line-height: 1.15;
  scroll-margin-top: 100px;
}
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: clamp(19px, 2vw, 23px); color: var(--navy); margin-top: 36px; scroll-margin-top: 100px; }
.prose p { color: var(--ink); }
.prose a { color: var(--blue); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
.prose a:hover { color: var(--navy); }
.prose strong { color: var(--navy); font-weight: 700; }
.prose ul, .prose ol { padding-left: 4px; margin-top: 20px; display: grid; gap: 14px; list-style: none; }
.prose ul li, .prose ol li { position: relative; padding-left: 34px; color: var(--ink); }
.prose ul li::before {
  content: ""; position: absolute; left: 6px; top: 11px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--amber); box-shadow: 0 0 0 4px var(--amber-tint);
}
.prose ol { counter-reset: li; }
.prose ol li { counter-increment: li; }
.prose ol li::before {
  content: counter(li); position: absolute; left: 0; top: 2px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--blue-tint); color: var(--blue); font-family: var(--ff-display); font-weight: 700; font-size: 13px;
  display: grid; place-items: center;
}

/* pull-quote / callout */
.prose blockquote {
  margin: 36px 0; padding: 26px 30px; background: var(--paper); border-left: 4px solid var(--amber);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0; font-family: var(--ff-display); font-weight: 600;
  font-size: clamp(19px, 2vw, 23px); line-height: 1.4; color: var(--navy);
}
.prose blockquote p { color: var(--navy); }
.callout {
  margin: 36px 0; padding: 26px 28px; border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--blue-tint), #fff); position: relative;
}
.callout .co-label {
  display: inline-flex; align-items: center; gap: 8px; font-family: var(--ff-text); font-weight: 700;
  font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--blue); margin-bottom: 10px;
}
.callout .co-label svg { width: 16px; height: 16px; }
.callout p { color: var(--ink); font-size: 16.5px; }

/* figure */
.prose figure { margin: 40px 0; }
.prose figure image-slot { width: 100%; height: clamp(240px, 34vw, 420px); border-radius: var(--radius-lg); display: block; }
.prose figcaption { font-size: 14px; color: var(--muted); margin-top: 12px; text-align: center; }

/* key-takeaways table-like grid */
.kt-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin: 36px 0; }
.kt-card { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px 24px; background: #fff; }
.kt-card .kt-num { font-family: var(--ff-display); font-weight: 700; font-size: 26px; color: var(--amber); }
.kt-card h4 { color: var(--navy); font-size: 16px; margin-top: 6px; }
.kt-card p { color: var(--ink-soft); font-size: 14.5px; line-height: 1.55; margin-top: 6px; }

/* ---- article tag/share footer ---- */
.article-foot { max-width: 720px; margin-top: 50px; padding-top: 30px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.article-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.article-tags a { font-size: 13px; font-weight: 600; color: var(--navy); background: var(--paper); border: 1px solid var(--line); padding: 7px 14px; border-radius: 100px; transition: background .25s, color .25s; }
.article-tags a:hover { background: var(--navy); color: #fff; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.article-side { position: sticky; top: 96px; display: grid; gap: 24px; }
.side-card { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; background: #fff; }
.side-card h4 { font-family: var(--ff-text); font-weight: 700; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted-2); margin-bottom: 16px; }

/* TOC */
.toc ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.toc a {
  display: block; font-size: 14.5px; line-height: 1.4; color: var(--ink-soft); padding: 8px 12px;
  border-radius: 8px; border-left: 2px solid transparent; transition: color .25s, background .25s, border-color .25s;
}
.toc a:hover { color: var(--navy); background: var(--paper); }
.toc a.active { color: var(--navy); font-weight: 700; background: var(--blue-tint); border-left-color: var(--amber); }

/* share */
.share-row { display: flex; gap: 10px; }
.share-row button, .share-row a {
  width: 42px; height: 42px; border-radius: 50%; border: 1.5px solid var(--line); background: #fff; cursor: pointer;
  display: grid; place-items: center; color: var(--navy);
  transition: background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease), transform .3s var(--ease);
}
.share-row button svg, .share-row a svg { width: 18px; height: 18px; }
.share-row button:hover, .share-row a:hover { background: var(--navy); color: var(--amber); border-color: var(--navy); transform: translateY(-3px); }
.share-copied { font-size: 13px; color: var(--blue); font-weight: 600; margin-top: 12px; opacity: 0; transition: opacity .3s; }
.share-copied.show { opacity: 1; }

/* author card */
.author-card { text-align: left; }
.author-card .ac-top { display: flex; align-items: center; gap: 14px; }
.author-card .ac-avatar { width: 54px; height: 54px; border-radius: 50%; flex: none; background: var(--navy); color: var(--amber); display: grid; place-items: center; font-family: var(--ff-display); font-weight: 700; font-size: 20px; }
.author-card .ac-name { font-weight: 700; color: var(--navy); font-size: 16px; }
.author-card .ac-role { font-size: 13px; color: var(--muted); }
.author-card p { font-size: 14px; color: var(--ink-soft); line-height: 1.6; margin-top: 16px; }

/* sidebar CTA */
.side-cta { background: linear-gradient(165deg, var(--navy), #001b4a); border-color: transparent; color: #fff; position: relative; overflow: hidden; }
.side-cta .sc-blob { position: absolute; right: -50px; bottom: -60px; width: 150px; height: 150px; border-radius: 46% 54% 58% 42% / 52% 44% 56% 48%; background: var(--amber); opacity: .85; }
.side-cta h4 { color: rgba(255,255,255,0.7); }
.side-cta h3 { color: #fff; font-size: 19px; position: relative; z-index: 2; }
.side-cta p { color: rgba(255,255,255,0.74); font-size: 14px; margin-top: 8px; position: relative; z-index: 2; }
.side-cta .btn { margin-top: 18px; position: relative; z-index: 2; }

/* ============================================================
   RELATED POSTS
   ============================================================ */
.related { border-top: 1px solid var(--line); }
.related .section-head { max-width: 600px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 980px) {
  .feature-post { grid-template-columns: 1fr; }
  .feature-post .fp-media { min-height: 260px; }
  .article-wrap { grid-template-columns: 1fr; }
  .article-side { position: static; order: 2; grid-template-columns: 1fr 1fr; display: grid; }
  .toc { display: none; }
  .kt-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .article-side { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .post, .post image-slot, .feature-post, .chip, .share-row button, .share-row a { transition: none; animation: none; }
}
