/* Razor-site stylesheet. Ported 1:1 from the React app so the look is unchanged:
   frontend/src/styles/global.css, the PublicLayout / Header / Footer CSS Modules in
   components/layout, and the StateFilter module in components/common. Hashed class names
   become plain BEM-style names (.site-header__brand etc.). Design tokens live in variables.css
   (verbatim copy). */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family-base);
  color: var(--color-text);
  background: var(--color-background);
  /* Req 6.2: most traffic is mobile - 16px is the accessible minimum that avoids
     iOS auto-zoom on input focus. */
  font-size: 16px;
  line-height: 1.5;
}

/* Laptops with 125-150% Windows display scaling report only ~1024-1366 CSS px, so the
   desktop layout looks zoomed-in and the nav wraps. Scale the whole desktop layout down a
   little (same effect as browser zoom 85-90%). Media queries use device width, so this
   doesn't change which breakpoint applies. Phones/tablets (<1024px) are untouched. */
@media (min-width: 1024px) {
  html {
    zoom: 0.85;
  }
}

@media (min-width: 1366px) {
  html {
    zoom: 0.9;
  }
}

@media (min-width: 1700px) {
  html {
    zoom: 1;
  }
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--color-primary);
}

button {
  font-family: inherit;
}

[hidden] {
  display: none !important;
}

/* ---- PublicLayout ---- */
.layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---- Header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: var(--shadow-sm);
}

.site-header__banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-md);
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--gradient-header);
}

.site-header__brand {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  text-decoration: none;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.site-header__logo {
  width: 71px;
  height: 76px;
  object-fit: contain;
  flex-shrink: 0;
}

.site-header__brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.site-header__name {
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1.15;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-header__tagline {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-header__right {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  flex-shrink: 0;
}

.site-header__state-filter {
  display: none;
}

@media (min-width: 1024px) {
  .site-header__state-filter {
    display: block;
  }
}

.site-header__menu-button {
  display: inline-flex;
  border: none;
  background: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
}

@media (min-width: 1024px) {
  .site-header__menu-button {
    display: none;
  }
}

.site-nav {
  display: none;
  align-items: center;
  gap: var(--spacing-xs);
  background: var(--color-navbar-bg);
  padding: 0 var(--spacing-md);
}

@media (min-width: 1024px) {
  .site-nav {
    display: flex;
  }
}

.site-nav__link {
  color: var(--color-navbar-text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  padding: var(--spacing-sm) 12px;
  white-space: nowrap;
}

.site-nav__link:hover {
  background: var(--color-navbar-bg-hover);
}

.site-nav__link--active,
.site-nav__link--active:hover {
  background: var(--color-navbar-active-bg);
  color: var(--color-text);
}

.mobile-nav {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  background: var(--color-background);
  border-top: 3px solid var(--color-accent);
  box-shadow: var(--shadow-md);
  padding: var(--spacing-sm);
  gap: var(--spacing-sm);
  z-index: 10;
}

.mobile-nav a {
  color: var(--color-text);
  text-decoration: none;
  padding: var(--spacing-xs);
  border-radius: var(--radius-sm);
}

.mobile-nav a:hover {
  background: var(--color-surface);
}

@media (min-width: 1024px) {
  .mobile-nav {
    display: none;
  }
}

/* ---- StateFilter (common) ---- */
.state-filter {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  margin: 0;
}

.state-filter__label {
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
  color: var(--color-text-muted);
}

.state-filter__select {
  min-width: 0;
  max-width: 170px;
  padding: var(--spacing-xs) var(--spacing-sm);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 16px;
}

.state-filter--on-dark .state-filter__label {
  color: #ffffff;
}

.state-filter--on-dark .state-filter__select {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.6);
}

.state-filter--on-dark .state-filter__select option {
  color: var(--color-text);
}

/* ---- Footer ---- */
.site-footer {
  margin-top: auto;
  padding: var(--spacing-lg) var(--spacing-md);
  background: var(--color-footer-bg);
  border-top: 3px solid var(--color-accent);
  color: var(--color-footer-text);
  font-size: 0.9rem;
  text-align: center;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-md);
}

.site-footer__links a {
  color: var(--color-footer-text);
  text-decoration: none;
  font-weight: 600;
}

.site-footer__links a:hover {
  color: var(--color-accent);
}

.site-footer__social {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-md);
}

.site-footer__join-label {
  font-weight: 600;
}

.site-footer__social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #ffffff;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, filter 0.15s ease;
}

.site-footer__social-icon:hover {
  filter: brightness(1.15);
  transform: translateY(-2px);
}

.site-footer p {
  margin: 0;
  color: var(--color-footer-text);
}
