/* Sidebar tweaks for the course website (HTML pages only; slides use theme.scss). */

/* Bold the collapsible section headers in the docked sidebar
   ("Part 1: ...", unit names, etc.)
   so they stand out from the leaf-page entries below them. */
.sidebar-item.sidebar-item-section > .sidebar-item-container,
.sidebar-item.sidebar-item-section > .sidebar-item-container > a,
.sidebar-item.sidebar-item-section > .sidebar-item-container > .sidebar-item-toggle,
.sidebar-item.sidebar-item-section > .sidebar-item-container .sidebar-item-text {
  font-weight: 700;
}

/* Colour sidebar leaf links by type so they're identifiable at a glance:
   - Lectures (any file with "lec" in the name) → green
   - Quizzes (any file with "quiz" in the name) → blue
   The exercises and concepts pages keep the default (black/grey) colour. */
.sidebar a.sidebar-item-text[href*="lec"],
.sidebar-item .sidebar-item-text > a[href*="lec"] {
  color: #1a7a3b;       /* lecture green */
}
.sidebar a.sidebar-item-text[href*="lec"]:hover,
.sidebar-item .sidebar-item-text > a[href*="lec"]:hover {
  color: #105025;
}

.sidebar a.sidebar-item-text[href*="quiz"],
.sidebar-item .sidebar-item-text > a[href*="quiz"] {
  color: #2a55c2;       /* quiz blue */
}
.sidebar a.sidebar-item-text[href*="quiz"]:hover,
.sidebar-item .sidebar-item-text > a[href*="quiz"]:hover {
  color: #1a3a8c;
}

/* Interactive demos (links to an exercise's #explore section) → orange */
.sidebar a.sidebar-item-text[href*="#explore"],
.sidebar-item .sidebar-item-text > a[href*="#explore"] {
  color: #b35900;
}
.sidebar a.sidebar-item-text[href*="#explore"]:hover,
.sidebar-item .sidebar-item-text > a[href*="#explore"]:hover {
  color: #7a3d00;
}

/* Prerequisite box at the top of quiz and exercise pages (tools/prereqs.lua, from days.yml). */
.prereq-box {
  border-left: 4px solid #6c757d;
  background: #f5f6f7;
  padding: 0.4rem 0.8rem;
  margin: 0 0 1rem 0;
  font-size: 0.9em;
}
.prereq-box p { margin: 0.15rem 0; }

/* BEGIN GENERATED PART COLOURS (tools/days.py from days.yml; make sidebar) */
/* One colour per part: top-level sidebar items are Home (1), All interactive demos (2), Overview: prerequisites and learning paths (3), Coding exercises: getting started (4), Topics (5), then the parts (6–14). */
.sidebar-menu-container > ul > li.sidebar-item-section:nth-child(n+6) {
  border-left: 4px solid var(--week-color);
  padding-left: 0.35rem;
  margin: 0.4rem 0;
}
.sidebar-menu-container > ul > li.sidebar-item-section:nth-child(n+6) > .sidebar-item-container {
  background: var(--week-tint);
  border-radius: 0 4px 4px 0;
  padding-left: 0.3rem;
}
.sidebar-menu-container > ul > li.sidebar-item-section:nth-child(n+6) > .sidebar-item-container .menu-text {
  color: var(--week-color);
}
.sidebar-menu-container > ul > li:nth-child(6) { --week-color: #2a7f8f; --week-tint: #e6f3f5; } /* Part I: Images as numbers */
.sidebar-menu-container > ul > li:nth-child(7) { --week-color: #2f5f9e; --week-tint: #e8eef8; } /* Part II: Transforms and reconstruction */
.sidebar-menu-container > ul > li:nth-child(8) { --week-color: #3b7a3b; --week-tint: #e8f3e8; } /* Part III: From pixels to objects */
.sidebar-menu-container > ul > li:nth-child(9) { --week-color: #8a6a12; --week-tint: #f6f0de; } /* Part IV: Detecting points, lines and features */
.sidebar-menu-container > ul > li:nth-child(10) { --week-color: #a0522d; --week-tint: #f7ebe4; } /* Part V: Aligning images and motion */
.sidebar-menu-container > ul > li:nth-child(11) { --week-color: #6b4fa0; --week-tint: #efebf7; } /* Part VI: Segmentation as optimisation */
.sidebar-menu-container > ul > li:nth-child(12) { --week-color: #a8324a; --week-tint: #f8e9ec; } /* Part VII: Learning from examples */
.sidebar-menu-container > ul > li:nth-child(13) { --week-color: #9c2f8a; --week-tint: #f6e8f3; } /* Part VIII: Colour and fluorescence */
.sidebar-menu-container > ul > li:nth-child(14) { --week-color: #4f5d75; --week-tint: #eceff3; } /* Part IX: 3D and computing */
/* END GENERATED PART COLOURS */
