/* =============================================================================
   Coalition Phase 1a Mobile Header CSS
   File: assets/css/mobile.css

   Purpose:
   - Mobile-specific repair for the validated Phase 1 text/font header.
   - Keeps desktop header rules out of the mobile cascade.
   - Prevents vertical word wrapping and Login/Register overlap on phone widths.

   Load:
   <link rel="stylesheet" href="/assets/css/mobile.css" media="(max-width: 900px)">
   ============================================================================= */

@media (max-width: 900px) {
  html,
  body {
    overflow-x: hidden;
  }

  .site-header,
  header.site-header,
  .coalition-header,
  .global-header {
    box-sizing: border-box !important;
    position: relative !important;
    display: grid !important;
    grid-template-columns: 56px minmax(0, 1fr) minmax(78px, auto) !important;
    grid-template-areas: "mobile-nav mobile-wordmark mobile-auth" !important;
    align-items: center !important;
    justify-items: stretch !important;
    gap: 8px !important;
    width: 100% !important;
    min-height: 78px !important;
    height: auto !important;
    padding: 10px 10px !important;
    overflow: hidden !important;
    text-align: initial !important;
  }

  .mobile-nav-trigger,
  .mobile-menu-toggle,
  .hamburger,
  .nav-toggle {
    grid-area: mobile-nav !important;
    position: static !important;
    inset: auto !important;
    transform: none !important;
    justify-self: start !important;
    align-self: center !important;
    width: 50px !important;
    height: 50px !important;
    min-width: 50px !important;
    min-height: 50px !important;
    margin: 0 !important;
    z-index: 5 !important;
  }

  .observatory,
  .header-coordinates,
  .header-motto,
  .site-title-creed,
  .header-creed,
  .desktop-creed {
    display: none !important;
  }

  .site-title,
  .site-title.site-title-text-wordmark,
  .coalition-header-center,
  .header-brand,
  .brand-wordmark {
    grid-area: mobile-wordmark !important;
    box-sizing: border-box !important;
    position: static !important;
    inset: auto !important;
    transform: none !important;
    min-width: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    justify-self: stretch !important;
    align-self: center !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 2px !important;
    overflow: hidden !important;
    text-align: center !important;
    white-space: nowrap !important;
  }

  .site-title-wordmark,
  .coalition-header-wordmark,
  .brand-wordmark-text {
    display: block !important;
    box-sizing: border-box !important;
    max-width: 100% !important;
    width: 100% !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    word-break: keep-all !important;
    overflow-wrap: normal !important;
    text-overflow: clip !important;
    font-size: clamp(18px, 5vw, 26px) !important;
    line-height: 1 !important;
    letter-spacing: clamp(.065em, 1.1vw, .14em) !important;
  }

  .site-title-wordmark *,
  .coalition-header-wordmark *,
  .brand-wordmark-text * {
    white-space: nowrap !important;
    word-break: keep-all !important;
    overflow-wrap: normal !important;
  }

  .coalition-a {
    display: inline-block !important;
    white-space: nowrap !important;
    letter-spacing: 0 !important;
    margin-inline: -.035em !important;
    transform: translateY(.035em) scale(1.02) !important;
  }

  .site-title-subtitle,
  .coalition-header-subtitle,
  .brand-subtitle {
    display: block !important;
    max-width: 100% !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    word-break: keep-all !important;
    overflow-wrap: normal !important;
    text-overflow: clip !important;
    font-size: clamp(5px, 1.35vw, 7px) !important;
    line-height: 1.05 !important;
    letter-spacing: clamp(.035em, .45vw, .09em) !important;
  }

  .header-right,
  .auth-links,
  .auth-mini-links,
  .account-mini-menu,
  .user-mini-menu,
  .header-account {
    grid-area: mobile-auth !important;
    box-sizing: border-box !important;
    position: static !important;
    inset: auto !important;
    transform: none !important;
    justify-self: end !important;
    align-self: center !important;
    max-width: 98px !important;
    min-width: 0 !important;
    margin: 0 !important;
    z-index: 5 !important;
  }

  .auth-mini-links,
  .auth-links {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: center !important;
    gap: 5px !important;
    white-space: nowrap !important;
  }

  .auth-mini-links a,
  .auth-links a,
  .login-link,
  .register-link {
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 98px !important;
    min-height: 24px !important;
    height: 24px !important;
    padding: 3px 7px !important;
    font-size: 8px !important;
    line-height: 1 !important;
    letter-spacing: .075em !important;
    white-space: nowrap !important;
  }
}

@media (max-width: 430px) {
  .site-header,
  header.site-header,
  .coalition-header,
  .global-header {
    grid-template-columns: 52px minmax(0, 1fr) 82px !important;
    gap: 6px !important;
    min-height: 72px !important;
    padding: 8px 8px !important;
  }

  .mobile-nav-trigger,
  .mobile-menu-toggle,
  .hamburger,
  .nav-toggle {
    width: 46px !important;
    height: 46px !important;
    min-width: 46px !important;
    min-height: 46px !important;
  }

  .site-title-wordmark,
  .coalition-header-wordmark,
  .brand-wordmark-text {
    font-size: clamp(16px, 4.55vw, 21px) !important;
    letter-spacing: clamp(.04em, .85vw, .095em) !important;
  }

  .site-title-subtitle,
  .coalition-header-subtitle,
  .brand-subtitle {
    display: none !important;
  }

  .header-right,
  .auth-links,
  .auth-mini-links,
  .account-mini-menu,
  .user-mini-menu,
  .header-account {
    max-width: 82px !important;
  }

  .auth-mini-links a,
  .auth-links a,
  .login-link,
  .register-link {
    max-width: 82px !important;
    min-height: 22px !important;
    height: 22px !important;
    padding: 3px 5px !important;
    font-size: 7px !important;
    letter-spacing: .055em !important;
  }
}

@media (max-width: 360px) {
  .site-header,
  header.site-header,
  .coalition-header,
  .global-header {
    grid-template-columns: 48px minmax(0, 1fr) 72px !important;
    gap: 5px !important;
  }

  .mobile-nav-trigger,
  .mobile-menu-toggle,
  .hamburger,
  .nav-toggle {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    min-height: 42px !important;
  }

  .site-title-wordmark,
  .coalition-header-wordmark,
  .brand-wordmark-text {
    font-size: 15px !important;
    letter-spacing: .035em !important;
  }

  .header-right,
  .auth-links,
  .auth-mini-links,
  .account-mini-menu,
  .user-mini-menu,
  .header-account {
    max-width: 72px !important;
  }

  .auth-mini-links a,
  .auth-links a,
  .login-link,
  .register-link {
    max-width: 72px !important;
    font-size: 6.5px !important;
    padding-inline: 4px !important;
  }
}
