/* Mobile experience layer — Instagram-style bottom navigation plus mobile
   readability and touch-target fixes.

   Palette (contrast-checked on the white bar, WCAG AA):
     inactive icon/label  #5A6B7A  = 5.50:1
     active icon/label    #00274D  = 15.03:1  (strongest state)
     active indicator     #FF6F31  (decorative bar — carries no text contrast)
   Active state is signalled by FOUR cues, not colour alone: filled icon,
   bold label, top indicator bar, and aria-current. */

/* ---------- Bottom navigation bar ---------- */
.pws-tabbar {
  display: none; /* desktop: hidden */
}

@media (max-width: 767px) {
  .pws-tabbar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9400;
    background: #fff;
    border-top: 1px solid #d8e2e7;
    box-shadow: 0 -4px 18px rgba(0, 39, 77, .10);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    /* Fixed height: the bar must not resize when the web font swaps in, or
       content clearance would shift after first paint. */
    height: calc(58px + env(safe-area-inset-bottom, 0px));
    box-sizing: content-box;
    align-items: stretch;
    overflow: hidden;
  }

  .pws-tabbar__item {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: 100%;
    min-height: 0;
    padding: 0 2px;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    color: #5a6b7a;
    background: transparent;
    border: 0;
    -webkit-tap-highlight-color: transparent;
    transition: color .18s ease, transform .12s ease;
  }

  /* Top indicator bar on the active tab */
  .pws-tabbar__item::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 34px;
    height: 3px;
    background: #ff6f31;
    border-radius: 0 0 3px 3px;
    transition: transform .2s ease;
  }
  .pws-tabbar__item[aria-current="page"]::before { transform: translateX(-50%) scaleX(1); }

  .pws-tabbar__icon { width: 24px; height: 24px; display: block; }
  .pws-tabbar__icon svg { width: 24px; height: 24px; display: block; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

  /* Filled variant only shows on the active tab */
  .pws-tabbar__icon--solid { display: none; }
  .pws-tabbar__item[aria-current="page"] .pws-tabbar__icon--solid { display: block; }
  .pws-tabbar__item[aria-current="page"] .pws-tabbar__icon--outline { display: none; }

  .pws-tabbar__label {
    font: 500 11px/1.15 'DM Sans', Arial, sans-serif;
    letter-spacing: .1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    display: block;
  }

  /* Keep the bar one row tall: single-line labels only. */
  .pws-tabbar__item { overflow: hidden; }

  .pws-tabbar__item[aria-current="page"] {
    color: #00274d;
    font-weight: 700;
  }
  .pws-tabbar__item[aria-current="page"] .pws-tabbar__label { font-weight: 700; }

  .pws-tabbar__item:active { transform: scale(.94); }

  .pws-tabbar__item:focus-visible {
    outline: 3px solid #4dd5b0;
    outline-offset: -3px;
  }

  /* Clearance for the fixed bar. tabbar.js sets --pws-tabbar-h to the bar's
     measured height, so a wrapping label can never hide content. */
  body { padding-bottom: calc(var(--pws-tabbar-h, 60px) + 8px + env(safe-area-inset-bottom, 0px)) !important; }

  /* Move the back-to-top control above the bar so they never overlap. */
  .pws-top {
    bottom: calc(var(--pws-tabbar-h, 60px) + 14px + env(safe-area-inset-bottom, 0px)) !important;
    right: 14px !important;
    width: 44px !important;
    height: 44px !important;
  }
}

@media (max-width: 360px) {
  .pws-tabbar__label { font-size: 10px; }
  .pws-tabbar__item { min-height: 54px; padding: 6px 1px; }
}

/* ---------- Touch-target and readability fixes ---------- */
@media (max-width: 767px) {
  /* Inline/footer links get a real tap area. */
  .elementor-widget-icon-list a,
  .elementor-icon-list-item a,
  .staffing-sections a,
  footer a {
    display: inline-block;
    min-height: 44px;
    line-height: 44px;
  }

  /* Headings and body copy sized for a phone. */
  .staffing-hero h1 { font-size: clamp(30px, 8.5vw, 42px); line-height: 1.15; }
  .staffing-hero p { font-size: 17px; line-height: 1.65; }
  .staffing-sections h2 { font-size: 23px; }
  .staffing-sections p { font-size: 16px; }

  /* Branded mobile header: navy bar, logo left, toggle right. */
  .pws-header-sticky .e-con-inner,
  .xpro-theme-builder-header-nav .e-con-inner {
    padding-top: 10px;
    padding-bottom: 10px;
    align-items: center;
  }

  /* Full-bleed sections read better with tighter side padding on a phone. */
  .staffing-hero { padding-left: 20px; padding-right: 20px; }
  .staffing-sections { padding-left: 20px; padding-right: 20px; }
}

/* Landscape phones: the bar would eat too much vertical space. */
@media (max-width: 767px) and (max-height: 460px) and (orientation: landscape) {
  .pws-tabbar__label { display: none; }
  .pws-tabbar { height: calc(46px + env(safe-area-inset-bottom, 0px)); }
}

@media (prefers-reduced-motion: reduce) {
  .pws-tabbar__item,
  .pws-tabbar__item::before { transition: none !important; }
  .pws-tabbar__item:active { transform: none; }
}

@media print {
  .pws-tabbar { display: none !important; }
  body { padding-bottom: 0 !important; }
}
