/* This page owns its palette in both schemes. Keep post-map.css in sync. */
.post-map {
  --desk: #ede9df;
  --paper: #fffdf5;
  --ink: #383c3a;
  --muted: #706e63;
  --rule: #d4cebf;
  --thread: #a27454;
  --accent: #34685e;
  position: relative;
  left: 50%;
  width: min(1240px, calc(100vw - 48px));
  transform: translateX(-50%);
  color: var(--ink);
}
.post-map .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.map-intro { margin: 4px 0 28px; }
.map-eyebrow {
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.map-intro h1 {
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: normal;
  font-size: clamp(36px, 5vw, 52px);
  line-height: 1.1;
  letter-spacing: -.035em;
  margin-bottom: 12px;
}
.map-intro > p:last-child { color: var(--muted); font-size: 16px; }
.map-toolbar { display: flex; align-items: center; gap: 20px; margin-bottom: 14px; }
.map-find { min-width: 0; max-width: 420px; flex: 1; }
.map-find select {
  width: 100%;
  text-overflow: ellipsis;
  font: inherit;
  font-size: 13px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
  min-height: 38px;
  padding: 7px 28px 7px 10px;
}
.map-unlinked { font-size: 12px; color: var(--muted); cursor: pointer; }
.map-unlinked input { accent-color: var(--accent); vertical-align: middle; margin-right: 5px; }
.map-zoom { display: flex; gap: 0; margin-left: auto; }
.post-map button { font-family: inherit; cursor: pointer; }
.map-zoom button, #map-clear {
  min-width: 44px;
  min-height: 44px;
  padding: 5px 12px;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
  font-size: 13px;
}
.map-zoom button + button { border-left: 0; }
.map-zoom button:first-child { border-radius: 4px 0 0 4px; }
.map-zoom button:last-child { border-radius: 0 4px 4px 0; }
.post-map button:hover { border-color: var(--accent); }
.post-map :focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.map-desk {
  position: relative;
  height: 820px;
  min-height: 440px;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background-color: var(--desk);
  background-image: radial-gradient(var(--rule) .7px, transparent .7px);
  background-size: 13px 13px;
  box-shadow: inset 0 0 70px #69604b0a;
  cursor: grab;
  touch-action: none;
}
.map-desk.is-dragging { cursor: grabbing; }
.map-world { position: absolute; top: 0; left: 0; transform-origin: 0 0; }
.map-threads { position: absolute; top: 0; left: 0; overflow: visible; pointer-events: none; }
#map-arrow path { fill: var(--thread); }
.map-thread { fill: none; stroke: var(--thread); stroke-width: 1.8; opacity: .8; }
.map-thread.is-active { stroke-width: 3; opacity: 1; }
.map-thread.is-muted { opacity: .1; }
.map-group-label {
  position: absolute;
  width: 600px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  pointer-events: none;
}
.map-paper {
  box-sizing: border-box;
  position: absolute;
  width: 250px;
  height: 164px;
  border: 1px solid #d8d0be;
  border-radius: 1px 1px 8px 1px;
  padding: 14px 18px 12px;
  color: var(--ink);
  background: linear-gradient(135deg, transparent calc(100% - 17px), #b7a88a33 calc(100% - 17px), #fffdf500 calc(100% - 10px)), var(--paper);
  box-shadow: 1px 3px 3px #4b402013, 2px 10px 13px -8px #4b40203b;
  transform: rotate(var(--tilt));
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.post-map .map-paper { cursor: grab; }
.post-map .map-paper.is-dragging { cursor: grabbing; z-index: 2; box-shadow: 3px 12px 20px #0003; }
.map-paper[hidden], .map-group-label[hidden] { display: none; }
.map-paper:hover, .map-paper:focus-visible { z-index: 2; box-shadow: 2px 7px 14px #4b402030; }
.map-paper-date { color: var(--muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.map-paper-title {
  font: 17px/1.18 Georgia, 'Times New Roman', serif;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.map-paper-note { margin-top: auto; padding-top: 5px; font-size: 10px; color: var(--muted); border-top: 1px solid var(--rule); }
.map-paper.is-selected { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: 3px; z-index: 1; }
.map-paper.is-muted { opacity: .25; }
.map-desk-note { position: absolute; bottom: 12px; right: 20px; margin: 0; color: var(--muted); font: italic 13px Georgia, serif; pointer-events: none; }
.map-caption { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 20px; margin: 12px 0 28px; font-size: 11px; color: var(--muted); }
#map-detail { flex: 1; min-width: 0; }
.map-detail h2 { font: normal 23px/1.3 Georgia, serif; margin: 0 0 12px; letter-spacing: -.02em; }
.post-map a, .post-map a:visited { color: var(--accent); }
.map-detail p { color: var(--muted); font-size: 13px; margin-bottom: 0; }
.map-detail-links { display: grid; grid-template-columns: 1fr; gap: 4px; }
.map-detail h3 { font-size: 11px; font-weight: normal; letter-spacing: .08em; text-transform: uppercase; margin: 12px 0; color: var(--muted); }
.map-detail ul { margin: 0 0 0 17px; font-size: 13px; }
.map-detail li + li { margin-top: 7px; }
.map-reference-list { border-top: 1px solid var(--rule); padding-top: 18px; margin-bottom: 30px; font-size: 13px; }
.map-reference-list summary { color: var(--muted); cursor: pointer; }
.map-reference-list h3 { font-size: 15px; margin: 24px 0 10px; }
@media (prefers-color-scheme: dark) {
  .post-map {
    --desk: #242722;
    --paper: #353830;
    --ink: #e3e1d3;
    --muted: #b0b0a1;
    --rule: #494e43;
    --thread: #bc9972;
    --accent: #a1c6b5;
  }
  .map-paper { border-color: #565b4c; box-shadow: 1px 3px 3px #0002, 2px 10px 13px -8px #0008; }
}
@media (max-width: 650px) {
  .post-map { width: calc(100vw - 30px); }
  .map-toolbar { flex-wrap: wrap; gap: 12px; }
  .map-find { flex: 1 0 100%; max-width: none; }
  .map-desk { height: 62vh; min-height: 420px; }
  .map-desk-note { font-size: 11px; right: 12px; }
}
@media print {
  .map-app { display: none; }
  .map-reference-list > div { display: block; }
  .post-map { width: 100%; left: auto; transform: none; }
}
/* Keep the selected article and its links within reach of the map. */
.map-detail {
  display: none;
  position: absolute;
  z-index: 3;
  right: 18px;
  top: 18px;
  width: 380px;
  max-width: calc(100% - 36px);
  max-height: 46%;
  overflow: auto;
  box-sizing: border-box;
  padding: 20px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--paper);
  box-shadow: 0 4px 25px #0002;
  cursor: auto;
  touch-action: pan-y;
}
.map-detail.has-selection { display: block; }
.map-detail h2 { font-size: 21px; padding-right: 24px; }
#map-clear {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 22px;
  border-radius: 4px;
}
.map-help { font-size: 13px; color: var(--muted); margin-bottom: 28px; }
@media (max-width: 650px) {
  .map-detail { right: 10px; top: auto; bottom: 10px; max-width: calc(100% - 20px); padding: 14px; }
  .map-detail h2 { font-size: 17px; }
}

#map-reset { border: 0; border-bottom: 1px dotted var(--muted); padding: 0; font-size: inherit; color: var(--muted); background: transparent; }
