/* =========================================================
   COMPACT MOBILE PILL BAR (≤920px) — wrap, no scroll
   ========================================================= */
@media (max-width: 920px){
  /* Stack header: logo row, then nav row */
  .site-header .container{
    display: grid;
    grid-template-areas:
      "logo"
      "nav";
    grid-template-columns: 1fr;
    row-gap: 8px;
    align-items: center;
  }

  /* Hide header logo on mobile (optional: remove if you want it) */
  .logo{ display: none; }

  /* Nav container: no horizontal scrolling */
  .main-nav{
    grid-area: nav;
    justify-self: stretch;
    max-width: 100%;
    min-width: 0;         /* allow shrinking inside grid */
    overflow: visible;    /* <- no scroll */
  }

  /* Pill row: wrap instead of scroll */
  .main-nav ul{
    display: flex;
    flex-wrap: wrap;                  /* <- wrap to next line */
    justify-content: center;
    gap: 8px 10px;                    /* row x column gap */
    margin: 0;
    padding: 8px 10px;
    list-style: none;

    width: 100%;                      /* <- fill container; no max-content */
    background: var(--teal-200);
    border-radius: 9999px;
    box-shadow: var(--shadow);
  }

  /* Don’t hide scrollbars anymore */
  /* .main-nav::-webkit-scrollbar{ display:none; }
     .main-nav{ scrollbar-width: none; } */

  .main-nav li{ flex: 0 1 auto; }     /* allow wrapping */
  .main-nav a{
    font-weight: 700;
    font-size: 14px;
    line-height: 1;
    padding: 8px 12px;
    border-radius: 9999px;
    text-decoration: none;
    color: #0f2e2e;
    white-space: nowrap;
  }
  .main-nav a.is-active{
    background: #fff;
    color: #123;
    box-shadow: none;
  }
}


/* =========================
   Header shell & logo
   ========================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid rgba(0,0,0,.06);
}

.site-header .container{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 16px;
  padding-block: 14px;
}

.logo img{
  display:block;
  height: 36px;
  width:auto;
}

/* =========================
   Navigation (base)
   ========================= */
.nav-toggle{ display:none; }

.main-nav{
  flex: 0 0 auto;
  z-index: 90;
}

/* base pill row (desktop-friendly defaults) */
.main-nav ul{
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin: 0;
  padding: 6px 12px;
  list-style: none;

  background-color: var(--teal-200);
  border-radius: var(--radius-pill);
  box-shadow: 0 1px 0 rgba(0,0,0,.04) inset;

  width: auto;
  max-width: max-content;
}

.main-nav li{ display: inline-flex; }

.main-nav a{
  display:inline-block;
  text-decoration:none;
  font-weight:600;
  line-height:1;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  color: var(--teal-900);
  background: transparent;
  transition: background .15s ease, box-shadow .15s ease, transform .15s ease;
}
.main-nav a:hover{
  background: rgba(255,255,255,.9);
  transform: translateY(-1px);
}

/* Active pill */
.main-nav a.is-active{
  background: #fff;
  color: #123;
  box-shadow: var(--shadow);
}

/* a11y */
.main-nav li a:focus-visible {
  outline: 2px solid #4a8483;
  outline-offset: 2px;
}

/* =========================
   Desktop refinements (≥920px)
   ========================= */
@media (min-width: 920px){
  .logo img{ height: 40px; }

  .main-nav{
    position: static;
    display: block;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    transform: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .main-nav ul{
    display: flex;
    align-items: center;
    gap: 2rem;
    margin: 0;
    padding: 0.5rem 1.25rem;
    background-color: #a7d3d1;            /* your desktop capsule color */
    border-radius: var(--radius-pill);
    box-shadow: none;
  }

  .main-nav li a{
    padding: 10px 12px;
    background: transparent;
    color: #0b2a28;
  }
  .main-nav li a:hover{ color:#004d4d; }

  /* optional underline effect without layout shift */
  .main-nav li a.active{
    border-bottom: none;
    box-shadow: inset 0 -2px 0 #4a8483;
  }
}

/* =========================
   Brand bits (kept from your file)
   ========================= */
.header-inner{ display: flex; align-items: center; gap: 12px; }
.brand{ text-decoration: none; display: flex; flex-direction: column; gap: 2px; }
.logo-text{ font-weight: 800; font-size: 22px; color: var(--teal-900); letter-spacing: .5px; line-height: 1.1; }
.tagline{ font-size: 12px; color: #5c6; opacity: .85; margin-top: -2px; }
.pill{ text-decoration: none; padding: 8px 14px; border-radius: var(--radius-pill); color: var(--teal-900); background: transparent; transition: background .15s ease; }
.pill:hover{ background: var(--teal-200); }
@media (min-width: 920px){
  .header-inner{ gap: 16px; }
  .logo-text{ font-size: 28px; }
  .pill{ padding: 10px 16px; }
}

/* Prevent background scroll if you ever toggle body.nav-open in JS */
body.nav-open { overflow: hidden; }

/* =========================================================
   COMPACT MOBILE PILL BAR (≤920px)
   ========================================================= */
@media (max-width: 920px){
  /* Stack header: logo on its own row, then nav */
  .site-header .container{
    display: grid;
    grid-template-areas:
      "logo"
      "nav";
    grid-template-columns: 1fr;
    row-gap: 8px;
    align-items: center;
  }

  /* Hide header logo on mobile (hero shows another logo) */
  .logo{ display: none; }  /* <-- remove this line if you want it visible */

  /* Let nav shrink and be the scroller to avoid clipping */
  .main-nav{
    grid-area: nav;
    justify-self: stretch;
    max-width: 100%;
    min-width: 0;                 /* critical: allow shrink inside grid */
    overflow-x: auto;             /* swipe to scroll if pills overflow */
    -webkit-overflow-scrolling: touch;
  }

  /* Make the pill row content-sized so it can scroll horizontally */
  .main-nav ul{
    display: inline-flex;
    gap: 10px;
    margin: 0;
    padding: 8px;
    list-style: none;

    width: max-content;           /* content width => scrollable */
    background: var(--teal-200);  /* keep the teal capsule on mobile */
    border-radius: 9999px;
    box-shadow: var(--shadow);
  }

  /* Hide scrollbar without clipping */
  .main-nav::-webkit-scrollbar{ display:none; }
  .main-nav{ scrollbar-width: none; }

  .main-nav li{ flex: 0 0 auto; }
  .main-nav a{
    font-weight: 700;
    font-size: 13px;
    line-height: 1;
    padding: 10px 14px;
    border-radius: 9999px;
    text-decoration: none;
    color: #0f2e2e;
    white-space: nowrap;
  }
  .main-nav a.is-active{
    background: #fff;
    color: #123;
    box-shadow: none;             /* flatter on mobile */
  }
}
