/* ================================================================
   connerschultz.com — shared stylesheet
   Linked by index.html and every course reading-schedule page.

   Quick edits:
     • Colours (light)   →  :root
     • Colours (dark)    →  @media (prefers-color-scheme: dark)
     • Page width        →  --measure  (try 38rem / 40rem / 42rem)

   Schedule pages carry class="schedule" on <body>; that only
   tightens a few spacing values, nothing else.
   ================================================================ */

:root {
  --ink:        #1a1714;
  --ink-soft:   #4a443d;
  --ink-faint:  #8a8278;
  --paper:      #fbf7ef;
  --rule:       #d9d1c1;
  --accent:     #7a2a1a;   /* oxblood, used sparingly on link hover */
  --selection:  #efe3c8;   /* text-highlight background */
  --measure:    40rem;     /* reading measure — widen if long titles wrap */
  --serif: "Palatino", "Palatino Linotype", "Book Antiqua",
           "URW Palladio L", "Century Schoolbook",
           "Adobe Garamond Pro", "EB Garamond", Georgia, serif;

  /* let the browser style scrollbars and form controls to match */
  color-scheme: light dark;
}

/* — Dark mode ————————————————————————————————
   Applies only when the visitor's OS/browser is set to dark.
   Same variables, different values: no other rule changes. */

@media (prefers-color-scheme: dark) {
  :root {
    --ink:        #ece5d8;   /* warm off-white body text */
    --ink-soft:   #b5ada0;
    --ink-faint:  #948b80;
    --paper:      #17140f;   /* warm near-black background */
    --rule:       #35302a;
    --accent:     #c87a5f;   /* oxblood, lightened to read on dark */
    --selection:  #3a3128;
  }
}

* { box-sizing: border-box; }

html { font-size: 18px; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-feature-settings: "kern", "liga", "onum";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.55;
}

main {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 6rem 1.75rem 8rem;
}

/* schedule pages open with a back-link, so they need less headroom */
body.schedule main { padding-top: 3rem; }

/* — Back link (schedule pages) ———————————— */

.back {
  display: inline-block;
  margin-bottom: 3rem;
  font-size: 0.88rem;
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 120ms ease, border-color 120ms ease;
}
.back:hover,
.back:focus-visible {
  color: var(--accent);
  border-bottom-color: var(--accent);
  outline: none;
}

/* — Header ————————————————————————————————— */

header {
  margin-bottom: 4.5rem;
  text-align: center;
}
body.schedule header { margin-bottom: 3.5rem; }

h1 {
  font-size: 1.9rem;
  font-weight: 400;
  letter-spacing: 0.005em;
  margin: 0 0 0.35rem;
  line-height: 1.2;
}

header .title,
header .subtitle {
  margin: 0;
  color: var(--ink-soft);
  font-style: italic;
  font-size: 1.02rem;
}

header .contact {
  margin: 0.7rem 0 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

header .note {
  margin: 1.1rem 0 0;
  color: var(--ink-faint);
  font-size: 0.88rem;
}

/* nav = structural signposting: uppercase + tracked, echoing the section
   headers it jumps to. This sets it apart from the contact row below. */
header .nav {
  margin: 1.4rem 0 0;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-faint);
}

header .nav a,
header .contact a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 120ms ease, border-color 120ms ease;
}
header .nav a:hover,
header .nav a:focus-visible,
header .contact a:hover,
header .contact a:focus-visible {
  color: var(--accent);
  border-bottom-color: var(--accent);
  outline: none;
}

/* — Section headers ———————————————————————— */

h2 {
  font-size: 0.78rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--ink-faint);
  margin: 0 0 1.75rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--rule);
}

section {
  margin-bottom: 4.5rem;
  scroll-margin-top: 0.5in;   /* breathing room when reached via menu link */
}
section:last-of-type { margin-bottom: 0; }

/* — About —————————————————————————————————— */

.about p {
  margin: 0 0 1.1rem;
  font-size: 1rem;
  line-height: 1.65;
}
.about p:last-child { margin-bottom: 0; }
.about em, .about i { font-style: italic; }

/* — Publications ——————————————————————————— */

.pub { margin: 0 0 2.25rem; }
.pub:last-child { margin-bottom: 0; }

.pub-title {
  font-size: 1.08rem;
  margin: 0 0 0.2rem;
  font-weight: 400;
}

.pub-title a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 120ms ease, color 120ms ease;
}
.pub-title a:hover,
.pub-title a:focus-visible {
  color: var(--accent);
  border-bottom-color: var(--accent);
  outline: none;
}

.pub-meta {
  font-style: italic;
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin: 0 0 0.55rem;
}

.pub-abstract {
  margin: 0;
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1.6;
}

/* status tag for forthcoming / under review etc. */
.tag {
  display: inline-block;
  font-style: normal;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  border: 1px solid var(--rule);
  padding: 0.05rem 0.45rem;
  margin-left: 0.4rem;
  vertical-align: 0.12em;
  border-radius: 2px;
}

/* award / prize kicker — small accent line above a pub title */
.award {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.45rem;
  font-weight: 500;
}

/* — Teaching ——————————————————————————————— */

.teaching-group + .teaching-group { margin-top: 2.5rem; }

.teaching-institution {
  font-size: 0.95rem;
  font-weight: 400;
  font-style: italic;
  color: var(--ink-soft);
  margin: 0 0 0.9rem;
}

.courses {
  list-style: none;
  margin: 0;
  padding: 0;
}

.courses li {
  padding: 0.65rem 0;
  border-bottom: 1px dotted var(--rule);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.courses li:last-child { border-bottom: none; }

.course-name { color: var(--ink); }
.course-meta {
  color: var(--ink-faint);
  font-style: italic;
  font-size: 0.88rem;
}

/* course titles that link to a reading schedule */
.course-name a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  transition: color 120ms ease, border-color 120ms ease;
}
.course-name a:hover,
.course-name a:focus-visible {
  color: var(--accent);
  border-bottom-color: var(--accent);
  outline: none;
}

/* — Reading schedules —————————————————————— */

.unit { margin-bottom: 3.5rem; }
.unit:last-of-type { margin-bottom: 0; }

.unit h2 {
  margin: 0 0 1.5rem;
  text-align: center;
}

/* optional one-line gloss beneath a unit heading */
.unit-note {
  margin: -1rem 0 1.4rem;
  text-align: center;
  font-style: italic;
  font-size: 0.85rem;
  color: var(--ink-faint);
}

.readings {
  list-style: none;
  margin: 0;
  padding: 0;
}

.readings li {
  padding: 0.7rem 0;
  border-bottom: 1px dotted var(--rule);
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}
.readings li:last-child { border-bottom: none; }

.reading-topic {
  color: var(--ink);
  font-size: 1rem;
}

.reading-cite {
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.5;
}

.reading-cite a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  transition: color 120ms ease, border-color 120ms ease;
}
.reading-cite a:hover,
.reading-cite a:focus-visible {
  color: var(--accent);
  border-bottom-color: var(--accent);
  outline: none;
}

.optional {
  display: block;
  color: var(--ink-faint);
  font-size: 0.85rem;
  font-style: italic;
  margin-top: 0.1rem;
}

/* — Footer ————————————————————————————————— */

footer {
  margin-top: 5rem;
  font-size: 0.82rem;
  color: var(--ink-faint);
  text-align: left;
}
body.schedule footer { margin-top: 4.5rem; }

/* — Selection —————————————————————————————— */

::selection { background: var(--selection); color: var(--ink); }

/* — Mobile ————————————————————————————————— */

@media (max-width: 600px) {
  html { font-size: 17px; }

  main { padding: 3.25rem 1.25rem 4.5rem; }
  body.schedule main { padding-top: 2rem; }

  header { margin-bottom: 3rem; }
  body.schedule header { margin-bottom: 2.5rem; }

  h1 { font-size: 1.55rem; }

  section { margin-bottom: 3.25rem; }
  .unit { margin-bottom: 2.75rem; }
  .back { margin-bottom: 2rem; }

  footer { margin-top: 3.5rem; }
  body.schedule footer { margin-top: 3.5rem; }
}
