:root {
  color-scheme: light;
  font-family: system-ui, sans-serif;
  line-height: 1.5;
}

body {
  max-width: 60rem;
  margin: 0 auto;
  padding: 2rem 1rem;
  color: #222;
}

header {
  border-bottom: 1px solid #ccc;
  margin-bottom: 2rem;
}

h1,
h2,
h3 {
  line-height: 1.2;
}

section {
  margin: 2rem 0;
}

dl {
  display: grid;
  grid-template-columns: 10rem 1fr;
  gap: 0.5rem 1rem;
}

dt,
th {
  font-weight: 700;
}

dt {
  grid-column: 1;
}

dd {
  grid-column: 2;
  margin: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 2rem;
}

caption {
  margin-bottom: 0.5rem;
  font-weight: 700;
  text-align: left;
}

th,
td {
  padding: 0.6rem;
  border: 1px solid #ccc;
  text-align: left;
  vertical-align: top;
}

.calendar-scroll {
  max-width: 100%;
  overflow-x: auto;
}

.calendar-table {
  min-width: 60rem;
  table-layout: fixed;
}

.calendar-table th {
  background: #e9e9e9;
  text-align: center;
}

.calendar-table td {
  height: 8.5rem;
}

.calendar-table .muted {
  background: #f1f1f1;
  color: #888;
}

.calendar-table .no-class {
  background: #fafafa;
}

.calendar-table .has-due {
  position: relative;
  padding-bottom: 2.5rem;
}

.date {
  display: block;
  font-weight: 700;
}

.activity {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  overflow-wrap: break-word;
}

.chapter-number,
.activity em {
  display: block;
}

.assessment-event {
  color: #175ea8;
}

.ps-due {
  position: absolute;
  bottom: 0.6rem;
  left: 0.6rem;
  color: #b42318;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

#topic-outline .level3 {
  padding: 1rem 0;
  border-top: 1px solid #ddd;
}

#topic-outline .level3 h3 {
  margin: 0;
}

#topic-outline .level3 ul {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
}

#topic-outline .chapter-materials {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
}

#topic-outline .chapter-materials a {
  color: #175ea8;
}

@media (max-width: 36rem) {
  dl {
    display: block;
  }

  dd {
    margin-bottom: 0.5rem;
  }

  .calendar-table {
    font-size: 0.9rem;
  }
}

@page {
  size: letter portrait;
  margin: 0.4in;
}

/* The print layout is three pages: course information, topic outline, and
   references. Keep the page breaks explicit so the outline stands alone. */
@media print {
  :root {
    font-size: 9pt;
  }

  body {
    max-width: none;
    padding: 0;
  }

  header {
    margin-bottom: 1rem;
  }

  section {
    margin: 1rem 0;
  }

  .calendar-scroll {
    overflow: visible;
  }

  .calendar-table {
    min-width: 0;
    width: calc(100% - 0.1in);
    margin-right: auto;
    margin-left: auto;
  }

  .calendar-table th,
  .calendar-table td {
    padding: 0.35rem;
  }

  .calendar-table td {
    height: 6rem;
  }

  .calendar-table .has-due {
    padding-bottom: 1.8rem;
  }

  .ps-due {
    bottom: 0.35rem;
    left: 0.35rem;
    font-size: 0.7rem;
  }

  #calendar {
    break-inside: avoid;
  }

  #topic-outline {
    break-before: page;
    line-height: 1.35;
  }

  #references {
    break-before: page;
  }

  #topic-outline .level3 {
    margin: 0;
    padding: 0.28rem 0;
    break-inside: avoid;
  }
}
