/* =============================================================
   OPD Pilot — Blog (listing + article)
   Editorial/magazine layout. Uses the site design tokens only.
   ============================================================= */

/* ---------- shared blog page bg ---------- */
.blogpage { background: var(--bg-canvas); }

/* ---------- Listing hero ---------- */
.blog-hero {
  background: var(--color-crimson-50);
  border-bottom: 1px solid var(--border-subtle);
  text-align: center;
  padding: clamp(52px, 7vw, 88px) var(--space-7) clamp(40px, 5vw, 56px);
}
.blog-hero__eyebrow {
  display: inline-block; font-family: var(--font-display); font-weight: var(--fw-bold);
  font-size: var(--text-2xs); letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--color-crimson-600);
}
.blog-hero h1 {
  font-family: var(--font-display); font-weight: 800; letter-spacing: -0.02em;
  font-size: clamp(32px, 5vw, 48px); color: var(--fg-primary);
  margin: var(--space-3) 0 var(--space-3); line-height: 1.1;
}
.blog-hero p {
  font-size: clamp(16px, 2.2vw, 19px); color: var(--fg-secondary);
  line-height: 1.6; max-width: 640px; margin: 0 auto;
}

/* ---------- Category filter pills ---------- */
.blog-filter {
  display: flex; flex-wrap: wrap; gap: var(--space-3); justify-content: center;
  padding: var(--space-7) var(--space-7) 0;
}
.blog-filter__pill {
  font-family: var(--font-display); font-weight: var(--fw-semibold); font-size: var(--text-sm);
  color: var(--fg-secondary); background: var(--bg-surface);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-pill);
  padding: 8px 16px; cursor: pointer; transition: all .18s; text-decoration: none;
}
.blog-filter__pill:hover { border-color: var(--color-crimson-300); color: var(--color-crimson-600); }
.blog-filter__pill.is-active { background: var(--color-crimson-500); border-color: var(--color-crimson-500); color: #fff; }

/* ---------- Featured post ---------- */
.blog-wrap { max-width: 1160px; margin: 0 auto; padding: clamp(32px,5vw,56px) var(--space-7) clamp(56px,7vw,88px); }
.blog-featured {
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 0;
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-2xl); overflow: hidden; box-shadow: var(--shadow-lg);
  margin-bottom: clamp(32px,4vw,48px); text-decoration: none;
  transition: transform .2s, box-shadow .2s;
}
.blog-featured:hover { transform: translateY(-3px); box-shadow: var(--shadow-xl); }
.blog-cover {
  position: relative; min-height: 300px;
  background: linear-gradient(135deg, var(--color-midnight-900), var(--color-crimson-600));
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.blog-cover::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(420px 260px at 78% 18%, rgba(255,255,255,0.18), transparent 60%);
}
.blog-cover__mark { position: relative; z-index: 1; width: 40%; max-width: 130px; opacity: 0.92; }
.blog-cover--alt { background: linear-gradient(135deg, #1E3A8A, #2563EB); }
.blog-cover--green { background: linear-gradient(135deg, #14532D, #16A34A); }
.blog-cover--amber { background: linear-gradient(135deg, #7C2D12, #D97706); }
.blog-featured__body { padding: clamp(24px,3vw,44px); display: flex; flex-direction: column; }
.blog-chip {
  align-self: flex-start; font-family: var(--font-display); font-weight: var(--fw-bold);
  font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--color-crimson-600); background: var(--color-crimson-50);
  border: 1px solid var(--color-crimson-100); padding: 5px 11px; border-radius: var(--radius-pill);
  margin-bottom: var(--space-4);
}
.blog-featured__title {
  font-family: var(--font-display); font-weight: 800; letter-spacing: -0.02em;
  font-size: clamp(24px, 3vw, 32px); line-height: 1.18; color: var(--fg-primary); margin: 0 0 var(--space-3);
}
.blog-featured__excerpt { font-size: var(--text-base); color: var(--fg-secondary); line-height: 1.65; margin: 0 0 var(--space-6); }
.blog-readmore { align-self: flex-start; margin-top: var(--space-5); font-family: var(--font-display); font-weight: var(--fw-semibold); font-size: var(--text-sm); color: var(--color-crimson-600); text-decoration: none; }
.blog-readmore:hover { text-decoration: underline; }

/* ---------- Post meta (author row) ---------- */
.blog-meta { display: flex; align-items: center; gap: var(--space-3); margin-top: auto; }
.blog-meta__avatar {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  background: var(--color-midnight-800); color: #fff; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: var(--fw-bold); font-size: var(--text-sm);
}
.blog-meta__who { display: flex; flex-direction: column; line-height: 1.3; }
.blog-meta__name { font-family: var(--font-display); font-weight: var(--fw-semibold); font-size: var(--text-sm); color: var(--fg-primary); }
.blog-meta__date { font-size: var(--text-2xs); color: var(--fg-tertiary); }

/* ---------- Grid ---------- */
.blog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px,2.5vw,28px); }
.blog-card {
  display: flex; flex-direction: column; background: var(--bg-surface);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-xl); overflow: hidden;
  text-decoration: none; transition: transform .2s, box-shadow .2s, border-color .2s;
}
.blog-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--color-crimson-200); }
.blog-card .blog-cover { min-height: 168px; }
.blog-card .blog-cover__mark { max-width: 84px; }
.blog-card__body { padding: var(--space-5) var(--space-5) var(--space-6); display: flex; flex-direction: column; flex: 1; }
.blog-card__title {
  font-family: var(--font-display); font-weight: var(--fw-bold); font-size: var(--text-lg);
  line-height: 1.3; color: var(--fg-primary); margin: var(--space-3) 0 var(--space-2);
}
.blog-card__excerpt { font-size: var(--text-sm); color: var(--fg-secondary); line-height: 1.6; margin: 0 0 var(--space-5); }
.blog-card .blog-meta { margin-top: auto; }

/* empty state (no posts yet) */
.blog-empty { text-align: center; padding: var(--space-9) var(--space-7); color: var(--fg-tertiary); font-size: var(--text-base); }

/* =============================================================
   Article (single post)
   ============================================================= */
.post-hero { background: var(--color-crimson-50); border-bottom: 1px solid var(--border-subtle); }
.post-hero__inner { max-width: 1200px; margin: 0 auto; padding: clamp(28px,4vw,44px) var(--space-7) clamp(32px,4vw,48px); }
.post-crumb { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-display);
  font-size: var(--text-2xs); font-weight: var(--fw-semibold); color: var(--fg-tertiary);
  text-decoration: none; margin-bottom: var(--space-5); }
.post-crumb:hover { color: var(--color-crimson-600); }
.post-crumb svg { width: 14px; height: 14px; }
.post-hero h1 {
  font-family: var(--font-display); font-weight: 800; letter-spacing: -0.02em; line-height: 1.12;
  font-size: clamp(30px, 4.6vw, 46px); color: var(--fg-primary); margin: var(--space-3) 0 var(--space-4);
}
.post-hero__dek { font-size: clamp(17px, 2.2vw, 20px); color: var(--fg-secondary); line-height: 1.55; margin: 0 0 var(--space-6); }
.post-byline { display: flex; align-items: center; gap: var(--space-3); }
.post-byline .blog-meta__avatar { width: 44px; height: 44px; }
.post-byline__meta { font-size: var(--text-sm); color: var(--fg-tertiary); }
.post-byline__meta b { color: var(--fg-primary); font-family: var(--font-display); }
.post-byline__sep { color: var(--border-default); margin: 0 6px; }

/* featured figure */
.post-figure { max-width: 1200px; margin: clamp(-24px,-2vw,-16px) auto 0; padding: 0 var(--space-7); }
.post-figure__img {
  border-radius: var(--radius-2xl); overflow: hidden; box-shadow: var(--shadow-lg);
  min-height: clamp(200px, 34vw, 380px);
  background: linear-gradient(135deg, var(--color-midnight-900), var(--color-crimson-600));
  display: flex; align-items: center; justify-content: center;
}
.post-figure__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-figure__mark { width: 120px; opacity: 0.92; }

/* body */
.post-body { max-width: 1200px; margin: 0 auto; padding: clamp(40px,5vw,64px) var(--space-7) clamp(24px,3vw,32px); }
.post-body > p, .post-body > ul, .post-body > ol { font-size: 18px; line-height: 1.78; color: var(--fg-secondary); margin: 0 0 var(--space-6); }
.post-body > h2 { font-family: var(--font-display); font-weight: var(--fw-bold); font-size: clamp(24px,3vw,30px);
  letter-spacing: -0.015em; line-height: 1.25; color: var(--fg-primary); margin: var(--space-9) 0 var(--space-4); }
.post-body > h3 { font-family: var(--font-display); font-weight: var(--fw-bold); font-size: var(--text-xl);
  color: var(--fg-primary); margin: var(--space-7) 0 var(--space-3); }
.post-body ul, .post-body ol { padding-left: 1.3em; }
.post-body li { margin-bottom: var(--space-3); }
.post-body li::marker { color: var(--color-crimson-500); }
.post-body a { color: var(--color-crimson-600); font-weight: var(--fw-semibold); text-decoration: underline; text-underline-offset: 2px; }
.post-body strong { color: var(--fg-primary); }
.post-body blockquote {
  margin: var(--space-7) 0; padding: var(--space-4) 0 var(--space-4) var(--space-6);
  border-left: 3px solid var(--color-crimson-400); font-family: var(--font-display);
  font-style: italic; font-size: clamp(19px,2.4vw,23px); line-height: 1.5; color: var(--fg-primary);
}
.post-body figure { margin: var(--space-7) 0; }
.post-body figure img { width: 100%; border-radius: var(--radius-xl); border: 1px solid var(--border-subtle); }
.post-body figcaption { font-size: var(--text-xs); color: var(--fg-tertiary); text-align: center; margin-top: var(--space-2); }

/* key-takeaways callout */
.post-callout {
  background: var(--color-crimson-50); border: 1px solid var(--color-crimson-100);
  border-radius: var(--radius-xl); padding: var(--space-6) var(--space-6) var(--space-5); margin: var(--space-7) 0;
}
.post-callout h4 { font-family: var(--font-display); font-weight: var(--fw-bold); font-size: var(--text-md);
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-crimson-700); margin: 0 0 var(--space-3); }
.post-callout ul { margin: 0; padding-left: 1.2em; }
.post-callout li { font-size: var(--text-base); color: var(--fg-secondary); line-height: 1.55; }

/* share row */
.post-share { max-width: 1200px; margin: 0 auto; padding: 0 var(--space-7);
  display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap;
  border-top: 1px solid var(--border-subtle); padding-top: var(--space-6); }
.post-share__label { font-family: var(--font-display); font-weight: var(--fw-semibold); font-size: var(--text-sm); color: var(--fg-tertiary); }
.post-share__btns { display: flex; gap: var(--space-3); }
.post-share__btn { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--bg-surface); border: 1px solid var(--border-subtle); color: var(--fg-secondary); transition: all .18s; }
.post-share__btn:hover { border-color: var(--color-crimson-300); color: var(--color-crimson-600); transform: translateY(-2px); }
.post-share__btn svg { width: 18px; height: 18px; }

/* author bio */
.post-author { max-width: 1200px; margin: clamp(32px,4vw,48px) auto 0; padding: var(--space-6);
  display: flex; gap: var(--space-5); align-items: flex-start;
  background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-xl); }
.post-author__avatar { width: 56px; height: 56px; border-radius: 50%; flex-shrink: 0; background: var(--color-midnight-800);
  color: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 800; font-size: var(--text-lg); }
.post-author__name { font-family: var(--font-display); font-weight: var(--fw-bold); font-size: var(--text-md); color: var(--fg-primary); margin: 0 0 2px; }
.post-author__role { font-size: var(--text-sm); color: var(--fg-tertiary); margin: 0 0 var(--space-2); }
.post-author__bio { font-size: var(--text-sm); color: var(--fg-secondary); line-height: 1.6; margin: 0; }

/* more from blog */
.post-more { max-width: 1200px; margin: 0 auto; padding: clamp(48px,6vw,72px) var(--space-7); }
.post-more__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: var(--space-6); flex-wrap: wrap; gap: var(--space-3); }
.post-more__head h2 { font-family: var(--font-display); font-weight: 800; font-size: clamp(22px,3vw,28px); color: var(--fg-primary); margin: 0; letter-spacing: -0.01em; }
.post-more__all { font-family: var(--font-display); font-weight: var(--fw-semibold); font-size: var(--text-sm); color: var(--color-crimson-600); text-decoration: none; }
.post-more__all:hover { text-decoration: underline; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .blog-grid { grid-template-columns: repeat(2, 1fr); }
  .blog-featured { grid-template-columns: 1fr; }
  .blog-featured .blog-cover { min-height: 200px; }
}
@media (max-width: 560px) {
  .blog-grid { grid-template-columns: 1fr; }
  .post-byline { align-items: flex-start; }
}

/* =============================================================
   Article — richer components (TOC, table, inline CTA, FAQ)
   ============================================================= */
.post-body h2[id], .post-body [id].post-anchor { scroll-margin-top: 90px; }

/* Table of contents */
.post-toc {
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--color-crimson-400); border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6); margin: 0 0 var(--space-8);
}
.post-toc__title {
  font-family: var(--font-display); font-weight: var(--fw-bold); font-size: var(--text-sm);
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--fg-tertiary); margin: 0 0 var(--space-3);
}
.post-toc ol { margin: 0; padding-left: 1.2em; }
.post-toc li { margin-bottom: 8px; font-size: var(--text-base); line-height: 1.5; }
.post-toc li::marker { color: var(--color-crimson-500); font-family: var(--font-display); font-weight: 700; }
.post-toc a { color: var(--fg-secondary); text-decoration: none; font-weight: var(--fw-semibold); }
.post-toc a:hover { color: var(--color-crimson-600); text-decoration: underline; }

/* Comparison table */
.post-table-wrap { overflow-x: auto; margin: var(--space-7) 0; border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); }
.post-table { width: 100%; border-collapse: collapse; font-size: var(--text-base); background: var(--bg-surface); min-width: 520px; }
.post-table th, .post-table td { text-align: left; padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--border-subtle); vertical-align: top; line-height: 1.5; }
.post-table thead th { font-family: var(--font-display); font-weight: var(--fw-bold); font-size: var(--text-sm); color: #fff; background: var(--color-midnight-800); }
.post-table thead th:last-child { background: var(--color-crimson-600); }
.post-table tbody tr:last-child td { border-bottom: none; }
.post-table td:first-child { font-family: var(--font-display); font-weight: var(--fw-semibold); color: var(--fg-primary); }
.post-table td:nth-child(2) { color: var(--fg-tertiary); }
.post-table td:last-child { color: var(--fg-primary); }

/* Inline CTA card */
.post-ctacard {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-5); flex-wrap: wrap;
  background: linear-gradient(135deg, var(--color-midnight-900), var(--color-midnight-800));
  border-radius: var(--radius-2xl); padding: var(--space-6) var(--space-7); margin: var(--space-9) 0;
}
.post-ctacard__body h3 { font-family: var(--font-display); font-weight: var(--fw-bold); font-size: var(--text-xl); color: #fff; margin: 0 0 6px; }
.post-ctacard__body p { font-size: var(--text-sm); color: #c7d3e6; margin: 0; line-height: 1.5; }
.post-ctacard .btn { flex-shrink: 0; }

/* Checklist */
.post-check { list-style: none !important; padding-left: 0 !important; }
.post-check li { position: relative; padding-left: 30px; margin-bottom: var(--space-3); }
.post-check li::before {
  content: ""; position: absolute; left: 0; top: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--color-crimson-50) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23DC102E' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center/12px no-repeat;
}

/* FAQ accordion (native <details>, no JS) */
.post-faq { margin: var(--space-5) 0 0; }
.post-faq details { border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); background: var(--bg-surface); margin-bottom: var(--space-3); overflow: hidden; }
.post-faq summary { cursor: pointer; list-style: none; padding: var(--space-5) var(--space-6);
  font-family: var(--font-display); font-weight: var(--fw-semibold); font-size: var(--text-md); color: var(--fg-primary);
  display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); }
.post-faq summary::-webkit-details-marker { display: none; }
.post-faq summary::after { content: "+"; font-size: 24px; font-weight: 400; line-height: 1; color: var(--color-crimson-500); flex-shrink: 0; }
.post-faq details[open] summary::after { content: "\2212"; }
.post-faq details[open] summary { border-bottom: 1px solid var(--border-subtle); }
.post-faq__a { padding: var(--space-5) var(--space-6); }
.post-faq__a p { margin: 0 0 var(--space-3); font-size: var(--text-base); color: var(--fg-secondary); line-height: 1.7; }
.post-faq__a p:last-child { margin-bottom: 0; }

@media (max-width: 560px) {
  .post-ctacard { flex-direction: column; align-items: flex-start; }
  .post-ctacard .btn { width: 100%; text-align: center; }
}
