/* pm-module-bands.css — the visible module grouping on a short course page.
 * ---------------------------------------------------------------------------
 * Deliberately quiet. The point is orientation, not decoration: a learner
 * scrolling through 44 lessons should always be able to see which module they
 * are in, how far through it they are, and that an end is coming. Anything
 * louder competes with the lesson cards themselves.
 *
 * The tint alternates between modules rather than being one colour, because a
 * single tint on every band gives you no edge to see when one ends and the next
 * begins — which was the whole problem.
 *
 * Colours are taken from each course's own variables where they exist, with
 * neutral fallbacks so this file drops onto any of the courses unchanged.
 * ---------------------------------------------------------------------------
 */

.pm-band {
  border-radius: 18px;
  padding: 4px 14px 16px;
  margin: 34px 0;
  background: var(--pm-band-a, #EEF3F7);
  border: 1px solid var(--pm-band-line, #DDE5EC);
  /* a coloured rule along the top, so the start of a module is unmissable
     even when you scroll into the middle of the page */
  border-top: 4px solid var(--pm-band-accent, #0E7B7B);
}
.pm-band[data-band-index="b"] { background: var(--pm-band-b, #F7F3EE); }

/* ---------- header ---------- */
.pm-band-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 6px 15px;
  margin: 0 0 4px;
  border-bottom: 1px solid var(--pm-band-line, #DDE5EC);
  flex-wrap: wrap;
}
.pm-band-icon {
  flex: 0 0 auto;
  width: 46px; height: 46px;
  display: grid; place-items: center;
  font-size: 22px; line-height: 1;
  border-radius: 13px;
  background: var(--pm-band-icon-bg, #FFFFFF);
  border: 1px solid var(--pm-band-line, #E3E9EE);
}
.pm-band-text { flex: 1 1 240px; min-width: 0; }
.pm-band-eyebrow {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--pm-band-eyebrow, #60707C);
  margin: 0 0 3px;
}
h2.pm-band-name {
  margin: 0;
  font-size: 21px;
  line-height: 1.25;
  font-weight: 800;
  color: var(--pm-band-title, #16202A);
  letter-spacing: -0.01em;
}

/* ---------- live progress ---------- */
.pm-band-prog {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  min-width: 132px;
}
.pm-band-prog[data-empty] { visibility: hidden; }
.pm-band-count {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--pm-band-eyebrow, #60707C);
  white-space: nowrap;
}
.pm-band-bar {
  display: block;
  width: 132px; height: 7px;
  border-radius: 99px;
  background: var(--pm-band-track, #E3E9EE);
  overflow: hidden;
}
.pm-band-bar i {
  display: block; height: 100%;
  border-radius: 99px;
  background: var(--pm-band-accent, #0E7B7B);
  transition: width .4s ease;
}

/* ---------- completed ---------- */
.pm-band.pm-band-complete {
  border-color: var(--pm-band-accent, #0E7B7B);
}
.pm-band.pm-band-complete .pm-band-icon {
  border-color: var(--pm-band-accent, #0E7B7B);
}

/* ---------- footer: the visible end point ---------- */
/* Two rows. The top row is the marker and the way onward; below it sit the two
   things a learner can actually do here — test themselves on the module, and
   read the article on it. Those are stacked rather than inline because both
   now carry a second line of text saying what they are. */
.pm-band-foot {
  margin: 6px 6px 0;
  padding-top: 14px;
  border-top: 1px dashed var(--pm-band-line, #E3E9EE);
}
.pm-band-foot-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
/* THE END-OF-LESSON CHECKPOINT. A session card already carries its own cards
   and quiz; this is the pair for the whole lesson, and it needs to read as a
   stopping place rather than as two more buttons. Hence the sentence above
   them: it says what has just been finished and what the quiz will do, which
   is the part a learner cannot see from a button label. The buttons keep the
   classes the session cards use, so they are the same buttons a learner has
   been pressing all the way down the page. */
.pm-band-acts {
  margin-top: 14px;
}
.pm-band-acts-note {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--pm-band-muted, #55606B);
}
.pm-band-acts-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
/* On a phone the two sit one per line rather than squeezing onto one: a
   flashcard count and a question count both shrink to nothing when they share
   a 320px row. */
@media (max-width: 420px) {
  .pm-band-acts-row > * { flex: 1 1 100%; justify-content: center; }
}

.pm-band-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  margin-top: 12px;
}
.pm-band-end {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--pm-band-eyebrow, #60707C);
}
.pm-band-next {
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  color: var(--pm-band-accent, #0E7B7B);
  padding: 7px 13px;
  border-radius: 9px;
  border: 1px solid transparent;
}
a.pm-band-next:hover {
  border-color: var(--pm-band-accent, #0E7B7B);
  background: var(--pm-band-icon-bg, #FFFFFF);
}
.pm-band-next.done { color: var(--pm-band-eyebrow, #60707C); font-weight: 600; }

/* The two end-of-module actions share a shape: icon, a label, and a second
   line saying what the thing actually is. */
.pm-band-read,
.pm-band-test,
.pm-band-cards {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  font-family: inherit;
  font-size: 13px;
  text-decoration: none;
  color: var(--pm-band-eyebrow, #60707C);
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--pm-band-line, #DDE5EC);
  background: var(--pm-band-icon-bg, #FFFFFF);
  cursor: pointer;
}
.pm-band-read:hover,
.pm-band-test:hover,
.pm-band-cards:hover {
  color: var(--pm-band-title, #16202A);
  border-color: var(--pm-band-eyebrow, #60707C);
}
.pm-band-read-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1 1 auto; }
.pm-band-read-label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--pm-band-eyebrow, #60707C);
}
.pm-band-read-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--pm-band-title, #16202A);
  line-height: 1.35;
}
.pm-band-read-ico,
.pm-band-test-ico { font-size: 16px; line-height: 1; flex: none; }
.pm-band-read-ext { opacity: .55; font-weight: 700; flex: none; align-self: center; }

/* the test is the primary action of the two, so it carries the accent */
.pm-band-test {
  border-color: var(--pm-band-accent, #0E7B7B);
}
.pm-band-test .pm-band-read-label { color: var(--pm-band-accent, #0E7B7B); }
.pm-band-test:hover { background: var(--pm-band-a, #EDF2F9); }

/* the lesson cards keep their own styling; just remove the doubled margin */
.pm-band-body > .lesson-card:first-child { margin-top: 0; }
.pm-band-body > .lesson-card:last-child { margin-bottom: 0; }

@media (max-width: 640px) {
  .pm-band { padding: 2px 9px 12px; border-radius: 14px; margin: 22px 0; }
  .pm-band-head { gap: 11px; padding: 13px 3px 12px; }
  .pm-band-icon { width: 38px; height: 38px; font-size: 18px; border-radius: 11px; }
  h2.pm-band-name { font-size: 18px; }
  .pm-band-prog { align-items: flex-start; min-width: 0; flex: 1 1 100%; }
  .pm-band-bar { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .pm-band-bar i { transition: none; }
}
