/* ---------------------------------------------------------------------------
   CSCI 0111E — Bootstrap 5.3 overrides only.

   Deliberately small. This gets re-skinned every semester, so the budget is a
   flat palette and a real typeface, not a design system.

   Fall 2026 skin: the Guide Sign kit. Colors are MUTCD sign colors, where the
   code already carries meaning — green gets you somewhere, blue feeds you,
   yellow warns, orange is temporary, red says no. Type is the FHWA Series
   descendant (Overpass) for chrome, Public Sans for reading.
   --------------------------------------------------------------------------- */

:root {
  /* Sign colors — unchanged from the kit. Retroreflective sheeting keeps its
     color, so these are the same wherever they appear. */
  --guide-green: #14503f;   /* destinations -> chrome, structure            */
  --interstate:  #16355f;   /* services     -> links                        */
  --recreation:  #4a3122;   /* parks/scenic -> unused so far                */
  --warning:     #efb700;   /* conditions   -> focus rings, advisories      */
  --workzone:    #c0500f;   /* temporary    -> labels, in-progress markers  */
  --regulatory:  #96182a;   /* prohibition  -> hard errors only             */

  --sign-white: #ffffff;
  --sign-black: #141110;
  --concrete:   #dfe3dd;
  --galvanized: #949c9b;

  /* Semantic names the rest of this file uses. */
  --primary:      var(--guide-green);
  --primary-dark: #0d3729;   /* nav band: one step down from the sign face */
  --primary-tint: #e3ede8;

  /* Links take Interstate Blue. 12.3:1 on paper. */
  --link:      var(--interstate);
  --link-tint: #e8ecf3;

  /* The warm accent is Work Zone Orange, darkened from #c0500f so small
     labels clear 4.5:1 on the wash as well as on paper (5.6:1 / 6.4:1). */
  --accent:      #9e430d;
  --accent-tint: #fbede4;

  --ink:       #141a18;
  --ink-soft:  #414a47;
  --ink-faint: #616b68;   /* 5.5:1 on paper, 4.8:1 on wash */
  --paper:     var(--sign-white);
  --wash:      #eff1ec;
  --line:      #b9bfb7;

  --font-body: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-head: "Overpass", Arial, Helvetica, sans-serif;
  --font-mono: "Overpass Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* --- Base ---------------------------------------------------------------- */

body {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
  padding: 2.5rem 0 4rem;
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  color: var(--ink);
  letter-spacing: -0.005em;
}

code, pre, .table .col-date, .table .col-num {
  font-family: var(--font-mono);
}

code {
  font-size: 0.9em;
  color: var(--link);
  background: var(--link-tint);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

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

a:hover { color: var(--guide-green); }

.muted { color: var(--ink-faint); }

/* --- Focus and bypass ------------------------------------------------------
   The nav repeats eight links on every page, so there has to be a way past it
   (WCAG 2.4.1). The link sits off-screen until it takes focus. */

.skip-link {
  position: absolute;
  top: 0;
  left: -9999px;
  z-index: 100;
  padding: 0.7rem 1.15rem;
  background: var(--paper);
  color: var(--guide-green);
  border: 2px solid var(--guide-green);
  border-radius: 0 0 4px 0;
  font-weight: 500;
}

.skip-link:focus { left: 0; }

/* Focus is Warning Yellow everywhere — it is the "conditions ahead" color, and
   it is the one hue that holds up on both the paper ground and the green
   chrome, so the nav and footer no longer need a variant of their own. The
   dark halo is what carries it on white, where yellow alone is faint. */
:focus-visible {
  outline: 3px solid var(--warning);
  outline-offset: 2px;
  box-shadow: 0 0 0 6px rgba(20, 17, 16, 0.22);
}

/* main only takes focus because the skip link sends it there; a ring around
   the whole page would be noise. */
main[tabindex]:focus { outline: none; }

/* The nav is sticky, so anything reached by anchor would otherwise land
   underneath it. */
[id] { scroll-margin-top: 4.5rem; }

.tba {
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 0.85em;
  letter-spacing: 0.04em;
}

/* Bootstrap's reboot leaves list items flush against each other. Fine for the
   short link lists; too tight for bullets that each run several lines, where
   the gap between items has to beat the line spacing inside one. Opt in with
   ◊spaced-ul / ◊spaced-ol. */
main ul.spaced > li + li,
main ol.spaced > li + li { margin-top: 1.1rem; }

/* ◊checklist{...}: bullets replaced by an empty box. Drawn, not an <input>,
   because nothing here persists a tick across a page load. */
main ul.checklist { list-style: none; padding-left: 1.6rem; }
main ul.checklist > li { position: relative; }
main ul.checklist > li::before {
  content: "\2610";
  position: absolute;
  left: -1.6rem;
  color: var(--ink-soft);
  font-size: 1.1em;
  line-height: 1.35;
}

/* --- Table of contents --------------------------------------------------- */

.toc {
  margin: 0 0 2.5rem;
  padding: 1rem 1.25rem;
  background: var(--wash);
  border-left: 3px solid var(--primary);
}

.toc-title {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 0.55rem;
}

/* Two columns so eighteen sections read as a block you can scan, not a
   screenful you have to scroll past to reach the document. */
.toc-list {
  columns: 2;
  column-gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.95rem;
}

.toc-list li {
  break-inside: avoid;
  margin-bottom: 0.28rem;
}

@media (max-width: 640px) {
  .toc-list { columns: 1; }
}

/* --- Page grid -----------------------------------------------------------
   Three columns. Content sits in the middle; anything tagged ◊wide spans all
   three. Replaces the old .wide-content viewport arithmetic. */

.page-grid {
  display: grid;
  grid-template-columns:
    1fr
    min(70ch, calc(100% - 2rem))
    1fr;
}

.page-grid > * { grid-column: 2; }

.page-grid > .wide {
  grid-column: 1 / -1;
  width: min(calc(100% - 2rem), 1180px);
  margin-inline: auto;
}

/* --- Header, hero, nav ---------------------------------------------------- */

/* The one primitive the kit is built on: a green sign face with a white
   keyline set in from the edge, and two bolt dots at the top corners. The
   keyline is a pseudo-element rather than a border so it sits inside the
   panel instead of on its edge, which is what makes it read as a sign. */
.hero {
  position: relative;
  background: var(--primary);
  color: #fff;
  padding: 2.9rem 1.75rem 2.6rem;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0.6rem;
  border: 4px solid var(--sign-white);
  border-radius: 5px;
  pointer-events: none;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0.6rem;
  background:
    radial-gradient(circle at left 1.6rem top 1.6rem,
                    rgba(255, 255, 255, 0.5) 4px, transparent 4.5px),
    radial-gradient(circle at right 1.6rem top 1.6rem,
                    rgba(255, 255, 255, 0.5) 4px, transparent 4.5px);
  pointer-events: none;
}

.hero-inner {
  max-width: 70ch;
  margin-inline: auto;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
  margin-bottom: 0.4rem;
}

/* An exit-tab plate on the identity line — the same inversion the current nav
   item takes. It rides the eyebrow rather than the title because on a handout
   the title is the assignment's name, and a beta stamp over that would read as
   "this handout is provisional". */
.beta-plate {
  display: inline-block;
  background: var(--sign-white);
  color: var(--guide-green);
  padding: 0.05em 0.45em;
  border-radius: 2px;
  font-weight: 600;
  white-space: nowrap;
}

/* Sign legend: Overpass at its heaviest, in caps. Guide signs are set this
   way because it is what stays legible at distance; here it is what makes the
   header read as a panel rather than a page title on a colored band. */
.hero-title {
  color: #fff;
  font-size: clamp(1.9rem, 4vw, 2.85rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.015em;
  line-height: 1.02;
  margin: 0;
}

.site-nav {
  background: var(--primary-dark);
  position: sticky;
  top: 0;
  z-index: 10;
}

.nav-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.15rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-link {
  display: block;
  padding: 0.7rem 1.05rem;
  color: rgba(255, 255, 255, 0.82);
  font-family: var(--font-head);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  border-radius: 2px;
}

.nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

/* The current page inverts to a white plate, the way an exit tab reads
   against the panel it sits on, rather than taking an underline. */
.nav-link.current,
.nav-link.current:hover {
  background: var(--sign-white);
  color: var(--guide-green);
}

/* --- Sections ------------------------------------------------------------- */

.section-title {
  font-size: 1.6rem;
  font-weight: 600;
  margin: 2.75rem 0 1rem;
  padding-bottom: 0.35rem;
  /* A lane marking, flattened: the divider on the kit's own sections. */
  border-bottom: 2px dashed var(--line);
}

/* The 2.75rem above is separation *between* sections. On a page that opens
   with a section title it stacks on main's own top padding and reads as a
   gap. */
.page-grid > .section-title:first-child { margin-top: 0; }

/* ◊number-sections[] puts the number inside the heading. Inline, unlike the
   block "Part 3" label on a handout: a syllabus heading reads as one line,
   "9.2 Blocklists". Monospace so the digits line up down the page. */
.heading-number {
  font-family: var(--font-mono);
  font-size: 0.85em;
  font-weight: 500;
  color: var(--ink-soft);
  margin-right: 0.45em;
}

.subsection-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 1.75rem 0 0.6rem;
}

.highlight-box {
  background: var(--primary-tint);
  border-left: 3px solid var(--primary);
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
}

.highlight-box > :last-child { margin-bottom: 0; }

/* "Conditions ahead." Yellow is too light to carry text, so it is the rule
   only; the fill is a wash of it. */
.warning-box {
  background: #fdf4d9;
  border-left-color: var(--warning);
}

.subsubsection-title {
  font-size: 1.02rem;
  font-weight: 600;
  margin: 1.4rem 0 0.4rem;
  color: var(--primary-dark);
}

/* --- Tables --------------------------------------------------------------- */

.table {
  --bs-table-bg: transparent;
  font-size: 0.95rem;
}

.table thead th {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  border-bottom: 2px solid var(--line);
  white-space: nowrap;
}

.table td, .table th { padding: 0.55rem 0.7rem; vertical-align: top; }

/* Bootstrap greys captions down to near-invisible. A caption is the table's
   name, so it should read like one. */
.table caption {
  caption-side: top;
  padding: 0 0 0.4rem;
  color: var(--ink-soft);
  font-size: 0.88rem;
  font-weight: 600;
  text-align: left;
}

.schedule-table tbody tr:nth-child(even) { background: var(--wash); }

.schedule-table .col-num,
.schedule-table .col-date {
  white-space: nowrap;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

/* An in-class exam day. The topic cell holds the exam's own name — "Quiz",
   "Midterm" — so the row is tinted rather than labelled twice, and the
   nth-child stripe is overridden so the tint reads on every other row too. */
.schedule-table tbody tr.exam-row,
.schedule-table tbody tr.exam-row:nth-child(even) {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.schedule-table tbody tr.exam-row td:nth-child(3) { font-weight: 600; }

/* --- Calendar ------------------------------------------------------------- */

/* The Google Calendar frame. Height lives here rather than on the element so
   the frame reflows with the page instead of forcing a sideways scroll on a
   narrow screen. */
.calendar-embed {
  width: 100%;
  height: min(78vh, 640px);
  border: 1px solid var(--line);
  margin: 1.25rem 0 0.5rem;
}

.calendar-embed iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.calendar-embed-link {
  font-size: 0.93rem;
  margin-bottom: 2rem;
}

/* --- Staff ---------------------------------------------------------------- */

.staff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 1.75rem 1.5rem;
  margin-bottom: 1.5rem;
}

/* Photo on top, name and bio underneath. No box around the card: with a photo
   this size the image is the frame, and a border fighting the photo's own
   corners just adds noise. */
.staff-card {
  display: flex;
  flex-direction: column;
}

/* Square, cropped with object-fit, so photos of any dimension and aspect ratio
   can go into staff/ unprocessed. */
.staff-photo {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 6px;
  background: var(--primary-tint);
}

/* Placeholder graphics (the "photo coming" SVG) are drawings, not portraits,
   and are not square: `cover` would crop them to a center band. Fit the whole
   thing inside the square instead, inset so it doesn't touch the edges. */
.staff-photo[src$=".svg"] {
  object-fit: contain;
  padding: 14%;
}

.staff-photo-blank {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 2.25rem;
  color: var(--primary);
}

/* The "we'll be hiring" tile, in the photo slot of the last card. Dashed and
   unfilled so it reads as a vacancy in the grid rather than as a person whose
   picture failed to load. */
.staff-photo-open {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 2px dashed var(--line);
  color: var(--galvanized);
  font-family: var(--font-head);
  font-size: 2.5rem;
  font-weight: 600;
  line-height: 1;
}

.staff-body { padding-top: 0.65rem; }

.staff-name {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 0.2rem;
}

/* The person's own title, between the name and the bio. Set in the sign
   alphabet at small caps-ish tracking so it reads as a label on the card
   rather than as a first line of the bio. */
.staff-title {
  font-family: var(--font-head);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--guide-green);
  margin: 0 0 0.3rem;
}

.staff-bio {
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--ink-soft);
  margin: 0;
}

/* --- Q&A ------------------------------------------------------------------ */

.qa-item { margin-bottom: 1.75rem; }

.qa-question {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
}

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

/* The page closes on the same green it opened with, and on the same
   primitive — panel, keyline, bolts. */
.site-footer {
  position: relative;
  background: var(--primary);
  color: rgba(255, 255, 255, 0.86);
  padding: 2.25rem 1.75rem 2.1rem;
  margin-top: auto;
  text-align: center;
  font-size: 0.9rem;
}

.site-footer::after {
  content: "";
  position: absolute;
  inset: 0.6rem;
  border: 4px solid var(--sign-white);
  border-radius: 5px;
  pointer-events: none;
}

/* Reviews sit on the green as white plates — the same inversion the current
   nav item uses. Left-aligned inside the card even though the footer around
   them is centered: a block of running prose centered on several lines is
   hard to read. Only the home and staff pages emit this block — see
   review-pages in pollen.rkt.

   The strip scrolls sideways rather than wrapping, so adding a review makes
   the row longer instead of making the footer taller. Fixed-width columns
   with snap points: cards are equal width whatever the text length, and a
   flick lands on a card edge rather than mid-sentence. */
.footer-reviews {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(15rem, 19rem);
  align-items: stretch;
  gap: 1rem;
  max-width: 62rem;
  margin: 0 auto;
  padding-bottom: 0.6rem;
  text-align: left;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
}

.review {
  background: var(--paper);
  color: var(--ink);
  border-radius: 4px;
  padding: 0.9rem 1.1rem 1rem;
  scroll-snap-align: start;
  /* Pushes the byline to the bottom so it lines up across cards of very
     different lengths. */
  display: flex;
  flex-direction: column;
}

.review-stars {
  color: var(--warning);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  line-height: 1;
  margin-bottom: 0.5rem !important;
}

.review-body {
  flex: 1;   /* pushes the byline to the bottom of every card */
  font-size: 0.9rem;
  line-height: 1.5;
}

.review-byline {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-top: 0.6rem !important;
}

@media (max-width: 720px) {
  /* Narrow enough that a card should not need its own sideways scroll. */
  .footer-reviews { grid-auto-columns: minmax(0, 82vw); }
}


/* --- Small screens -------------------------------------------------------- */

@media (max-width: 640px) {
  /* Keeps the eyebrow clear of the bolt dots, which do not move in. */
  .hero { padding: 2.9rem 1.25rem 1.9rem; }
  .nav-link { padding: 0.6rem 0.75rem; font-size: 0.88rem; }
  .site-footer { padding: 1.9rem 1.25rem 1.75rem; }
}

/* --- Handouts ------------------------------------------------------------- */
/* Assignment and lab pages. Everything here is generated by the handout tags
   in pollen.rkt, so the class names below are not hand-written in any .pm. */

.handout-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem 2.5rem;
  margin: 0 0 2rem;
  padding: 0.9rem 1.15rem;
  background: var(--wash);
  border-left: 3px solid var(--primary);
}

.meta-item { display: flex; flex-direction: column; }

.meta-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.meta-value { font-weight: 500; }

/* Part headings keep the section rule, and carry their number above the title
   rather than inline, so long titles do not wrap around it. */
.part-number {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.15rem;
}

.task {
  margin: 1.9rem 0;
  padding-left: 1.05rem;
  border-left: 3px solid var(--line);
}

.task > :last-child { margin-bottom: 0; }

.task:target { border-left-color: var(--accent); }

.task-label {
  margin: 0 0 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.task-label a { text-decoration: none; }
.task-label a:hover { text-decoration: underline; }

/* A cross-reference should never be the thing that breaks across lines. */
a.xref { white-space: nowrap; }

.aside-line {
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.aside-tag { font-weight: 600; }

.aside {
  margin: 0.9rem 0;
  padding: 0.55rem 0.9rem;
  background: var(--wash);
  border: 1px solid var(--line);
  font-size: 0.97rem;
}

.aside > summary {
  cursor: pointer;
  font-weight: 500;
  color: var(--primary-dark);
}

.aside[open] > summary { margin-bottom: 0.6rem; }

.codeblock {
  background: var(--wash);
  border: 1px solid var(--line);
  padding: 0.75rem 0.95rem;
  overflow-x: auto;
  font-size: 0.88rem;
  line-height: 1.5;
  margin: 0.9rem 0;
}

/* The inline-code chip styling would be wrong inside a block. */
.codeblock code {
  color: inherit;
  background: none;
  padding: 0;
  font-size: inherit;
}

.callout-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.figure { margin: 1.4rem 0; }
.figure img { max-width: 100%; height: auto; }

.figure-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-start;
  margin: 1.4rem 0;
}

.figure-row .figure { flex: 1 1 0; min-width: 8rem; margin: 0; }
.figure-row .figure img { width: 100%; }

.figure figcaption {
  font-size: 0.88rem;
  color: var(--ink-soft);
  margin-top: 0.4rem;
}

.theme-song {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: 0.93rem;
}

.theme-song-label { color: var(--ink-soft); }

/* --- Notes to ourselves --------------------------------------------------- */
/* ◊todo boxes. Violet, because every student-facing annotation is teal, warm,
   or grey, and dashed, because a to-do is scaffolding rather than content.
   Dev-only: ◊todo emits nothing under SITE_MODE=prod, so these rules never
   apply to a published page. */

.todo-box {
  background: #f4ecfb;
  border: 2px dashed #7a4fa8;
  border-radius: 3px;
  padding: 0.75rem 1rem;
  margin: 1.25rem 0;
}

.todo-box > :last-child { margin-bottom: 0; }

/* The banner root puts at the top of a page that still has open to-dos.
   Solid rather than dashed, and tighter than a note, because it is a count
   rather than a note: it says how many and where, and the notes themselves
   say what. */

.todo-banner {
  border-style: solid;
  margin-top: 0;
  padding: 0.6rem 1rem;
}

.todo-banner p:last-child {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.todo-banner a { color: #5b2d8e; }

.todo-label {
  margin: 0 0 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #5b2d8e;
}

/* --- Labs ----------------------------------------------------------------- */
/* A lab page is a sequence of checkpoints with work between them, so the
   checkpoints outweigh everything else on it. */

.checkpoint {
  border-left-width: 5px;
  margin: 2rem 0;
}

.checkpoint-label {
  margin: 0 0 0.3rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

/* Step numbers sit above their heading like part numbers, but quieter: a step
   is a stage of one part, not a division of the page. */
.step-number {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.1rem;
}

.step-title { margin-top: 2.1rem; }

/* Optional work should read as an offer, not as a task a pair is behind on. */
.optional-task { border-left-style: dashed; }
.optional-task .task-label { color: var(--ink-faint); }
