/* Course hub (a single class): assessments, material list, drop / restore
   a class, the two-column layout and the empty-page course picker. */

/* ---------- Course hub (a single class) ---------- */
/* Its own name: .course-head belongs to the Notes document headings
   (notes-grid.css, notes-bar.css), whose flex row squeezed these counts
   (issue #16 F-37). */
.course-hub-head { display: block; margin-bottom: var(--sp-3); }
.course-hub-head h2 { font-size: var(--fs-xl); margin-bottom: 0; }
.course-hub-head .course-sub { margin-top: var(--sp-1); }
.course-sub { color: var(--text-muted); font-size: var(--fs-sm); }

.course-jumps {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-bottom: var(--sp-6);
}

.course-section {
  margin: 0 0 var(--sp-2);
}

/* Quizzes and tests: the graded things, kept visually apart from material. */
.assess-list { margin-bottom: var(--sp-6); display: flex; flex-direction: column; gap: var(--sp-2); }

.assess-item {
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
.assess-item:has(.assess-row.exam) { border-left-color: var(--danger); }

.assess-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  padding: var(--sp-3);
  border: none;
  background: none;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.assess-row:hover { background: var(--surface-2); }

.assess-pill {
  flex-shrink: 0;
  font-size: var(--fs-2xs);
  font-weight: 800;
  letter-spacing: var(--label-tracking);
  padding: var(--sp-1) var(--sp-2);
  border-radius: var(--radius);
  color: var(--on-accent);
  background: var(--accent);
}
.assess-pill.exam { background: var(--danger); }
/* Finals/midterms stay in the TEST category but get their own color, same
   idea as .assess-pill.exam above — distinct from a regular test. */
.assess-pill.assess-final { background: var(--final); color: var(--on-final); }
.assess-pill.assess-midterm { background: var(--warning); }
.assess-item:has(.assess-row.assess-final) { border-left-color: var(--final); }
.assess-item:has(.assess-row.assess-midterm) { border-left-color: var(--warning); }

.assess-name { flex: 1; min-width: 0; font-weight: 600; font-size: var(--fs-md); overflow-wrap: anywhere; }
/* Phones: the name keeps at least ~12 characters; the due badge and caret
   drop to a second line rather than squeezing it. */
@media (max-width: 560px) {
  .assess-row { flex-wrap: wrap; }
  .assess-name { flex: 1 1 12ch; }
}

.assess-caret { flex-shrink: 0; font-size: var(--fs-xs); color: var(--text-muted); }
.assess-row.open .assess-caret { color: var(--accent); }

.assess-details {
  padding: var(--sp-1) var(--sp-3) var(--sp-3);
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}
.assess-details[hidden] { display: none; }

.assess-label {
  margin: var(--sp-3) 0 var(--sp-2);
}
.assess-loading { font-size: var(--fs-sm); color: var(--text-muted); padding: var(--sp-2) 0; }

.assess-related { display: flex; flex-direction: column; gap: var(--sp-2); }
.assess-related-doc { font-size: var(--fs-sm); font-weight: 600; overflow-wrap: anywhere; }
.assess-related-snip {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  line-height: var(--lh);
  /* keep every entry scannable at the same height */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.assess-actions { display: flex; gap: var(--sp-2); margin-top: var(--sp-3); }

/* Course material: a plain list, no folders, no page images. */
.material-list {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.material-row {
  display: flex;
  align-items: baseline;
  gap: var(--sp-3);
  width: 100%;
  padding: var(--sp-2) var(--sp-3);
  border: none;
  border-bottom: 1px solid var(--border);
  background: none;
  color: var(--text-muted);
  font: inherit;
  font-size: var(--fs-sm);
  text-align: left;
  cursor: pointer;
}
.material-row:last-child { border-bottom: 0; }
.material-row:hover { background: var(--surface-2); color: var(--text); }

.material-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 760px) {
  .material-name {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    white-space: normal;
    overflow-wrap: anywhere;
  }
}
.material-type {
  flex-shrink: 0;
  font-size: var(--fs-2xs);
  letter-spacing: var(--label-tracking);
  text-transform: uppercase;
  opacity: 0.65;
}

.course-loading { color: var(--text-muted); font-size: var(--fs-sm); padding: var(--sp-2) 0; }

/* ---------- Drop / restore a class ---------- */
.nav-child-row { display: flex; align-items: center; }
.nav-child-row .nav-child { flex: 1; min-width: 0; }
/* In the rail a dropped row is a <span>, which took the body line-height and
   stood 39.5px against the 36px <button> rows: one line box for both. (The
   phone strip already matched, so it keeps its height.) */
@media (min-width: 761px) {
  .nav-child-row .nav-child { line-height: var(--lh-tight); }
}
/* The label is its own box so the ellipsis applies: on bare text inside the
   flex button it never drew and names were cut mid-letter. */
.nav-child .nav-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-drop {
  flex-shrink: 0;
  border: none;
  background: none;
  color: var(--rail-text);
  cursor: pointer;
  font-size: var(--fs-xs);
  line-height: 1;
  padding: var(--sp-2);
  border-radius: 6px;
  /* Stays out of the way until you go looking for it. */
  opacity: 0;
}
.nav-child-row:hover .nav-drop { opacity: 0.65; }
.nav-drop:hover { opacity: 1 !important; color: var(--danger); }
.nav-drop.restore:hover { color: var(--accent); }

.nav-child-row.dropped .nav-child { opacity: 0.5; font-style: italic; cursor: default; }
.nav-child-row.dropped .nav-drop { opacity: 0.65; }
/* No hover on a touch screen: an invisible but tappable x would drop a class
   by accident, so show it and give it a finger-sized box. */
@media (hover: none), (pointer: coarse) {
  .nav-child-row .nav-drop { opacity: 0.65; min-width: 44px; min-height: 44px; }
}

.nav-dropped-toggle {
  width: 100%;
  border: none;
  background: none;
  color: var(--rail-text);
  cursor: pointer;
  text-align: left;
  font-size: var(--fs-2xs);
  padding: var(--sp-2) var(--sp-3) var(--sp-2) var(--sp-8);
  opacity: 0.6;
}
.nav-dropped-toggle:hover { opacity: 1; color: var(--text); }

.course-drop { margin-left: auto; }
.course-drop:hover { border-color: var(--danger); color: var(--danger); }

/* Armed state: the click that would actually drop the class. */
.nav-drop.armed,
.course-drop.armed {
  opacity: 1 !important;
  color: var(--on-accent);
  background: var(--danger);
  border-color: var(--danger);
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: 0.02em;
}
/* The rail hover tint comes after .armed, so a hovered armed x keeps it
   (the order the shell sheet gave it before it was folded, issue #16 F-80). */
.nav-drop:hover { background: var(--rail-2); }

.chapter-tag {
  display: inline-block;
  margin-right: var(--sp-2);
  padding: 1px var(--sp-2);
  border-radius: var(--radius);
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--accent);
  background: var(--accent-soft);
}

/* Two columns: what you sit for (left), what you hand in (right). */
.course-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-5);
  margin-bottom: var(--sp-6);
}
@media (max-width: 760px) { .course-cols { grid-template-columns: 1fr; } }
/* Beside the sidebar the page column is far narrower than the viewport: one
   column until each half would still be about 350px (issue #16 item 4). */
@container main (max-width: 719px) { .course-cols { grid-template-columns: 1fr; } }
.course-col { min-width: 0; }
.course-col .assess-list { margin-bottom: 0; }
.course-col-empty {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  padding: var(--sp-3) var(--sp-0);
  opacity: 0.75;
}

.assess-pill.homework { background: var(--success); }
.assess-item:has(.assess-row.homework) { border-left-color: var(--success); }

.assess-summary {
  font-size: var(--fs-sm);
  line-height: var(--lh);
  margin: var(--sp-3) 0 var(--sp-0);
  color: var(--text);
}

/* Dismiss control on a workload row — same two-click guard as dropping. */
.hw-dismiss { margin-left: var(--sp-1); }
.list-item:hover .hw-dismiss { opacity: 0.65; }

/* Empty course page: offer the classes instead of a shrug. */
.course-picker { padding: var(--sp-2) 0; }
.course-picker-lead { color: var(--text-muted); font-size: var(--fs-sm); margin-bottom: var(--sp-2); }
.course-picker-list { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.course-picker-item {
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: var(--fs-sm);
  cursor: pointer;
}
.course-picker-item:hover { border-color: var(--accent); color: var(--accent); }
