.map-opener:not([hidden]),
.map-close {
  display: inline-flex;
  gap: 0.4em;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0 0.3em;
  background: transparent;
  border: 0;
  font: inherit;
  color: inherit;
}
.map-opener::before {
  content: "";
  width: 20px;
  height: 18px;
  background: currentColor;
  mask: url("assets/ink-fold-map.svg") center / contain no-repeat;
}
footer .map-opener {
  font: bold 13px system-ui;
}
#village-map {
  width: min(840px, 95vw);
  max-height: 92vh;
  max-height: 92dvh;
  border: 1px solid #977349;
  border-radius: 3px;
  background: #ffedc7;
  color: #223f32;
  box-shadow: 0 24px 80px #07181199;
  overscroll-behavior: contain;
}
#village-map[open] .map-fold {
  animation: map-arrive 0.26s ease-out;
}
@keyframes map-arrive {
  from {
    opacity: 0.4;
    transform: translateY(8px);
  }
}
.map-heading {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px 12px;
  background: #fff0cc;
  border-top: 5px solid #a93229;
  border-bottom: 3px double #986d45;
}
.map-heading p,
.map-postmark {
  font: 800 10px/1.3 system-ui;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.map-heading h2 {
  font:
    italic bold clamp(23px, 4vw, 38px) / 1.15 Georgia,
    serif;
}
.map-close {
  color: #853525;
  font: bold 13px system-ui;
  white-space: nowrap;
}
.map-body {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
}
.map-art {
  position: relative;
  isolation: isolate;
  aspect-ratio: 1;
  overflow: hidden;
  background: #ead9ad;
}
.map-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.map-art::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(
      90deg,
      transparent 48%,
      #29221722 49.7%,
      #fff7c977 50%,
      transparent 52%
    ),
    linear-gradient(
      0deg,
      transparent 48%,
      #191c1822 49.7%,
      #fffcdd44 50%,
      transparent 52%
    );
}
.map-art button {
  position: absolute;
  z-index: 1;
  top: 39%;
  left: 24%;
  min-height: 44px;
  min-width: 54px;
  transform: translate(-50%, -50%);
  border: 0;
  background: transparent;
  white-space: nowrap;
}
.map-art [data-stop="toys"],
.map-art [data-stop="post"] {
  left: 76%;
}
.map-art [data-stop="air"],
.map-art [data-stop="post"] {
  top: 86%;
}
.map-art button span {
  display: block;
  padding: 0.18em 0.54em;
  background: #fff7dc;
  color: #1c392d;
  border: 1px solid #314438;
  box-shadow: 2px 2px 0 #40372186;
  font:
    italic bold clamp(13px, 2.5vw, 18px) / 1.2 Georgia,
    serif;
}
.map-art button[aria-pressed="true"] span {
  background: #8f241e;
  border-color: #682319;
  color: #fff6d9;
  box-shadow: 2px 2px 0 #fff2c4;
}
.map-art button[aria-pressed="true"] span::before {
  content: "";
  display: inline-block;
  border-left: 6px solid currentColor;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  margin-right: 0.35em;
  vertical-align: 0.08em;
}
.map-ticket {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  gap: 4px;
  padding: clamp(16px, 3vw, 30px);
  border-left: 2px dashed #ad8c62;
  background: #fff1cf;
}
.map-postmark {
  color: #854031;
}
.map-ticket h3 {
  font:
    italic bold clamp(25px, 4vw, 40px) / 1.05 Georgia,
    serif;
  margin: 4px 0;
}
#stop-dispatch {
  font:
    italic 15px/1.4 Georgia,
    serif;
}
#stop-links {
  margin-top: 12px;
  border-top: 1px solid #b19b74;
}
#stop-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5em;
  min-height: 44px;
  border-bottom: 1px solid #b19b74;
  font: bold 14px/1.2 system-ui;
}
.ink-out, .ink-turn, .ink-play, #stop-links a::after {
  display: inline-block;
  width: 1em; height: 1em; flex: none; vertical-align: -.12em;
  background-color: currentColor;
  -webkit-mask: url("assets/ink-out-arrow.svg") center / contain no-repeat;
  mask: url("assets/ink-out-arrow.svg") center / contain no-repeat;
}
.ink-right { transform: rotate(45deg); }
.ink-down { transform: rotate(135deg); }
.ink-left { transform: rotate(225deg); }
.ink-turn { mask-image: url("assets/ink-turn.svg"); }
.ink-play { mask-image: url("assets/ink-play.svg"); }
#stop-links a::after {
  content: "";
  color: #8f241e;
}
@media (max-width: 600px) and (orientation: portrait) {
  .map-body {
    display: block;
  }
  .map-art {
    width: min(100%, 42dvh);
    margin: auto;
  }
  .map-ticket {
    border-left: 0;
    border-top: 2px dashed #ad8c62;
    padding: 11px 15px 15px;
  }
  .map-ticket h3 {
    font-size: 24px;
  }
  #stop-links {
    margin-top: 5px;
  }
}
@media (max-width: 420px) {
  .pressnav {
    gap: 4px;
    padding-inline: 8px;
  }
  .pressnav nav {
    gap: clamp(4px, 1.8vw, 8px);
    font-size: 12px;
  }
  .pressnav .brand {
    gap: 4px;
  }
}
@media (max-height: 500px) and (orientation: landscape) {
  #village-map .map-fold {
    display: grid; grid-template-rows: auto minmax(0, 1fr); height: min(90dvh, 415px);
  }
  #village-map .map-ticket { display: block; overflow: auto; overscroll-behavior: contain; min-height: 0; }
  .map-body {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  }
  .map-art {
    width: min(100%, calc(90dvh - 65px));
    margin: auto;
  }
  .map-heading {
    padding-block: 3px;
  }
  .map-heading h2 {
    font-size: 23px;
  }
  .map-ticket {
    padding: 8px 15px;
  }
  #stop-links {
    margin-top: 4px;
  }
}
@media (prefers-reduced-motion: reduce) {
  #village-map[open] .map-fold {
    animation: none;
  }
}

#stop-links a:has(img) { justify-content: start; text-decoration: none; }
#stop-links a:has(img)::after { margin-left: auto; }
#stop-links a img {
  width: 30px; height: 35px; flex: none; object-fit: cover; object-position: 50% 35%;
  border: 2px solid #fffaea; box-shadow: 0 1px 3px #47362755; transform: rotate(-3deg);
}
#stop-links a:nth-child(even) img { transform: rotate(3deg); }
#stop-links a:has(img):hover { text-decoration: underline; }
body:has(#quiet[aria-pressed="true"]) #village-map[open] .map-fold { animation: none; }

.atlas-roads {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
#atlas-wagon { filter: drop-shadow(1px 0 0 #ffedc9) drop-shadow(-1px -1px 0 #ffedc9) drop-shadow(0 1px 1px #503720); }
.map-art button::before {
  content: "";
  position: absolute;
  inset: -125% -6% 0;
}
#pocket-radio .pocket-map { display: none; }
@media (max-width: 700px) and (orientation: portrait) {
  .atlas-in-pocket #pocket-radio .pocket-map:not([hidden]) {
    display: inline-flex;
    border-right: 1px solid #ba9d623b;
    border-radius: 0;
  }
  .atlas-in-pocket #pocket-radio #pocket-title::before { display: none; }
}

/* Safari Page Zoom on a compact iPhone narrows the page below 240px. */
@media (max-width: 245px) {
  .pressnav { padding-inline: 3px; }
  .pressnav .nav-family { display: none; }
  .pressnav nav { min-width: 0; justify-content: space-between; flex: 1; }
}
