/* =================================================================
   exam-countdown.css — the "Exam dates" card and chips
   Rendered by assets/js/exam-countdown.js from upcoming_exams:
     .mtm-cd-list   the card in an exam hub's side column
     .mtm-cd-chip   one line of chips under a subject page's title and on
                    the signed-in home page
   The markup ships a static fallback (a link to the exam calendar) that
   occupies the same space, so nothing moves when the dates arrive.
   Every colour is a token with a fallback, so pages that do not load
   main.css (subject pages) and dark mode both work.
   ================================================================= */

.mtm-cd-fallback {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-secondary, #475569);
}

.mtm-cd-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.mtm-cd-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 0;
  border-top: 1px solid var(--border, #e2e8f0);
}
.mtm-cd-item:first-child { border-top: 0; padding-top: 2px; }
.mtm-cd-title {
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--text-secondary, #475569);
}
.mtm-cd-when {
  font-size: 0.82rem;
  color: var(--text-muted, #5b6b81);
}
.mtm-cd-when strong {
  font-weight: 700;
  color: var(--text, #0f172a);
}
.mtm-cd-item.is-soon .mtm-cd-when strong { color: #b45309; }
.mtm-cd-note {
  font-size: 0.75rem;
  color: var(--text-muted, #5b6b81);
}
.mtm-cd-more {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary, #2563eb);
  text-decoration: none;
}
.mtm-cd-more:hover { text-decoration: underline; }

/* ── Chips ─────────────────────────────────────────────────────── */
.mtm-cd-chips,
[data-countdown-style="chips"] {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
}
.mtm-cd-chip,
.mtm-cd-fallback-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 3px 11px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 999px;
  background: var(--card-bg, #fff);
  font-size: 0.78rem;
  line-height: 1.3;
  color: var(--text-secondary, #475569);
  text-decoration: none;
  white-space: nowrap;
}
.mtm-cd-chip:hover,
.mtm-cd-fallback-link:hover {
  border-color: var(--primary, #2563eb);
  color: var(--text, #0f172a);
}
.mtm-cd-chip strong { color: var(--text, #0f172a); font-weight: 700; }
.mtm-cd-chip.is-soon { border-color: #f59e0b; }

/* Under a subject page's title (the header is centred). */
.subject-exam-dates {
  justify-content: center;
  margin: -12px auto 24px;
  padding: 0 16px;
}

/* Signed-in home page: a labelled line under the stats. */
.home-exam-dates {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  /* Below the stats row, which already leaves --section-gap under itself;
     the same gap under this line keeps "Choose your exam" where it was. */
  margin: calc(-1 * var(--section-gap, 20px) + 10px) 0 var(--section-gap, 20px);
}
.home-exam-dates[hidden] { display: none; }
.home-exam-dates-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted, #5b6b81);
}

/* In an exam hub's side column, between the progress panel and Exam Info.
   At ≤ 1024px the column becomes a grid that spaces its cards itself. */
@media (min-width: 1025px) {
  .sd-aside > .mtm-countdown:not(:last-child) { margin-bottom: 12px; }
}
