/* DHV Experience 13.78.20 — Contextual Tabs Convergence
 * Home, Category and Tag/Taxonomy share one low-chrome navigation grammar.
 * Presentation only: existing public routes and archive queries remain authoritative. */

.dhvx-context-tabs {
  position: relative;
  z-index: 15;
  min-width: 0;
  min-height: 52px;
  display: flex;
  align-items: stretch;
  gap: 16px;
  padding: 0 22px;
  border-bottom: 1px solid color-mix(in srgb,var(--dhvx-border) 82%,transparent);
  background: color-mix(in srgb,var(--dhvx-surface) 97%,var(--dhvx-canvas));
}

.dhvx-context-tabs__primary {
  flex: 0 0 auto;
  min-width: 0;
  display: flex;
  align-items: stretch;
  gap: 22px;
}

.dhvx-context-tabs__tab {
  position: relative;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 1px;
  color: var(--dhvx-text-secondary);
  font-size: 13.25px;
  line-height: 1;
  font-weight: 650;
  letter-spacing: -.008em;
  text-decoration: none;
  white-space: nowrap;
}

.dhvx-context-tabs__tab:hover {
  color: var(--dhvx-text);
}

.dhvx-context-tabs__tab:focus-visible {
  outline: 2px solid color-mix(in srgb,var(--dhvx-brand) 45%,transparent);
  outline-offset: -4px;
  border-radius: 4px;
}

.dhvx-context-tabs__tab.is-active {
  color: var(--dhvx-text);
  font-weight: 760;
}

.dhvx-context-tabs__tab.is-active::after {
  content: "";
  position: absolute;
  inset: auto 0 -1px;
  height: 2px;
  border-radius: 999px 999px 0 0;
  background: var(--dhvx-brand);
}

.dhvx-context-tabs__divider {
  width: 1px;
  height: 22px;
  flex: 0 0 1px;
  align-self: center;
  background: color-mix(in srgb,var(--dhvx-border) 86%,transparent);
}

.dhvx-context-tabs__viewport {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg,#000 0,#000 calc(100% - 28px),transparent 100%);
  mask-image: linear-gradient(90deg,#000 0,#000 calc(100% - 28px),transparent 100%);
}

.dhvx-context-tabs__track {
  min-width: 0;
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 3px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-right: 30px;
}
.dhvx-context-tabs__track::-webkit-scrollbar { display: none; }

/* Category identity survives, but the old pill/card treatment does not. */
.dhvx-context-tabs .dhvx-category-link.is-chip {
  min-height: 40px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 7px 0 5px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--dhvx-text-secondary);
  font-size: 12.25px;
  line-height: 1;
  font-weight: 630;
}

.dhvx-context-tabs .dhvx-category-link.is-chip .dhvx-category-link__icon {
  width: 25px;
  height: 25px;
  flex-basis: 25px;
  border-radius: 8px;
  background: color-mix(in srgb,var(--dhvx-category) 9%,transparent);
}

.dhvx-context-tabs .dhvx-category-link.is-chip:hover,
.dhvx-context-tabs .dhvx-category-link.is-chip:focus-visible {
  border-color: transparent;
  background: color-mix(in srgb,var(--dhvx-category) 6%,transparent);
  color: var(--dhvx-category);
}

.dhvx-context-tabs .dhvx-category-link.is-chip:focus-visible {
  outline: 2px solid color-mix(in srgb,var(--dhvx-category) 36%,transparent);
  outline-offset: -2px;
}

/* Home keeps the existing sticky mode switch behavior, now as part of the
 * same contextual navigation row that also exposes the category journey. */
.dhvx-app[data-dhv-experience="feed"] .dhvx-context-tabs {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb,var(--dhvx-surface) 94%,transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
body.admin-bar .dhvx-app[data-dhv-experience="feed"] .dhvx-context-tabs { top: 32px; }

/* Listing surfaces stay in normal document flow: the heading and Feed remain
 * the dominant content rather than turning taxonomy navigation into chrome. */
.dhvx-site-app.is-listing .dhvx-context-tabs {
  width: 100%;
  position: relative;
  top: auto;
  z-index: 1;
}

/* Explicit tablet state: preserve readable labels and a useful category lane
 * instead of shrinking the desktop row. */
@media (min-width:768px) and (max-width:1119px) {
  .dhvx-context-tabs {
    min-height: 50px;
    gap: 13px;
    padding-inline: 18px;
  }
  .dhvx-context-tabs__primary { gap: 18px; }
  .dhvx-context-tabs__tab { min-height: 50px; font-size: 13px; }
  .dhvx-context-tabs__divider { height: 20px; }
  .dhvx-context-tabs__track { min-height: 50px; gap: 2px; padding-right: 26px; }
  .dhvx-context-tabs .dhvx-category-link.is-chip {
    min-height: 39px;
    padding-inline: 4px 6px;
    font-size: 11.9px;
  }
  .dhvx-context-tabs .dhvx-category-link.is-chip .dhvx-category-link__icon {
    width: 24px;
    height: 24px;
    flex-basis: 24px;
  }
}

/* Mobile is a platform navigation lane, not a desktop tab bar compressed to
 * phone width. The two primary choices stay visible; categories scroll. */
@media (max-width:767px) {
  .dhvx-context-tabs {
    min-height: 46px;
    gap: 11px;
    padding-inline: 14px;
  }
  .dhvx-context-tabs__primary { gap: 15px; }
  .dhvx-context-tabs__tab {
    min-height: 46px;
    font-size: 12.75px;
    font-weight: 660;
  }
  .dhvx-context-tabs__tab.is-active { font-weight: 760; }
  .dhvx-context-tabs__divider { height: 18px; }
  .dhvx-context-tabs__viewport {
    margin-right: -14px;
    -webkit-mask-image: linear-gradient(90deg,#000 0,#000 calc(100% - 36px),transparent 100%);
    mask-image: linear-gradient(90deg,#000 0,#000 calc(100% - 36px),transparent 100%);
  }
  .dhvx-context-tabs__track {
    min-height: 46px;
    gap: 1px;
    padding-right: 34px;
  }
  .dhvx-context-tabs .dhvx-category-link.is-chip {
    min-height: 40px;
    padding: 0 5px 0 4px;
    font-size: 11.65px;
  }
  .dhvx-context-tabs .dhvx-category-link.is-chip .dhvx-category-link__icon {
    width: 24px;
    height: 24px;
    flex-basis: 24px;
    border-radius: 7px;
  }
  .dhvx-app[data-dhv-experience="feed"] .dhvx-context-tabs {
    display: none;
    position: relative;
    top: auto;
  }
}

@media (max-width:359px) {
  .dhvx-context-tabs { gap: 8px; padding-inline: 12px; }
  .dhvx-context-tabs__primary { gap: 12px; }
  .dhvx-context-tabs__tab { font-size: 12.25px; }
  .dhvx-context-tabs__divider { height: 16px; }
  .dhvx-context-tabs__viewport { margin-right: -12px; }
  .dhvx-context-tabs .dhvx-category-link.is-chip { font-size: 11.25px; }
}

html[data-theme="dark"] .dhvx-context-tabs {
  background: color-mix(in srgb,var(--dhvx-surface) 94%,var(--dhvx-canvas));
  border-bottom-color: color-mix(in srgb,var(--dhvx-border) 78%,transparent);
}
html[data-theme="dark"] .dhvx-app[data-dhv-experience="feed"] .dhvx-context-tabs {
  background: color-mix(in srgb,var(--dhvx-surface) 93%,transparent);
}

@media (prefers-reduced-motion:reduce) {
  .dhvx-context-tabs *,
  .dhvx-context-tabs *::before,
  .dhvx-context-tabs *::after { scroll-behavior:auto!important; transition:none!important; }
}

@media (forced-colors:active) {
  .dhvx-context-tabs { border-bottom:1px solid CanvasText; background:Canvas; }
  .dhvx-context-tabs__divider { background:CanvasText; }
  .dhvx-context-tabs__tab.is-active::after { background:Highlight; forced-color-adjust:none; }
  .dhvx-context-tabs .dhvx-category-link.is-chip { color:CanvasText; }
  .dhvx-context-tabs .dhvx-category-link.is-chip:focus-visible,
  .dhvx-context-tabs__tab:focus-visible { outline:2px solid Highlight; }
}
