:root {
  --fog: #e3e8e4;
  --fog-deep: #d3dbd6;
  --ink: #22302d;
  --bog: #3f5a4f;
  --stone: #6f7f78;
  --lantern: #c98b2b;
  --paper: #f1f4f1;
  --serif: "IM Fell English", Georgia, serif;
  --sans: "Karla", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  display: flex; flex-direction: column;
  background: var(--fog); color: var(--ink);
  font-family: var(--sans); font-size: 16px; line-height: 1.5;
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--lantern); outline-offset: 2px; }

/* Masthead: the artwork fades into fog behind the title */
.masthead {
  /* the header keeps its own dusky palette, independent of the page */
  --fog: #26332e; --fog-deep: #34433d; --ink: #e4eae6; --bog: #a6c4b5;
  color: var(--ink);
  position: relative; flex: 0 0 auto; min-height: 168px;
  display: flex; align-items: center; padding: 1.25rem clamp(1rem, 4vw, 3rem);
  background: var(--fog-deep) center / cover no-repeat;
}
.masthead::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, var(--fog) 8%, rgba(38,51,46,.82) 42%, rgba(38,51,46,0) 85%);
}
.masthead-text { position: relative; max-width: 40rem; }
.masthead h1 {
  margin: 0; font: 400 clamp(2.1rem, 5.5vw, 3.8rem)/1.05 var(--serif); letter-spacing: .01em;
}
.masthead p { margin: .5rem 0 0; color: var(--bog); max-width: 32rem; }

.layout { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 24rem; }
.map-wrap { position: relative; min-height: 0; }
#map { position: absolute; inset: 0; background: var(--fog-deep); }
.map-message {
  position: absolute; inset: 1rem auto auto 1rem; right: 1rem; max-width: 32rem;
  background: var(--paper); border-left: 4px solid var(--lantern); padding: .9rem 1rem; z-index: 2;
}

.panel { display: flex; flex-direction: column; min-height: 0; background: var(--paper); border-left: 1px solid var(--fog-deep); }
.panel-tools { padding: 1rem 1rem .5rem; }
#search {
  width: 100%; padding: .6rem .75rem; font: inherit; color: var(--ink);
  background: #fff; border: 1px solid var(--stone); border-radius: 3px;
}
.status { margin: .5rem 0 0; font-size: .9rem; color: var(--stone); }
.panel-body { flex: 1 1 auto; overflow-y: auto; padding: 0 1rem 1.5rem; }
.panel-heading { margin: .5rem 0; font: 400 1.25rem var(--serif); }

.story-list { list-style: none; margin: 0; padding: 0; }
.story-list li { border-top: 1px solid var(--fog-deep); }
.story-btn {
  display: block; width: 100%; text-align: left; padding: .8rem .25rem;
  background: none; border: 0; font: inherit; color: inherit; cursor: pointer;
}
.story-btn:hover .story-title { text-decoration: underline; text-decoration-color: var(--lantern); text-underline-offset: 3px; }
.story-title { display: block; font: 400 1.2rem/1.25 var(--serif); }
.story-place { display: block; font-size: .9rem; color: var(--stone); }
.story-btn.unmapped .story-place::after { content: " (no map location)"; font-style: italic; }

.back { margin: .75rem 0 .5rem; padding: 0; background: none; border: 0; color: var(--bog); font: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.detail h2 { margin: .25rem 0 0; font: 400 1.9rem/1.15 var(--serif); }
.detail .place { margin: .25rem 0 1rem; color: var(--bog); font-weight: 500; }
.detail img { display: block; width: 100%; height: auto; max-height: 16rem; object-fit: cover; margin-bottom: 1rem; background: var(--fog-deep); }
.detail .body p { margin: 0 0 1em; font: 400 1.1rem/1.65 var(--serif); max-width: 62ch; }
.detail .src a { color: var(--bog); }

@media (max-width: 820px) {
  body { height: auto; display: block; }
  html, body { height: auto; }
  .layout { display: block; }
  .map-wrap { height: 55vh; }
  .panel { border-left: 0; border-top: 1px solid var(--fog-deep); }
  .panel-body { overflow: visible; }
}

/* ---------- site navigation buttons (under the header) ---------- */
.sitenav {
  flex: 0 0 auto; display: flex; flex-wrap: wrap; gap: .6rem;
  padding: .7rem clamp(1rem, 4vw, 3rem);
  background: var(--paper); border-bottom: 1px solid var(--fog-deep);
}
.btn {
  display: inline-block; padding: .5rem 1.25rem; border-radius: 3px;
  border: 1px solid var(--bog); background: transparent; color: var(--bog);
  font: 700 .95rem var(--sans); text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--fog-deep); }
.btn[aria-current="page"] { background: var(--bog); color: var(--paper); }
.btn-primary { background: var(--bog); color: var(--paper); }
.btn-primary:hover { background: var(--ink); }

/* ---------- text pages (About, Contact) ---------- */
body.content { height: auto; min-height: 100%; }
html:has(body.content) { height: auto; }
.page { flex: 1 0 auto; width: 100%; max-width: 46rem; margin: 0 auto; padding: 2rem clamp(1rem, 4vw, 2rem) 4rem; }
.page h2 { margin: 0 0 1rem; font: 400 clamp(1.8rem, 4vw, 2.6rem)/1.15 var(--serif); }
.page p { margin: 0 0 1.1em; font: 400 1.2rem/1.7 var(--serif); }
.page blockquote {
  margin: 1.5rem 0; padding: .1rem 0 .1rem 1.25rem; border-left: 3px solid var(--lantern); color: var(--bog);
}
.page blockquote p { font-style: italic; }
.page .lead { font-size: 1.35rem; color: var(--bog); }

.contact-form { display: grid; gap: 1.1rem; margin-top: 1.75rem; }
.contact-form label { display: grid; gap: .35rem; font: 700 .95rem var(--sans); }
.contact-form input, .contact-form textarea {
  width: 100%; padding: .65rem .75rem; font: 400 1rem var(--sans); color: var(--ink);
  background: #fff; border: 1px solid var(--stone); border-radius: 3px;
}
.contact-form textarea { min-height: 11rem; resize: vertical; }
.contact-form .btn { justify-self: start; font-size: 1rem; }
.form-note { margin: 0; font: 400 .95rem var(--sans); color: var(--stone); }
.form-note a { color: var(--bog); }
