/* MHSB TOC — same visual language as MHSB Read Aloud. Colors are variables; dark mode is detected by the script (data-mode). */

.wpct-h { scroll-margin-top: var(--wpct-scroll-offset, 96px); }

.wpct-nav {
  --wpct-bg: #faf8f4;
  --wpct-fg: #221f1f;
  --wpct-line: #e7e0d3;
  --wpct-accent: #b4976f;
  --wpct-on-accent: #221f1f;
  --wpct-shadow: 0 1px 0 rgba(34,31,31,.04), 0 10px 28px -14px rgba(34,31,31,.28);

  box-sizing: border-box;
  margin: 1.5em 0;
  padding: 16px 18px;
  background: var(--wpct-bg);
  color: var(--wpct-fg);
  border: 1px solid var(--wpct-line);
  border-radius: 3px;
  box-shadow: var(--wpct-shadow);
  font-size: 15px;
  line-height: 1.4;
  text-align: left;
  color-scheme: light;
}
.wpct-nav *, .wpct-nav *::before, .wpct-nav *::after { box-sizing: border-box; }

/* Fixed dark */
.wpct-theme-dark {
  --wpct-bg: #221f1f; --wpct-fg: #f3efe7; --wpct-line: #3b3836; --wpct-accent: #c6aa7e;
  --wpct-shadow: 0 12px 30px -14px rgba(0,0,0,.6);
  color-scheme: dark;
}
/* Minimal: no box, takes your text color */
.wpct-theme-minimal {
  --wpct-bg: transparent; --wpct-line: rgba(127,127,127,.35); --wpct-shadow: none;
  color: inherit; border-width: 1px 0; border-radius: 0; padding: 14px 0;
}

/* Adaptive themes (Editorial, Minimal) when the site is dark */
.wpct-nav[data-mode="dark"].wpct-theme-editorial {
  --wpct-bg: #221f1f; --wpct-fg: #f3efe7; --wpct-line: #3b3836; --wpct-accent: #c6aa7e; --wpct-on-accent: #221f1f;
  --wpct-shadow: 0 12px 30px -14px rgba(0,0,0,.6);
  color-scheme: dark;
}
.wpct-nav[data-mode="dark"].wpct-theme-minimal { --wpct-line: rgba(255,255,255,.2); --wpct-accent: #c6aa7e; color-scheme: dark; }

/* ---------- Header ---------- */
.wpct-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wpct-title {
  display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1 1 auto;
  font-family: Georgia, "Times New Roman", Times, serif; font-size: 1.15em; letter-spacing: .01em; line-height: 1.2;
}
/* The slanted bar from the logo, at its real proportions (about 1:8.8) */
.wpct-mark, .wpct-marker {
  display: block; flex: 0 0 auto; width: 3px; height: 26px; background: var(--wpct-accent);
  clip-path: polygon(0 12.6%, 95% 0, 100% 85.6%, 16% 100%);
}
.wpct-current { display: none; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.wpct-nav .wpct-toggle {
  appearance: none; -webkit-appearance: none; margin: 0; padding: 0; border: 0; box-shadow: none;
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 34px; height: 34px; border-radius: 50%; background: transparent; color: inherit; cursor: pointer;
  transition: background-color .18s;
}
.wpct-nav .wpct-toggle:hover { background: rgba(127,127,127,.16); }
.wpct-toggle svg { display: block; fill: currentColor; transition: transform .2s; }
.wpct-toggle[aria-expanded="false"] svg { transform: rotate(-90deg); }
.wpct-nav button:focus-visible, .wpct-nav a:focus-visible { outline: 2px solid var(--wpct-accent); outline-offset: 2px; }

.wpct-body { margin-top: 12px; }
.wpct-body[hidden] { display: none; }

/* ---------- List ---------- */
.wpct-nav ul.wpct-list {
  position: relative !important; list-style: none; margin: 0; padding: 0;
  border-left: 1px solid var(--wpct-line);
}
.wpct-nav ul.wpct-list li { list-style: none; margin: 0; padding: 0; }
.wpct-nav ul.wpct-list li::before, .wpct-nav ul.wpct-list li::after { content: none; }
.wpct-nav ul.wpct-list a {
  display: block; padding: 6px 8px 6px 16px; color: inherit; text-decoration: none; border: 0; box-shadow: none;
  font-size: 14px; line-height: 1.4; font-weight: 400; opacity: .85;
  transition: opacity .2s, background-color .25s;
}
.wpct-nav ul.wpct-list a:hover { opacity: 1; }
/* While a section is active, the others step back so the current one stands out */
.wpct-nav ul.wpct-list.has-active a { opacity: .6; }
.wpct-nav ul.wpct-list.has-active a:hover { opacity: .9; }
.wpct-nav ul.wpct-list .wpct-l2 a { padding-left: 30px; font-size: 13.5px; }
.wpct-nav ul.wpct-list .wpct-l3 a { padding-left: 44px; font-size: 13px; }
.wpct-nav ul.wpct-list li.is-active > a,
.wpct-nav ul.wpct-list.has-active li.is-active > a {
  opacity: 1;
  background: rgba(180,151,111,.18);
  background: color-mix(in srgb, var(--wpct-accent) 22%, transparent);
  border-radius: 0 3px 3px 0;
}

.wpct-nav .wpct-marker {
  position: absolute; left: -2px; top: 0; opacity: 0; pointer-events: none;
  transition: transform .28s ease, opacity .2s;
}
.wpct-nav .wpct-marker-wrap { position: static !important; height: 0; overflow: visible; }

/* ---------- Sticky sidebar (large screens) ---------- */
.wpct-nav.is-side, .wpct-nav.is-side[data-mode] {
  position: fixed; top: 0; left: 0; margin: 0; padding: 0;
  background: transparent; border: 0; border-radius: 0; box-shadow: none; color: inherit;
  --wpct-line: rgba(127,127,127,.35);
  overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin;
  z-index: var(--wpct-z, 90); will-change: transform;
}
.wpct-nav.is-side .wpct-toggle { display: none; }
.wpct-nav.is-side .wpct-head { margin-bottom: 4px; }
.wpct-nav.is-side .wpct-body { margin-top: 8px; }
.wpct-nav.is-side .wpct-body[hidden] { display: block; }

/* ---------- Docked bar (phones and tablets) ---------- */
.wpct-placeholder { display: block; }
.wpct-nav.is-docked, .wpct-nav.is-docked[data-mode] {
  position: fixed; left: 0; right: 0; margin: 0 auto;
  width: min(720px, calc(100% - 16px));
  top: calc(var(--wpct-dock-top, 0px) + 8px);
  z-index: var(--wpct-dock-z, 9991);
  padding: 0; display: flex; flex-direction: column;
  max-height: calc(100vh - var(--wpct-dock-top, 0px) - 24px);
  border: 1px solid var(--wpct-line); border-radius: 3px;
  box-shadow: 0 10px 30px -8px rgba(34,31,31,.35);
  animation: wpct-dock-in .22s ease-out;
}
.wpct-theme-minimal.is-docked { --wpct-bg: #fff; color: #221f1f; }
.wpct-theme-minimal.is-docked[data-mode="dark"] { --wpct-bg: #221f1f; color: #f3efe7; }
@keyframes wpct-dock-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

.wpct-is-docked-title, .is-docked .wpct-title-text { display: none; }
.is-docked .wpct-current { display: block; }
.is-docked .wpct-head { padding: 8px 8px 8px 14px; cursor: pointer; flex: 0 0 auto; }
.is-docked .wpct-body {
  margin: 0; padding: 6px 14px 12px; border-top: 1px solid var(--wpct-line);
  overflow-y: auto; overscroll-behavior: contain; flex: 1 1 auto;
}

@media (max-width: 560px) {
  .wpct-nav { padding: 14px; }
  .wpct-theme-minimal { padding: 12px 0; }
}
@media (prefers-reduced-motion: reduce) {
  .wpct-nav, .wpct-nav * { transition: none !important; animation: none !important; }
}
@media print { .wpct-nav.is-side, .wpct-nav.is-docked, .wpct-toggle { display: none; } }
