/* P11 (Joshua, 24 Nov 2026):
   1. Keep the floating pill header pinned at the top while scrolling on
      Android Chrome and iPhone Safari. overflow-x was removed from html/body
      in p8 so position:sticky is not defeated; reinforce top/z-index here.
   2. Shrink the header on small phones so Menu, Login and Apply stay fully
      inside the viewport. Desktop layout is unchanged. */

.site-header {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 200;
  flex-shrink: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.site-header .header-inner {
  width: 100%;
  max-width: min(1248px, 100%);
  min-width: 0;
  box-sizing: border-box;
}

.site-header .brand,
.site-header .nav-menu,
.site-header .header-actions,
.site-header .header-apply,
.site-header .header-login {
  min-width: 0;
}

@media (max-width: 639px) {
  .site-header {
    padding: 10px 10px 0;
  }

  .site-header .header-inner {
    min-height: 54px;
    padding: 5px 6px 5px 12px;
    gap: 6px;
  }

  .site-header .brand {
    gap: 8px;
    flex-shrink: 1;
  }

  .site-header .brand img {
    width: 30px;
    height: 30px;
  }

  .site-header .brand span {
    font-size: 18px;
  }

  .site-header .nav-menu {
    margin-left: auto;
    flex-shrink: 0;
  }

  .site-header .nav-menu summary {
    padding: 6px 10px;
    font-size: 13px;
    min-height: 34px;
  }

  .site-header .header-actions {
    margin-left: 0;
    gap: 4px;
    flex-shrink: 0;
  }

  .site-header .header-actions .btn-sm {
    min-height: 34px;
    padding: 0 10px;
    font-size: 13px;
  }

  /* Keep the homepage hero tucked under the slightly shorter floating header. */
  main > .hero:first-child {
    margin-top: -74px;
    padding-top: 122px;
  }
}

@media (max-width: 379px) {
  .site-header {
    padding: 8px 6px 0;
  }

  .site-header .header-inner {
    min-height: 50px;
    padding: 4px 5px 4px 8px;
    gap: 4px;
  }

  .site-header .brand img {
    width: 26px;
    height: 26px;
  }

  .site-header .brand span {
    font-size: 16px;
  }

  .site-header .brand .logo-r {
    font-size: 0.4em;
  }

  .site-header .nav-menu summary {
    padding: 5px 8px;
    font-size: 12.5px;
    min-height: 32px;
  }

  .site-header .header-actions .btn-sm {
    min-height: 32px;
    padding: 0 8px;
    font-size: 12.5px;
  }

  main > .hero:first-child {
    margin-top: -66px;
    padding-top: 114px;
  }
}
