:root {
  --paper: #f7f3ea;
  --ink: #2a251f;
  --muted: #6b6257;
  --rule: #d9cfbd;
  --accent: #8a3b12;
  --accent-ink: #fff;
  --card: #fffdf8;
  --foot-bg: #2f2a23;
  --foot-ink: #f3ece0;
  --foot-muted: #bfb3a2;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1c1915;
    --ink: #ece4d6;
    --muted: #a99d8c;
    --rule: #3a342c;
    --accent: #e0915f;
    --accent-ink: #1c1915;
    --card: #24201b;
    --foot-bg: #12100d;
    --foot-ink: #ece4d6;
    --foot-muted: #a99d8c;
  }
  :root:not([data-theme="light"]) .hero img, :root:not([data-theme="light"]) .feature img { filter: invert(1) sepia(.3); mix-blend-mode: screen; }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.55 Georgia, "Iowan Old Style", "Times New Roman", serif;
}
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

.masthead, main, .footer-inner { max-width: 960px; margin: 0 auto; padding: 0 16px; }
.masthead {
  display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: baseline; justify-content: space-between;
  padding-top: 18px; padding-bottom: 12px; border-bottom: 3px double var(--rule);
}
.brand { font-size: 1.5rem; font-weight: bold; color: var(--ink); text-decoration: none; letter-spacing: .02em; }
.masthead nav { display: flex; gap: 20px; }
.masthead nav a { color: var(--ink); text-decoration: none; font-variant: small-caps; letter-spacing: .05em; }
.masthead nav a:hover { color: var(--accent); }

main { padding-top: 24px; padding-bottom: 48px; }
/* Keep the footer at the bottom of the window on short pages. */
body { min-height: 100vh; display: flex; flex-direction: column; }
.masthead, main, .footer-inner { width: 100%; }
main { flex: 1 0 auto; }
h1 { font-size: 2.4rem; line-height: 1.1; margin: 0 0 .4em; }
h2 { font-size: 1.35rem; margin: 1.6em 0 .5em; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 40em; }
.note { color: var(--muted); }

.hero { display: flex; gap: 32px; align-items: center; margin-bottom: 24px; }
.hero img { width: 260px; max-width: 40%; height: auto; }
.hero p, .hero .lede, .hero .note { color: var(--ink); }
@media (max-width: 640px) {
  .hero { flex-direction: column; align-items: flex-start; gap: 12px; }
  .hero img { width: 180px; max-width: 60%; }
  h1 { font-size: 2rem; }
}

/* Home page: the old site's header photo, full width, title over it. */
.banner {
  position: relative; height: min(58vh, 520px); min-height: 280px;
  background: #3b4a2c center 62% / cover no-repeat;
}
.banner.tracks { background-image: url("tracks.jpg"); }
.banner.main-street {
  height: min(42vh, 380px); min-height: 220px;
  background-color: #5a4630; background-image: url("img/main-street.jpg"); background-position: center 40%;
}
.banner::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0) 45%, rgba(0,0,0,.55) 100%);
}
.banner-text {
  position: absolute; z-index: 1; left: 0; right: 0; bottom: 0;
  max-width: 960px; margin: 0 auto; padding: 0 16px 28px; color: #fff;
}
.banner-text h1 { margin: 0; font-size: clamp(2.2rem, 6vw, 3.4rem); text-shadow: 0 1px 12px rgba(0,0,0,.4); }
.banner-text p {
  margin: 6px 0 0; font-variant: small-caps; letter-spacing: .06em; font-size: 1.1rem;
  text-shadow: 0 1px 8px rgba(0,0,0,.5);
}

.sections > section { margin-bottom: 40px; }
.sections h2 { font-size: 1.6rem; margin: 0 0 .4em; padding-bottom: 6px; border-bottom: 1px solid var(--rule); }
.sections h2 a { color: var(--ink); text-decoration: none; }
.sections h2 a:hover { color: var(--accent); }
.feature { display: flex; gap: 28px; align-items: flex-start; }
.feature > a { flex: none; }
.feature img { width: 220px; height: auto; display: block; }
.feature > div { flex: 1; }
.feature h2 { margin-top: 0; }
@media (max-width: 640px) {
  .feature { flex-direction: column; gap: 12px; }
  .feature img { width: 180px; }
}

#filter {
  width: 100%; max-width: 420px; padding: 10px 12px; font: inherit; font-size: 1rem;
  border: 1px solid var(--rule); border-radius: 4px; background: var(--card); color: var(--ink);
}
nav.years {
  display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 16px 0 8px; padding: 12px 0;
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  font-family: system-ui, sans-serif; font-size: .9rem;
}

.year { scroll-margin-top: 12px; }
.year h2 { border-bottom: 1px solid var(--rule); padding-bottom: 4px; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.year .vol { font-weight: normal; font-style: italic; color: var(--muted); font-size: 1rem; }
.year .name { font-weight: normal; color: var(--muted); font-size: .85rem; font-variant: small-caps; letter-spacing: .05em; margin-left: auto; }

ul.issues { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 2px 24px; }
ul.issues li { padding: 5px 0; border-bottom: 1px dotted var(--rule); }
.num { display: inline-block; min-width: 3.2em; color: var(--muted); font-variant-numeric: tabular-nums; }

ul.docs { list-style: none; padding: 0; }
ul.docs li { padding: 12px 0; border-bottom: 1px solid var(--rule); }
ul.docs a { font-size: 1.15rem; }
.by, .when { color: var(--muted); font-size: .95rem; }

.site-footer { background: var(--foot-bg); color: var(--foot-muted); margin-top: 32px; }
.footer-inner { padding-top: 32px; padding-bottom: 28px; }
.site-footer a { color: var(--foot-ink); }
.f-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 12px 32px; }
.f-top .brand { color: var(--foot-ink); font-size: 1.3rem; }
.f-nav { display: flex; gap: 24px; }
.f-nav a { text-decoration: none; font-variant: small-caps; letter-spacing: .05em; font-size: 1.05rem; }
.f-nav a:hover { text-decoration: underline; }
.f-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 24px;
  margin-top: 24px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.12);
  font-size: .85rem;
}
.f-bottom p { margin: 0; }


/* Local History */
.hist { margin-bottom: 44px; }
.hist > h2 { font-size: 1.6rem; margin: 0 0 .6em; padding-bottom: 6px; border-bottom: 1px solid var(--rule); }
.hist h3 { font-size: 1.3rem; margin: 0 0 .2em; line-height: 1.25; }
.hist h3 a { color: var(--ink); text-decoration: none; }
.hist h3 a:hover { color: var(--accent); text-decoration: underline; }
.meta { color: var(--muted); margin: 0 0 .6em; font-size: .95rem; }

.book, .story { display: flex; gap: 24px; align-items: flex-start; padding: 16px 0; }
.book + .book { border-top: 1px dotted var(--rule); }
.book .cover, .story .thumb { flex: none; }
.book img {
  width: 150px; height: auto; display: block;
  box-shadow: 0 1px 2px rgba(0,0,0,.15), 0 6px 16px rgba(0,0,0,.18);
}
.story img { width: 220px; height: auto; display: block; border-radius: 2px; }
.book p:last-child, .story p:last-child { margin-bottom: 0; }

ul.links { padding-left: 1.2em; }
ul.links li { margin: .3em 0; }

@media (max-width: 640px) {
  .book { gap: 16px; }
  .book img { width: 96px; }
  .story { flex-direction: column; gap: 12px; }
  .story img { width: 100%; max-width: 420px; }
}

/* Articles */
.prose { max-width: 42em; }
.prose .kicker { font-family: system-ui, sans-serif; font-size: .85rem; color: var(--muted); margin: 0 0 .5em; }
.prose .kicker a { color: var(--muted); }
.prose .byline { font-style: italic; color: var(--muted); border-top: 1px solid var(--rule); padding-top: 12px; margin-top: 28px; }
.prose figure { margin: 24px 0; }
.prose figure img { width: 100%; height: auto; display: block; border-radius: 2px; }
.prose figcaption { font-size: .85rem; color: var(--muted); margin-top: 6px; }
.prose .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: end; }
.prose .pair figure { margin: 0; }
.prose figure.right { float: right; width: 45%; margin: 4px 0 16px 24px; }
.prose figure.left { float: left; width: 45%; margin: 4px 24px 16px 0; }
.prose::after { content: ""; display: block; clear: both; }
@media (max-width: 640px) {
  .prose .pair { grid-template-columns: 1fr; }
  .prose figure.right, .prose figure.left { float: none; width: auto; margin: 20px 0; }
}

/* Home page */
.intro { font-size: 1.25rem; line-height: 1.5; color: var(--muted); max-width: 36em; margin: 8px 0 36px; }
.home-section { margin-bottom: 48px; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px;
  border-bottom: 1px solid var(--rule); padding-bottom: 6px; margin-bottom: 12px; }
.section-head h2 { font-size: 1.6rem; margin: 0; }
.section-head h2 a { color: var(--ink); text-decoration: none; }
.section-head h2 a:hover { color: var(--accent); }
.section-head .more { font-size: .95rem; white-space: nowrap; }

ol.timeline, ul.shelf { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 20px; }
ol.timeline { grid-template-columns: repeat(6, 1fr); }
ol.timeline a, ul.shelf a { display: block; text-decoration: none; color: var(--ink); }
ol.timeline img, ul.shelf img {
  width: 100%; height: auto; display: block; background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.15), 0 6px 16px rgba(0,0,0,.18); transition: transform .15s;
}
ol.timeline a:hover img, ul.shelf a:hover img { transform: translateY(-3px); }
ol.timeline img { aspect-ratio: 8.5 / 11; object-fit: cover; object-position: top; }
.timeline .yr { display: block; margin-top: 10px; font-size: 1.15rem; font-weight: bold; }
.timeline .cap { display: block; font-size: .85rem; color: var(--muted); line-height: 1.3; }
.timeline a:hover .yr { color: var(--accent); }

ul.shelf { grid-template-columns: repeat(3, 1fr); align-items: start; }
ul.shelf .img { display: flex; align-items: flex-end; height: 230px; }
ul.shelf .img img { width: auto; max-width: 100%; max-height: 100%; }
ul.shelf .t { display: block; margin-top: 10px; line-height: 1.3; }
ul.shelf .m { display: block; font-size: .85rem; color: var(--muted); margin-top: 2px; }
ul.shelf a:hover .t { color: var(--accent); text-decoration: underline; }

@media (max-width: 800px) {
  ol.timeline { grid-template-columns: repeat(3, 1fr); }
  ul.shelf { grid-template-columns: repeat(2, 1fr); }
  ul.shelf .img { height: 190px; }
}
