/* Hux Studio category navigation v115: primary rail + horizontal secondary index. */

.asset-results-pane {
  min-width: 0;
}

#subcategory-group.asset-subcategory-bar {
  --subcategory-line: #37373c;
  position: sticky;
  top: calc(var(--nav-height) + var(--subnav-height) + 12px);
  z-index: 24;
  display: grid;
  grid-template-columns: 138px minmax(0, 1fr);
  align-items: stretch;
  width: 100%;
  min-height: 58px;
  margin: 0 0 16px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--subcategory-line);
  background: rgb(13 13 14 / 96%);
  box-shadow: 0 4px 14px rgb(0 0 0 / 10%);
  backdrop-filter: blur(14px) saturate(110%);
  animation: asset-subcategory-reveal 180ms cubic-bezier(0.33, 1, 0.68, 1) both;
}

.asset-subcategory-heading {
  display: grid;
  align-self: stretch;
  align-content: center;
  gap: 3px;
  min-width: 0;
  padding: 10px 14px;
  border-right: 1px solid var(--subcategory-line);
  background: linear-gradient(120deg, rgb(255 77 77 / 7%), transparent 72%);
}

.asset-subcategory-heading .section-kicker {
  overflow: hidden;
  color: var(--brand, #ff4d4d);
  font-size: 8px;
  letter-spacing: 0.14em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-subcategory-heading strong {
  overflow: hidden;
  color: var(--hux-tab-text-strong, #f2f2f3);
  font-size: 13px;
  font-weight: 690;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#subcategory-pills.secondary-pills {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  width: 100%;
  min-height: 56px;
  align-items: stretch;
  gap: 0;
  padding: 0;
  overflow-x: auto;
  overflow-y: hidden;
  border: 0;
  background: transparent;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

#subcategory-pills.secondary-pills::-webkit-scrollbar {
  width: 0;
  height: 0;
}

#subcategory-pills > .secondary-pill {
  position: relative;
  display: inline-flex;
  flex: 1 1 auto;
  min-width: 76px;
  width: auto;
  min-height: 56px;
  align-items: center;
  justify-content: center;
  grid-template-columns: none;
  gap: 8px;
  padding: 0 11px;
  border: 0;
  border-right: 0;
  border-bottom: 0;
  border-radius: 0;
  background: transparent;
  color: var(--hux-tab-text, #8b8b90);
  font-size: 12px;
  font-weight: 650;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  scroll-snap-align: start;
  transition: color 140ms ease, background-color 140ms ease;
}

#subcategory-pills > .secondary-pill::before {
  position: absolute;
  right: 16px;
  bottom: 0;
  left: 16px;
  height: 2px;
  background: var(--brand, #ff4d4d);
  content: "";
  opacity: 0;
  transform: scaleX(0.35);
  transition: opacity 140ms ease, transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

#subcategory-pills > .secondary-pill::after {
  /* Separators are structural, independent of hover and selected borders. */
  display: block;
  position: absolute;
  inset: 0 0 0 auto;
  width: 1px;
  height: auto;
  background: var(--subcategory-line);
  content: "";
  opacity: 1;
  transform: none;
  pointer-events: none;
}

#subcategory-pills > .secondary-pill:last-child::after {
  display: none;
}

#subcategory-pills > .secondary-pill:hover,
#subcategory-pills > .secondary-pill:focus-visible {
  background: rgb(255 255 255 / 3%);
  color: #e6e6e8;
}

#subcategory-pills > .secondary-pill.active {
  border: 0;
  background: rgb(255 77 77 / 5%);
  color: var(--hux-tab-text-strong, #f2f2f3);
  box-shadow: none;
}

#subcategory-pills > .secondary-pill.active::before {
  opacity: 1;
  transform: scaleX(1);
}

#subcategory-pills > .secondary-pill .ui-icon {
  display: block;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  margin: 0;
  padding: 0;
  align-self: center;
  background-color: currentColor;
  mask-size: 16px 16px;
  -webkit-mask-size: 16px 16px;
  color: inherit;
  opacity: 1;
  filter: none;
  transform: none;
}

#subcategory-pills > .secondary-pill .secondary-pill-label {
  line-height: 20px;
}

#subcategory-pills > .secondary-pill.active .ui-icon {
  color: var(--brand, #ff4d4d);
}

#subcategory-pills > .secondary-pill .pill-count,
#subcategory-pills > .secondary-pill.active .pill-count {
  min-width: 1.5ch;
  padding: 0;
  background: transparent;
  color: #6f6f75;
  font-size: 11px;
  line-height: 20px;
  font-variant-numeric: tabular-nums;
}

#subcategory-pills > .secondary-pill.active .pill-count {
  color: var(--brand, #ff4d4d);
}

#subcategory-pills > .secondary-pill:disabled,
#subcategory-pills > .secondary-pill.empty,
#subcategory-pills > .secondary-pill:disabled .ui-icon,
#subcategory-pills > .secondary-pill.empty .ui-icon,
#subcategory-pills > .secondary-pill:disabled .pill-count,
#subcategory-pills > .secondary-pill.empty .pill-count {
  color: var(--hux-tab-text, #8b8b90);
  opacity: 1;
}

#subcategory-pills > .secondary-pill:disabled,
#subcategory-pills > .secondary-pill.empty {
  cursor: default;
}

/* The same single-pixel frame runs through the heading and every tab state. */
html[data-theme="light"] #subcategory-group.asset-subcategory-bar {
  --subcategory-line: #d4d4d8;
  border-color: var(--subcategory-line);
  box-shadow: 0 4px 14px rgb(24 24 27 / 5%);
}

#subcategory-group .asset-subcategory-heading {
  border-right-color: var(--subcategory-line);
}

html[data-theme="light"] #subcategory-pills > .secondary-pill:not(.active) .ui-icon,
html[data-theme="light"] #subcategory-pills > .secondary-pill:not(.active) .pill-count {
  color: #606066;
}

#assets-view .asset-results-pane .asset-grid,
#assets-view .asset-results-pane .skeleton-grid {
  margin-top: 0;
}

#category-pills > .pill .pill-copy small {
  display: none;
}

@keyframes asset-subcategory-reveal {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1020px) {
  #subcategory-group.asset-subcategory-bar {
    top: calc(var(--nav-height) + var(--subnav-height) + 8px);
    grid-template-columns: 116px minmax(0, 1fr);
  }

  #subcategory-pills > .secondary-pill {
    flex: 0 0 auto;
    min-width: max-content;
    padding-inline: 15px;
  }
}

@media (max-width: 900px) {
  #subcategory-group.asset-subcategory-bar {
    margin-top: 10px;
  }
}

@media (max-width: 720px) {
  #subcategory-group.asset-subcategory-bar {
    top: calc(var(--subnav-height) + 8px);
    grid-template-columns: minmax(0, 1fr);
    min-height: 50px;
    margin-bottom: 12px;
  }

  .asset-subcategory-heading {
    display: none;
  }

  #subcategory-pills.secondary-pills,
  #subcategory-pills > .secondary-pill {
    min-height: 50px;
  }

  #subcategory-pills > .secondary-pill {
    padding-inline: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #subcategory-group.asset-subcategory-bar {
    animation: none;
  }

  #subcategory-pills > .secondary-pill,
  #subcategory-pills > .secondary-pill::before {
    transition: none;
  }
}
