/*
 * CSE 561, Autumn 2026 — page styles.
 * Layout: fixed purple top bar, fixed left sidebar with section links,
 * one scrolling main column. No framework; edit freely.
 *
 * UW colors: purple #4b2e83, gold #b7a57a, web gold #e8e3d3, metallic gold #85754d
 */

:root {
  --purple: #4b2e83;
  --gold: #b7a57a;
  --text: #111;
  --muted: #666;
  --rule: #e5e5e5;
  --cell-border: #cccccc;
  --shade: #f3f3f3;
  --link: #2a7ae2;
  --link-visited: #1756a9;
  --topbar-h: 50px;
  --sidebar-w: 210px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  padding-top: var(--topbar-h);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--text);
  background: #fdfdfd;
}

a { color: var(--link); text-decoration: none; }
a:visited { color: var(--link-visited); }
a:hover { color: var(--text); text-decoration: underline; }

/* ---------- Top bar ---------- */

.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: var(--purple);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 10;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.topbar a, .topbar a:visited { color: #fff; }
.topbar a:hover { color: #e8e3d3; text-decoration: none; }
.topbar .brand { font-size: 18px; font-weight: 600; }
.topbar .quarter { font-size: 15px; color: #e8e3d3; }

/* ---------- Sidebar ---------- */

.sidebar {
  position: fixed;
  top: var(--topbar-h); bottom: 0; left: 0;
  width: var(--sidebar-w);
  padding: 24px 0;
  background: #f5f5f5;
  border-right: 1px solid var(--rule);
  overflow-y: auto;
}
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li a {
  display: block;
  padding: 8px 24px;
  color: #333;
  font-size: 15px;
}
.sidebar li a:hover { background: #e8e8e8; color: var(--purple); text-decoration: none; }
.sidebar li ul li a { padding-left: 40px; font-size: 14px; color: #555; }

/* ---------- Main column ---------- */

.main {
  margin-left: var(--sidebar-w);
  padding: 24px 40px 40px;
  max-width: 1150px;
}

h1 {
  font-size: 30px;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--purple);
}
.subtitle { margin: 0 0 28px; font-size: 18px; color: var(--muted); }

h2 {
  font-size: 24px;
  font-weight: 600;
  margin: 40px 0 14px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--rule);
  scroll-margin-top: calc(var(--topbar-h) + 12px); /* keep headings visible under the fixed bar */
}
h2:first-of-type { margin-top: 20px; }

p { margin: 0 0 14px; }
ul, ol { margin: 0 0 14px 24px; padding: 0; }
li > ul, li > ol { margin-bottom: 0; }

/* ---------- Organization: borderless label/description table ---------- */

table.org { border-collapse: collapse; margin: 0 0 14px; }
table.org td { padding: 3px 0; vertical-align: top; border: none; }
table.org td:first-child { font-weight: 600; white-space: nowrap; padding-right: 18px; }

/* ---------- Administrivia table ---------- */

table.admin {
  width: 75%;
  max-width: 760px;
  border: 1px solid var(--cell-border);
  border-collapse: collapse;
  margin-bottom: 18px;
}
table.admin td { padding: 8px 12px; vertical-align: top; }
table.admin td:first-child { width: 170px; font-weight: 600; white-space: nowrap; }
table.admin tr:nth-child(odd) { background: var(--shade); }
table.admin p { margin: 4px 0 0; }

/* ---------- Schedule table ---------- */

table.schedule {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
}
table.schedule th, table.schedule td {
  border: 1px solid var(--cell-border);
  padding: 10px;
  vertical-align: top;
  text-align: left;
}
table.schedule th { background: #eeeeee; font-weight: 700; }
table.schedule td.date { width: 80px; white-space: nowrap; }
table.schedule td.lecturer { width: 230px; }
table.schedule .affil { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
table.schedule .slides { display: block; font-size: 13px; margin-top: 2px; }
table.schedule td.reading b { display: block; margin-bottom: 4px; }
table.schedule td.reading ul { margin: 0 0 0 20px; }
table.schedule tr:nth-child(even) { background: var(--shade); }
table.schedule tr:target { background: #f3eedd; } /* row linked via #anchor */

/* "Primary read" / "Shallow reads" labels inside a reading cell */
table.schedule .label { display: block; font-size: 14px; font-style: italic; color: var(--muted); }
table.schedule td.reading > .label { margin: -2px 0 2px; }
.shallow { margin-top: 8px; font-size: 14px; color: #333; }
.shallow ul { margin: 2px 0 0 20px; }

/* Project milestone shown inside a reading cell */
.milestone { margin-top: 8px; font-size: 14px; font-weight: 600; color: var(--purple); }

/* Holidays and other no-class days */
table.schedule tr.noclass td { color: var(--muted); font-style: italic; }

/* ---------- Footer ---------- */

.footer {
  margin-left: var(--sidebar-w);
  padding: 18px 40px;
  border-top: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
}
.footer img { height: 28px; }

/* ---------- Narrow screens: sidebar collapses to a top list ---------- */

@media (max-width: 800px) {
  .sidebar {
    position: static;
    width: auto;
    padding: 8px 0;
    border-right: none;
    border-bottom: 1px solid var(--rule);
  }
  .sidebar ul { display: flex; flex-wrap: wrap; }
  .sidebar li a { padding: 6px 14px; }
  .sidebar li ul { display: none; }
  .main, .footer { margin-left: 0; padding-left: 20px; padding-right: 20px; }
  table.admin { width: 100%; }
  .topbar .quarter { display: none; }
}

@media print {
  .topbar, .sidebar { display: none; }
  body { padding-top: 0; }
  .main, .footer { margin-left: 0; }
}
