.course-hero {
  text-align: center;
  padding: 2rem 1rem !important;
}

.course-hero-term {
  font-size: 1.5rem;
  letter-spacing: 0.3px;
}

.course-hero-title {
  font-size: 3rem;
  font-weight: 500;
}

.course-hero-instructor {
  font-size: 1.5rem;
}

.course-hero-instructor strong {
  font-weight: 600;
}

.course-hero-lectures {
  font-size: 1.1rem;
  margin-top: 0.4rem;
}

body {
  font-family: 'Roboto', sans-serif;
  grid-template-columns: 1fr min(75rem, 90%) 1fr;  /* wider content */
  font-size: 1rem;                                  /* smaller base font */
}

main {
  padding: 0rem;
}

:root {
  --bg: #ffffff;
  --accent-bg: #f8f9fb;
  --text: #1d1d1d;
  --text-light: #646464;
  --border: #c8ccd4;

  /* Cornell red as accent without overwhelming the page */
  --accent: #b31b1b;
  --accent-hover: #d32424;
  --accent-text: #ffffff;

  --code: #8b2f4d;
  --preformatted: #333333;
  --marked: #fff3b0;
  --disabled: #f0f0f0;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;

    --bg: #1b1b1c;
    --accent-bg: #242426;
    --text: #e0e0e0;
    --text-light: #b0b0b0;

    /* Dark-mode friendly Cornell accent */
    --accent: #e3685b;
    --accent-hover: #ff8a80;
    --accent-text: #1b1b1c;

    --code: #ffb3c7;
    --preformatted: #dddddd;
    --marked: #554400;
    --disabled: #0f0f10;
  }

  img,
  video {
    opacity: 0.85;
  }
}


header {
  padding-bottom: 0 !important;
}

h1, h2 { color: var(--accent); }

h3, h4, h5, h6 { color: var(--text); }

/* Format headers */
h1 {
  font-size: 2rem;
}

h2 {
  font-size: 1.8rem;
}

h3 {
  font-size: 1.4rem;
  margin: 1rem 0;
}

h4 {
  font-size: 1.44rem;
}

h5 {
  font-size: 1.15rem;
}

h6 {
  font-size: 0.96rem;
}
 
p {
  margin: 0.25rem 0;
}

table {
  border-collapse: collapse;
  width: 100%;
  border: 0px solid var(--border);
  margin: 0.5rem 0;
}

table th,
table td {
  padding: 0.5rem 0.75rem;
  border: 0px solid var(--border);
}

table .module-row td {
  background: var(--accent-bg);
  font-weight: 600;
  font-size: 1.0rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
  border-top: 2px solid var(--border);
  border-bottom: 2px solid var(--border);
  color: var(--accent);
}

table tr:nth-child(odd) {
  background: var(--bg);
}

table tr:nth-child(even) {
  background: var(--accent-bg);
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-scroll table {
  min-width: 800px;
  font-size: 0.9rem;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.25rem;
}

.course-title {
  color: white;
  font-weight: 600;
  font-size: 1.25rem;
}

/* Override the theme's header nav "button" links: make them flat */
header nav a,
header nav a:visited {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  margin: 0rem;
  margin-block-start: 0rem !important;

  color: var(--text);
  text-decoration: none;

  font-size: 1.15rem;
  font-weight: 500;
}

/* Hover: simple underline + accent color */
header nav a:hover {
  color: var(--accent);
  text-decoration: underline;
  background: transparent;
}

/* Current page: accent + stronger underline */
header nav a.current,
header nav a[aria-current="page"],
header nav a[aria-current="true"] {
  color: var(--accent);
  text-decoration: underline;
  background: transparent;
  font-weight: 600;
}

/* If your nav uses SVG icons (RSS), keep them inheriting text color */
header nav .icon {
  fill: currentColor;
}

body > header > nav.navbar {
  margin-block-start: 0;
  margin-left: auto;
  margin-right: auto;
}


nav.navbar {
  display: flex;
  align-items: baseline;   /* looks nicer with mixed font sizes */
  margin: 0rem;
}

/* Push links right + space them */
nav.navbar .nav-links {
  margin-left: auto;
  display: flex;
  align-items: baseline;
  gap: 1.5rem;            /* increase/decrease as you like */
}

.banner {
  width: 100%;
  margin-bottom: 2rem;
  margin-top: 0rem;
}

.course-staff {
  margin-block: 1rem 2rem;
  border: 0 !important;
  margin: 0;
  padding: 0;
  --photo: clamp(100px, 10vw, 128px);
}

.staff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.staff-card {
  padding: 0rem;
  border: 0 !important;
  /* border: 1px solid var(--border-color, rgba(0, 0, 0, 0.12)); */
  /* border-radius: 14px; */
  /* background: var(--card-bg, rgba(255, 255, 255, 0.9)); */
}

.staff-header {
  display: grid;
  grid-template-columns: var(--photo) 1fr;
  gap: 1rem;
  align-items: center;
}

.staff-photo {
  inline-size: var(--photo);
  block-size: var(--photo);
  object-fit: cover;
  border: 1px solid var(--border-color, rgba(0, 0, 0, 0.12));
}
.staff-photo--circle {
  border-radius: 999px;
}

.staff-photo--square {
  border-radius: 12px;
}

.staff-role {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  opacity: 0.75;
  margin: 0;
}

.staff-name {
  font-weight: 700;
  font-size: 1.15rem;
  margin: 0.15rem 0 0.35rem;
}

.staff-detail {
  margin: 0.15rem 0;
}

.office-hours {
  margin-block-start: 1.5rem;
}

.office-hours ul {
  padding-inline-start: 1.25rem;
}

course-staff > staff-grid > .article {
  border: 0 !important;
}

.course-staff section {
  border: 0 !important;
}

.page-section {
  background: var(--bg);
  padding-block: 1rem !important ;
  line-height: 1.75;
  border: 0 !important;
  margin: 0;
}

.page-section--accent {
  background: var(--accent-bg);
}

.page-section__inner {
  max-width: 980px;
  margin-inline: auto;
  padding-inline: 1rem;
}

.page-section p {
  margin-block: 0.75rem;
}

.page-section li {
  line-height: 1.6;
}

/* =========================
   1) Layout: constrain measure
   ========================= */

body {
  /* keep your font, but tighten default reading rhythm */
  font-size: 16px;              /* stable baseline */
  line-height: 1.6;
}

/* Constrain the actual reading column */
main {
  max-width: 980px;             /* key: readable line length */
  margin: 0 auto;        /* give content breathing room */
}

main ul, main ol {
  max-width: 700px;
}

/* If your theme uses a wrapper like .content, .container, etc,
   add it here too. Safe even if unused. */
.content,
.container,
.page-section__inner {
  max-width: 860px;
}


/* =========================
   2) Typography: headings like the reference
   ========================= */

/* Keep h1/h2 accent if you like, but reduce size + weight */
h1, h2 {
  color: var(--accent);
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(2.0rem, 3vw, 2.6rem);
  font-weight: 700;
  line-height: 1.15;
  margin: 1.25rem 0 0.75rem;
}

h2 {
  font-size: clamp(1.5rem, 2.2vw, 2.0rem);
  font-weight: 700;
  line-height: 1.2;
  margin: 2.0rem 0 0.75rem;
}

/* Section headers like "Prerequisites" should look crisp and dark,
   not the same accent as page title */
h3 {
  color: var(--text);
  font-size: 1.25rem;
  font-weight: 750;
  line-height: 1.25;
  margin: 1.5rem 0 0.5rem;
}

/* Optional: make h4-h6 more consistent */
h4 { font-size: 1.1rem; font-weight: 700; margin: 1.25rem 0 0.4rem; }
h5 { font-size: 1.0rem; font-weight: 700; margin: 1.0rem 0 0.35rem; }
h6 { font-size: 0.95rem; font-weight: 700; margin: 1.0rem 0 0.35rem; }


/* =========================
   3) Body text + links: improve readability
   ========================= */

p {
  margin: 0.65rem 0;            /* your 0.25rem is too cramped */
  color: var(--text);
}

p, li {
  font-size: 1rem;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--accent-hover);
}


/* =========================
   4) Lists: make bullets look like the reference
   ========================= */

ul, ol {
  margin: 0.75rem 0 1.0rem;
  padding-left: 1.25rem;
}

/* More legible list rhythm */
li {
  margin: 0.45rem 0;
  line-height: 1.55;
}

/* This is the trick that matches your reference:
   "bold lead-in" then normal description, with a subtle break */
li strong {
  font-weight: 700;
  color: var(--text);
}

/* If your markdown produces "• <strong>Title</strong>. Sentence..."
   give the title a little air without needing HTML changes */
li strong::after {
  content: " ";
}


/* =========================
   5) “Soft section” feel (like the reference)
   ========================= */

/* Your .page-section is good; make it feel less tall + more consistent */
.page-section {
  padding-block: 2rem;
}

.page-section--accent {
  background: var(--accent-bg);
}

/* Optional: add a subtle divider between big sections */
.page-section + .page-section {
  border-top: 1px solid color-mix(in srgb, var(--border) 65%, transparent);
}

/* =========================
   Navbar: centered + responsive
   ========================= */

nav.navbar {
  /* full-width bar */
  width: 100%;
  box-sizing: border-box;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);

  /* center its contents to match main width */
  max-width: 980px;          /* must match main */
  margin: 0 auto;
  padding: 0.75rem 1rem;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* Title */
nav.navbar > .course-title {
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.1;
  white-space: nowrap;
}

/* Links */
nav.navbar > .nav-links {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* link styling */
nav.navbar a,
nav.navbar a:visited {
  color: var(--text);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 550;
  padding: 0.15rem 0;
}

nav.navbar a:hover {
  color: var(--accent);
  text-decoration: underline;
}

nav.navbar a.current,
nav.navbar a[aria-current="page"],
nav.navbar a[aria-current="true"] {
  color: var(--accent);
  text-decoration: underline;
  font-weight: 650;
}

/* RSS icon sizing */
nav.navbar .icon {
  width: 1em;
  height: 1em;
  vertical-align: -0.1em;
  fill: currentColor;
}

@media (max-width: 640px) {
  nav.navbar {
    flex-direction: column;
    align-items: center;      /* center the column */
    text-align: center;
    gap: 0.6rem;
  }

  nav.navbar > .course-title {
    width: 100%;
    text-align: center;
  }

  /* Center the links row; keep horizontal scroll if needed */
  nav.navbar > .nav-links {
    width: 100%;
    justify-content: center;  /* center the items */
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 0.9rem;
    padding-bottom: 0.25rem;
  }

  /* Optional: make it feel less "stuck to the left" when it scrolls */
  nav.navbar > .nav-links::before,
  nav.navbar > .nav-links::after {
    content: "";
    flex: 0 0 0.5rem;
  }

  nav.navbar a,
  nav.navbar a:visited {
    white-space: nowrap;
    font-size: 0.98rem;
  }
}
