/* Thayer Morrill — site styles. One file for every page. */

:root {
  --paper: #ffffff;
  --ink: #1c2230;
  --muted: #5d6675;
  --rule: #e3e5e9;
  --red: #b5121b;
  --red-soft: #fbeeee;
  --band: #1c2230;
  --band-accent: #b5121b;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #15181e;
    --ink: #e8eaef;
    --muted: #a4acb9;
    --rule: #2b3039;
    --red: #ff7a7a;
    --red-soft: #2a1b1d;
    --band: #0c0f14;
    --band-accent: #d1343c;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.6;
  font-optical-sizing: auto;
}

.wrap {
  max-width: 46rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

a { color: inherit; text-decoration-color: var(--red); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--red); }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; border-radius: 2px; }

/* Masthead: the same band on every page */
.masthead {
  background: var(--band);
  color: #ffffff;
  border-bottom: 4px solid var(--band-accent);
}
.masthead-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem 2rem;
  padding-top: 1.6rem;
  padding-bottom: 1.4rem;
}
.site-name {
  color: #ffffff;
  font-size: 2.1rem;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.site-name:hover { color: #ffffff; }
.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
}
.site-nav a {
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
  padding: 0.2rem 0;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: #ffffff; border-bottom-color: var(--band-accent); }
.site-nav a[aria-current="page"] { color: #ffffff; border-bottom-color: var(--band-accent); }
.masthead :focus-visible { outline-color: #ffffff; }

h1 {
  font-size: 2.2rem;
  font-weight: 500;
  line-height: 1.2;
  margin: 2.75rem 0 1.25rem;
}

/* Intro: one large centered portrait photo, then the text, centered */
.intro {
  text-align: center;
  margin: 2.5rem 0 1rem;
}
.intro img {
  display: block;
  /* As wide as the column allows, but never so tall that the text drops off a laptop screen */
  width: min(100%, 30rem, 52.5vh);
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  margin: 0 auto 1.75rem;
  border-radius: 3px;
}
.intro > div { max-width: 34rem; margin: 0 auto; }
.intro p { margin: 0 0 0.75rem; }
.intro .role { font-size: 1.2rem; line-height: 1.4; }
.contact { font-family: var(--sans); font-size: 0.95rem; color: var(--muted); }
.contact a, .contact span { margin: 0 0.6rem; display: inline-block; }

/* The sign photo, tucked beside the heading on the paper pages */
.sign {
  float: right;
  width: 11rem;
  margin: 0.5rem 0 1rem 1.75rem;
}
.sign img { display: block; width: 100%; height: auto; border-radius: 3px; }

/* Sections */
h2 {
  font-size: 1.65rem;
  font-weight: 500;
  line-height: 1.25;
  margin: 3.5rem 0 1rem;
}
.lede { margin: 0 0 2.25rem; }

/* Working papers */
.papers { list-style: none; padding: 0; margin: 0; }
.papers li { margin: 0 0 1.4rem; }
.title { font-weight: 600; line-height: 1.35; }
.title a { text-decoration-color: var(--rule); }
.title a:hover { text-decoration-color: var(--red); }
.meta {
  font-family: var(--sans);
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--muted);
  margin: 0.15rem 0 0;
}

/* The ranked list */
.ranked { list-style: none; padding: 0; margin: 0; counter-reset: rank; }
.ranked > li {
  counter-increment: rank;
  position: relative;
  padding-left: 4.25rem;
  margin: 0 0 2.25rem;
}
.ranked > li::before {
  content: counter(rank);
  position: absolute;
  left: 0;
  top: -0.3rem;
  width: 3.1rem;
  text-align: right;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 2.6rem;
  line-height: 1;
  font-variant-numeric: lining-nums;
  color: var(--red);
}
.ranked > li:first-child::before { font-size: 3.6rem; top: -0.55rem; }
.ranked h3 { font-size: 1.15rem; font-weight: 600; line-height: 1.35; margin: 0; }
.ranked h3 a { text-decoration-color: var(--rule); }
.ranked h3 a:hover { text-decoration-color: var(--red); }
.ranked .note { margin: 0.5rem 0 0; }

.plate { margin: 1rem auto 0; max-width: 20rem; }
.plate img { display: block; width: 100%; height: auto; border-radius: 4px; }

cite { font-style: italic; }
.status { color: var(--red); font-weight: 600; }

/* Draft-only notes. Delete these blocks before launch. */
.draft {
  border: 1px dashed var(--red);
  background: var(--red-soft);
  padding: 1rem 1.25rem;
  margin: 2rem 0;
  font-family: var(--sans);
  font-size: 0.95rem;
}
.draft h2 { margin-top: 0; font-family: var(--serif); }
.draft .papers li { margin-bottom: 1rem; }
.draft .title { font-family: var(--serif); font-size: 1.05rem; }

/* Personal section */
.personal figure { margin: 0 0 1.25rem; }
.personal img { display: block; width: 100%; height: auto; border-radius: 2px; }
.personal figcaption {
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 0.5rem;
}
/* A portrait and a landscape photo side by side, at equal heights */
.photo-row {
  display: grid;
  grid-template-columns: 9fr 16fr;
  gap: 1rem;
  align-items: start;
  margin: 0 0 1.25rem;
}
.photo-row figure { margin: 0; }
.draft-text { color: var(--red); font-style: italic; }

/* Teaching page */
.files { padding-left: 1.25rem; }
.files li { margin: 0 0 0.4rem; }

/* Footer */
.site-footer {
  margin-top: 4rem;
  padding: 1.5rem 0 3rem;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--muted);
}

@media (max-width: 560px) {
  body { font-size: 1.0625rem; }
  .intro { margin-top: 1.75rem; }
  .sign { width: 7.5rem; margin: 0.35rem 0 0.75rem 1rem; }
  .photo-row { grid-template-columns: 1fr; gap: 1.25rem; }
  .photo-row figure:first-child img { max-width: 18rem; }
  .ranked > li { padding-left: 2.9rem; }
  .ranked > li::before { width: 2.2rem; font-size: 2rem; top: -0.15rem; }
  .ranked > li:first-child::before { font-size: 2.6rem; top: -0.35rem; }
  .site-name { font-size: 1.75rem; }
  .site-nav { gap: 0.25rem 1.1rem; font-size: 0.95rem; }
  h1 { font-size: 1.8rem; margin-top: 2rem; }
}
