/*
 * Phase 4 — Round 5
 * Legacy CSS retirement + stabilization layer
 * Narrow, final-pass corrections after legacy file removal.
 */

:root {
  --focus-ring-color: rgba(124, 139, 122, 0.24);
  --focus-ring-strong: rgba(76, 90, 82, 0.34);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px var(--focus-ring-color), 0 0 0 1px var(--focus-ring-strong);
  border-radius: 14px;
}

.home-hero__search,
.search-strip,
.hero-search,
.page-shell__panel,
.market-card,
.profile-card,
.support-card,
.region-card {
  max-width: 100%;
}

.page-shell,
.page-market-archive,
.page-profile,
.page-support,
.site-footer {
  overflow-wrap: anywhere;
}

@media (max-width: 960px) {
  .home-hero,
  .page-shell,
  .page-market-archive,
  .page-profile,
  .page-support {
    padding-inline: clamp(16px, 4vw, 24px);
  }

  .home-hero__stats,
  .home-paths,
  .market-grid,
  .profile-grid,
  .support-grid,
  .footer-columns {
    gap: 16px;
  }
}

@media (max-width: 720px) {
  .site-header__inner,
  .home-hero__body,
  .home-paths,
  .market-grid,
  .profile-grid,
  .support-grid,
  .footer-columns {
    grid-template-columns: 1fr !important;
  }

  .home-hero__actions,
  .search-strip__actions,
  .market-toolbar__actions,
  .profile-hero__actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .home-hero__actions > *,
  .search-strip__actions > *,
  .market-toolbar__actions > *,
  .profile-hero__actions > * {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}


@media (max-width: 960px) {
  .site-footer__top,
  .site-footer__nav-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .site-footer {
    padding-left: 16px;
    padding-right: 16px;
    padding-bottom: 28px;
  }

  .site-footer__inner {
    padding-top: 28px;
  }

  .site-footer__meta {
    flex-direction: column;
    align-items: flex-start;
  }
}


/* Round 5B cleanup: neutralize legacy premium remnants */
body h1,
body h2,
body h3,
body h4,
body h5,
body h6 {
  color: var(--site-text) !important;
}

.site-header {
  background: rgba(246, 242, 234, 0.82) !important;
  border-bottom: 1px solid rgba(71, 82, 74, 0.10) !important;
}

.site-header__brand,
.site-header__toggle {
  color: var(--site-text) !important;
}

.site-header__link {
  color: rgba(31, 38, 34, 0.72) !important;
}

.site-header__link:hover,
.site-header__link--active {
  color: var(--site-text) !important;
  background: rgba(255, 255, 255, 0.58) !important;
  border-color: rgba(71, 82, 74, 0.08) !important;
}

.site-footer__group h3,
.site-footer__heading,
.site-footer__legal,
.site-footer__meta-links a {
  color: var(--site-text) !important;
}

.site-footer__link,
.site-footer__copy {
  color: var(--site-muted) !important;
}
