/* ============================================================
   SOLEMN VALE — shared stylesheet
   One file links from every page (map, index, bestiary, ...).
   Restyle the whole site by editing here.
   ============================================================ */

:root {
  --ink:        #16191604;   /* not used directly; see --bg */
  --bg:         #0d0e0c;     /* void around the map */
  --header-bg:  #1a1c1a;     /* header bar */
  --bone:       #e8e2d0;     /* primary text on dark */
  --bone-dim:   #a8a392;     /* secondary text */
  --rust:       #a8512f;     /* accent (Solemn Vale dried-blood) */
  --moss:       #6b7257;     /* secondary accent */
  --line:       #2c302a;     /* hairline dividers */
  --header-h:   58px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--bone);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ---------- header / nav row ---------- */
.site-header {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 18px;
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 1000;            /* above the Leaflet map */
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
}
.brand .title {
  font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
  font-size: 22px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bone);
  white-space: nowrap;
}
.brand .subtitle {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--rust);
  white-space: nowrap;
}

/* nav: placeholder buttons — wire hrefs later */
.site-nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.site-nav a {
  display: inline-block;
  padding: 7px 13px;
  font-size: 13px;
  letter-spacing: 0.05em;
  color: var(--bone-dim);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: transparent;
  transition: color .15s, border-color .15s, background .15s;
  white-space: nowrap;
}
.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--bone);
  border-color: var(--rust);
  background: #20231f;
  outline: none;
}
.site-nav a[aria-current="page"] {
  color: var(--bone);
  border-color: var(--rust);
  background: #241c18;
}

/* ---------- map ---------- */
#map {
  position: absolute;
  top: var(--header-h);
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg);
}

/* Leaflet chrome tuned to the theme */
.leaflet-container { background: var(--bg); }
.leaflet-bar a {
  background: var(--header-bg);
  color: var(--bone);
  border-bottom-color: var(--line);
}
.leaflet-bar a:hover { background: #24271f; color: var(--bone); }
.leaflet-control-attribution {
  background: rgba(13,14,12,.78) !important;
  color: var(--bone-dim) !important;
}
.leaflet-control-attribution a { color: var(--moss) !important; }

/* ---------- custom marker pin (no external icon needed) ---------- */
.sv-pin {
  width: 18px;
  height: 18px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  border: 2px solid var(--bone);
  box-shadow: 0 0 0 2px rgba(0,0,0,.45);
}
.sv-pin.loc { background: var(--rust); }
.sv-pin.site { background: var(--moss); }

/* tooltip (hover label) */
.leaflet-tooltip.sv-tip {
  background: var(--header-bg);
  border: 1px solid var(--rust);
  color: var(--bone);
  font-size: 12px;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,.5);
}
.leaflet-tooltip.sv-tip::before { display: none; }   /* drop the little arrow */

/* popup (click detail) */
.leaflet-popup-content-wrapper {
  background: var(--header-bg);
  color: var(--bone);
  border: 1px solid var(--line);
  border-radius: 3px;
}
.leaflet-popup-tip { background: var(--header-bg); border: 1px solid var(--line); }
.sv-popup h3 {
  margin: 0 0 4px;
  font-family: Georgia, serif;
  font-size: 15px;
  letter-spacing: 0.03em;
  color: var(--bone);
}
.sv-popup p { margin: 0 0 8px; font-size: 13px; color: var(--bone-dim); line-height: 1.4; }
.sv-popup a.more {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--rust);
  text-decoration: none;
}
.sv-popup a.more:hover { text-decoration: underline; }

/* ---------- small screens ---------- */
@media (max-width: 560px) {
  :root { --header-h: 92px; }
  .site-header { flex-direction: column; align-items: flex-start; justify-content: center; gap: 6px; padding: 8px 14px; }
  .brand .title { font-size: 19px; }
  .site-nav { width: 100%; }
}
