/* ============================================================
   Site-wide tab strip — the full-width bar directly below the
   header on every page (SPA, /hs-codes/, profile, blog, legal).
   Markup:
     <nav class="site-tabs" aria-label="Tools">
       <div class="site-tabs-inner">
         <a class="site-tab [active]" href="/..." data-tab="...">
           <svg/>
           <span class="site-tab-full">…</span>
           <span class="site-tab-short">…</span>
         </a>
   Colours come from each page's theme variables, with fallbacks
   for pages that only define a subset.
   ============================================================ */

.site-tabs {
  position: sticky;
  top: 0;
  z-index: 90;
  background: var(--bg-secondary, #111827);
  border-bottom: 1px solid var(--border-color, #2d3a52);
  backdrop-filter: saturate(140%) blur(6px);
}

.site-tabs-inner {
  display: flex;
  align-items: stretch;
  gap: 0.25rem;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
}

.site-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 48px;
  padding: 0.7rem 1rem;
  color: var(--text-secondary, #94a3b8);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.site-tab:hover {
  color: var(--text-primary, #f1f5f9);
  background: var(--bg-hover, rgba(255, 255, 255, 0.04));
}

.site-tab:focus-visible {
  outline: 2px solid var(--accent-blue, #4f7cff);
  outline-offset: -2px;
  border-radius: 6px;
}

.site-tab.active {
  color: var(--text-primary, #f1f5f9);
  border-bottom-color: var(--accent-blue, #4f7cff);
  background: linear-gradient(180deg, transparent 0%, rgba(79, 124, 255, 0.10) 100%);
}

.site-tab svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.site-tab.active svg {
  color: var(--accent-blue, #4f7cff);
}

.site-tab-short { display: none; }
.site-tab-full { display: inline; }

/* Below ~1100px the six full labels no longer fit on one row. */
@media (max-width: 1100px) {
  .site-tabs-inner { padding: 0 1rem; gap: 0.1rem; }
  .site-tab { padding: 0.7rem 0.7rem; font-size: 0.88rem; }
  .site-tab-full { display: none; }
  .site-tab-short { display: inline; }
}

/* The CusDec Creator is desktop-only (see .vdf-mobile-warning). */
@media (max-width: 900px) {
  .site-tab--desktop { display: none !important; }
}

/* Phones: icon stacked over a small label; tabs share the row so the
   strip never scrolls horizontally. */
@media (max-width: 700px) {
  .site-tabs-inner { padding: 0 0.25rem; gap: 0; }
  .site-tab {
    flex: 1 1 0;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
    gap: 0.2rem;
    min-height: 56px;
    padding: 0.45rem 0.15rem 0.4rem;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.01em;
  }
  .site-tab svg { width: 20px; height: 20px; }
  .site-tab-short {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* Header refinements shared by every page that uses the strip. */
.header .nav-link.nav-link-blog {
  display: inline-flex;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.28rem 0.8rem;
  background: var(--bg-card, #1a2235);
}

/* Pages with their own sticky header keep the strip in normal flow. */
.site-tabs.site-tabs--static { position: relative; z-index: auto; }
