/* ==========================================================================
   /salary page styles: Tom Select skin, facility picker form, and the
   national CPC pay distribution chart. Components shared with facility
   pages (pay stats, breakdown, ladder) live in style.css instead.
   ========================================================================== */

/* Tom Select skinned to match the site's cards (light + dark) */
.ts-wrapper .ts-control {
  border: none !important;
  border-radius: var(--bs-border-radius) !important;
  padding: 10px 15px !important;
  box-shadow: 0 .125rem .25rem rgba(0, 0, 0, .075) !important;
  font-size: 1.1rem !important;
  background-color: var(--card-bg) !important;
  color: var(--text-color) !important;
}
.ts-wrapper .ts-dropdown {
  border-radius: var(--bs-border-radius) !important;
  box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15) !important;
  border: 1px solid var(--card-border) !important;
  background-color: var(--card-bg) !important;
  color: var(--text-color) !important;
}
.ts-wrapper .ts-dropdown .option {
  padding: 10px 15px;
  font-size: 1rem;
}
[data-bs-theme="dark"] .ts-wrapper .ts-control,
[data-bs-theme="dark"] .ts-wrapper .ts-dropdown {
  background-color: var(--calc-select-bg) !important;
  color: var(--calc-select-color) !important;
}
[data-bs-theme="dark"] .ts-wrapper .ts-control > input,
[data-bs-theme="dark"] .ts-wrapper .ts-control .item {
  color: var(--calc-select-color) !important;
  background-color: transparent !important;
}
[data-bs-theme="dark"] .ts-wrapper .ts-dropdown .option.active,
[data-bs-theme="dark"] .ts-wrapper .ts-dropdown .option:hover {
  background-color: rgba(255, 255, 255, 0.1) !important;
  color: #fff !important;
}
[data-bs-theme="dark"] .ts-wrapper:not(.form-control):not(.form-select).single .ts-control {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23e9ecef' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") !important;
}

/* National CPC pay distribution chart */
.sal-histo {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 170px;
}
.sal-histo .histo-col {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 100%;
  min-width: 0;
}
.sal-histo .histo-bar {
  background: var(--table-header-bg);
  border-radius: 4px 4px 0 0;
  transition: background-color 0.15s ease;
}
.sal-histo .histo-col:hover .histo-bar {
  background: var(--primary);
}
.sal-histo-labels {
  display: flex;
  gap: 4px;
  margin-top: 0.25rem;
}
.sal-histo-labels span {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
  font-size: 0.7rem;
  color: var(--bs-secondary-color);
  white-space: nowrap;
  overflow: hidden;
}

/* Busy state while a facility fragment is in flight */
#pay[aria-busy="true"],
#national-overview.loading {
  opacity: 0.45;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

/* salary.js focuses the loaded facility heading (tabindex=-1) so keyboard and
   screen-reader users land on the result. It is not an interactive control and
   can't be reached by tabbing, so hide the resulting focus ring. */
#pay h2:focus {
  outline: none;
}

/* Example facility chips under the picker */
.fac-chip {
  font-variant-numeric: tabular-nums;
}

/* Top-paying facilities list */
.top-pay-list {
  max-width: 32rem;
  padding-left: 1.5rem;
  margin-bottom: 0.5rem;
}
.top-pay-list li {
  padding: 0.2rem 0;
}
.top-pay-list .top-pay-val {
  /* float keeps the li display:list-item so the ol ranking markers render */
  float: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.top-pay-list li::after {
  /* Contain the float: when a long facility name wraps on narrow screens,
     the value would otherwise escape into the next facility's row. */
  content: "";
  display: block;
  clear: both;
}

/* Thin out histogram axis labels on narrow phones so they don't clip.
   Keep the last label so the top of the pay range always shows. */
@media (max-width: 480px) {
  .sal-histo-labels span:nth-child(even):not(:last-child) {
    visibility: hidden;
  }
  /* Survivors spill into the hidden neighbors' slots instead of clipping */
  .sal-histo-labels span {
    overflow: visible;
  }
}
