/* Minimal course page stylesheet */

/* --- Base / layout --- */
* { box-sizing: border-box; }

:root {
  --max-width: 65em;
  --nav-height: 56px;
  --page-pad: 30px;
}

body {
  margin: 0;
  padding: var(--page-pad);
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  font-family: sans-serif;
  line-height: 1.4;
  quotes: '\00201C' '\00201D' '\002018' '\002019';
}

body.light { background: #fff; color: #000; }
body.dark  { background: #00467f; color: #fff; }
body.dark a { color: inherit; }

p { text-align: justify; }

/* --- Nav --- */
nav {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);

  width: calc(100% - (2 * var(--page-pad)));
  max-width: var(--max-width);

  background: #333;
  color: #fff;
  padding: 10px 12px;
  z-index: 10;
}

nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 14px 20px;
  justify-content: center;
  margin: 0;
  padding: 0;
}

nav a {
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}
nav a:hover,
nav a:focus {
  text-decoration: underline;
}

/* Ensure anchor jumps aren't hidden behind fixed nav */
h1, h2, section[id] {
  scroll-margin-top: calc(var(--nav-height) + 14px);
}

/* Push content below the fixed nav */
.content { margin-top: calc(var(--nav-height) + 14px); }

/* --- Page header / sections --- */
.page-header h1 {
  margin: 0;
  font-size: 2.25rem;
}

.page-header .term {
  margin: 0.25rem 0 0;
  font-size: 1.25rem;
  opacity: 0.9;
}

/* One spacing system to rule them all */
.page-section { margin: 2rem 0; }
.page-section > * + * { margin-top: 0.9rem; }

.page-section hr {
  opacity: 0.35;
  margin: 0.9rem 0;
}

/* Lists */
.page-section ul,
.page-section ol {
  padding-left: 1.25rem;
}
.page-section li { margin: 0.35rem 0; }

/* --- Tables --- */
/* Keep generic tables sane without forcing the "data-table" look everywhere */
table { border-collapse: collapse; }

/* Opt-in pretty tables */
table.data-table {
  margin: 1rem auto;
  width: 100%;
  max-width: 55em;
}

table.data-table th,
table.data-table td {
  border: 1px solid currentColor;
  padding: 0.5rem 0.75rem;
  text-align: left;
  vertical-align: top;
}

table.data-table thead th {
  font-weight: 700;
  background: rgba(0, 0, 0, 0.05);
}

body.dark table.data-table thead th {
  background: rgba(255, 255, 255, 0.15);
}

/* Keep Date + DoW compact and prevent dumb wrapping */
table.data-table th:nth-child(1),
table.data-table td:nth-child(1) {
  white-space: nowrap;
  width: 7ch;
}

table.data-table th:nth-child(2),
table.data-table td:nth-child(2) {
  white-space: nowrap;
  width: 4ch;
}


/* --- Accessibility helper (optional; harmless if unused) --- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
}
.skip-link:focus {
  left: 12px;
  top: 12px;
  background: #fff;
  color: #000;
  padding: 8px 10px;
  z-index: 999;
}
