/* ============================================================
   ADBOXX blog article pages (/blog/<slug>/)
   Prose track is sized to the reading measure; tables, figures,
   boxes and cards use the wide track (full container).
   ============================================================ */

.post img {
  height: auto;
}

/* ── Header ─────────────────────────────────────────────────── */
.post-head {
  padding: 7.25rem 0 3.5rem;
  border-bottom: 1px solid var(--border);
}

.post-head-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  gap: 3.5rem;
  align-items: center;
}

.post-h1 {
  font-size: clamp(2rem, 3.6vw, 3.1rem);
  font-weight: 900;
  letter-spacing: -0.035em;
  line-height: 1.12;
  margin-bottom: 1.25rem;
}

.post-lede {
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--text);
}

.post-byline {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  margin-top: 1.75rem;
}

.post-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--border2);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1rem;
  font-weight: 900;
  color: var(--accent);
  letter-spacing: -0.04em;
}

.post-byline-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--white);
}

.post-byline-name a:hover {
  color: var(--accent);
}

.post-byline-meta {
  font-size: 0.8125rem;
  color: var(--muted);
}

.post-hero-img img {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--border);
}

/* ── Flow grid: prose track + wide track ────────────────────── */
.post-flow {
  display: grid;
  grid-template-columns:
    [wide-start] minmax(0, 1fr)
    [prose-start] minmax(0, 46rem)
    [prose-end] minmax(0, 1fr) [wide-end];
  padding: 3.5rem 0 5rem;
}

.post-flow > * {
  grid-column: prose;
}

.post-flow > .wide {
  grid-column: wide;
}

.post-flow h2 {
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: var(--white);
  margin: 3.25rem 0 1rem;
  scroll-margin-top: 5.5rem;
}

.post-flow h3 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1.35;
  margin: 1.75rem 0 0.5rem;
}

.post-flow p,
.post-flow li {
  font-size: 1.0625rem;
  line-height: 1.75;
  color: #d4d4e0;
}

.post-flow p {
  margin-bottom: 1.15rem;
}

.post-flow ul,
.post-flow ol {
  padding-left: 1.35rem;
  margin-bottom: 1.4rem;
}

.post-flow li {
  margin-bottom: 0.6rem;
  padding-left: 0.25rem;
}

.post-flow a:where(:not(.btn-primary, .btn-ghost, .post-card)) {
  color: #8db4ff;
  text-decoration: underline;
  text-decoration-color: rgba(141, 180, 255, 0.4);
  text-underline-offset: 3px;
}

.post-flow a:where(:not(.btn-primary, .btn-ghost, .post-card)):hover {
  text-decoration-color: currentColor;
}

.post-flow strong {
  color: var(--white);
  font-weight: 600;
}

/* ── Contents card ──────────────────────────────────────────── */
.post-toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.5rem;
}

.post-toc-label,
.post-box-label {
  display: block;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.9rem;
}

.post-toc ol {
  columns: 2;
  column-gap: 2.5rem;
  margin: 0;
  padding-left: 1.1rem;
}

.post-toc li {
  font-size: 0.9375rem;
  margin-bottom: 0.45rem;
  break-inside: avoid;
  color: var(--muted);
}

.post-flow .post-toc a {
  color: var(--text);
  text-decoration: none;
}

.post-flow .post-toc a:hover {
  color: var(--accent);
}

/* ── Answer / formula boxes ─────────────────────────────────── */
.post-box {
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.09), rgba(59, 130, 246, 0.03));
  border: 1px solid rgba(59, 130, 246, 0.24);
  border-radius: 16px;
  padding: 1.75rem;
  margin: 1rem 0 1.5rem;
}

.post-box-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.post-flow .post-box h3 {
  margin-top: 0;
  font-size: 1.0625rem;
}

.post-flow .post-box p {
  font-size: 0.975rem;
  line-height: 1.65;
  margin-bottom: 0;
}

.post-formula {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.01em;
  margin-bottom: 0.4rem;
}

/* ── Tables ─────────────────────────────────────────────────── */
.post-table-wrap {
  margin: 1.75rem 0 2rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow-x: auto;
  background: var(--surface);
}

.post-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}

.post-table caption {
  text-align: left;
  padding: 1rem 1.15rem 0.25rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.post-table th {
  text-align: left;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--white);
  background: var(--surface2);
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid var(--border2);
}

.post-table td {
  font-size: 0.9375rem;
  line-height: 1.55;
  color: #d0d0dc;
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.post-table tr:last-child td {
  border-bottom: none;
}

.post-table td.num,
.post-table th.num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.post-table tr.hl td {
  background: rgba(59, 130, 246, 0.07);
  color: var(--white);
}

/* ── Figures ────────────────────────────────────────────────── */
.post-figure {
  margin: 2.25rem 0 2.5rem;
}

.post-figure img {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--border);
}

.post-figure figcaption {
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: 0.75rem;
}

/* image + text split (wide) */
.post-split {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 2.75rem;
  align-items: center;
  margin: 2.75rem 0;
}

.post-split.flip > :first-child {
  order: 2;
}

.post-split img {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--border);
}

.post-split-text h2 {
  margin-top: 0;
}

.post-split-text p:last-child {
  margin-bottom: 0;
}

/* ── CTA band, author, sources, related ─────────────────────── */
.post-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 16px;
  padding: 2rem 2.25rem;
  margin: 2.75rem 0 1rem;
}

.post-cta-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 0.35rem;
}

.post-flow .post-cta p {
  font-size: 0.975rem;
  margin: 0;
  color: var(--muted);
}

.post-author {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  border-top: 1px solid var(--border);
  padding-top: 2rem;
  margin-top: 2.5rem;
}

.post-author .post-avatar {
  width: 56px;
  height: 56px;
  font-size: 1.2rem;
}

.post-flow .post-author p {
  font-size: 0.95rem;
  line-height: 1.65;
  margin-bottom: 0.4rem;
}

.post-sources {
  margin-top: 1.5rem;
}

.post-flow .post-sources li {
  font-size: 0.9rem;
  color: var(--muted);
}

.post-related {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.post-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.35rem 1.4rem;
  transition: border-color 0.2s;
}

.post-card:hover {
  border-color: var(--accent);
}

.post-card-topic {
  display: block;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.6rem;
}

.post-card-title {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--white);
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 960px) {
  .post-head-grid,
  .post-split {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .post-split.flip > :first-child {
    order: 0;
  }

  .post-box-grid,
  .post-related {
    grid-template-columns: 1fr;
  }

  .post-cta {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .post-head {
    padding-top: 6rem;
  }

  .post-toc ol {
    columns: 1;
  }

  .post-flow p,
  .post-flow li {
    font-size: 1rem;
  }

  .post-box,
  .post-cta {
    padding: 1.4rem;
  }
}
