.atlas {
  margin-bottom: clamp(3rem, 8vw, 6.4rem);
  padding: clamp(0.9rem, 3vw, 2.2rem);
  border: 1px solid #9faea7;
  background: #e8ece3;
  scroll-margin-top: 1rem;
}

.atlas-heading {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  align-items: end;
  gap: 0.8rem 2rem;
  margin-bottom: 1.35rem;
}

.atlas-heading h2 {
  color: var(--blue);
  font-size: clamp(2.05rem, 4.7vw, 4.3rem);
  font-weight: 780;
  line-height: 0.95;
  letter-spacing: -0.07em;
  text-wrap: balance;
}

.atlas-heading h2:focus {
  outline: none;
}

.atlas-heading p {
  max-width: 40ch;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1rem, 1.45vw, 1.16rem);
  line-height: 1.48;
}

.atlas-controls:not([hidden]) {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.atlas-day-0 { --day-ink: #2543ae; }
.atlas-day-1 { --day-ink: #a63c2a; }
.atlas-day-2 { --day-ink: #4f692e; }
.atlas-day-3 { --day-ink: #7f3972; }
.atlas-day-4 { --day-ink: #126f6a; }
.atlas-day-5 { --day-ink: #8d5816; }

.atlas-controls button {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  min-height: 2.4rem;
  padding: 0.32rem 0.75rem;
  border: 1px solid #a2afa6;
  border-radius: 0;
  background: #f4f4e9;
  color: var(--ink);
  font: inherit;
  font-size: 0.81rem;
  font-weight: 710;
  cursor: pointer;
}

.atlas-controls button[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: white;
}

.atlas-controls button:not([aria-pressed="true"]):hover {
  background: var(--lime);
}

.atlas-controls button span,
.atlas-key-pin {
  display: inline-block;
  flex-shrink: 0;
  width: 0.66rem;
  height: 0.66rem;
  border-radius: 50%;
  background: var(--day-ink, var(--blue));
}

.atlas-controls button[aria-pressed="true"] span {
  border: 1px solid #fff8e8;
}

.atlas-plates {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(0.65rem, 1.42vw, 1.05rem);
}

.atlas-plate {
  overflow: hidden;
  border: 1px solid #a5b1a1;
  background: #f3f1e3;
}

.atlas-plate figcaption {
  display: block;
  padding: 0.63rem 0.8rem;
  border-bottom: 1px solid #a5b1a1;
  font-size: 0.78rem;
  font-weight: 760;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.atlas-graphic {
  display: block;
  width: 100%;
  height: auto;
  background: #d2e0df;
}

.map-water,
.map-water-shape {
  fill: #d2e0df;
}

.map-water-shape {
  stroke: #aabfb8;
  stroke-width: 0.65;
}

.map-land {
  fill: #f4f1e4;
  fill-rule: evenodd;
  stroke: #a6ac97;
  stroke-width: 0.72;
}

.map-land-context {
  fill: #eaeade;
}

.map-mesh {
  fill: none;
  stroke: #849a91;
  stroke-dasharray: 1.1 2.6;
  stroke-width: 0.5;
  opacity: 0.48;
  pointer-events: none;
}

.map-park {
  fill: #c8d5b0;
  stroke: #9cab83;
  stroke-width: 0.7;
}

.map-bridge {
  fill: none;
  stroke: #8d9f99;
  stroke-width: 1.1;
}

.map-district-label,
.map-park-label,
.map-water-label,
.map-place-label {
  paint-order: stroke fill;
  stroke-linejoin: round;
  pointer-events: none;
}

.map-district-label {
  fill: #536458;
  stroke: #f1efe1;
  stroke-width: 2.2;
  font-size: 9.2px;
  font-weight: 720;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.map-park-label {
  fill: #475e43;
  stroke: #cfdbba;
  stroke-width: 2.2;
  font-size: 9.6px;
  font-weight: 710;
}

.map-water-label {
  fill: #4d6a70;
  stroke: #d2e0df;
  stroke-width: 2.5;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13px;
  font-style: italic;
  letter-spacing: 1px;
}

.map-walk {
  fill: none;
  stroke: var(--day-ink);
  stroke-width: 2.55;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 4 3.2;
  pointer-events: none;
}

.map-place {
  cursor: pointer;
  outline: none;
}

.map-place-label {
  fill: #172722;
  stroke: #f5f3e7;
  stroke-width: 2.65;
  font-size: 11.4px;
  font-weight: 710;
}

.map-leader {
  fill: none;
  stroke: var(--day-ink);
  stroke-width: 1.05;
}

.map-hit {
  fill: transparent;
}

.map-pin-halo {
  fill: #f9f7e9;
}

.map-pin {
  fill: var(--day-ink);
}

.map-place:hover .map-pin-halo,
.map-place:focus-visible .map-pin-halo {
  fill: var(--lime);
  stroke: #25362e;
  stroke-width: 1.1;
}

.map-place:hover .map-place-label,
.map-place:focus-visible .map-place-label {
  fill: var(--blue);
  text-decoration: underline;
}

.map-filtered-out {
  display: none;
}

.map-compass,
.map-scale {
  fill: #304b44;
  font-size: 9.5px;
  font-weight: 750;
}

.compass-half {
  fill: #f5f2e8;
}

.map-scale path {
  fill: none;
  stroke: #304b44;
  stroke-width: 1.2;
}

.atlas-two-plates {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.toronto-atlas .map-water,
.toronto-atlas .sea-inlet {
  fill: #cddce1;
}

.vancouver-atlas .map-water,
.vancouver-atlas .sea-inlet {
  fill: #c8dfe4;
}

.vancouver-atlas .atlas-day-0 { --day-ink: #a13f27; }
.vancouver-atlas .atlas-day-1 { --day-ink: #245990; }

.sea-city-block,
.sea-street {
  fill: none;
  stroke: #c7c9b3;
  stroke-width: 0.7;
}

.sea-street {
  stroke: #aaa991;
  stroke-width: 1.1;
}

.sea-inlet {
  fill: #d2e0df;
  stroke: #9cafa8;
  stroke-width: 0.9;
}

.atlas-key {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.55rem 1.6rem;
  padding-top: 0.83rem;
  color: var(--muted);
  font-size: 0.77rem;
  line-height: 1.45;
}

.atlas-key ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.15rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.atlas-key li {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.atlas-key-line {
  display: inline-block;
  width: 1.2rem;
  border-block-start: 2px dashed var(--blue);
}

@media (max-width: 53rem) {
  .atlas-heading {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 62rem) {
  .vancouver-atlas .atlas-plates {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 45rem) {
  .atlas-plates,
  .vancouver-atlas .atlas-plates {
    grid-template-columns: 1fr;
  }
}
