/* Local SVG district map; all rules are confined to its section and component. */
.district-comparison {
  padding: 64px 60px;
  background: var(--sand);
  color: var(--deep-grey);
  scroll-margin-top: calc(var(--site-header-height, 110px) + 24px);
}

.district-comparison .district-comparison-inner {
  max-width: 1380px;
  margin: 0 auto;
  min-width: 0;
}

.district-comparison .district-comparison-heading {
  max-width: 760px;
  margin-bottom: 36px;
  overflow-wrap: anywhere;
}

.district-comparison .district-comparison-heading h2 {
  font-family: 'Museo Sans', 'Roboto', sans-serif;
  font-size: var(--fs-xl);
  font-weight: 500;
  line-height: 1.25;
  margin: 0 0 16px;
}

.district-comparison .district-comparison-heading p {
  margin: 0;
  font-size: var(--fs-base);
  line-height: 1.7;
}

.district-comparison .district-comparison-heading em,
.district-explorer .district-cta-box em {
  color: var(--orange);
  font-style: normal;
  font-weight: inherit;
}

.district-explorer {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 40px;
  color: var(--deep-grey);
  overflow-wrap: anywhere;
}

.district-explorer > * {
  min-width: 0;
}

.district-explorer .district-map-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 20px;
  margin-bottom: 20px;
  font-size: var(--fs-sm);
  line-height: 1.5;
}

.district-explorer .district-map-header > :first-child {
  font-weight: 700;
}

.district-explorer .district-map svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 590px;
  overflow: visible;
}

.district-explorer .district-map path[role='button'] {
  cursor: pointer;
  /* The separate contour handles keyboard focus as well as selection. */
  outline: none;
  transition: fill 0.15s ease;
}

.district-explorer .district-map path[role='button']:not([aria-pressed='true']):hover {
  fill: var(--deep-grey);
}

.district-explorer .district-focus-outline {
  visibility: hidden;
  stroke: var(--orange);
}

.district-explorer .district-map svg:has([role='button']:focus-visible) .district-focus-outline {
  visibility: visible;
}

.district-explorer .map-credit {
  margin: 12px 0 0;
  font-size: var(--fs-xs);
  line-height: 1.6;
}

.district-explorer .map-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  margin-top: 20px;
  padding: 0;
  border: 0;
  font-size: var(--fs-xs);
  line-height: 1.5;
  color: var(--deep-grey);
}

.district-explorer .map-legend span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.district-explorer .map-legend i {
  display: inline-block;
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
}

.district-explorer .district-info {
  padding: 32px;
  border: 1px solid var(--light-grey);
  border-radius: 6px;
  background: var(--white);
}

.district-explorer .district-info > label {
  display: block;
  margin-bottom: 8px;
  font-size: var(--fs-sm);
  font-weight: 700;
}

.district-explorer .district-info select {
  appearance: none;
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 44px;
  padding: 10px 44px 10px 12px;
  border: 1px solid var(--deep-grey);
  border-radius: 4px;
  background: var(--white);
  background-image:
    linear-gradient(45deg, transparent 50%, var(--deep-grey) 50%),
    linear-gradient(135deg, var(--deep-grey) 50%, transparent 50%);
  background-position: right 22px center, right 16px center;
  background-size: 6px 6px;
  background-repeat: no-repeat;
  color: var(--deep-grey);
  font: inherit;
  font-size: var(--fs-base);
}

.district-explorer .district-info [aria-live] {
  margin-top: 28px;
}

.district-explorer .district-info h3 {
  margin: 0 0 10px;
  font-family: 'Museo Sans', 'Roboto', sans-serif;
  font-size: var(--fs-2xl);
  font-weight: 500;
  line-height: 1.25;
}

.district-explorer .district-info p {
  margin: 0 0 16px;
  font-size: var(--fs-base);
  line-height: 1.7;
}

.district-explorer .district-prices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin: 20px 0;
  padding: 20px 0;
  border-block: 1px solid var(--light-grey);
}

.district-explorer .district-prices strong {
  display: block;
  font-size: clamp(1.2rem, 2vw, 1.7rem);
  font-weight: 700;
  line-height: 1.4;
}

.district-explorer .district-prices span {
  display: block;
  font-size: var(--fs-xs);
  line-height: 1.5;
}

.district-explorer .district-insight {
  padding: 20px;
  border-left: 3px solid var(--orange);
  background: var(--sand);
}

.district-explorer .district-info .field-hint {
  font-size: var(--fs-sm);
}

.district-explorer .district-cta-box {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--light-grey);
}

.district-explorer .district-cta-box h4 {
  margin: 0 0 12px;
  font-family: 'Museo Sans', 'Roboto', sans-serif;
  font-size: var(--fs-lg);
  font-weight: 500;
  line-height: 1.4;
}

.district-explorer .district-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  min-height: 48px;
  margin-top: 4px;
  padding: 13px 22px;
  border: 1px solid var(--deep-grey);
  border-radius: 4px;
  background: var(--deep-grey);
  color: var(--white);
  font-size: var(--fs-sm);
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
}

.district-explorer .district-cta:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.district-explorer .district-table {
  grid-column: 1 / -1;
  min-width: 0;
  padding-top: 20px;
  border-top: 1px solid var(--light-grey);
  scroll-margin-top: calc(var(--site-header-height, 110px) + 24px);
}

.district-explorer .district-table-hint {
  display: none;
}

@media (max-width: 600px) {
  .district-explorer .district-table-hint {
    display: block;
    margin: 8px 0;
    font-size: var(--fs-sm);
  }
}

.district-explorer .district-table summary {
  min-height: 44px;
  padding: 10px 0;
  font-size: var(--fs-base);
  font-weight: 700;
  line-height: 1.5;
  cursor: pointer;
}

.district-explorer .table-scroll {
  max-width: 100%;
  overflow-x: auto;
}

.district-explorer table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: var(--fs-sm);
  line-height: 1.6;
}

.district-explorer th,
.district-explorer td {
  padding: 12px;
  border-bottom: 1px solid var(--light-grey);
  text-align: left;
  vertical-align: top;
}

.district-explorer th {
  font-weight: 700;
}

.district-explorer th[scope='row'] {
  white-space: nowrap;
}

.district-explorer caption {
  padding: 16px 0;
  text-align: left;
  font-size: var(--fs-sm);
}

.district-explorer :is(select, summary, a, .table-scroll):focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 4px;
}

@media (max-width: 1024px) {
  .district-comparison {
    padding: 48px 40px;
  }

  .district-explorer {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }

  .district-explorer .district-map svg {
    max-height: 500px;
  }
}

@media (max-width: 768px) {
  .district-comparison {
    padding: 40px 24px;
  }

  .district-explorer .district-info {
    padding: 24px 20px;
  }

  .district-explorer .district-map svg {
    max-height: 410px;
  }

  .district-explorer .map-legend {
    gap: 8px 14px;
  }

  .district-explorer th,
  .district-explorer td {
    padding: 12px 8px;
  }
}

@media (max-width: 480px) {
  .district-explorer .district-prices {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .district-explorer .district-map path[role='button'] {
    transition: none;
  }
}
