/* ==========================================================================
   Sub-header — category tab strip (Resources page)
   Figma: node 15563:11933 (Desktop) — sits flush under the site header,
   no dedicated Mobile Figma frame for this component.
   ========================================================================== */
.sub-header {
  background-color: #4d0077;
  width: 100%;
}

.sub-header__container {
  max-width: var(--container-max-width);
  margin-inline: auto;
  padding-inline: var(--container-padding-inline);
}

.sub-header__tabs {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.sub-header__tabs::-webkit-scrollbar {
  display: none;
}

.sub-header__item {
  flex: 0 0 auto;
}

.sub-header__tab {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 13px 20px;
  border-radius: 6px;
  font-family: var(--font-base);
  font-size: 15px;
  font-weight: 400;
  color: var(--color-text-light);
  white-space: nowrap;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.sub-header__tab:hover,
.sub-header__tab:focus-visible {
  background-color: rgba(255, 255, 255, 0.08);
}

.sub-header__tab.is-active {
  background-color: #7500c0;
}

.sub-header__tab.is-active:hover,
.sub-header__tab.is-active:focus-visible {
  background-color: #7500c0;
}

.sub-header__tag {
  font-size: 13px;
  color: #c99ee9;
}

/* ==========================================================================
   Tablet — same right-aligned composition, tighter spacing
   ========================================================================== */
@media (min-width: 768px) and (max-width: 1023px) {
  .sub-header__tabs {
    justify-content: flex-start;
    gap: 4px;
  }

  .sub-header__tab {
    padding: 12px 16px;
    font-size: 14px;
  }
}

/* ==========================================================================
   Mobile — horizontally scrollable tab strip, left-aligned
   ========================================================================== */
@media (max-width: 767px) {
  .sub-header__tabs {
    justify-content: flex-start;
    gap: 4px;
    -webkit-mask-image: linear-gradient(to right, black calc(100% - 28px), transparent);
    mask-image: linear-gradient(to right, black calc(100% - 28px), transparent);
  }

  .sub-header__tab {
    padding: 11px 14px;
    font-size: clamp(13px, 3.6vw, 14px);
  }

  .sub-header__tag {
    font-size: 12px;
  }
}

@media (max-width: 479px) {
  .sub-header__tab {
    padding: 10px 12px;
  }
}

/* ==========================================================================
   Touch-guard + reduced-motion
   ========================================================================== */
@media (hover: none) and (pointer: coarse) {
  .sub-header__tab:hover {
    background-color: transparent;
  }

  .sub-header__tab.is-active:hover {
    background-color: #7500c0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sub-header__tab {
    transition: none !important;
  }
}
