:root {
  color-scheme: light;
  --course-blue: #285890;
  --course-purple: #4f1684;
  --panel: #f0f0f0;
  --tab: #d0d0d0;
  --tab-selected: #f8f8f8;
  --border: #d7d7d7;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--course-blue);
  overflow-x: hidden;
}

body {
  margin: 0;
  padding: 0 1rem 2rem;
  background-color: var(--course-blue);
  color: #111;
  font-family: Georgia, serif;
  line-height: 1.45;
}

a {
  color: var(--course-purple);
}

a:focus-visible {
  outline: 3px solid #f0b429;
  outline-offset: 3px;
}

#top-matter {
  position: relative;
  width: 100%;
  max-width: 1040px;
  background-color: #666;
  color: white;
  border: 5px solid #999;
  padding: 1rem;
  text-align: center;
  margin: 30px auto 0;
  font-family: Futura, Calibri, sans-serif;
  font-size: 1.1rem;
}

#top-matter a {
  color: white;
  text-decoration: none;
  border-bottom: 1px dashed white;
}

.spqr-home-link {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 10;
  display: block;
  border-bottom: 0;
}

.spqr-home-link img {
  display: block;
  width: 56px;
  height: 56px;
  max-width: none;
  margin: 0;
  border-radius: 6px;
}

/* Below this width the side gutter is too narrow for the icon,
   so push the header down beneath it. */
@media (max-width: 1200px) {
  #top-matter {
    margin-top: 76px;
  }
}

#main {
  width: 100%;
  max-width: 1030px;
  min-width: 0;
  padding: 1rem 2rem 2rem;
  margin: 0 auto;
  border-left: 2px solid white;
  border-right: 2px solid white;
  background-color: var(--panel);
}

.chunk {
  margin: 1rem auto;
  width: 98%;
}

#navbar {
  display: flex;
  width: 100%;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
  gap: 0.5rem;
  border-bottom: 1px solid #e0e0e0;
  text-align: center;
}

.navitem {
  display: inline-block;
  background-color: var(--tab);
  padding: 0.35rem 1rem 0.25rem;
  font-family: Futura, Calibri, sans-serif;
  font-size: 1.05rem;
  white-space: nowrap;
}

.navitem.selected {
  background-color: var(--tab-selected);
  border: 1px solid #e0e0e0;
  border-bottom-color: var(--tab-selected);
  margin-bottom: -1px;
}

#announcements {
  width: 75%;
  padding: 0.25rem 2rem;
  background-color: white;
  color: #333;
  border: 1px dashed #ccc;
}

h3,
h4 {
  font-family: Futura, Calibri, sans-serif;
}

h3 {
  width: 80%;
  margin: 0.5rem auto;
  text-align: center;
  border-bottom: 1px solid var(--course-blue);
}

h4 {
  width: 80%;
  margin: 1rem auto 0.5rem;
  text-align: left;
}

.course-title {
  margin: 1.5rem auto;
}

.update-warning {
  color: #b00020;
}

p {
  text-align: justify;
}

li {
  margin-bottom: 0.25rem;
}

ul {
  margin-top: 0.2rem;
  margin-bottom: 0;
}

img {
  display: block;
  max-width: 90%;
  height: auto;
  margin: 15px auto;
  padding: 0;
}

.course-mark {
  width: 100px;
}

.course-experiences img {
  display: block;
  width: 100%;
  max-width: 100%;
  object-fit: contain;
}

.instructor-info {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  margin: 1rem 0 2rem;
  padding: 0.6rem;
}

.instructor-info .photo img {
  width: 130px;
  max-width: none;
  height: auto;
  margin: 0;
  object-fit: cover;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(40, 88, 144, 0.12);
}

.instructor-info .bio {
  flex: 1;
  text-align: justify;
}

.mds-schedule-table {
  width: 100%;
  margin: 0 auto;
  overflow: hidden;
  background: white;
  font-size: 1rem;
}

.mds-schedule-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
}

.mds-schedule-cell:nth-child(4),
.mds-schedule-cell:last-child {
  flex: 1;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
}

.resource-group {
  width: 90%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.resource-item {
  padding: 0.75rem 1rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.resource-title {
  font-weight: 700;
}

.handout_table tr > th:nth-child(1),
.handout_table tr > td:nth-child(1) {
  text-align: center;
}

.handout_table tr > td:nth-child(1),
.handout_table tr > td:nth-child(2),
.handout_table tr > td:nth-child(3),
.handout_table tr > td:nth-child(5),
.handout_table tr > th:nth-child(1),
.handout_table tr > th:nth-child(2),
.handout_table tr > th:nth-child(3),
.handout_table tr > th:nth-child(5) {
  white-space: nowrap;
}

.pending-section {
  min-height: 320px;
}

.tbd-notice {
  max-width: 720px;
  margin: 2rem auto;
  padding: 1rem 1.25rem;
  background: white;
  border-left: 5px solid var(--course-blue);
}

.archive-offering-list {
  width: 100%;
  margin: 0;
  padding-left: 1.5rem;
  font-family: Futura, Calibri, sans-serif;
  font-size: 1.15rem;
}

.archive-offering-list li {
  margin-bottom: 0.6rem;
}

.archive-highlights {
  margin-bottom: 1rem;
}

.archive-news p:last-child {
  margin-bottom: 0;
}

@media (max-width: 760px) {
  body {
    padding: 0;
  }

  #top-matter {
    margin-top: 0;
    border-width: 0 0 4px;
  }

  .spqr-home-link {
    top: 0.4rem;
    left: 0.4rem;
  }

  .spqr-home-link img {
    width: 32px;
    height: 32px;
  }

  #main {
    padding: 1rem;
    border: 0;
  }

  #navbar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    justify-content: stretch;
    gap: 0.35rem;
  }

  .navitem {
    min-width: 0;
    padding: 0.4rem 0.65rem 0.3rem;
    font-size: 0.95rem;
    white-space: normal;
  }

  h3,
  h4 {
    width: 100%;
  }

  .instructor-info {
    flex-direction: column;
  }

  .instructor-info .bio,
  p {
    text-align: left;
  }

  .mds-schedule-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  table {
    display: block;
    overflow-x: auto;
  }

  .handout_table tr > td,
  .handout_table tr > th {
    white-space: normal;
  }
}
