/* ── JobsFirst responsive overrides ────────────────────────────────────────
   These styles complement per-page inline styles.
   Breakpoints: 900px (tablet), 640px (mobile)
   ──────────────────────────────────────────────────────────────────────── */

/* ── Hamburger (hidden on desktop) ── */
.jf-ham {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  margin-left: auto;
  flex-shrink: 0;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  position: relative;
  z-index: 1001;
}
.jf-ham span {
  display: block;
  width: 22px;
  height: 2px;
  background: #00415B;
  border-radius: 2px;
  transition: transform .2s, opacity .2s;
}
.jf-ham.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.jf-ham.open span:nth-child(2) { opacity: 0; }
.jf-ham.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile-only Apply link inside the drawer */
.jf-nav-cta { display: none !important; }

.jf-site-header {
  position: relative;
  z-index: 1000;
  background: #fff;
}

/* ── Tablet: ≤ 900px ── */
@media (max-width: 900px) {
  .jf-g5 { grid-template-columns: repeat(3, 1fr) !important; }
  .jf-g4 { grid-template-columns: repeat(2, 1fr) !important; }
  .jf-foot { grid-template-columns: repeat(2, 1fr) !important; }
  .jf-g2 { grid-template-columns: 1fr !important; gap: 32px !important; }
  .jf-g3, .jf-news-grid { grid-template-columns: 1fr 1fr !important; }
  .jf-h1 { font-size: 38px !important; line-height: 1.15 !important; }
  .jf-hero { gap: 28px !important; }
}

/* ── Mobile: ≤ 640px ── */
@media (max-width: 640px) {

  /* Shared horizontal padding at mobile */
  .jf-container,
  #state-header .container,
  #official-web-statement .container {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
  #state-header .col-lg-6 { flex-wrap: wrap; row-gap: 6px; }
  #state-header p.text-nowrap { white-space: normal !important; }

  @media (min-width: 992px) {
    #state-header p.text-nowrap { white-space: nowrap !important; }
  }

  /* Header */
  .jf-hdr { gap: 12px !important; }
  body.jf-nav-open .jf-site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 12px rgba(0,65,91,.12);
  }

  /* Hide desktop nav + CTA, show hamburger */
  .jf-nav {
    display: none !important;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    z-index: 999 !important;
    flex-direction: column;
    padding: 8px 0 24px;
    gap: 0;
    overflow-y: auto;
    border-top: 1px solid #AFD9ED;
    box-shadow: 0 8px 24px rgba(0,65,91,.15);
  }
  .jf-nav.open { display: flex !important; }
  .jf-nav a {
    padding: 16px 24px !important;
    border-bottom: 1px solid #E9F8FE !important;
    border-right: none !important;
    border-left: none !important;
    font-size: 16px !important;
    width: 100%;
    display: block !important;
    box-sizing: border-box !important;
  }
  .jf-nav-cta {
    display: block !important;
    margin: 20px 24px 0 !important;
    width: calc(100% - 48px) !important;
    background: #109BE0 !important;
    color: #fff !important;
    border-radius: 6px !important;
    border-bottom: none !important;
    padding: 14px 18px !important;
    font: 600 15px 'Poppins', sans-serif !important;
    text-align: center !important;
  }
  .jf-cta { display: none !important; }
  .jf-ham { display: flex !important; }

  /* Section inner padding */
  .jf-pad {
    padding-left: 16px !important;
    padding-right: 16px !important;
    padding-top: 40px !important;
    padding-bottom: 40px !important;
  }

  /* Hero */
  .jf-hero {
    flex-direction: column !important;
    gap: 20px !important;
    align-items: flex-start !important;
  }
  .jf-hero-logo { margin-top: 0 !important; }
  .jf-hero-logo img { height: 64px !important; }
  .jf-h1 { font-size: 28px !important; line-height: 1.2 !important; }
  .jf-h2 { font-size: 24px !important; line-height: 1.25 !important; }
  .jf-hp { font-size: 16px !important; line-height: 1.55 !important; }
  .jf-quote { font-size: 16px !important; }
  .jf-stat-card { padding: 16px !important; }
  .jf-stat-num { font-size: 32px !important; }
  .jf-hbtns { flex-direction: column !important; }
  .jf-hbtns > a, .jf-hbtns > button {
    width: 100% !important;
    justify-content: center !important;
    box-sizing: border-box !important;
  }

  /* Stats bar: 5-col → 2-col */
  .jf-stats {
    grid-template-columns: repeat(2, 1fr) !important;
    border-radius: 0 !important;
  }
  .jf-stats > div { border-left: none !important; }
  .jf-stats > div:nth-child(2) { border-left: 1px solid rgba(175,217,237,.32) !important; }
  .jf-stats > div:nth-child(n+3) { border-top: 1px solid rgba(175,217,237,.32); }
  .jf-stats > div:nth-child(4) { border-left: 1px solid rgba(175,217,237,.32) !important; }

  /* Grid collapses */
  .jf-g4, .jf-g3, .jf-g2 { grid-template-columns: 1fr !important; }
  .jf-g5 { grid-template-columns: repeat(2, 1fr) !important; }

  /* Keep 2-col for small stat cards (120 days, 60 days, etc.) */
  .jf-g2s { grid-template-columns: repeat(2, 1fr) !important; }

  /* Dashboard stat counters: stack on mobile */
  .jf-stat-grid { grid-template-columns: 1fr !important; }

  /* Dashboard category bars: fix overflow label */
  .jf-bar-label { font-size: 12px !important; width: 110px !important; }

  /* News grid */
  .jf-news-grid { grid-template-columns: 1fr !important; }

  /* Single article layout */
  .jf-article {
    padding: 32px 16px 40px !important;
    border-right: none !important;
  }
  .jf-article-aside {
    padding: 24px 16px 40px !important;
  }
  .jf-breadcrumb {
    font-size: 13px !important;
  }

  /* Filter tabs bar */
  .jf-filter-bar { padding: 14px 16px !important; }

  /* Tables: horizontal scroll */
  .jf-tbl-wrap { overflow-x: auto !important; -webkit-overflow-scrolling: touch; }
  .jf-tbl-inner { min-width: 560px; }

  /* Dashboard project table: horizontal scroll */
  .jf-dash-tbl { overflow-x: auto !important; -webkit-overflow-scrolling: touch; }
  .jf-dash-tbl__inner { min-width: 640px; }

  /* Footer */
  .jf-foot { grid-template-columns: 1fr !important; gap: 24px !important; }

  /* Leaflet map height on mobile */
  #jf-map { height: 300px !important; }
}

/* ── Project phase progress bar (modal) ── */
.jf-phase-bar {
  display: flex;
  gap: 0;
  width: 100%;
  overflow-x: auto;
  padding: 2px 0 10px;
  -webkit-overflow-scrolling: touch;
}
.jf-phase-seg {
  flex: 1 1 0;
  min-width: 72px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px 12px 18px;
  min-height: 44px;
  background: #D8EEF8;
  color: #595959;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%, 10px 50%);
}
.jf-phase-seg + .jf-phase-seg {
  margin-left: -9px;
}
.jf-phase-seg:first-child {
  padding-left: 12px;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%);
  border-radius: 5px 0 0 5px;
}
.jf-phase-seg:last-child {
  padding-right: 12px;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 10px 50%);
  border-radius: 0 5px 5px 0;
}
.jf-phase-seg:nth-child(1) { z-index: 1; }
.jf-phase-seg:nth-child(2) { z-index: 2; }
.jf-phase-seg:nth-child(3) { z-index: 3; }
.jf-phase-seg:nth-child(4) { z-index: 4; }
.jf-phase-seg:nth-child(5) { z-index: 5; }
.jf-phase-seg:nth-child(6) { z-index: 6; }
.jf-phase-seg__label {
  display: block;
  font: 600 9px/1.25 'Poppins', sans-serif;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-align: center;
  word-break: break-word;
}
.jf-phase-seg--done {
  background: #00415B;
  color: #fff;
}
.jf-phase-seg--current {
  background: #109BE0;
  color: #fff;
}
.jf-phase-seg--upcoming {
  background: #D8EEF8;
  color: #595959;
}

@media (max-width: 640px) {
  .jf-phase-seg {
    min-width: 84px;
    padding-top: 10px;
    padding-bottom: 10px;
  }
  .jf-phase-seg__label {
    font-size: 8px;
  }
}
