/* Course pages only (loaded by _layouts/course.html). Homepage styles live in style.scss. */

:root {
  --c-blue: #1f5fae;
  --c-blue-bg: #e6eef9;
  --c-red: #b3261e;
  --c-red-bg: #fbe9e7;
  --c-green: #2e7d32;
  --c-green-bg: #eef6ee;
  --c-purple: #6a3d9a;
  --c-purple-bg: #f1eaf8;
  --c-orange: #b35c00;
  --c-shade: #eff1f4;
  --c-border: #dde1e6;
  --c-crimson: #4a0100;
}

/* ---- Header bits ---- */
.course h1 .course-term {
  display: block;
  margin-top: 0.15em;
  font-size: 0.75em;
  font-weight: 500;
}

.course-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 1.2em;
}
.course-menu a {
  padding: 3px 10px;
  border: 1px solid var(--c-border);
  border-radius: 4px;
  font-size: 0.9em;
}
.course-menu a.active { background: var(--c-shade); font-weight: 600; }

/* ---- Callouts (styled like the homepage .infonotes box) ---- */
.course .entry blockquote.callout,
.course .entry .callout {
  margin: 1.2em 0;
  padding: 6px 12px;
  color: #673a3f;
  background-color: #EAECEE;
  border-left: 6px solid var(--c-crimson);
  font-style: normal;
}
.course .entry .callout > :first-child { margin-top: 0.4em; }
.course .entry .callout > :last-child { margin-bottom: 0.4em; }
.course .entry .callout-blue {
  color: var(--c-blue);
  background: var(--c-blue-bg);
  border-left-color: var(--c-blue);
}

/* ---- Small colored tags ---- */
.tag {
  display: inline-block;
  padding: 0 6px;
  margin: 1px 4px 1px 0;
  border-radius: 3px;
  font-size: 0.8em;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
  vertical-align: baseline;
}
.tag-purple { color: #fff; background: var(--c-purple); }
.tag-blue   { color: var(--c-blue); background: var(--c-blue-bg); }
.tag-red    { color: var(--c-red); background: var(--c-red-bg); }
.tag-green  { color: var(--c-green); background: var(--c-green-bg); }
/* Textbook labels use solid backgrounds */
strong.tag-blue  { color: #fff; background: var(--c-blue); }
strong.tag-green { color: #fff; background: var(--c-green); }
.tag-book.tag-purple { color: #fff; background: var(--c-purple); }
.tag-book.tag-blue   { color: #fff; background: var(--c-blue); }
.tag-book.tag-green  { color: #fff; background: var(--c-green); }

/* Colored text carried over from GitBook */
.text-green  { color: var(--c-green); }
.text-red    { color: var(--c-red); }
.text-blue   { color: var(--c-blue); }
.text-purple { color: var(--c-purple); }
.text-orange { color: var(--c-orange); }
.text-teal   { color: #00796b; }
.text-gray   { color: #6b6b6b; }
.tag-teal    { color: #00695c; background: #e0f2f1; }
.tag-gray    { color: #444; background: #ececec; }
.tag-orange  { color: var(--c-orange); background: #fdf0e1; }

/* ---- Schedule ---- */
table.schedule {
  width: 100%;
  border-collapse: collapse;
  margin: 1em 0 1.5em;
  font-size: 0.92em;
}
table.schedule th,
table.schedule td {
  padding: 6px 8px;
  vertical-align: top;
  border-bottom: 1px solid var(--c-border);
}
table.schedule thead th {
  border-bottom: 2px solid var(--c-crimson);
  font-weight: 600;
}
table.schedule .s-wk { width: 3em; text-align: center; }
table.schedule thead th:first-child { text-align: center; }
table.schedule .s-date { width: 6.5em; white-space: nowrap; }
table.schedule .s-slides { white-space: nowrap; }
table.schedule .tag { white-space: normal; }
table.schedule td { overflow-wrap: anywhere; }
table.schedule .s-date, table.schedule .s-wk { overflow-wrap: normal; }
table.schedule .s-note ul { margin: 0.2em 0 0.2em 1.2em; padding: 0; }
table.schedule .s-day { font-size: 0.9em; }
table.schedule .s-label { display: none; }
table.schedule .s-note { display: block; }
table.schedule .s-note:first-child { margin-top: 0; }
table.schedule .tag + .s-note { margin-top: 2px; }

table.schedule tbody tr:nth-child(odd)  { background: #fff; }
table.schedule tbody tr:nth-child(even) { background: var(--c-shade); }

table.schedule tr.is-noclass .s-topic { color: var(--c-green); font-weight: 600; }
table.schedule tr.is-noclass .s-note { color: var(--c-green); }

table.schedule tr.is-exam .s-topic { color: var(--c-red); font-weight: 700; }


/* Stacked cards on phones */
@media screen and (max-width: 640px) {
  table.schedule,
  table.schedule tbody,
  table.schedule tr,
  table.schedule td { display: block; width: auto; }
  table.schedule thead { display: none; }
  table.schedule tr {
    margin: 0 0 8px;
    padding: 8px 10px;
    border: 1px solid var(--c-border);
    border-radius: 6px;
  }
  table.schedule td { padding: 0; border: 0; }
  table.schedule .s-wk,
  table.schedule .s-date {
    display: inline;
    width: auto;
    font-size: 0.85em;
  }
  table.schedule .s-label { display: inline; }
  table.schedule .s-wk::after { content: " \00b7  "; }
  table.schedule .s-topic { margin: 2px 0; font-size: 1.05em; }
  table.schedule .s-slides { margin: 2px 0; }
  table.schedule .s-slides:empty,
  table.schedule .s-presenter:empty,
  table.schedule .s-deliverable:empty { display: none; }
  table.schedule .s-presenter,
  table.schedule .s-deliverable { margin: 2px 0; }
  table.schedule .s-presenter::before { content: "Presenter: "; }
  table.schedule .s-remarks:empty { display: none; }
}

/* Long URLs used as link text wrap instead of overflowing on small phones */
.course .entry a { overflow-wrap: anywhere; }
