/* ============================================================
   Mock Test Mitra™ — railway-manual.css
   The chapter map on the per-manual Railway pages (railway/*.html),
   written by scripts/build_railway_manual_pages.py.

   Those pages reuse the subject-dashboard chrome (.sd-page,
   .sd-header …) and the hub blocks in exam-hub.css (.hub-lede,
   .hub-faq-item, .hub-related-list …). Only the chapter rows and
   the paper buttons are new, and they live in this file so that
   adding them does not change exam-hub.css — and with it the
   cache-buster on every page that links it.

   Depends on: main.css (colour tokens), exam-hub.css
   Every colour is a token, so dark mode follows automatically.
   --exam-accent1 comes from the page's own <style> block and is
   lifted for dark mode there (#0f5132 -> #4ade80).
   ============================================================ */

.rm-chapters {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.rm-chapter {
  padding: 14px 16px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md, 10px);
}

.rm-chapter-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  margin: 0 0 10px;
}

.rm-chapter-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text);
  /* Manual headings can be long unbroken strings (annexure titles, file paths). */
  overflow-wrap: anywhere;
}

.rm-chapter-note {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.rm-papers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Buttons are 44px tall: the paper numbers are tapped on a phone, often one-handed. */
.rm-paper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 14px;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1;
  color: var(--exam-accent1, #0f5132);
  text-decoration: none;
  background: transparent;
  border: 1px solid var(--exam-accent1, #0f5132);
  border-radius: var(--radius-full, 9999px);
  transition: background var(--dur-normal, 0.22s), color var(--dur-normal, 0.22s);
}

.rm-paper:hover {
  color: var(--bg-secondary);
  background: var(--exam-accent1, #0f5132);
}

.rm-paper:focus-visible {
  outline: 2px solid var(--exam-accent1, #0f5132);
  outline-offset: 2px;
}

/* A paper that combines several short chapters reads differently from a whole chapter. */
.rm-paper--combined { border-style: dashed; }

@media (prefers-reduced-motion: reduce) {
  .rm-paper { transition: none; }
}

@media (max-width: 640px) {
  .rm-chapter { padding: 12px; }
}
