/* The Curious Case of the Inverted M’s — academic reading styles */

:root {
  --bg: #f4efe6;
  --bg-elevated: #faf6ef;
  --ink: #2a2622;
  --ink-muted: #5c534a;
  --accent: #3d342c;
  --rule: #c9bead;
  --link: #4a3f35;
  --link-hover: #1a1510;
  --footnote-bg: #efe9de;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua",
    "Liberation Serif", Georgia, serif;
  --sans: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
  --measure: 65ch;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 112.5%; /* 18px */
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--serif);
  line-height: 1.65;
  font-weight: 400;
}

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

a:hover,
a:focus-visible {
  color: var(--link-hover);
}

.site-header {
  border-bottom: 1px solid var(--rule);
  background: var(--bg-elevated);
  padding: 1.25rem 1.5rem;
}

.site-header-inner {
  max-width: var(--measure);
  margin: 0 auto;
}

.site-header p {
  margin: 0.25rem 0;
  font-family: var(--sans);
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--ink-muted);
}

.site-header .credit-title {
  color: var(--ink);
  font-weight: 600;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--bg);
  padding: 0.5rem 1rem;
  z-index: 10;
  font-family: var(--sans);
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

main {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

.article-meta {
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--ink-muted);
  margin: 0 0 1.75rem;
}

.article-meta time {
  font-variant-numeric: lining-nums;
}

h1 {
  font-size: 2rem;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 0.5rem;
  color: var(--accent);
}

.byline {
  font-size: 1.05rem;
  margin: 0 0 1.75rem;
  color: var(--ink-muted);
}

.epigraph {
  margin: 0 0 2.25rem;
  padding: 0 0 0 1.25rem;
  border-left: 2px solid var(--rule);
  font-style: italic;
  color: var(--ink-muted);
}

.epigraph cite {
  display: block;
  margin-top: 0.5rem;
  font-style: normal;
  font-size: 0.9rem;
  font-family: var(--sans);
  color: var(--ink-muted);
}

h2 {
  font-size: 1.25rem;
  line-height: 1.3;
  font-weight: 700;
  margin: 2.5rem 0 1rem;
  color: var(--accent);
}

p {
  margin: 0 0 1.1rem;
  hyphens: auto;
}

ul {
  margin: 0 0 1.25rem;
  padding-left: 1.35rem;
}

li {
  margin-bottom: 0.55rem;
}

li:last-child {
  margin-bottom: 0;
}


.article-figure {
  margin: 1.75rem 0;
  padding: 0;
}

.article-figure--hero {
  margin: 0 0 2rem;
}

.article-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--rule);
  background: #fff;
}

.article-figure figcaption {
  margin-top: 0.55rem;
  font-family: var(--sans);
  font-size: 0.88rem;
  color: var(--ink-muted);
  line-height: 1.45;
}

.photo-gallery {
  margin: 1.75rem 0 2rem;
  display: grid;
  gap: 1.25rem;
}

.photo-gallery .article-figure {
  margin: 0;
}

.photo-credit {
  margin: 0.25rem 0 0;
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--ink-muted);
  line-height: 1.4;
}

.footnote-ref {
  font-family: var(--sans);
  font-size: 0.75em;
  font-weight: 600;
  vertical-align: super;
  line-height: 0;
  margin-left: 0.05em;
  text-decoration: none;
}

.footnote-ref:hover {
  text-decoration: underline;
}

.pub-note {
  margin-top: 2rem;
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--ink-muted);
}

hr.section-rule {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 2.75rem 0;
}

.references ul {
  list-style: none;
  padding-left: 0;
}

.references li {
  padding-left: 1.25rem;
  text-indent: -1.25rem;
  margin-bottom: 0.75rem;
}

.notes {
  margin-top: 0.5rem;
}

.notes ol {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: note;
}

.notes li {
  position: relative;
  margin-bottom: 1rem;
  padding-left: 2rem;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--ink);
}

.notes li::before {
  counter-increment: note;
  content: "[" counter(note) "]";
  position: absolute;
  left: 0;
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-muted);
}

.notes li:target {
  background: var(--footnote-bg);
  outline: 1px solid var(--rule);
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
  border-radius: 2px;
}

.backref {
  font-family: var(--sans);
  font-size: 0.8rem;
  margin-left: 0.35rem;
  text-decoration: none;
}

.site-footer {
  border-top: 1px solid var(--rule);
  padding: 1.5rem;
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--ink-muted);
  text-align: center;
}

.site-footer p {
  margin: 0.25rem 0;
  max-width: var(--measure);
  margin-left: auto;
  margin-right: auto;
  hyphens: none;
}

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

  html {
    font-size: 118.75%; /* ~19px */
  }
}

@media print {
  :root {
    --bg: #fff;
    --bg-elevated: #fff;
    --ink: #000;
    --ink-muted: #333;
    --rule: #999;
    --footnote-bg: #f5f5f5;
  }

  html {
    font-size: 11pt;
  }

  body {
    background: #fff;
    color: #000;
  }

  .site-header,
  .site-footer,
  .skip-link {
    border: none;
  }

  .site-header {
    padding: 0 0 1rem;
  }

  main {
    max-width: none;
    padding: 0;
  }

  a {
    color: inherit;
    text-decoration: none;
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    font-family: var(--sans);
    color: #444;
  }

  .footnote-ref::after,
  .backref::after,
  a.footnote-ref[href^="http"]::after,
  .site-header a[href^="http"]::after {
    content: none;
  }

  h2 {
    page-break-after: avoid;
  }

  .notes li,
  .references li {
    page-break-inside: avoid;
  }

  .caption {
    border-color: #ccc;
  }
}
