/* About panel: a quiet link at the top right opens a text panel that slides in over the map. */
:root { --accent: #b3721a; }

.about-link {
  position: fixed;
  top: 18px;
  right: 24px;
  z-index: 9;
  padding: 8px 0 6px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: var(--ui-weight);
  letter-spacing: var(--ui-tracking);
  text-transform: uppercase;
  color: var(--ink-faint);
  text-shadow: 0 0 4px var(--ground), 0 0 9px var(--ground);
  transition: color 0.2s ease;
}
.about-link:hover,
.about-link:focus-visible,
.about-link[aria-expanded="true"] { color: var(--accent); }
.about-link:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; }

.about {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 8;
  width: min(460px, 100%);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--ground);
  border-left: 1px solid var(--line);
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 0.32s cubic-bezier(0.2, 0.7, 0.2, 1), visibility 0s 0.32s;
}
.about.open { transform: none; visibility: visible; transition-delay: 0s; }
.about:focus { outline: none; }

.about-wrap { padding: 62px 40px 72px; }
.about-wrap > * { max-width: 560px; }

.about-eyebrow {
  margin: 0 0 18px;
  font-family: var(--font-label);
  font-weight: var(--label-weight);
  font-size: 13px;
  line-height: 1;
  letter-spacing: var(--kicker-tracking);
  text-transform: uppercase;
  color: var(--ink-faint);
}
.about-wrap h2 {
  margin: 0 0 30px;
  font-family: var(--font-display);
  font-weight: var(--head-weight);
  font-size: 30px;
  line-height: 1.06;
  letter-spacing: var(--head-tracking);
  color: var(--ink);
}
.about-label {
  margin: 34px 0 10px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: var(--ui-weight);
  line-height: 1.5;
  letter-spacing: var(--label-tracking);
  text-transform: uppercase;
  color: var(--ink-faint);
}
.about-wrap p {
  margin: 0 0 15px;
  font-size: var(--about-size);
  line-height: 1.72;
  color: var(--ink-soft);
  text-wrap: pretty;
}

/* Column legend (js/maplegend.js): a canvas with the district, labels placed over it by transform. Fixed size, never scaled. */
.dl { position: relative; flex: none; }
.dl-canvas { position: absolute; left: 0; top: 0; display: block; }
.dl-fig, .dl-city { position: absolute; left: 0; top: 0; white-space: nowrap; line-height: 18px; font-size: 14px; color: var(--ink-soft); }
.dl-fig { font-family: var(--font-num); font-weight: var(--num-weight); font-variant-numeric: var(--num-variant); font-feature-settings: var(--num-feature); }
.dl-city { font-family: var(--font-ui); color: var(--ink); }
.about .legend-sub { margin-top: 0; }
.about #about-legend { margin: 0 0 12px; }
.about-wrap .legend-note { margin-bottom: 18px; }

/* Map legend, bottom right of the map on desktop; the subheading moves down to the top of the drawing (transform only) */
.maplegend {
  position: absolute;
  right: 28px;
  bottom: 6px;
  z-index: 2;
  pointer-events: none;
  text-shadow: 0 0 2px var(--ground), 0 0 2px var(--ground), 0 0 4px var(--ground), 0 0 8px var(--ground), 0 0 14px var(--ground);
  contain: layout;
}
.maplegend[hidden] { display: none; }
.maplegend .ml-sub {
  position: absolute;
  left: 0;
  top: 0;
  margin: 0;
  white-space: nowrap;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: var(--ui-weight);
  line-height: 1.5;
  letter-spacing: var(--label-tracking);
  text-transform: uppercase;
  color: var(--ink-soft);
}
.maplegend .ml-note { margin-left: 6px; text-transform: none; letter-spacing: 0.02em; font-family: var(--font-num); font-variant-numeric: var(--num-variant); font-feature-settings: var(--num-feature); }
.maplegend .dl-fig, .maplegend .dl-city { font-size: 13px; }
body:has(#maplegend:not([hidden])) #detail { right: 300px; }
@media (max-width: 860px) { .maplegend { display: none; } }

.about .sources { margin: 0; }
.about .src { margin: 0 0 20px; }
.about .src dt {
  margin: 0 0 3px;
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--ink);
}
.about .src dd {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--ink-soft);
}
.about .src .lic {
  display: block;
  margin-top: 4px;
  font-family: var(--font-label);
  font-weight: var(--meta-weight);
  font-size: 13px;
  line-height: 1.6;
  letter-spacing: var(--meta-tracking);
  color: var(--ink-faint);
}
.about a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}
.about a:hover,
.about a:focus-visible { color: var(--accent); text-decoration-color: currentColor; }
.about-wrap .about-credit {
  margin: 38px 0 0;
  font-family: var(--font-label);
  font-weight: var(--meta-weight);
  font-size: 13px;
  line-height: 1.6;
  letter-spacing: var(--meta-tracking);
  color: var(--ink-faint);
}

@media (max-width: 860px) {
  .about { width: 100%; border-left: 0; }
  .about-wrap { padding: 56px 20px 56px; }
  .about-link { top: 12px; right: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .about { transition-duration: 0.01ms; }
}

/* Keep the Globe / Country switch clear of the open panel */
@media (min-width: 861px) {
  #views { transition: transform 0.32s cubic-bezier(0.2, 0.7, 0.2, 1); }
  body:has(#about.open) #views { transform: translateX(calc(-50% - 230px)); }
}

/* The one claim About must make loudly: what a city is here */
.about-wrap .about-say {
  margin: 0 0 18px;
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 22px;
  line-height: 1.32;
  letter-spacing: -0.005em;
  color: var(--ink);
  text-wrap: balance;
}
.about-label:focus { outline: none; }

/* Readout note under the population line: opens About at "What a city is"; a settlement cluster keeps its own note instead */
.ro1-def, .mro-def { margin: 4px 0 0 !important; font-size: 15px; line-height: 1.35; }
.city-def {
  pointer-events: auto;
  color: var(--ink-soft);
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}
.city-def:hover, .city-def:focus-visible { color: var(--accent); text-decoration-color: currentColor; }
.city-def:focus-visible { outline: 1px solid var(--ink); outline-offset: 2px; }
#readout[data-cluster="1"] .ro1-def, #readout[data-cluster="1"] .mro-def { display: none; }
html.m-on .mro-def { flex-basis: 100%; }
