:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --text: #22231f;
  --muted: #62645c;
  --line: #dcd8cd;
  --accent: #3d5a47;
  --accent-text: #ffffff;
  --stone: #e9e6de;
  --stone-text: #2b2c28;
  --radius: 6px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161714;
    --surface: #1f201c;
    --text: #e6e4dc;
    --muted: #a4a69b;
    --line: #34362f;
    --accent: #8fb79a;
    --accent-text: #10140f;
    --stone: #2a2b27;
    --stone-text: #e9e7df;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.55 var(--sans);
}
a { color: var(--accent); }
h1, h2 { font-family: var(--serif); font-weight: 600; line-height: 1.2; }
h1 { font-size: 2rem; margin: 1.2rem 0 0.4rem; }
h2 { font-size: 1.35rem; margin: 2rem 0 0.8rem; }
code { font-size: 0.95em; }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }
.lede { color: var(--muted); margin-top: 0; }
.small { color: var(--muted); font-size: 0.9rem; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

header.site { border-bottom: 1px solid var(--line); background: var(--surface); }
header.site .wrap { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding-top: 10px; padding-bottom: 10px; }
.brand { font-family: var(--serif); font-size: 1.4rem; font-weight: 600; color: var(--text); text-decoration: none; }
footer.site { margin-top: 3rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.9rem; }

form.search { display: flex; gap: 6px; flex-wrap: wrap; }
form.search input[type=search], form.search select {
  font: inherit; padding: 6px 10px; min-width: 0; flex: 1 1 14rem;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg); color: var(--text);
}
form.search select { flex: 0 1 auto; }
form.search button {
  font: inherit; padding: 6px 14px; border: 0; border-radius: var(--radius);
  background: var(--accent); color: var(--accent-text); cursor: pointer;
}
form.search.big { margin: 1.4rem 0; }
form.search.big input { font-size: 1.15rem; padding: 10px 14px; }
form.search.inline { margin: 1rem 0 1.5rem; }
header.site form.search { flex: 0 1 26rem; }

.intro { padding: 1rem 0; }
.intro h1 { font-size: 2.3rem; }

ul.places { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
ul.places a {
  display: flex; flex-direction: column; height: 100%; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; color: var(--text);
}
ul.places a:hover { border-color: var(--accent); }
ul.places .name { font-family: var(--serif); font-size: 1.15rem; font-weight: 600; }
ul.places .where, ul.places .counts { color: var(--muted); font-size: 0.9rem; }

.crumbs { margin-top: 1rem; font-size: 0.9rem; color: var(--muted); }

.views { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 1.5rem; }
.views img { height: 160px; border-radius: var(--radius); }

ul.stones { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
ul.stones a { display: flex; flex-direction: column; text-decoration: none; color: var(--text); }
ul.stones img, ul.stones .nophoto {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
  border-radius: var(--radius); background: var(--stone); display: block;
}
ul.stones .title { font-weight: 600; margin-top: 4px; line-height: 1.3; }
ul.stones .meta, .results .meta { color: var(--muted); font-size: 0.85rem; }
ul.stones a:hover .title { color: var(--accent); }

h1 .years { color: var(--muted); font-weight: 400; font-size: 0.7em; white-space: nowrap; }
.face-body { display: grid; gap: 16px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 760px) { .face-body { grid-template-columns: 1fr 1fr; } }
.inscription {
  background: var(--stone); color: var(--stone-text);
  border-radius: 40px 40px var(--radius) var(--radius);
  padding: 28px 18px; text-align: center;
  font-family: var(--serif); letter-spacing: 0.06em; line-height: 1.7;
  overflow-wrap: anywhere;
}
.inscription span, .snippet span { display: block; min-height: 1em; }
.photo img { width: 100%; border-radius: var(--radius); display: block; }
.photo.placeholder {
  aspect-ratio: 3 / 4; display: grid; place-items: center;
  background: var(--stone); color: var(--muted); border-radius: var(--radius);
}
.untranscribed { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); padding: 16px; }

.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 2rem; }

ol.results { padding-left: 1.4rem; }
ol.results li { margin-bottom: 1rem; }
ol.results a { font-weight: 600; }
.snippet { font-family: var(--serif); letter-spacing: 0.04em; font-size: 0.92rem; color: var(--muted); margin-top: 2px; }
