:root {
  --ink: #1c140f;
  --red: #7e1616;
  --gold: #8a6a2a;
  --paper: #fffdf8;
  --rule: #e6d8c4;
  --muted: #5c5148;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: 1.125rem;
  line-height: 1.45;
}

a { color: var(--red); text-underline-offset: 0.12em; }
a:hover { text-decoration-thickness: 2px; }

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

header.site {
  border-top: 7px solid var(--red);
  border-bottom: 1px solid var(--gold);
  margin-bottom: 1.75rem;
}

header.site .wrap { padding-top: 1.1rem; padding-bottom: 1rem; }

.mark {
  margin: 0;
  color: var(--red);
  font-size: 1.35rem;
  line-height: 1;
}

header.site h1 {
  margin: 0.15rem 0 0;
  font-size: 1.85rem;
  font-weight: 600;
  letter-spacing: 0;
}

header.site h1 a { color: inherit; text-decoration: none; }
header.site h1 a:hover { color: var(--red); }

.lede {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}

form.search {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: flex-end;
  margin: 1.35rem 0 0.4rem;
}

form.search label {
  flex: 1 1 100%;
  font-size: 0.95rem;
  color: var(--muted);
}

form.search input {
  flex: 1 1 14rem;
  font: inherit;
  color: inherit;
  background: #fff;
  border: 1px solid var(--gold);
  border-radius: 0;
  padding: 0.45rem 0.55rem;
}

form.search button {
  font: inherit;
  color: #fff;
  background: var(--red);
  border: 0;
  border-radius: 0;
  padding: 0.5rem 0.85rem;
  cursor: pointer;
}

form.search button:hover { background: #641111; }

.count {
  margin: 0.2rem 0 1.4rem;
  color: var(--muted);
  font-size: 1rem;
}

h2 {
  margin: 1.6rem 0 0.45rem;
  font-size: 1.25rem;
  font-weight: 600;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.2rem;
}

.letters { margin: 0.4rem 0 0.8rem; line-height: 1.8; }
.letters a { margin-right: 0.45rem; text-decoration: none; }
.letters a:hover { text-decoration: underline; }

.pile { columns: 2; column-gap: 2rem; margin: 0; padding: 0; list-style: none; }
.pile li { break-inside: avoid; margin: 0 0 0.28rem; }
.quiet { color: var(--muted); font-size: 0.92rem; }

.place, .facts { margin: 0.2rem 0 0.7rem; color: var(--muted); }

.choir-block { margin: 0 0 1.5rem; }
.choir-block h3 { margin: 0 0 0.2rem; font-size: 1.2rem; font-weight: 600; }

.directory { margin: 0.45rem 0 0.8rem; max-width: 40rem; }
.source { margin: 0.15rem 0 0; font-size: 0.98rem; }
.absent { margin: 0.3rem 0 0.6rem; }

.result { margin: 0 0 0.85rem; }
.result h3 { margin: 0; font-size: 1.08rem; font-weight: 600; }

footer.site {
  border-top: 1px solid var(--gold);
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: 2rem;
}

footer.site .wrap { padding-top: 0.8rem; padding-bottom: 1.4rem; }
footer.site p { margin: 0; }

/* Site nav links (map, directory) */
.site-nav { margin: 0.6rem 0 0; font-size: 0.95rem; }
.site-nav a { margin-right: 1rem; color: var(--red); text-decoration: none; }
.site-nav a:hover { text-decoration: underline; }

/* Map page. Height must live in this file: the page CSP blocks inline styles,
   so a style attribute on #choir-map is ignored and the box collapses to its border. */
#choir-map {
  width: 100%;
  height: 680px;
  border: 1px solid var(--rule);
}

/* Directory filter form */
.filter-form { margin: 0 0 1.4rem; }
.filter-form fieldset { border: 1px solid var(--rule); padding: 0.7rem 1rem; }
.filter-form legend { font-size: 0.95rem; color: var(--muted); padding: 0 0.3rem; }
.filter-form label { font-size: 0.92rem; color: var(--muted); margin-right: 0.3rem; }
.filter-form select {
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--gold);
  border-radius: 0;
  padding: 0.3rem 0.4rem;
  margin-right: 1rem;
}
.filter-form button {
  font: inherit;
  font-size: 0.95rem;
  color: #fff;
  background: var(--red);
  border: 0;
  padding: 0.35rem 0.8rem;
  cursor: pointer;
}
.filter-form button:hover { background: #641111; }

/* Facts table */
.facts-table { width: 100%; border-collapse: collapse; font-size: 0.97rem; }
.facts-table th, .facts-table td { padding: 0.4rem 0.6rem; text-align: left; border-bottom: 1px solid var(--rule); vertical-align: top; }
.facts-table th { font-weight: 600; color: var(--muted); font-size: 0.88rem; text-transform: uppercase; letter-spacing: 0.03em; border-bottom: 2px solid var(--gold); }
.facts-table tr:hover td { background: #f9f4ec; }
.facts-table td.unknown { color: var(--muted); font-style: italic; }

/* Nearby results in search */
.nearby-intro { margin: 0.3rem 0 0.7rem; font-size: 0.95rem; color: var(--muted); }

@media (min-width: 900px) {
  .wrap.wide { max-width: 58rem; }
  .pile { columns: 3; }
}

@media (max-width: 640px) {
  body { font-size: 1.05rem; }
  header.site h1 { font-size: 1.6rem; }
  .pile { columns: 1; }
  form.search input, form.search button { flex: 1 1 100%; }
  .facts-table th:nth-child(2), .facts-table td:nth-child(2) { display: none; }
  #choir-map {
    height: 420px;
    height: 70dvh;
    min-height: 320px;
  }
}
