/* IBM Plex faces live in fonts.css */

:root {
  --font-sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ink: #16161d;
  --grey: #555;
  --light-grey: #777;
  --rule: #e3e3e0;
  --bg: #fdfcfb;
  --land: #fbfbfa;
  --indent: 4ch;
  --indent-narrow: 3ch;
  --rubric-gap: 0.3rem;
  --name-size: clamp(1.25rem, 3vw, 1.6rem);
  --entry-gap: 1rem;
  --fold-gap: 0.5rem;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0 auto;
  max-width: 53rem;
  padding: clamp(1.25rem, 4vw, 3.5rem);
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 1rem;
  line-height: 1.65;
}

/* Masthead */

.masthead {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem 2rem;
  padding-bottom: 1.75rem;
}

.masthead__contact {
  font-size: 0.8rem;
  font-style: normal;
  line-height: 1.6;
  color: var(--grey);
}

.masthead__contact a { color: inherit; }

.masthead__dateline {
  grid-row: 1;
  grid-column: 2;
  margin: 0;
  font-size: 0.8rem;
  text-align: right;
  color: var(--light-grey);
}

.masthead__name {
  grid-column: 1 / -1;
  margin: 1rem 0 0;
  font-family: var(--font-sans);
  font-size: var(--name-size);
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.15;
}

.masthead__tagline {
  grid-column: 1 / -1;
  margin: 0.4rem 0 0;
  font-family: var(--font-mono);
  font-size: 1.05rem;
}

/* Entries: rubric above indented content */

.entry {
  padding-block: var(--entry-gap);
}

.rubric {
  margin: 0 0 var(--rubric-gap);
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1.6;
  color: var(--grey);
}

.entry__body {
  margin: 0;
  padding-inline-start: var(--indent);
}

.entry__body p { margin: 0; }
.entry__body p + p { margin-top: 0.8em; }
.entry__body p + ul,
.entry__body ul + p { margin-top: 0.6em; }
.entry__body ul + ul { margin-top: 0.9em; }
.entry__note {
  font-size: 0.82rem;
  color: var(--grey);
}

/* Folds */

details.entry:not([open]) {
  padding-block: var(--fold-gap);
}

details.entry summary {
  list-style: none;
  cursor: pointer;
}

details.entry summary::-webkit-details-marker { display: none; }

details.entry summary::after {
  content: "▸";
  margin-inline-start: 0.5em;
  font-size: 1rem;
  line-height: 1;
  vertical-align: -0.05em;
  color: var(--light-grey);
}

details.entry[open] summary::after { content: "▾"; }

details.entry summary:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Lists */

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

li + li { margin-top: 0.3em; }

/* Links */

a {
  color: inherit;
  text-decoration-color: var(--rule);
  text-underline-offset: 0.18em;
}

a:hover { text-decoration-color: currentColor; }

/* Map */

.map {
  position: relative;
  margin: 1.1rem 0 0;
  width: calc(100% + var(--indent));
  margin-inline-start: calc(-1 * var(--indent));
  height: clamp(24rem, 72vh, 54rem);
  border: 1px solid var(--rule);
  background: #fff;
}
.map svg {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
}
.map svg:active { cursor: grabbing; }
.map svg:focus,
.map-site:focus { outline: none; }
.map-graticule {
  fill: none;
  stroke: var(--rule);
  stroke-width: 0.5;
  vector-effect: non-scaling-stroke;
}
.map-land {
  fill: var(--land);
  stroke: none;
}
.map-borders {
  fill: none;
  stroke: #8a8a85;
  stroke-width: 0.7;
}
.map-river {
  fill: none;
  stroke: #ebebeb;
  stroke-width: 1.1;
  vector-effect: non-scaling-stroke;
}
.map-lake { fill: #ebebeb; }
.map-inner {
  transform-box: view-box;
  transform-origin: 0 0;
  will-change: transform;
}
.map-readout {
  margin: 0.4rem 0 0;
  font-size: 0.7rem;
  color: var(--light-grey);
}
.map-hint {
  margin: 0.4rem 0 0;
  font-size: 0.82rem;
  color: var(--grey);
}
.map-retry {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  cursor: pointer;
}
.sites-hint + .sites-list { margin-top: 0.35rem; }
.sites-list {
  margin-top: 0.9rem;
  font-size: 0.9rem;
  color: var(--grey);
}
.sites-list li {
  line-height: 1.3;
  margin-bottom: 0.35rem;
}
.sites-list li:last-child { margin-bottom: 0; }
.sites-list li.is-linked { cursor: pointer; }
.sites-list li.is-active { color: var(--ink); }
.sites-list li:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.map-label { transition: opacity 0.2s; }
.map-label--country {
  visibility: hidden; /* built in, off by default */
}
body.show-country-labels .map-label--country { visibility: visible; }
.subrubric {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--grey);
  margin: 1rem 0 0.35rem;
}
.entry__body > .subrubric:first-child { margin-top: 0; }
.map-label text {
  text-anchor: middle;
  font-family: var(--font-mono);
}
.map-label--country text {
  font-family: var(--font-sans);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  fill: #8a8a85;
}
.map-label--water text,
.map-label--river text {
  font-style: italic;
  font-size: 11px;
  fill: #9a9a94;
}
.map-label--range text {
  font-family: var(--font-sans);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  fill: #a0a09a;
}
.map-site { cursor: pointer; }
.map-site circle {
  fill: #4d4d4d;
  stroke: #fff;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}
.map-site:focus-visible circle {
  stroke: var(--ink);
  stroke-width: 2.5;
}
.map-site .map-site__pulse {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.5;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}
.map-site.is-pulsing .map-site__pulse { animation: site-pulse 1.3s ease-out infinite; }
@keyframes site-pulse {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(3.2); opacity: 0; }
}
.map-popup {
  position: absolute;
  z-index: 2;
  width: max-content;
  max-width: min(17rem, calc(100% - 16px));
  padding: 0.5rem 1.6rem 0.55rem 0.8rem;
  background: #fff;
  border: 1px solid #bdbdb7;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.5;
}
.map-popup strong {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.85rem;
}
.map-popup__text { color: var(--ink); }
.map-popup__close {
  position: absolute;
  top: 0.1rem;
  right: 0.25rem;
  border: 0;
  background: none;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  color: var(--grey);
}

/* Responsive */

@media (max-width: 48rem) {
  .masthead { grid-template-columns: 1fr; }
  .masthead__name { grid-row: 1; margin-top: 0; }
  .masthead__tagline { grid-row: 2; }
  .masthead__contact { grid-row: 3; }
  .masthead__dateline {
    grid-row: 4;
    grid-column: 1;
    text-align: left;
  }
  .entry__body { padding-inline-start: var(--indent-narrow); }
}

/* Print */

@media print {
  body {
    max-width: none;
    padding: 0;
  }
  a { text-decoration: none; }
  .entry { break-inside: avoid; }
}
