/* ============================================================
 * COURSE — Philosophy and Psychology of Explanation.
 * Builds on site-tokens.css + editorial.css (the personal site's
 * design system): same paper, ink, vermilion accent, typeface roles
 * and hairline rules. This file only sets the syllabus's own
 * components: the page header, the instructor card, the schedule
 * (parts and session rows), the running-text sections and the
 * colophon.
 * ============================================================ */

:root {
  --course-block: 856px;     /* the main column beside the "On this page" rail */
  --course-measure: 38em;    /* prose: about 70 characters of the body face at 18px */
  --mast-h: 66px;            /* the sticky masthead's height (one row); the layout's script sets the real one */
}

/* Links in running text: colour only, no rule (as on the personal site).
   :where() keeps this at zero specificity so the masthead, rail and crumbs keep their own colours. */
:where(.course main, .course .course-header) a {
  color: var(--accent-deep);
  border-bottom: 0;
}
:where(.course main, .course .course-header) a:hover { text-decoration: underline; text-underline-offset: 3px; }
/* Keyboard focus: the site's vermilion ring (as in the masthead, the page navigation and the personal
   site's cards), clear of the letters; it covers the instructor card's links too */
:where(.course main, .course .course-header) a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Justified running text with hyphenation, as site-wide on the personal site */
.course .lead, .course .prose p, .course .prose li, .course .thread .body li,
.course .reading-note, .course .ed-figure figcaption {
  text-align: justify;
  -webkit-hyphens: auto;
  hyphens: auto;
  hyphenate-limit-chars: 7 3 3;
}

/* ============================================================
 * PAGE HEADER — after the notebook header (.nb-header)
 * ============================================================ */
.course-header { max-width: 1280px; margin: 0 auto; padding: 104px 80px 56px; }
.course-header-inner { max-width: var(--course-block); }
.crumbs { font-family: var(--ui); font-size: 13px; color: var(--muted); margin: 0 0 28px; }
.course .crumbs a { color: var(--ink-soft); border-bottom: 1px solid var(--rule); text-decoration: none; }
.course .crumbs a:hover { color: var(--accent-deep); border-bottom-color: var(--accent-deep); text-decoration: none; }
.course-title {
  font-family: var(--f-h1); font-weight: 400; font-size: 52px; line-height: 1.06;
  letter-spacing: -1.2px; margin: 0 0 18px; color: var(--ink); max-width: 17em; text-wrap: balance;
}
.byline {
  font-family: var(--f-byline); font-size: 14px; color: var(--muted);
  margin: 0 0 32px; letter-spacing: 0.1px;
}
.byline .dot { margin: 0 0.45em; color: var(--muted-light); }
/* the byline wraps only after a dot, never inside "Spring 2026" or "Can Konuk" */
.byline .by { white-space: nowrap; }
.lead {
  font-family: var(--f-lead); font-size: 19px; line-height: 1.65;
  color: var(--ink-soft); margin: 0; max-width: 680px;
}
.lead p { margin: 0 0 12px; }
.lead p:last-child { margin-bottom: 0; }
/* the instructor card closes the header, under the description */
.course-header .instructor-card { margin-top: 40px; }

/* ============================================================
 * SECTIONS
 * ============================================================ */
.course .page { padding-top: 8px; }
.course main > * { max-width: var(--course-block); }
.course-section { margin: 0 0 88px; scroll-margin-top: calc(var(--mast-h) + 30px); }
.course-section:last-of-type { margin-bottom: 0; }
.course-section .section-head { margin-bottom: 28px; }
.course .otp-link { display: flex; align-items: baseline; text-wrap: balance; }
/* the rail's label level with the §1 label (main has no top padding to offset), as on the notebooks */
.course .on-this-page { margin-top: 0; }
.otp-n {
  font-family: var(--ui); font-size: 12.5px; color: var(--muted);
  font-variant-numeric: tabular-nums; display: inline-block; min-width: 2.1em; flex: none;
}
.otp-link.active .otp-n { color: var(--accent); }
/* the parts' roman numerals in the rail's own face: in the sans they read as bars (I, II, III) */
.otp-sublist .otp-n { font-family: var(--f-toc); font-size: 13px; }

/* ============================================================
 * INSTRUCTOR CARD — the personal site's card idiom (outlined panel,
 * paper shadow) with its portrait frame and mono e-mail
 * ============================================================ */
.instructor-card {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  padding: 24px 28px;
  box-shadow: var(--panel-shadow);
  background: transparent;
  max-width: 640px;
}
.instructor-card .portrait-frame { width: 112px; height: 140px; }
.instructor-name {
  font-family: var(--display); font-style: italic; font-weight: 500;
  font-size: 22px; line-height: 1.3; color: var(--ink); margin: 0 0 6px;
}
.course .instructor-name a { color: var(--ink); border-bottom: 1px solid var(--rule); text-decoration: none; }
.course .instructor-name a:hover { color: var(--accent-deep); border-bottom-color: var(--accent-deep); text-decoration: none; }
.instructor-role { font-family: var(--f-refs); font-size: 15.4px; color: var(--muted); margin: 0 0 10px; }
.instructor-detail { font-family: var(--f-refs); font-size: 16.5px; line-height: 1.55; color: var(--ink-soft); margin: 0 0 6px; }
.instructor-detail:last-child { margin-bottom: 0; }
.course .instructor-detail a.mono {
  font-family: var(--mono); font-size: 14.5px; color: var(--ink); letter-spacing: 0.3px; border: 0;
}
.instructor-detail .at { color: var(--muted); }
/* Office hours: the site's emphasis is the accent, set as text, never a raw inline red */
.office-hours { color: var(--accent-deep); }
.office-hours .oh-label {
  font-family: var(--f-figlabel); font-size: 15px; letter-spacing: 0.02em; color: var(--ink);
  margin-right: 0.35em;
}
/* the time and the place each hold together: no "Room 103" or "PM" left alone on a line */
.office-hours .oh-time { white-space: nowrap; }
.office-hours .oh-where { display: inline-block; }

/* ============================================================
 * SCHEDULE — parts as numbered thread heads, sessions as ruled rows
 * ============================================================ */
.part { margin-top: 56px; scroll-margin-top: calc(var(--mast-h) + 30px); }
.section-head + .part { margin-top: 0; }   /* Part I sits under the Schedule head like every section's first block (:first-of-type matched the head, a div too) */
.part-head { margin-bottom: 8px; padding-left: 72px; }   /* gutter wide enough for "III" (the personal site's 56px fits I and II) */
.part-head .numeral { font-style: normal; }
.part-head .rule-and-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 20px; }
.part-head .part-sub {
  font-family: var(--ui); font-size: 13px; color: var(--muted); letter-spacing: 0.2px;
  font-variant-numeric: tabular-nums;
}
/* an unnumbered part keeps the numeral gutter empty, its title in the title column (as in the "On this page" rail) */

.sessions { list-style: none; margin: 0; padding: 0; }
.session {
  display: grid;
  grid-template-columns: 136px minmax(0, 1fr);
  gap: 24px;
  padding: 16px 0 18px;
  border-top: 1px solid var(--rule);
  align-items: baseline;
}
.session:first-child { border-top-color: var(--ink-soft); }
.session:last-child { border-bottom: 1px solid var(--rule); }
.session-meta { font-family: var(--ui); line-height: 1.4; }
.session-no {
  display: block;
  font-size: 11px; font-weight: 600; letter-spacing: 1.4px; text-transform: uppercase;
  color: var(--ink-soft);
}
.session-date {
  display: block; margin-top: 3px;
  font-size: 13.5px; color: var(--muted);
  font-variant-numeric: tabular-nums lining-nums;
}
.session-topic {
  font-family: var(--f-h3); font-weight: 500; font-size: 20px; line-height: 1.3;
  letter-spacing: -0.2px; color: var(--ink); margin: 0; text-wrap: balance;
}
.readings { margin-top: 6px; font-family: var(--f-refs); font-size: 15.4px; line-height: 1.5; color: var(--ink-soft); text-wrap: pretty; }   /* no lone "(2016)." on the last line, as the personal site's research intro */
.reading-primary { margin: 0 0 4px; }
.reading-primary:last-child, .reading-secondary:last-child, .reading-note:last-child { margin-bottom: 0; }
.reading-secondary { margin: 4px 0 4px; color: var(--muted); }
.reading-secondary::before {
  content: "Secondary reading";
  font-family: var(--f-figlabel); font-size: 13px; letter-spacing: 0.02em; color: var(--ink-soft);
  margin-right: 0.5em;
}
/* an instruction inside a reading line (read only, optional addition): the same small-caps label, never shouted caps */
.reading-cue {
  font-family: var(--f-figlabel); font-size: 13px; letter-spacing: 0.02em; color: var(--ink-soft);
  text-transform: lowercase; white-space: nowrap;
}
.reading-note {
  margin: 8px 0 0; padding: 8px 0 0;
  border-top: 1px solid var(--rule-light);
  color: var(--ink-soft);
}
/* a note that opens the readings (Session 17) sits under the topic like any first reading: no rule to separate it from nothing */
.reading-note:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.readings strong { font-weight: 600; color: var(--ink); }
.readings .range { white-space: nowrap; }  /* a range such as §§1.4–1.5 or Ch. 1–2 never breaks at its dash */
.readings em { font-style: italic; }
/* a day without class */
.session--off .session-no { color: var(--muted); }   /* the date keeps --muted too: --muted-light (2.6:1) is too faint for text to be read */
.session--off .session-topic { color: var(--muted); font-weight: 400; font-style: italic; }

/* ============================================================
 * RUNNING TEXT — general information, policies
 * ============================================================ */
.prose h3, .course-section > h3 {
  font-family: var(--f-h3); font-weight: 500; font-size: 23px; line-height: 1.3;
  letter-spacing: -0.2px; margin: 48px 0 14px; color: var(--ink); scroll-margin-top: calc(var(--mast-h) + 30px);
}
.prose > h3:first-child, .section-head + h3, .section-head + .prose > h3:first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol {
  font-family: var(--f-body); font-size: 18px; line-height: 1.65; letter-spacing: var(--body-tracking);
  color: var(--ink); max-width: var(--course-measure); margin: 0 0 18px;
}
.prose p { text-wrap: pretty; }   /* no lone word on the last line (as the personal site's research intro) */
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin-bottom: 6px; }
.prose li::marker { color: var(--muted); }

/* What to expect: two numbered threads, as the research threads on the personal site */
.expect { margin: 0 0 48px; }
.expect .threads { gap: 56px; }
.expect .thread-head { padding-left: 48px; margin-bottom: 18px; }
.expect .thread-head .numeral { font-size: 36px; top: 4px; }
.expect .thread-head h4 {
  font-family: var(--f-h2); font-weight: 400; font-size: 20px; line-height: 1.25;
  letter-spacing: -0.3px; margin: 0; color: var(--ink); text-wrap: balance;
}
.expect .will { font-family: var(--f-lead); font-size: 18px; color: var(--ink-soft); margin: 0 0 10px; }
.expect ul {
  font-family: var(--f-body); font-size: 17px; line-height: 1.6; letter-spacing: var(--body-tracking);
  color: var(--ink); margin: 0; padding-left: 1.3em;
}
.expect li { margin-bottom: 6px; }
.expect li::marker { color: var(--muted); }

/* Grading: three equal thirds, set as a small ruled table; the labels start
   on the thread titles' indent above (30px + 18px gap = 48px) */
.prose .grading { list-style: none; margin: 0 0 18px; padding: 0; max-width: 520px; border-top: 1px solid var(--ink-soft); }
.prose .grading li {
  display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 18px; align-items: baseline;
  padding: 8px 0; margin: 0; border-bottom: 1px solid var(--rule); text-align: left;
  font-family: var(--f-body); font-size: 18px; letter-spacing: var(--body-tracking); color: var(--ink);
}
.grading .frac { font-family: var(--ui); font-size: 15px; color: var(--accent-deep); font-variant-numeric: tabular-nums; }

/* ============================================================
 * PHONE
 * ============================================================ */
@media (max-width: 900px) {
  .course-header { padding: 48px 24px 40px; }
  .course-title { font-size: 38px; letter-spacing: -0.6px; }
  .lead { font-size: 18px; }
  .instructor-card { grid-template-columns: 96px minmax(0, 1fr); gap: 20px; padding: 20px 16px; }
  .instructor-card .portrait-frame { width: 96px; height: 120px; }
  /* stacked, the two threads stay closer to each other than to the next heading (48px) */
  .expect .threads { gap: 36px; }
}
@media (max-width: 640px) {
  .course-title { font-size: 32px; line-height: 1.1; }
  .byline .dot { margin: 0 0.35em; }
  .section-head h2 { font-size: 30px; }
  .thread-head, .expect .thread-head { padding-left: 40px; }
  .part-head { padding-left: 56px; }
  .thread-head .numeral { font-size: 34px; }
  .part-head .numeral { top: 9px; }   /* the smaller numeral back on the part title's baseline */
  .expect .thread-head .numeral { font-size: 30px; top: 6px; }
  .expect .thread-head h4 { font-size: 18px; }
  .thread-head h3 { font-size: 24px; }
  .session { grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 14px 0 16px; }
  .session-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 10px; }
  .session-date { margin-top: 0; }
  .session-topic { font-size: 19px; }
  .prose p, .prose ul, .prose ol { font-size: 17px; }
  .prose .grading li { grid-template-columns: 22px minmax(0, 1fr); }   /* 22 + 18 = the 40px thread indent */
  .prose h3, .course-section > h3 { font-size: 20px; margin-top: 40px; }
  .instructor-card { grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
  .instructor-card .portrait-frame { width: 96px; height: 120px; }
}
@media (max-width: 420px) {
  .instructor-card .instructor-detail a.mono { font-size: 13.5px; overflow-wrap: anywhere; }
}

/* ON THIS PAGE: room for the keyboard focus ring. The rail scrolls (overflow-y: auto), which clips
   whatever is drawn outside its box, so the box reaches out by the ring's 4px (offset + width; 5px on
   the left, where the links sit 1px out) and the padding gives the room back to the links. */
.course .on-this-page { padding: 0 4px 4px 5px; margin-left: -5px; margin-right: -4px; }

/* ============================================================
 * PRINT — a session, the card and every head stay whole on the page
 * ============================================================ */
@media print {
  .section-head, .part-head, .session, .instructor-card, .expect .thread, .prose .grading li, .colophon { break-inside: avoid; }
  .section-head, .part-head, .prose h3, .course-section > h3, .thread-head, .expect .will { break-after: avoid; }
  .colophon { margin-top: 48px; }
  .page { padding-bottom: 0; }
}
