/* Widget 5 — TOC rail + the article's three-zone grid, per the re-authored
   Article sample and 01-LAYOUT-AND-WIDTHS.md §4:
     240 rail + 48 + 744 prose + 48 + 240 aside = 1320 (the shell's content box)
   Ladder: 3 zones ≥1416 · 2 zones 1128–1415 (aside folds below) · single
   column <1128 (the rail is REMOVED, never compressed — the measure survives). */

.hc-body-grid {
  display: grid;
  grid-template-columns: var(--hc-rail) minmax(0, var(--hc-prose)) var(--hc-rail);
  column-gap: var(--hc-rail-gap);
  row-gap: 0;
  align-items: start;
}

.hc-prose {
  min-width: 0;
  max-width: var(--hc-prose);
}

/* ---- Sticky TOC rail (left) ---- */

.hc-toc {
  position: sticky;
  top: 24px;
}

.hc-toc__title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--hc-secondary);
  margin: 0 0 12px;
}

.hc-toc__list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: none;
}

.hc-toc__item { margin: 0; }

.hc-toc__link {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--hc-secondary);
  text-decoration: none;
  padding: 7px 10px;
  border-radius: 9px;
}
.hc-toc__link:hover { color: var(--hc-pink); }

.hc-toc__dot {
  width: 5px;
  height: 5px;
  border-radius: 99px;
  flex: none;
  background: transparent;
}

/* Current section — set by assets/js/toc.js as you scroll. */
.hc-toc__link.is-current {
  font-weight: 700;
  color: var(--hc-pink);
  background: #ff4d670f;
}
.hc-toc__link.is-current .hc-toc__dot { background: var(--hc-pink); }

/* ---- Aside rail (right): verification chip, then Read next. Never the app
   cutout — the aside is navigation and evidence, not conversion. Whole rail
   sticky with internal scroll so a tall rail never strands its lower cards. ---- */

.hc-aside {
  grid-column: 3;
  grid-row: 1;
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.hc-aside__label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--hc-secondary);
}

.hc-verify {
  background: #fff;
  border: 1px solid var(--hc-line-soft);
  border-radius: 16px;
  padding: 14px 16px;
}
.hc-verify__chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #0e7a4f14;
  color: #0e7a4f;
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  padding: 4px 10px;
  margin-top: 8px;
}
.hc-verify__meta {
  font-size: 12px;
  line-height: 1.55;
  color: var(--hc-mut);
  margin-top: 8px;
}

.hc-rn__head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.hc-rn__head::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--hc-line), transparent);
}
.hc-rn__list {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 14px;
}
.hc-body-grid a.hc-rn__card {
  display: flex;
  flex-direction: column;
  gap: 9px;
  color: inherit;
}
.hc-rn__thumb {
  display: block;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  background: var(--hc-wash);
  overflow: hidden;
}
.hc-rn__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hc-rn__kicker {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--hc-pink);
}
.hc-rn__title {
  display: block;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--hc-ink);
  margin-top: 4px;
}
.hc-rn__read {
  display: block;
  font-size: 12px;
  color: var(--hc-mut);
  margin-top: 5px;
}
.hc-body-grid a.hc-rn__all {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--hc-pink);
  margin-top: 16px;
}

/* ---- Mobile collapsible TOC (shown when the rail is removed) ---- */

.hc-toc-mobile {
  display: none;
  border: 1px solid var(--hc-line);
  border-radius: 14px;
  padding: 13px 16px;
  margin: 0 0 24px;
}
.hc-toc-mobile__summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  color: var(--hc-ink);
}
.hc-toc-mobile__summary::-webkit-details-marker { display: none; }
.hc-toc-mobile[open] .hc-toc-mobile__summary svg { transform: rotate(180deg); }
.hc-toc-mobile__summary svg { transition: transform 0.15s ease; flex: none; }

.hc-toc-mobile__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}
.hc-toc-mobile__list a {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--hc-secondary);
  text-decoration: none;
}
.hc-toc-mobile__list a:hover { color: var(--hc-pink); }

/* Anchor targets clear the sticky header rather than hiding under it. */
.hc-prose h2 { scroll-margin-top: 24px; }

/* ---- Ladder: 1128–1415 — two zones; the aside folds below, Read next 3-up ---- */
@media (max-width: 1415px) {
  .hc-body-grid {
    grid-template-columns: var(--hc-rail) minmax(0, var(--hc-prose));
    row-gap: 40px;
  }
  .hc-aside {
    grid-column: 1 / -1;
    grid-row: 2;
    position: static;
    max-height: none;
    overflow: visible;
  }
  .hc-rn__list {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 22px;
  }
}

/* ---- Ladder: <1128 — the rail goes away entirely; measure survives ---- */
@media (max-width: 1127px) {
  .hc-body-grid {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    row-gap: 36px;
  }
  .hc-toc { display: none; }
  .hc-toc-mobile { display: block; }
  .hc-prose { max-width: var(--hc-prose); margin-inline: auto; width: 100%; }
  .hc-aside { order: 2; align-self: stretch; max-width: var(--hc-prose); margin-inline: auto; width: 100%; }
  .hc-rn__list { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .hc-rn__list { grid-template-columns: 1fr; }
}

/* Featured-image placeholder (hc_card_thumb) — fills any card media box. */
.hc-thumb-ph {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 100%;
}
