/* On-page contents box (src/components/OnPageToc.astro). The card is wohnsitzausland.com's .essay-sidebar__toc
 * (its src/styles/global.css: 1px border, 6px radius, 1.5rem padding, 0.7rem uppercase title with 0.12em
 * tracking and 1rem below it, entries 0.85rem / 1.4 with 0.5rem between them) in this site's colours. Porting:
 * set the --otoc-* tokens to the site's own. Everything is scoped to .otoc, so the phone list and sheet that
 * Base.astro clones from the list keep their own look. Never a max-height or overflow here (no inner scroll). */
.otoc {
  --otoc-bg: var(--paper, #fffdf8);
  --otoc-border: var(--rule, #ddd4c3);
  --otoc-title: var(--gold-dark, #85672f);
  --otoc-link: var(--body-2, #4a4843);
  --otoc-hover: var(--navy, #0f1a2c);
  --otoc-active: var(--navy, #0f1a2c);
  --otoc-mark: var(--gold, #a8844a);
  --otoc-sub: var(--muted, #5c5a55);
  background: var(--otoc-bg);
  border: 1px solid var(--otoc-border);
  border-radius: 6px;
  padding: 1.5rem;
}
.otoc .otoc__title {
  margin: 0 0 1rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--otoc-title);
}
.otoc ul { list-style: none; margin: 0; padding: 0; }
.otoc .otoc__item { margin-bottom: 0.5rem; }
.otoc .otoc__item:last-child { margin-bottom: 0; }
.otoc .otoc__link,
.otoc .otoc__sublink {
  display: block;
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--otoc-link);
  transition: color 0.15s;
  /* The active mark sits in the box's left padding, so entries never shift. */
  margin-left: calc(-1.5rem + 3px);
  padding-left: calc(1.5rem - 5px);
  border-left: 2px solid transparent;
}
.otoc .otoc__link:hover,
.otoc .otoc__sublink:hover { color: var(--otoc-hover); }
.otoc .otoc__item.is-active > .otoc__link { color: var(--otoc-active); font-weight: 600; border-left-color: var(--otoc-mark); }
.otoc .otoc__sub { margin: 0.45rem 0 0.15rem; padding-left: 0.85rem; border-left: 1px solid var(--otoc-border); }
.otoc .otoc__sub[hidden] { display: none; }
.otoc .otoc__subitem { margin-bottom: 0.35rem; }
.otoc .otoc__subitem:last-child { margin-bottom: 0; }
.otoc .otoc__sublink {
  font-size: 0.8rem;
  color: var(--otoc-sub);
  margin-left: calc(-1.5rem - 0.85rem - 1px + 3px);
  padding-left: calc(1.5rem + 0.85rem + 1px - 5px);
}
.otoc .otoc__subitem.is-active > .otoc__sublink { color: var(--otoc-active); border-left-color: var(--otoc-mark); }
@media (prefers-reduced-motion: reduce) { .otoc .otoc__link, .otoc .otoc__sublink { transition: none; } }
