/* Derek and Daniel's Stat 110 section.
   Reproduces the look of https://cs61.seas.harvard.edu/site/2026/ (Bootstrap 5.0.2
   defaults plus its css/cs161.css) in plain CSS, with no framework dependency. */

:root {
  color-scheme: light;
  --ink: #212529;
  --link: #0d6efd;
  --link-hover: #0a58ca;
  --paper: #fff;
  --nav-muted: rgba(0, 0, 0, .55);
  --nav-hover: rgba(0, 0, 0, .7);
  --nav-active: rgba(0, 0, 0, .9);
  --menu-border: rgba(0, 0, 0, .15);
  --menu-hover: #e9ecef;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, ::before, ::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--link); text-decoration: none; }
@media (hover: hover) { a:hover { color: var(--link-hover); text-decoration: underline; } }
:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; }
img { vertical-align: middle; }

.skip-link { position: absolute; top: -100px; left: .75rem; z-index: 20; padding: .5rem .75rem; background: var(--paper); border: 1px solid var(--menu-border); border-radius: .25rem; }
.skip-link:focus { top: .5rem; }

/* Navbar: Bootstrap .navbar.navbar-expand-lg.navbar-light > .container-fluid */
.navbar { position: relative; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; min-height: 88px; max-width: 1136px; margin-inline: auto; padding: 1rem 3rem; }
.navbar-brand { display: inline-flex; align-items: center; gap: .625rem; flex-shrink: 0; padding: 0; margin-right: 2rem; font-size: 1.25rem; white-space: nowrap; color: var(--nav-active); }
.brand-mark { width: 2.4em; height: 2.4em; }
/* Show the supplied blue wordmark from the existing full-resolution logo. */
.brand-wordmark { position: relative; display: block; width: 6em; aspect-ratio: 1008 / 198; overflow: hidden; }
.brand-wordmark img { position: absolute; width: 109.722222%; max-width: none; height: auto; left: -4.861111%; top: -198.989899%; }
.navbar-brand:hover, .navbar-brand:focus { color: var(--nav-active); text-decoration: none; }
.navbar-toggler { display: none; padding: .25rem .75rem; font-size: 1.25rem; line-height: 1; color: var(--nav-muted); background: transparent; border: 1px solid rgba(0, 0, 0, .1); border-radius: .25rem; cursor: pointer; }
.navbar-toggler-icon {
  display: inline-block; width: 1.5em; height: 1.5em; vertical-align: middle;
  background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%280, 0, 0, 0.55%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") center / 100% no-repeat;
}
.navbar-collapse { display: flex; flex-basis: auto; flex-grow: 1; align-items: center; }
.navbar-nav { display: flex; flex-direction: row; gap: .5rem; padding-left: 0; margin: 0; list-style: none; }
.nav-item { position: relative; }
.nav-link { display: block; padding: .5rem .75rem; color: var(--nav-muted); cursor: pointer; list-style: none; transition: color .15s ease-in-out; }
.nav-link::-webkit-details-marker { display: none; }
.nav-link::after { display: inline-block; margin-left: .255em; vertical-align: .255em; content: ""; border-top: .3em solid; border-right: .3em solid transparent; border-bottom: 0; border-left: .3em solid transparent; }
.nav-link-direct::after { display: none; }
.nav-link-direct:hover { text-decoration: none; }
.nav-link[aria-current="page"] { color: var(--nav-active); font-weight: 600; }
.logout-form { margin: 0; }
.logout-form button { border: 0; background: none; font: inherit; cursor: pointer; }
.nav-link:hover, .nav-link:focus { color: var(--nav-hover); }
.dropdown[open] > .nav-link { color: var(--nav-active); }
.dropdown-menu {
  position: absolute; top: 100%; left: 0; z-index: 1000;
  min-width: 10rem; padding: .5rem 0; margin: .125rem 0 0;
  font-size: 1rem; color: var(--ink); text-align: left;
  background: var(--paper); background-clip: padding-box;
  border: 1px solid var(--menu-border); border-radius: .25rem;
}
.dropdown-item { display: block; width: 100%; padding: .25rem 1rem; clear: both; font-weight: 400; color: var(--ink); white-space: nowrap; }
.dropdown-item:hover, .dropdown-item:focus { color: #1e2125; background: var(--menu-hover); text-decoration: none; }
.dropdown-item:active { color: #fff; background: var(--link); }

/* Page: css/cs161.css */
.page {
  font-family: var(--sans);
  font-feature-settings: "cv11" 1;
  font-weight: 400;
  font-size: 1.125em;
  line-height: 1.55;
  text-size-adjust: auto;
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  padding: 2rem 3rem 3rem;
  max-width: 1136px;
  margin: 0 auto;
}
.landing { width: 100%; min-width: 0; margin: 0 auto; }
h1 { margin: 0 0 2rem; font-size: calc(1.375rem + 1.5vw); font-weight: 600; letter-spacing: -.02em; line-height: 1.2; text-wrap: balance; }
h2 { margin: 0 0 .75rem; font-size: 1.5rem; font-weight: 600; letter-spacing: -.01em; line-height: 1.2; }
p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }
strong { font-weight: 700; }
ul, ol { padding-left: 2rem; margin: 0 0 1rem; }
.announcements { color: red; }
section { margin-top: 2.5rem; scroll-margin-top: 1.5rem; }
section > p, section > ul { max-width: 72ch; }
section > :last-child { margin-bottom: 0; }
section li + li { margin-top: .5rem; }

/* Keep the course identity and useful links grouped without float wrapping. */
.introduction { display: grid; grid-template-columns: clamp(200px, 20vw, 240px) minmax(0, 1fr); align-items: center; gap: 2rem; }
.mascot { width: 100%; margin: 0; }
.mascot img { display: block; width: 100%; height: auto; }
.intro-copy > p { margin-bottom: 1.25rem; }
.intro-copy > p:last-child { margin-bottom: 0; }

/* Schedule table: .page table / th / td from cs161.css */
.schedule { width: 100%; margin: 0 0 1rem; border-collapse: collapse; border-spacing: 0; }
.schedule th, .schedule td { padding: .75rem 1.5rem .75rem 0; text-align: left; vertical-align: top; }
.schedule th:last-child, .schedule td:last-child { padding-right: 0; }
.schedule th[scope="row"] { font-weight: 600; }
.schedule thead th { border-bottom: 1px solid var(--menu-border); }
.schedule tbody tr + tr { border-top: 1px solid var(--menu-border); }

/* Sign-in page: the same document layout as the homepage, with Bootstrap's .btn-primary. */
.login-page .introduction { align-items: start; }
.login-page .intro-copy { max-width: 60ch; }
.btn-primary {
  display: inline-block; padding: .375rem .75rem;
  font-size: 1rem; font-weight: 400; line-height: 1.5; text-align: center; white-space: nowrap;
  color: #fff; background: var(--link); border: 1px solid var(--link); border-radius: .25rem;
  transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out;
}
.btn-primary:hover { color: #fff; background: #0b5ed7; border-color: var(--link-hover); text-decoration: none; }
.btn-primary:active { background: var(--link-hover); border-color: #0a53be; }
.login-help { font-size: .875rem; color: #62666a; }
#login-status { color: red; }
#login-status:empty { display: none; }

.site-credit { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--menu-border); font-size: .875rem; color: #62666a; }
.calendar-note { font-size: .875rem; }
.calendar-filters { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0; }
.calendar-filters button, #calendar-retry, #calendar-event button { font: inherit; font-size: .9375rem; white-space: nowrap; padding: .5rem 1rem; border: 1px solid #dadce0; border-radius: 6px; background: white; color: #3c4043; cursor: pointer; }
@media (hover: hover) { .calendar-filters button:hover { background: #f8fafd; } }
.calendar-filters button[aria-pressed="true"] { color: #174ea6; border-color: #d2e3fc; background: #e8f0fe; }
.calendar-surface { padding: 1.25rem; border: 1px solid #dadce0; border-radius: 10px; }
#calendar-status { font-size: .875rem; margin-top: .75rem; }
#calendar-retry { margin-top: .5rem; }
#course-calendar { font-size: .8125rem; --fc-border-color: #e8eaed; --fc-button-bg-color: white; --fc-button-text-color: #3c4043; --fc-button-border-color: #dadce0; --fc-button-hover-bg-color: #f1f3f4; --fc-button-hover-border-color: #dadce0; --fc-button-active-bg-color: #e8f0fe; --fc-button-active-border-color: #d2e3fc; --fc-today-bg-color: #f8fafd; --fc-page-bg-color: white; --fc-now-indicator-color: #d93025; }
#course-calendar .fc-toolbar-title { font-size: 1.2rem; font-weight: 500; letter-spacing: normal; margin: 0; }
#course-calendar .fc-toolbar { gap: .75rem; margin-bottom: 1.25rem; }
#course-calendar .fc-button { padding: .5rem .7rem; border-radius: 5px; box-shadow: none; }
#course-calendar .fc-button-active { color: #174ea6; }
#course-calendar .fc-prev-button, #course-calendar .fc-next-button { border: none; border-radius: 50%; }
#course-calendar .fc-col-header-cell-cushion { color: #5f6368; font-weight: 500; padding: .75rem .25rem; }
#course-calendar .fc-day-today .fc-col-header-cell-cushion { color: #1967d2; }
#course-calendar .fc-timegrid-slot-label-cushion { color: #5f6368; font-size: .6875rem; }
#course-calendar .fc-timegrid-slot { height: 1.9rem; }
#course-calendar .fc-timegrid-event { border-radius: 5px; padding: 3px; box-shadow: none; }
#course-calendar .fc-event { cursor: pointer; }
#course-calendar .fc-event-title { font-weight: 500; }
#course-calendar .fc-list-day-cushion { background: #f8fafd; }
#course-calendar .fc-list-event-title a { color: #3c4043; }
#calendar-event { width: min(480px, calc(100% - 48px)); padding: 1.5rem; border: 1px solid #dadce0; border-radius: 10px; color: var(--ink); }
#calendar-event::backdrop { background: rgba(32, 33, 36, .3); }
#calendar-event h3 { font-size: 1.25rem; margin: 0 0 1rem; }
@media (max-width: 700px) {
  .calendar-surface { padding: .75rem; }
  #course-calendar .fc-header-toolbar { flex-wrap: wrap; }
  #course-calendar .fc-toolbar-chunk:nth-child(2) { order: -1; width: 100%; }
  #course-calendar .fc-button { padding: .45rem .5rem; }
}

@media (min-width: 1200px) { h1 { font-size: 2.5rem; } }

@media (max-width: 991.98px) {
  .navbar-brand { margin-right: 0; }
  .navbar-toggler { display: inline-block; }
  .navbar-collapse { display: none; flex-basis: 100%; }
  .navbar-collapse.show { display: flex; }
  .navbar-nav { flex-direction: column; gap: 0; width: 100%; margin: .75rem 0 .5rem; }
  .nav-link { padding: .625rem 0; }
  .logout-form button { width: 100%; padding-inline: 0; text-align: left; }
  .dropdown-menu { position: static; margin-top: 0; }
  .dropdown-item { padding: .5rem 1rem; }
}
@media (max-width: 540px) {
  .navbar { padding-inline: 1.5rem; }
  .page { padding: 1.25rem 1.5rem 2rem; font-size: 1.0625em; }
  h1 { margin-bottom: 1.5rem; }
  section { margin-top: 2rem; }
}
@media (max-width: 760px) {
  .introduction { grid-template-columns: 1fr; gap: 1.5rem; }
  .mascot { width: 160px; margin: 0; }
  .schedule:not(.schedule-compact) thead { display: none; }
  .schedule:not(.schedule-compact) tr { display: block; padding: .75rem 0; }
  .schedule:not(.schedule-compact) tr:first-child { padding-top: 0; }
  .schedule:not(.schedule-compact) th, .schedule:not(.schedule-compact) td { display: block; padding: .125rem 0; }
  .schedule-compact th, .schedule-compact td { padding: .625rem 1rem .625rem 0; }
  .schedule-compact th[scope="row"] { white-space: nowrap; }
}
@media (max-width: 400px) {
  .schedule-compact { font-size: .9375rem; }
  .schedule-compact th, .schedule-compact td { padding-right: .75rem; }
}

@media print {
  .navbar, .skip-link { display: none; }
  .page { padding: 0; font-size: 12pt; }
  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
  a { color: inherit; }
  section { break-inside: avoid; }
}
