/* Lost Churches prototype styles. See c_design_change_log.md before changing. */
:root {
  --paper: #f8f7f2;
  --surface: #ffffff;
  --ink: #20201d;
  --muted: #5b5f59;
  --line: #cfc9bc;
  --line-soft: #e7e2d7;
  --accent: #2f5d59;
  --accent-ink: #ffffff;
  --afterlife: #7a4b35;
  --notice: #f2ead7;
  --focus: #1b6d85;
  --prose: 68ch;
  --wide: 1180px;
  color-scheme: light;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 106.25%; /* 17px */
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a { color: var(--accent); text-underline-offset: 0.15em; }
a:hover { color: var(--ink); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
[tabindex="-1"]:focus { outline: none; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0.5rem;
  background: var(--surface);
  padding: 0.4rem 0.8rem;
  z-index: 10;
}
.skip-link:focus { left: 0.5rem; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 0.9em; }

.muted { color: var(--muted); }
.small { font-size: 0.88rem; }

/* ---------- Header ---------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0.9rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  flex-wrap: wrap;
}
.site-title { display: flex; flex-direction: column; }
.site-name { display: inline-flex; align-items: center; gap: 0.6rem; }
.site-mark { flex: none; margin-top: -0.2rem; }
.site-name {
  color: var(--ink);
  font-size: 1.55rem;
  font-weight: 400;
  text-decoration: none;
  letter-spacing: 0.01em;
}
.site-tagline { color: var(--muted); font-size: 0.85rem; }
.site-header nav { display: flex; gap: 0.25rem 1.25rem; flex-wrap: wrap; }
.site-header nav a {
  color: var(--ink);
  text-decoration: none;
  padding: 0.2rem 0;
  border-bottom: 2px solid transparent;
}
.site-header nav a:hover { border-bottom-color: var(--line); }
.site-header nav a[aria-current="page"] { border-bottom-color: var(--accent); }

/* ---------- Main ---------- */
main {
  flex: 1;
  width: 100%;
  max-width: var(--wide);
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
}
.prose { max-width: var(--prose); }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: 0.4em; }

.section { margin-top: 2.5rem; }
.section > h2 {
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--line);
}

/* ---------- Buttons and forms ---------- */
button, .button {
  font: inherit;
  font-size: 0.95rem;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.5rem 1rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
button.secondary, .button.secondary {
  background: transparent;
  color: var(--accent);
}
button:hover { filter: brightness(1.1); }
button.link {
  border: 0;
  background: none;
  color: var(--accent);
  padding: 0;
  text-decoration: underline;
}

label { display: block; font-size: 0.9rem; font-weight: 700; margin-bottom: 0.25rem; }
input, select, textarea {
  font: inherit;
  font-size: 1rem;
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  padding: 0.5rem 0.6rem;
}
textarea { min-height: 7rem; }
.field { margin-bottom: 0.9rem; }
.checkbox { display: flex; gap: 0.5rem; align-items: flex-start; font-weight: 400; }
.checkbox input { width: auto; margin-top: 0.3rem; }
.honeypot { position: absolute; left: -9999px; }

/* ---------- Search page intro ---------- */
.intro-band {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 1.5rem 3rem;
  align-items: end;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--line);
}
.intro-band h1 { font-size: clamp(1.6rem, 3vw, 2.15rem); max-width: 26ch; }
.intro-band p { max-width: 52ch; }
.headline-figure { display: flex; align-items: baseline; gap: 0.6rem; margin-bottom: 0.4rem; }
.headline-figure strong { font-size: 3rem; line-height: 1; }
.headline-figure span { color: var(--muted); }
.chart { margin: 0; }
.chart figcaption { color: var(--muted); font-size: 0.82rem; margin-top: 0.3rem; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .bar { fill: var(--accent); }
.chart .bar:hover { fill: var(--ink); }
.chart .axis { stroke: var(--line); }
.chart .tick { fill: var(--muted); font-size: 18px; font-family: Georgia, serif; }
.latest { margin: 0.9rem 0 0; font-size: 0.95rem; }
.latest b { font-weight: 700; }

/* ---------- Search controls ---------- */
.search-form { margin-top: 1.75rem; }
.keyword-row { display: flex; gap: 0.5rem; max-width: 720px; }
.keyword-row input { font-size: 1.1rem; padding: 0.65rem 0.8rem; }
.filter-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.75rem 1rem;
  margin-top: 1rem;
}
.filter-row .field { margin: 0; }
.year-pair { display: flex; gap: 0.4rem; align-items: center; }
.year-pair input { min-width: 0; }
.results-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 1.75rem 0 0.6rem;
}
.results-bar .sort { display: flex; gap: 0.5rem; align-items: center; }
.results-bar .sort label { margin: 0; font-weight: 400; color: var(--muted); }
.results-bar .sort select { width: auto; }

/* ---------- Results ---------- */
.results-table { width: 100%; border-collapse: collapse; background: var(--surface); }
.results-table th {
  text-align: left;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  padding: 0.55rem 0.7rem;
  border-bottom: 2px solid var(--line);
  background: var(--paper);
}
.results-table td {
  padding: 0.65rem 0.7rem;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}
.results-table tr:hover td { background: #fcfbf7; }
.results-table .name a { font-weight: 700; }
.results-table .thumb-cell { width: 64px; padding-right: 0; }
.results-table .num { white-space: nowrap; }
.thumb {
  width: 56px;
  height: 42px;
  object-fit: cover;
  display: block;
  background: var(--line-soft);
}
.thumb.empty { background: transparent; }
.result-cards { display: none; list-style: none; margin: 0; padding: 0; }
.show-more { margin-top: 1.25rem; text-align: center; }
.no-results { padding: 2rem 0; }

/* ---------- Profile ---------- */
.crumb { display: inline-block; margin-bottom: 1rem; font-size: 0.95rem; }
.profile-head h1 { margin-bottom: 0.3rem; }
.summary-line { font-size: 1.1rem; margin-bottom: 0.3rem; }
.aka { color: var(--muted); margin: 0; }
.profile-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 2rem;
  margin-top: 1.75rem;
  align-items: start;
}
.hero-figure { margin: 0; }
.hero-figure img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  background: var(--line-soft);
}
.hero-figure figcaption { font-size: 0.85rem; color: var(--muted); margin-top: 0.4rem; }
.no-photo {
  aspect-ratio: 4 / 3;
  border: 1px dashed var(--line);
  display: grid;
  place-content: center;
  text-align: center;
  color: var(--muted);
  padding: 1rem;
}
.facts { margin: 0; }
.facts div {
  display: grid;
  grid-template-columns: 9.5rem minmax(0, 1fr);
  gap: 0.75rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line-soft);
}
.facts div:first-child { border-top: 1px solid var(--line-soft); }
.facts dt { color: var(--muted); font-size: 0.9rem; }
.facts dd { margin: 0; }
.help { display: block; color: var(--muted); font-size: 0.8rem; }

.afterlife {
  border-left: 4px solid var(--afterlife);
  padding: 0.25rem 0 0.25rem 1.25rem;
}
.afterlife > h2 { border-bottom: 0; padding-bottom: 0; }
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}
.tile { background: var(--surface); border: 1px solid var(--line-soft); padding: 0.75rem 0.9rem; }
.tile span { display: block; color: var(--muted); font-size: 0.82rem; }
.tile strong { font-weight: 400; font-size: 1.1rem; }

.data-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.data-table th {
  text-align: left;
  color: var(--muted);
  font-size: 0.8rem;
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid var(--line);
}
.data-table td { padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--line-soft); vertical-align: top; }

details.history { border-bottom: 1px solid var(--line-soft); }
details.history:first-of-type { border-top: 1px solid var(--line-soft); }
details.history summary {
  cursor: pointer;
  padding: 0.7rem 0;
  font-weight: 700;
}
details.history summary .count { color: var(--muted); font-weight: 400; }
details.history .table-wrap { padding-bottom: 1rem; overflow-x: auto; }

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
}
.gallery { align-items: start; }
.gallery button {
  display: block;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  color: var(--ink);
}
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--line-soft); }
.gallery .cap { font-size: 0.82rem; color: var(--muted); display: block; margin-top: 0.3rem; }
.preview-flag {
  display: inline-block;
  background: var(--notice);
  font-size: 0.75rem;
  padding: 0.1rem 0.4rem;
  margin-top: 0.25rem;
}

ol.sources { padding-left: 1.4rem; }
ol.sources li { margin-bottom: 0.45rem; }

.contribute-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1rem 0; }
.contribute-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 1.25rem;
  max-width: 720px;
  margin-top: 1rem;
}
.contribute-panel h3 { margin-top: 0; }
.comment { border-top: 1px solid var(--line-soft); padding: 0.75rem 0; max-width: var(--prose); }
.comment-meta { color: var(--muted); font-size: 0.85rem; }
.notice { background: var(--notice); padding: 0.6rem 0.8rem; font-size: 0.92rem; }
.form-message { margin-top: 0.75rem; }
.cite { font-size: 0.88rem; color: var(--muted); max-width: var(--prose); }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 18, 0.9);
  display: grid;
  place-items: center;
  padding: 1rem;
  z-index: 20;
}
.lightbox[hidden] { display: none; }
.lightbox-inner { max-width: 1000px; width: 100%; color: #fff; }
.lightbox img { max-width: 100%; max-height: 72vh; margin: 0 auto; display: block; }
.lightbox-meta { font-size: 0.9rem; margin-top: 0.6rem; }
.lightbox-meta a { color: #cfe6e3; }
.lightbox-controls { display: flex; justify-content: space-between; margin-top: 0.75rem; gap: 0.5rem; }
.lightbox-controls button { background: transparent; border-color: #fff; }

/* ---------- Info pages ---------- */
.link-list { list-style: none; padding: 0; }
.link-list li { margin-bottom: 0.6rem; }
dl.glossary dt { font-weight: 700; margin-top: 0.8rem; }
dl.glossary dd { margin: 0.15rem 0 0; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
}
.footer-inner { max-width: var(--wide); margin: 0 auto; padding: 1.25rem 1rem 1.5rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0.4rem 1.5rem; margin-bottom: 0.6rem; }
.footer-meta { color: var(--muted); margin: 0.2rem 0 0; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .intro-band, .profile-hero { grid-template-columns: 1fr; }
  .results-table { display: none; }
  .result-cards { display: block; }
  .result-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 72px;
    gap: 0.75rem;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--line-soft);
  }
  .result-card:first-child { border-top: 1px solid var(--line); }
  .result-card a { font-weight: 700; }
  .result-card p { margin: 0.15rem 0 0; font-size: 0.93rem; }
  .result-card .thumb { width: 72px; height: 54px; }
}
@media (max-width: 560px) {
  main { padding-top: 1.25rem; }
  .header-inner { padding: 0.75rem 1rem; }
  .site-tagline { display: none; }
  .site-header nav { gap: 0.2rem 1rem; }
  .facts div { grid-template-columns: 1fr; gap: 0.1rem; }
  .keyword-row { flex-direction: column; }
  .headline-figure strong { font-size: 2.4rem; }
}

.visually-hidden-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.hero-figure > button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}

.filters > summary {
  display: none;
  cursor: pointer;
  font-weight: 700;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line-soft);
}
@media (max-width: 860px) {
  .filters > summary { display: list-item; }
  .filters[open] .filter-row { margin-top: 0.75rem; }
}

.data-table td:first-child { white-space: nowrap; width: 1%; padding-right: 1.5rem; }

/* ---------- Copy from the web copy document ---------- */
.copy h2 { margin-top: 2rem; }
.copy h3 { margin-top: 1.4rem; }
.copy ul, .copy ol { padding-left: 1.3rem; }
.copy li { margin-bottom: 0.4em; }
.on-this-page { font-size: 0.95rem; color: var(--muted); }

/* ---------- Trends figures ---------- */
.figure { margin: 1.75rem 0; }
.figure.wide { width: min(840px, calc(100vw - 2rem)); max-width: none; }
.figure-title { font-size: 0.98rem; margin-bottom: 0.4rem; }
.figure svg { width: 100%; height: auto; display: block; }
.figure .grid { stroke: var(--line-soft); }
.figure .tick { fill: var(--muted); font-size: 12px; font-family: Georgia, serif; }
.figure .bar { fill: #8fa9a6; }
.figure .hit { fill: transparent; }
.figure .bar-hit:hover .bar { fill: var(--accent); }
.figure .fit { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
.figure .inflection-guide { stroke: #b7893d; stroke-width: 1; stroke-dasharray: 4 4; }
.figure .inflection-point { fill: #b7893d; stroke: var(--surface); stroke-width: 2; }
.figure .inflection-label { fill: #72531f; font-size: 12px; font-family: Georgia, serif; font-weight: 700; }
.legend { display: flex; align-items: center; flex-wrap: wrap; gap: 0.4rem 0.5rem; font-size: 0.85rem; color: var(--muted); margin-bottom: 0.3rem; }
.key-bar { display: inline-block; width: 12px; height: 12px; background: #8fa9a6; border-radius: 2px; }
.key-line { display: inline-block; width: 18px; height: 2px; background: var(--ink); margin-left: 0.8rem; }
.key-point { display: inline-block; width: 10px; height: 10px; background: #b7893d; border-radius: 50%; margin-left: 0.8rem; }
.table-toggle { margin-top: 0.6rem; font-size: 0.9rem; }
.table-toggle summary { cursor: pointer; color: var(--accent); }
.table-toggle .table-wrap { max-height: 320px; overflow: auto; margin-top: 0.5rem; }
.barlist-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem 2.5rem; }
.barlist { margin: 0; }
.barlist ul { list-style: none; margin: 0.4rem 0 0; padding: 0; }
.barlist li { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr) 2.5rem; align-items: center; gap: 0.6rem; padding: 0.22rem 0; font-size: 0.9rem; }
.bl-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bl-track { height: 12px; }
.bl-bar { display: block; height: 12px; background: var(--accent); border-radius: 0 2px 2px 0; min-width: 2px; }
.bl-value { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }

/* ---------- News ---------- */
.news-filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.25rem 0 0.5rem; }
.chip {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  font-size: 0.9rem;
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.news-list { max-width: 760px; }
.news-item { padding: 1.4rem 0; border-bottom: 1px solid var(--line-soft); }
.news-item h2 { font-size: 1.35rem; margin: 0.2rem 0 0.4rem; }
.news-item h2 a { color: var(--ink); text-decoration: none; }
.news-item h2 a:hover { text-decoration: underline; }
.news-meta { font-size: 0.82rem; color: var(--muted); margin: 0; letter-spacing: 0.02em; }
.news-cat { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.75rem; color: var(--ink); }
.news-lead { margin: 0 0 0.4rem; }
.read-more { margin: 0; font-size: 0.92rem; }
.story h1 { font-size: clamp(1.7rem, 3.4vw, 2.3rem); margin-top: 0.3rem; }
.standfirst { font-size: 1.15rem; line-height: 1.5; color: #3b3d39; border-bottom: 1px solid var(--line); padding-bottom: 1.1rem; margin-bottom: 1.4rem; }
.story-body a { text-decoration-color: rgba(47, 93, 89, 0.45); }
.more-news { max-width: var(--prose); }
@media (max-width: 560px) {
  .barlist li { grid-template-columns: minmax(0, 8.5rem) minmax(0, 1fr) 2.2rem; }
  .site-mark { width: 28px; height: 28px; }
}
.news-brief p { margin: 0; font-size: 0.95rem; color: #3b3d39; }
