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

:root { --chem-ink: #153747; --chem-blue: #176b91; }
body { color: var(--chem-ink); font-size: 1.05rem; }
h1, h2, h3 { color: var(--chem-ink); }
.course-start {
  border-left: 5px solid var(--chem-blue);
  background: #eef6f9;
  padding: 1rem 1.3rem;
  margin: 1.5rem 0;
}
.course-start p:last-child { margin-bottom: 0; }
.course-card {
  border: 1px solid #cedee5;
  border-top: 4px solid #176b91;
  border-radius: 0.35rem;
  padding: 1rem 1.2rem;
  margin-bottom: 0.6rem;
  background: #fbfdfe;
}
.course-card h3 { font-size: 1.2rem; margin-top: 0; }
.course-card p:last-child { margin-bottom: 0; }
a { text-underline-offset: 0.15em; }
.quarto-title .subtitle { max-width: 45rem; color: #386174; }
img { max-width: 100%; }

/* Local interactive chemistry workbenches; shared by the 25 daily demos. */
.chem-demo { margin: 1.4rem 0; padding: 1.1rem; border: 1px solid #b8cfd9; border-radius: .4rem; min-width: 0; }
.demo-controls { display: flex; flex-wrap: wrap; align-items: end; gap: .9rem 1.2rem; margin-bottom: 1rem; }
.demo-field { flex: 1 1 220px; min-width: 0; max-width: 100%; }
.demo-field label { display: block; font-weight: 600; margin-bottom: .35rem; }
.demo-field output { font-weight: 400; white-space: nowrap; }
.demo-field input, .demo-field select { width: 100%; min-width: 0; max-width: 100%; font: inherit; }
.demo-field input[type="number"], .demo-field select { padding: .45rem .55rem; min-height: 2.75rem; border: 1px solid #829ba6; border-radius: .25rem; background: white; color: #153747; }
.demo-field input[type="range"] { min-height: 2.75rem; accent-color: #176b91; }
.demo-controls button { font: inherit; color: #153747; background: #eef6f9; border: 1px solid #7297a8; border-radius: .25rem; padding: .5rem .8rem; min-height: 2.75rem; }
.demo-controls button:hover { background: #dceef5; }
.demo-controls button:disabled { opacity: .55; }
.demo-controls :focus-visible { outline: 3px solid #176b91; outline-offset: 3px; }
.demo-visual { min-width: 0; max-width: 100%; display: flex; flex-wrap: wrap; gap: .8rem; align-items: flex-start; justify-content: center; }
.demo-visual svg { display: block; flex: 1 1 330px; min-width: 0; width: 100%; height: auto; max-width: 100%; margin: .3rem 0; }
.demo-visual img { max-width: 100%; height: auto; }
.demo-result { margin-top: .8rem; padding: .7rem .9rem; background: #edf5f8; font-weight: 600; overflow-wrap: anywhere; }
.demo-detail { margin-top: .7rem; overflow-wrap: anywhere; }
.demo-detail table { width: 100%; }
.sidebar a.sidebar-item-text[href*="demos/day"] { color: #a04d00; font-style: normal; }
@media (max-width: 480px) {
  .chem-demo { padding: .65rem; }
  .demo-field { flex-basis: 100%; }
  .demo-controls button { flex-grow: 1; }
}

/* Bold the collapsible section headers in the docked sidebar
   ("Course info", "Before you start", "Day 1 — ...", "Day 2 — ...", 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;
}

/* Exercises are italic; direct demo anchors keep their orange styling. */
.sidebar a.sidebar-item-text[href*="exercise"]:not([href*="#explore"]),
.sidebar a.sidebar-item-text[href*="/day"]:not([href*="lec"]):not([href*="quiz"]):not([href*="00-concepts"]):not([href*="demos/"]):not([href*="#explore"]) {
  font-style: italic;
}

/* One colour per week in the sidebar: a stripe down the left of the whole
   block and a tinted header, so the weeks are easy to tell apart.
   Positional: top-level items are Home (1), Course info (2), Week 1 (3) ...
   Week 5 (7), Further reading (8). Update if top-level items change. */
.sidebar-menu-container > ul > li.sidebar-item-section:nth-child(n+3) {
  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+3) > .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+3) > .sidebar-item-container .menu-text {
  color: var(--week-color);
}
.sidebar-menu-container > ul > li:nth-child(3) { --week-color: #2a7f8f; --week-tint: #e6f3f5; } /* Week 1 teal */
.sidebar-menu-container > ul > li:nth-child(4) { --week-color: #6b4fa0; --week-tint: #efebf7; } /* Week 2 purple */
.sidebar-menu-container > ul > li:nth-child(5) { --week-color: #a8324a; --week-tint: #f8e9ec; } /* Week 3 crimson */
.sidebar-menu-container > ul > li:nth-child(6) { --week-color: #8a6a12; --week-tint: #f6f0de; } /* Week 4 ochre */
.sidebar-menu-container > ul > li:nth-child(7) { --week-color: #3b5bab; --week-tint: #e9eef8; } /* Week 5 blue */
.sidebar-menu-container > ul > li:nth-child(8) { --week-color: #6c757d; --week-tint: #f1f3f5; } /* Further reading grey */
