/* Final city-page content guard: keep generated copy readable at every width. */
body.city-detail-page .city-detail-page-inner,
body.city-detail-page .city-detail-shell,
body.city-detail-page .city-detail-body,
body.city-detail-page .city-detail-grid,
body.city-detail-page .city-detail-card,
body.city-detail-page .city-detail-card p,
body.city-detail-page .city-detail-card li,
body.city-detail-page .city-detail-lead,
body.city-detail-page .city-related-card,
body.city-detail-page .budget-snapshot-card,
body.city-detail-page .budget-snapshot-stat {
  min-width: 0;
  max-height: none !important;
  overflow: visible !important;
  text-overflow: clip !important;
  -webkit-line-clamp: unset !important;
  line-clamp: unset !important;
}

body.city-detail-page .city-detail-card p,
body.city-detail-page .city-detail-card li,
body.city-detail-page .city-detail-lead,
body.city-detail-page .city-related-why,
body.city-detail-page .budget-snapshot-stat strong,
body.city-detail-page .budget-snapshot-notes {
  white-space: normal !important;
  overflow-wrap: anywhere;
  word-break: normal;
}

body.city-detail-page .city-detail-grid {
  align-items: start;
}

body.city-detail-page .city-detail-card,
body.city-detail-page .budget-snapshot-card {
  height: auto !important;
}

body.city-detail-page .city-detail-hero__content {
  min-width: 0;
}

body.city-detail-page .city-detail-name,
body.city-detail-page .city-detail-vibe,
body.city-detail-page .city-detail-lead {
  width: auto;
  max-width: 100%;
}

body.city-detail-page .budget-snapshot-grid {
  align-items: stretch;
}

body.city-detail-page .budget-snapshot-stat {
  height: auto !important;
}

/* Keep the city hero balanced and fully visible. */
body.city-detail-page .city-editorial-hero,
body.city-editorial-active .city-editorial-hero {
  min-height: 0 !important;
  height: auto !important;
  align-items: stretch !important;
  overflow: hidden !important;
}

body.city-detail-page .city-editorial-hero__copy,
body.city-editorial-active .city-editorial-hero__copy {
  min-height: 0 !important;
  height: auto !important;
  overflow: visible !important;
  justify-content: center !important;
}

body.city-detail-page .city-editorial-hero__media,
body.city-editorial-active .city-editorial-hero__media {
  min-height: 0 !important;
  height: 100% !important;
  overflow: hidden !important;
}

body.city-detail-page .city-editorial-hero__media img,
body.city-editorial-active .city-editorial-hero__media img {
  min-height: 0 !important;
  height: 100% !important;
  object-fit: cover !important;
}

body.city-detail-page .city-editorial-hero__actions,
body.city-editorial-active .city-editorial-hero__actions {
  flex-shrink: 0 !important;
}

/* Facts are one compact row on desktop, not a tall empty card. */
body.city-detail-page .city-editorial-facts,
body.city-editorial-active .city-editorial-facts {
  width: min(100% - 96px, 1240px) !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 22px auto 44px !important;
  overflow: hidden !important;
}

body.city-detail-page .city-editorial-facts__inner,
body.city-editorial-active .city-editorial-facts__inner {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
}

body.city-detail-page .city-editorial-facts .city-detail-signals,
body.city-editorial-active .city-editorial-facts .city-detail-signals {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  gap: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  background: #fff !important;
}

body.city-detail-page .city-editorial-facts .city-detail-signal,
body.city-editorial-active .city-editorial-facts .city-detail-signal {
  display: block !important;
  width: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  height: auto !important;
  margin: 0 !important;
  padding: 22px 20px !important;
  border-bottom: 0 !important;
}

body.city-detail-page .city-section,
body.city-detail-page .city-section-inner,
body.city-detail-page .city-related-card,
body.city-detail-page .rr-card {
  max-height: none !important;
  height: auto !important;
  overflow: visible !important;
}

@media (max-width: 1100px) {
  body.city-detail-page .city-editorial-hero,
  body.city-editorial-active .city-editorial-hero {
    grid-template-columns: minmax(320px, 0.82fr) minmax(0, 1.18fr) !important;
    width: calc(100% - 32px) !important;
  }

  body.city-detail-page .city-editorial-hero__copy,
  body.city-editorial-active .city-editorial-hero__copy {
    padding: 38px 34px 42px !important;
  }

  body.city-detail-page .city-editorial-facts,
  body.city-editorial-active .city-editorial-facts {
    width: calc(100% - 48px) !important;
  }
}

@media (max-width: 980px) {
  body.city-detail-page .city-editorial-hero,
  body.city-editorial-active .city-editorial-hero {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body.city-detail-page .city-editorial-hero__media,
  body.city-editorial-active .city-editorial-hero__media {
    height: auto !important;
    min-height: clamp(300px, 52vw, 440px) !important;
    aspect-ratio: 16 / 9;
  }

  body.city-detail-page .city-editorial-facts .city-detail-signals,
  body.city-editorial-active .city-editorial-facts .city-detail-signals {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body.city-detail-page .city-editorial-facts .city-detail-signal,
  body.city-editorial-active .city-editorial-facts .city-detail-signal {
    border-bottom: 1px solid rgba(28, 40, 52, 0.14) !important;
  }
}

@media (max-width: 760px) {
  body.city-detail-page .city-detail-body,
  body.city-detail-page .city-detail-hero__content {
    width: calc(100% - 28px) !important;
  }

  body.city-detail-page .city-detail-grid,
  body.city-detail-page .city-related-grid,
  body.city-detail-page .budget-snapshot-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 640px) {
  body.city-detail-page .city-editorial-hero,
  body.city-editorial-active .city-editorial-hero {
    width: calc(100% - 20px) !important;
    margin-top: 10px !important;
  }

  body.city-detail-page .city-editorial-hero__copy,
  body.city-editorial-active .city-editorial-hero__copy {
    padding: 28px 20px 32px !important;
  }

  body.city-detail-page .city-editorial-hero__media,
  body.city-editorial-active .city-editorial-hero__media {
    min-height: 240px !important;
    aspect-ratio: 4 / 3;
  }

  body.city-detail-page .city-editorial-facts,
  body.city-editorial-active .city-editorial-facts {
    width: calc(100% - 20px) !important;
    margin: 12px auto 30px !important;
  }

  body.city-detail-page .city-editorial-facts .city-detail-signals,
  body.city-editorial-active .city-editorial-facts .city-detail-signals {
    grid-template-columns: 1fr !important;
  }

  body.city-detail-page .city-editorial-facts .city-detail-signal,
  body.city-editorial-active .city-editorial-facts .city-detail-signal {
    padding: 18px !important;
    border-right: 0 !important;
  }
}