/* ──────────────────────────────────────────
   Sub-navigation bar (below header)
   Modern horizontal nav mirroring sidebar items
   ────────────────────────────────────────── */

.subnav {
  background: #ffffff;
}

.subnav__inner {
  max-width: 1010px;
  margin: 0 auto;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 4px;
  height: 44px;
}

/* Group of related links with optional label */
.subnav__group {
  display: flex;
  align-items: center;
  gap: 2px;
}

/* Section label (e.g., "Lediga jobb", "Mitt Jobbstöd") */
.subnav__label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #9ca3af;
  margin-right: 8px;
  white-space: nowrap;
  user-select: none;
}

/* Vertical divider between groups */
.subnav__divider {
  width: 1px;
  height: 20px;
  background: #e5e7eb;
  margin: 0 12px;
  flex-shrink: 0;
}

/* Individual nav link */
.subnav__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.835rem;
  font-weight: 500;
  color: #4b5563;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
  position: relative;
}

.subnav__link:hover {
  background: #f3f4f6;
  color: #1f2937;
}

/* Active state — subtle blue pill */
.subnav__link--active {
  background: #eff6ff;
  color: #2563eb;
  font-weight: 600;
}

.subnav__link--active:hover {
  background: #dbeafe;
  color: #1d4ed8;
}

/* Bottom indicator line for active link */
.subnav__link--active::after {
  content: '';
  position: absolute;
  bottom: -9px;
  left: 25%;
  right: 25%;
  height: 2px;
  background: #2563eb;
  border-radius: 1px;
}

/* SVG icon beside link text */
.subnav__icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ─── Adjust body top offset when subnav is present ─── */
/* The header is position:fixed. When subnav is visible (not hidden),
   we need extra top padding to clear the taller header. */

/* ─── Adjust body offset for longer header ─── */
.headerbar:has(.subnav:not(.subnav--hidden)) ~ .layout {
  padding-top: 115px;  /* 75px default + ~44px subnav */
}

/* ─── Nav links inline in header (replaces filter position) ─── */
.headerbar__nav-inline {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  min-width: 0;
  margin-left: 24px;
}

.headerbar__nav-inline .subnav__link {
  padding: 6px 14px;
}

/* ─── Subnav filters variant ─── */
.subnav--filters .subnav__inner {
  gap: 0;
  overflow: visible;
}

.subnav--filters .jfilters {
  width: auto;
  max-width: none;
}

.subnav--filters .jfilters--topbar {
  width: auto;
}

.subnav--filters {
  overflow: visible;
  z-index: 19;
  border-top: 0;
  transition: max-height 0.25s ease, opacity 0.2s ease;
  max-height: 60px;
}

/* Hidden state */
.subnav--hidden {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

/* Search toggle button — reset button defaults to match nav links */
.subnav__link--search {
  cursor: pointer;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.835rem;
  font-weight: 500;
  color: #4b5563;
  padding: 6px 14px;
  margin: 0;
  line-height: normal;
  letter-spacing: normal;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
  box-shadow: none;
}

.subnav__link--search.subnav__link--active {
  color: #2563eb;
  background: rgba(37, 99, 235, 0.08);
}

/* ─── "eller" separator ─── */
.subnav__eller {
  font-size: 12px;
  font-weight: 500;
  color: #9ca3af;
  text-transform: lowercase;
  padding: 0 10px;
  white-space: nowrap;
  user-select: none;
}

/* ─── Search box in filter bar ─── */
.subnav__searchbox {
  display: flex;
  align-items: center;
  position: relative;
  flex: 1 1 0;
  min-width: 120px;
}

/* ─── Dual search form (yrke + ort) ─── */
.subnav__dual-search {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 0;
  min-width: 0;
}

.subnav__field {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
}

.subnav__field .autocomplete-dropdown {
  min-width: 220px;
}

.subnav__search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: #9ca3af;
  pointer-events: none;
}

.subnav__search-input {
  width: 100%;
  height: 34px;
  padding: 6px 12px 6px 32px;
  font-size: 13px;
  font-weight: 400;
  color: #374151;
  background: #fff;
  border: 1.5px solid #d1d5db;
  border-radius: 6px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.subnav__search-input::placeholder {
  color: #9ca3af;
  font-weight: 400;
}

.subnav__search-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .subnav__inner {
    padding: 0 8px;
    gap: 2px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .subnav__inner::-webkit-scrollbar {
    display: none;
  }

  .subnav__label {
    display: none;
  }

  .subnav__link {
    padding: 6px 10px;
    font-size: 0.78rem;
  }

  .subnav__icon {
    width: 14px;
    height: 14px;
  }

  .subnav__divider {
    margin: 0 6px;
  }
}

@media (max-width: 480px) {
  .subnav__link {
    padding: 5px 8px;
    font-size: 0.72rem;
    gap: 4px;
  }

  .subnav__icon {
    display: none;
  }
}
