/**
 * Ethos R49.9 Markets performance styles.
 *
 * These rules are intentionally limited to the Markets landing page, Alabama
 * hub, and individual market guides. They do not alter the homepage, map
 * artwork, map data, or shared card design.
 */

.ethos-page-markets .mobile-action-rail,
.ethos-page-alabama .mobile-action-rail,
.ethos-market-guide-route .mobile-action-rail {
  display: none !important;
}

.ethos-page-markets #market-explorer,
.ethos-page-markets #coverage-map,
.ethos-page-markets #california-markets,
.ethos-page-markets #alabama-markets,
.ethos-page-alabama #alabama-regions,
.ethos-page-alabama #alabama-coverage {
  scroll-margin-top: 88px;
}

@media (max-width: 782px) {
  .ethos-page-markets,
  .ethos-page-alabama,
  .ethos-market-guide-route {
    padding-bottom: 0;
  }

  .ethos-page-markets #market-explorer,
  .ethos-page-markets #coverage-map,
  .ethos-page-markets #california-markets,
  .ethos-page-markets #alabama-markets,
  .ethos-page-alabama #alabama-regions,
  .ethos-page-alabama #alabama-coverage {
    scroll-margin-top: 72px;
  }
}

.ethos-markets-map-lazy {
  position: relative;
  display: block;
  min-block-size: 1040px;
  overflow: hidden;
  background:
    radial-gradient(85% 58% at 50% 4%, rgba(255, 255, 255, 0.055), transparent 68%),
    #0a0a0c;
}

.ethos-markets-map-lazy__fallback {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  padding: 48px 20px;
  color: #f5f4f1;
  text-align: center;
  background:
    radial-gradient(70% 50% at 50% 38%, rgba(195, 160, 103, 0.08), transparent 72%),
    #0a0a0c;
}

.ethos-markets-map-lazy__fallback[hidden] {
  display: none;
}

.ethos-markets-map-lazy__fallback span {
  inline-size: 38px;
  block-size: 38px;
  border: 1px solid rgba(245, 244, 241, 0.16);
  border-top-color: #c3a067;
  border-radius: 50%;
  animation: ethos-r499-map-loader 900ms linear infinite;
}

.ethos-markets-map-lazy__fallback p {
  margin: 0;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.19em;
  text-transform: uppercase;
}

.ethos-markets-map-lazy[data-ethos-markets-map-state="error"]
  .ethos-markets-map-lazy__fallback span {
  inline-size: 48px;
  block-size: 1px;
  border: 0;
  border-radius: 0;
  background: #c3a067;
  animation: none;
}

@keyframes ethos-r499-map-loader {
  to {
    transform: rotate(1turn);
  }
}

@media (max-width: 640px) {
  .ethos-markets-map-lazy {
    min-block-size: 900px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ethos-markets-map-lazy__fallback span {
    animation: none;
  }
}

/*
 * Browser-native render deferral for long, below-fold editorial sections.
 * Hero, proof, snapshot, interactive explorer, and map surfaces are excluded.
 * `auto` lets the browser remember each section's measured size after reveal.
 */
@supports (content-visibility: auto) {
  .ethos-markets-page > .ethos-markets-directory,
  .ethos-markets-page > .ethos-markets-method,
  .ethos-markets-page > .ethos-markets-closing {
    content-visibility: auto;
    contain-intrinsic-size: auto 980px;
  }

  .ethos-alabama-hub > .ethos-alabama-regions,
  .ethos-alabama-hub > .ethos-alabama-coverage,
  .ethos-alabama-hub > .ethos-alabama-leadership,
  .ethos-alabama-hub > .ethos-alabama-relocation {
    content-visibility: auto;
    contain-intrinsic-size: auto 900px;
  }

  .ethos-market-guide > article > .ethos-market-overview,
  .ethos-market-guide > article > .ethos-market-areas,
  .ethos-market-guide > article > .ethos-market-education,
  .ethos-market-guide > article > .ethos-market-resources,
  .ethos-market-guide > article > .ethos-market-analysis,
  .ethos-market-guide > article > .ethos-market-advisors,
  .ethos-market-guide > article > .ethos-market-close {
    content-visibility: auto;
    contain-intrinsic-size: auto 760px;
  }
}
