/* ============================================================
   Article structure — TOC card + heading scale
   Complements design-system.css (loaded before this file).
   Palette: ink #111B33 / paper #F6F8FC / signal #1BA5B5
   ============================================================ */

/* ---------- Heading scale ----------
   h1 is reserved for the post title; body sections start at h2.
   A clear 1.5x step keeps the hierarchy legible at 15px body type. */
#article-container h2 {
  font-size: 1.5em;
  line-height: 1.45;
  margin-top: 2em;
  margin-bottom: 0.8em;
}

#article-container h3 {
  font-size: 1.25em;
  line-height: 1.5;
  margin-top: 1.6em;
  margin-bottom: 0.6em;
}

#article-container h4 {
  font-size: 1.1em;
  line-height: 1.55;
  margin-top: 1.3em;
  margin-bottom: 0.5em;
}

/* Keep the h2 cyan rule tight under the larger text. */
#article-container h2::after {
  bottom: -0.18em;
}

/* ---------- In-article TOC card ----------
   Native <details> so it works without JS and stays accessible. */
.post-toc {
  background: var(--card-bg);
  border: 1px solid var(--signal-line);
  border-left: 3px solid var(--signal);
  border-radius: 4px;
  margin: 1.5em 0 2em;
  padding: 0.85em 1.1em;
  font-size: 0.95em;
  line-height: 1.7;
}

.post-toc > summary {
  cursor: pointer;
  list-style: none;
  color: var(--ink);
  font-size: 1.05em;
  letter-spacing: 0.02em;
}

.post-toc > summary::-webkit-details-marker {
  display: none;
}

.post-toc > summary::before {
  content: '▸';
  display: inline-block;
  color: var(--signal);
  margin-right: 0.5em;
  transition: transform 0.2s ease;
}

.post-toc[open] > summary::before {
  transform: rotate(90deg);
}

.post-toc .toc-hint {
  color: var(--mist);
  font-size: 0.85em;
  font-weight: 400;
  margin-left: 0.6em;
}

.post-toc .toc-list {
  list-style: none;
  margin: 0.7em 0 0;
  padding: 0;
  counter-reset: none;
}

.post-toc .toc-list li {
  margin: 0.15em 0;
}

.post-toc .toc-list a {
  color: var(--graphite);
  border-bottom: 1px dashed var(--signal-line);
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.post-toc .toc-list a:hover {
  color: var(--signal);
  border-bottom-color: var(--signal);
}

.post-toc .toc-l2 > a {
  font-weight: 600;
}

.post-toc .toc-l3 {
  padding-left: 1.6em;
}

.post-toc .toc-l3 > a {
  color: var(--mist);
  font-size: 0.95em;
}

[data-theme='dark'] .post-toc {
  background: var(--card-bg);
  border-color: var(--signal-line);
}

/* ---------- Figure captions ----------
   Image alt text rendered as a quiet caption line where the theme
   exposes it; harmless where it does not. */
#article-container img {
  max-width: 100%;
  height: auto;
}

/* ---------- Mobile ---------- */
@media screen and (max-width: 768px) {
  #article-container h2 {
    font-size: 1.35em;
  }

  #article-container h3 {
    font-size: 1.18em;
  }

  .post-toc {
    padding: 0.7em 0.9em;
    font-size: 0.92em;
  }
}
