:root {
  --paper: #f6f0e3;
  --paper-2: #ece3cf;
  --ink: #2b2620;
  --ink-soft: #6a5f50;
  --rule: #d6c9ad;
  --accent: #8a3b1f;
  --header-h: 72px;
  font-family: "Source Serif 4", Georgia, serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); }
h1, h2, h3 { font-family: "IM Fell English", Georgia, serif; font-weight: 400; }

.masthead {
  display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap;
  padding: 12px 20px; border-bottom: 2px solid var(--ink);
  min-height: var(--header-h);
}
.masthead h1 { margin: 0; font-size: 2rem; letter-spacing: .02em; }
.tagline { margin: 0; color: var(--ink-soft); font-style: italic; flex: 1; }
.link-button { background: none; border: 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; padding: 0; }
.about { padding: 8px 20px 12px; border-bottom: 1px solid var(--rule); background: var(--paper-2); max-width: 70ch; }

.layout { display: grid; grid-template-columns: 380px 1fr; height: calc(100vh - var(--header-h)); }
.sidebar { overflow-y: auto; border-right: 1px solid var(--rule); background: var(--paper); }
.map { height: 100%; background: var(--paper-2); }

.filters { padding: 14px 16px 6px; position: sticky; top: 0; background: var(--paper); border-bottom: 1px solid var(--rule); z-index: 1; }
.filters input, .filters select { width: 100%; font: inherit; font-size: .95rem; padding: 6px 8px; border: 1px solid var(--rule); background: #fffaf0; color: var(--ink); border-radius: 3px; }
.filter-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.filter-row label { font-size: .8rem; color: var(--ink-soft); display: grid; gap: 2px; }
.count { font-size: .8rem; color: var(--ink-soft); margin: 8px 0 0; }

.place-list { list-style: none; margin: 0; padding: 0; }
.place-list li button {
  display: grid; grid-template-columns: 12px 1fr; gap: 10px; align-items: start;
  width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--rule);
  padding: 10px 16px; font: inherit; color: inherit; cursor: pointer;
}
.place-list li button:hover, .place-list li button:focus-visible { background: var(--paper-2); }
.place-list .dot { width: 12px; height: 12px; border-radius: 50%; margin-top: 5px; border: 1px solid rgba(0,0,0,.35); }
.place-list .name { font-weight: 600; }
.place-list .meta { font-size: .8rem; color: var(--ink-soft); }

.detail { padding: 14px 18px 30px; }
.detail h2 { font-size: 1.8rem; margin: 6px 0 0; }
.detail .sub { color: var(--ink-soft); margin: 2px 0 12px; font-size: .9rem; }
.detail h3 { font-size: 1.25rem; margin: 22px 0 6px; border-bottom: 1px solid var(--rule); padding-bottom: 2px; }
.entry { margin: 14px 0 18px; }
.entry .cite { font-size: .85rem; color: var(--ink-soft); }
.entry .cite strong { color: var(--ink); font-style: italic; font-weight: 400; }
.entry blockquote { margin: 6px 0 0; padding: 4px 0 4px 14px; border-left: 3px solid var(--accent); font-family: "IM Fell English", Georgia, serif; font-size: 1.05rem; line-height: 1.45; }
.entry blockquote p { margin: 0 0 .6em; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: .8rem; color: #fff; }
.tags { font-size: .8rem; color: var(--ink-soft); }
.back { margin-bottom: 4px; }
.notes p { line-height: 1.5; }
.precision-note { font-size: .8rem; color: var(--ink-soft); font-style: italic; }

.legend { background: rgba(246,240,227,.92); padding: 6px 10px; border: 1px solid var(--rule); border-radius: 3px; font-size: .8rem; line-height: 1.6; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; border: 1px solid rgba(0,0,0,.35); }
.leaflet-container { font-family: "Source Serif 4", Georgia, serif; }
.leaflet-tile-pane { filter: sepia(.35) saturate(.8); }

@media (max-width: 760px) {
  :root { --header-h: auto; }
  .layout { grid-template-columns: 1fr; grid-template-rows: 55vh auto; height: auto; }
  .map { grid-row: 1; height: 55vh; }
  .sidebar { grid-row: 2; border-right: 0; overflow: visible; }
  .filters { position: static; }
  .masthead h1 { font-size: 1.6rem; }
  .tagline { flex-basis: 100%; order: 3; }
}

/* Footer: visitor counter and last-updated date. */
.layout { height: calc(100vh - var(--header-h) - 40px); }
.site-foot { display: flex; gap: 16px; justify-content: center; align-items: center; flex-wrap: wrap;
  min-height: 40px; padding: 6px 16px; font-size: .8rem; color: var(--ink-soft); border-top: 1px solid var(--rule); }
.counter { display: inline-flex; gap: 2px; vertical-align: middle; }
.counter span { background: #111; color: #7cfc00; font: 700 14px/1.2 "Courier New", monospace; padding: 1px 4px; border: 1px inset #555; }
