/* Guide area: landing, contents and the chapter reader. Design tokens only, so dark mode follows automatically. */

/* ---- lists of chapters (landing) ---- */
.guide-part h2 { margin: 0 0 var(--space-2); }
.guide-part > p { margin: 0 0 var(--space-3); }
.guide-chaplist,
.guide-toc-list,
.guide-toc-sections { list-style: none; margin: 0; padding: 0; }
.guide-chaplist { display: grid; gap: var(--space-2); }
.guide-chap {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 44px;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--outline-soft);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
}
.guide-chap:hover { background: var(--lavender-soft); }
.guide-chap.is-read { background: var(--sage-soft); }
.guide-chap-ico { flex: none; font-size: 1.25rem; line-height: 1; }
.guide-chap-body { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.guide-chap-no { font-size: 0.8125rem; color: var(--ink-soft); }
.guide-chap-title { font-weight: 600; overflow-wrap: anywhere; }
.guide-chap-state { flex: none; font-size: 0.8125rem; color: var(--ink-soft); white-space: nowrap; }
.guide-chap-state.is-read { color: var(--sage); font-weight: 700; }

.guide-continue { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); }
.guide-continue-text { min-width: 0; flex: 1 1 14rem; }
.guide-continue h2 { margin: 0 0 var(--space-1); font-size: 1rem; }
.guide-continue p { margin: 0; overflow-wrap: anywhere; }
.guide-progress p { margin: 0 0 var(--space-2); }
.guide-more { flex-wrap: wrap; gap: var(--space-2); }
.guide-disclaimer { margin: 0; }

/* ---- table of contents ---- */
.guide-toc-list { display: grid; gap: var(--space-3); }
.guide-toc-chapter {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  min-height: 44px;
  padding: var(--space-2) 0;
  font-weight: 600;
  color: var(--plum-deep);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.guide-toc-chapter:hover { text-decoration: underline; }
.guide-toc-chapter:focus-visible,
.guide-toc-sections a:focus-visible,
.guide-back:focus-visible,
.guide-toc-count { margin-inline-start: auto; font-weight: 400; }
.guide-toc-sections { display: grid; margin: 0 0 var(--space-2); padding-inline-start: var(--space-5); border-inline-start: 2px solid var(--outline-soft); }
.guide-toc-sections a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: var(--space-1) var(--space-3);
  color: var(--ink);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.guide-toc-sections a:hover { background: var(--lavender-soft); border-radius: var(--radius); }

/* ---- reader chrome ---- */
.guide-reader { max-width: 46rem; margin-inline: auto; }
.guide-back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--plum-deep);
  font-weight: 600;
  text-decoration: none;
}
.guide-back:hover { text-decoration: underline; }
.guide-toolbar { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.guide-tool { min-height: 44px; min-width: 44px; }
.guide-tool.is-on { background: var(--sage-soft); border-color: var(--sage); color: var(--ink); }
.guide-tool[aria-pressed="true"] { border-color: var(--plum); }
.guide-note { margin: 0; }
.guide-note[hidden] { display: none; }

/* ---- article ---- */
.guide-article {
  font-size: calc(1rem * var(--guide-font-scale, 1));
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.guide-article > :first-child { margin-top: 0; }
.guide-article > :last-child { margin-bottom: 0; }
.guide-article [id] { scroll-margin-top: calc(var(--topbar-h, 56px) + var(--space-4)); }
.guide-article [tabindex="-1"]:focus { outline: none; }
.guide-article h2 { font-size: 1.4em; margin: 1.6em 0 0.5em; }
.guide-article h3 { font-size: 1.15em; margin: 1.3em 0 0.4em; }
.guide-article p { margin: 0 0 0.9em; }
.guide-article ul,
.guide-article ol { margin: 0 0 1em; padding-inline-start: 1.4em; }
.guide-article li { margin-bottom: 0.35em; }

.guide-hit {
  background: var(--blossom-soft);
  outline: 3px solid var(--gold);
  outline-offset: 4px;
  border-radius: var(--radius);
  animation: guide-hit-fade 5s ease-out forwards;
}
@keyframes guide-hit-fade {
  0%, 60% { background-color: var(--blossom-soft); outline-color: var(--gold); }
  100% { background-color: transparent; outline-color: transparent; }
}
.guide-speaking {
  background: var(--lavender-soft);
  box-shadow: -4px 0 0 var(--plum);
  border-radius: var(--radius);
}
@media (prefers-reduced-motion: reduce) {
  .guide-hit { animation: none; }
}

/* ---- callouts (single-cell tables that start with an emoji) ---- */
.guide-callout { margin: 1em 0; border-radius: var(--radius); border: 1px solid var(--outline); border-inline-start-width: 6px; background: var(--lavender-soft); }
.guide-callout table { width: 100%; border: 0; border-collapse: collapse; background: transparent; }
.guide-callout th,
.guide-callout td { border: 0; background: transparent; padding: var(--space-3) var(--space-4); color: var(--ink); text-align: start; }
.guide-callout.is-must,
.guide-callout.is-stop { background: var(--danger-bg); border-color: var(--danger); }
.guide-callout.is-should { background: var(--good-bg); border-color: var(--good); }
.guide-callout.is-warn { background: var(--caution-bg); border-color: var(--caution); }
.guide-callout.is-note { background: var(--lavender-soft); border-color: var(--plum); }

/* ---- evidence star cells ---- */
.guide-stars { color: var(--gold); letter-spacing: 0.1em; white-space: nowrap; }

/* ---- previous / next ---- */
.guide-pager { display: flex; flex-wrap: wrap; gap: var(--space-3); justify-content: space-between; }
.guide-pager-link {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  flex: 1 1 12rem;
  min-height: 44px;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--outline-soft);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  overflow-wrap: anywhere;
}
a.guide-pager-link:hover { background: var(--lavender-soft); }
.guide-pager-link.is-next { text-align: end; }
.guide-pager-link.is-empty { border: 0; background: transparent; }
.guide-pager-title { font-weight: 600; }

/* ---- small screens ---- */
@media (max-width: 400px) {
  .guide-chap { padding: var(--space-2); gap: var(--space-2); }
  .guide-toc-sections { padding-inline-start: var(--space-3); }
  .guide-pager-link.is-empty { display: none; }
  .guide-toolbar .btn { flex: 1 1 auto; }
}

/* ---- print: only the chapter text ---- */
@media print {
  .guide-reader { max-width: none; }
  .guide-article { border: 0; box-shadow: none; padding: 0; font-size: 12pt; line-height: 1.5; }
  .guide-article h2,
  .guide-article h3 { break-after: avoid; }
  .guide-callout,
  .guide-article .table-wrap { break-inside: avoid; }
  .guide-hit,
  .guide-speaking { background: none; outline: none; box-shadow: none; animation: none; }
  .guide-callout { border: 1px solid #000; background: none; }
  .guide-disclaimer { margin-top: 12pt; }
}
