/* Study guide reader — builds on the theme tokens in mock-exam/interactive/styles.css */


.guide-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) 220px;
  gap: 2.25rem;
  max-width: 1320px;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 3rem;
}

/* Sidebar */
.guide-sidebar { position: sticky; top: 4.5rem; align-self: start; max-height: calc(100vh - 5.5rem); overflow-y: auto; }
.guide-tracks { display: flex; gap: 0.25rem; padding: 0.25rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.guide-track { flex: 1; text-align: center; padding: 0.4rem 0.3rem; border-radius: 7px; font-size: 0.85rem; font-weight: 600; color: var(--text-muted); }
.guide-track span { display: block; font-weight: 400; font-size: 0.72rem; }
.guide-track:hover { text-decoration: none; color: var(--text); }
.guide-track-active { background: var(--accent); color: var(--accent-contrast); }
.guide-track-active:hover { color: var(--accent-contrast); }
.guide-pages { list-style: none; padding: 0; margin: 1rem 0; }
.guide-pages a { display: block; padding: 0.38rem 0.7rem; border-radius: 7px; color: var(--text); font-size: 0.92rem; border-left: 3px solid transparent; }
.guide-pages a:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); text-decoration: none; }
.guide-pages a.active { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); border-left-color: var(--accent); font-weight: 600; }
.guide-sidebar-cta { display: block; text-align: center; font-size: 0.9rem; }
.guide-sidebar-cta:hover { text-decoration: none; }

/* On this page */
.guide-toc { position: sticky; top: 4.5rem; align-self: start; max-height: calc(100vh - 5.5rem); overflow-y: auto; font-size: 0.84rem; }
.guide-toc p { font-weight: 700; margin: 0 0 0.5rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.75rem; }
.guide-toc ul { list-style: none; padding: 0; margin: 0; border-left: 1px solid var(--border); }
.guide-toc li a { display: block; padding: 0.2rem 0 0.2rem 0.75rem; color: var(--text-muted); margin-left: -1px; border-left: 2px solid transparent; }
.guide-toc li.toc-l3 a { padding-left: 1.5rem; font-size: 0.8rem; }
.guide-toc li a.toc-active { color: var(--accent); border-left-color: var(--accent); }
.guide-toc li a:hover { color: var(--text); text-decoration: none; }

/* Article typography */
.prose { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 2rem 2.4rem; box-shadow: var(--shadow); line-height: 1.7; font-size: 1.02rem; }
.prose > :first-child { margin-top: 0; }
.prose h1 { font-size: 2.1rem; margin-bottom: 1rem; }
.prose h2 { font-size: 1.5rem; margin: 2.6rem 0 0.8rem; padding-top: 1.2rem; border-top: 1px solid var(--border); scroll-margin-top: 5rem; }
.prose h3 { font-family: var(--serif); font-size: 1.2rem; margin: 1.8rem 0 0.6rem; scroll-margin-top: 5rem; }
.prose h4 { margin: 1.4rem 0 0.4rem; }
.prose .anchor { float: left; margin-left: -1.1em; padding-right: 0.3em; color: var(--accent); opacity: 0; font-weight: 400; }
.prose h2:hover .anchor, .prose h3:hover .anchor { opacity: 0.7; text-decoration: none; }
.prose p, .prose ul, .prose ol { margin: 0.75rem 0; }
.prose li { margin: 0.25rem 0; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }
.prose blockquote { margin: 1.2rem 0; padding: 0.8rem 1.1rem; border-left: 4px solid var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); border-radius: 0 10px 10px 0; color: var(--text); }
.prose blockquote p { margin: 0.3rem 0; }
.prose pre { background: color-mix(in srgb, var(--text) 5%, var(--surface)); border: 1px solid var(--border); border-radius: 10px; padding: 1rem 1.1rem; overflow-x: auto; font-size: 0.86rem; line-height: 1.55; }
.prose pre code { background: none; padding: 0; font-size: inherit; }
.prose code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.table-wrap { overflow-x: auto; margin: 1rem 0; border: 1px solid var(--border); border-radius: 10px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.92rem; line-height: 1.5; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--border); }
.prose th { background: color-mix(in srgb, var(--accent) 7%, var(--surface)); font-weight: 700; }
.prose tr:last-child td { border-bottom: 0; }

/* Interactive bits */
details.answer { margin: 0.6rem 0 1.4rem; border: 1px dashed color-mix(in srgb, var(--correct) 55%, var(--border)); border-radius: 10px; background: color-mix(in srgb, var(--correct) 5%, var(--surface)); }
details.answer summary { cursor: pointer; padding: 0.55rem 0.9rem; font-weight: 700; color: var(--correct); list-style: none; }
details.answer summary::-webkit-details-marker { display: none; }
details.answer summary::before { content: "▸ "; }
details.answer[open] summary::before { content: "▾ "; }
details.answer p { margin: 0; padding: 0 0.9rem 0.8rem; }
.practice-cta { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: 0.5rem 0 1.5rem; padding: 0.9rem 1.1rem; border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border)); border-radius: 12px; background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.practice-cta strong { display: block; }
.practice-cta span { color: var(--text-muted); font-size: 0.9rem; }
.practice-cta .btn:hover { text-decoration: none; }

/* Pager + edit link */
.guide-pager { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1.5rem; }
.guide-pager a { flex: 1; max-width: 48%; padding: 0.8rem 1rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); font-weight: 600; }
.guide-pager a span { display: block; font-size: 0.8rem; font-weight: 400; color: var(--text-muted); }
.guide-pager a:hover { border-color: var(--accent); text-decoration: none; }
.guide-pager .pager-next { text-align: right; margin-left: auto; }
.guide-edit { font-size: 0.85rem; margin-top: 1rem; }

/* Guide index */
.guide-index-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; margin-top: 1.5rem; }
.guide-index-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 1.4rem; box-shadow: var(--shadow); }
.guide-index-card h2 { margin: 0 0 0.6rem; }
.guide-index-card ul { columns: 2; column-gap: 1.5rem; padding-left: 1.1rem; font-size: 0.93rem; }
.guide-index-card .actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 1rem; }
.guide-index-card .actions a:hover { text-decoration: none; }

/* Responsive */
@media (max-width: 1150px) {
  .guide-layout { grid-template-columns: 240px minmax(0, 1fr); }
  .guide-toc { display: none; }
}
@media (max-width: 820px) {
  .guide-layout { grid-template-columns: minmax(0, 1fr); padding-top: 1rem; }
  body.guide .guide-menu-btn { display: inline-block; }
  body.guide .guide-top-links { display: none; }
  .guide-sidebar { display: none; position: static; max-height: none; }
  .guide-sidebar.open { display: block; }
  .prose { padding: 1.3rem 1.1rem; font-size: 1rem; }
  .prose .anchor { display: none; }
  .guide-index-card ul { columns: 1; }
}

/* Small-screen polish */
.guide-toc li a { line-height: 1.35; padding-top: 0.3rem; padding-bottom: 0.3rem; }
@media (max-width: 820px) {
  .prose h1 { font-size: 1.65rem; }
  .prose h2 { font-size: 1.3rem; }
  .practice-cta .btn { width: 100%; text-align: center; }
}

/* Practice-question options rendered as a clean list */
.prose ul.options { list-style: none; padding-left: 0; }
.prose ul.options li { padding: 0.45rem 0.75rem; margin: 0.35rem 0; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.article-byline { margin: -0.4rem 0 1.2rem; font-size: 0.9rem; color: var(--text-muted); }

/* Cheat sheet stands out in the sidebar */
.guide-pages a.nav-cheat { font-weight: 700; color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 12%, transparent); }
.guide-pages a.nav-cheat.active { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); }
