/* Brands on the SXdrv templates (content/brands.py). Linked after sxdrv.css
   only when a brand is active. Each brand sets custom properties only; the
   layout and every rule stay SXdrv's. Contrast (WCAG):
   newsfeeds24  #fff on #1d5fd1 5.8:1, #5b9cf5 on #0d1520 6.6:1, #1d5fd1 on #fff 5.8:1
   appnations   #fff on #6d28d9 7.1:1, #a78bfa on #0e0b16 7.2:1, #6d28d9 on #fff 7.1:1
   socialhubbs  #0d1f28 on #2ba4d9 6.0:1, #2ba4d9 on #0d1f28 6.0:1, #0e6a94 on #fff 6.0:1 */
html:has(body.brand-newsfeeds24),
body.brand-newsfeeds24 {
  --black: #0d1520;
  --header: #0a111a;
  --footer: #0a111a;
  --brand: #1d5fd1;
  --brand-fill: #1d5fd1;
  --brand-ink: #ffffff;
  --brand-text: #5b9cf5;
  --brand-safe: #1d5fd1;
  --focus: #5b9cf5;
  --panel: #131f2e;
  --line: #1a2636;
  --panel-line: #2a3a50;
  --placeholder: #1a2636;
  --hero-placeholder: #142030;
  --logo-ratio: 549 / 112;
}
html:has(body.brand-appnations),
body.brand-appnations {
  --black: #0e0b16;
  --header: #0a0810;
  --footer: #0a0810;
  --brand: #6d28d9;
  --brand-fill: #6d28d9;
  --brand-ink: #ffffff;
  --brand-text: #a78bfa;
  --brand-safe: #6d28d9;
  --focus: #a78bfa;
  --panel: #16121f;
  --line: #1e1929;
  --panel-line: #302840;
  --placeholder: #1e1929;
  --hero-placeholder: #18141f;
  --logo-ratio: 590 / 112;
}
html:has(body.brand-socialhubbs-feed),
body.brand-socialhubbs-feed {
  --black: #0d1f28;
  --header: #0a1820;
  --footer: #0a1820;
  --brand: #2ba4d9;
  --brand-fill: #2ba4d9;
  --brand-ink: #0d1f28;
  --brand-text: #2ba4d9;
  --brand-safe: #0e6a94;
  --focus: #f59480;
  --panel: #12293a;
  --line: #163040;
  --panel-line: #24485c;
  --placeholder: #163040;
  --hero-placeholder: #12293a;
  --logo-ratio: 603 / 112;
}

/* Phone header (brand sites only; sxdrv.com never loads this file and its
   header markup is unchanged). SXdrv lets .cats-top wrap at 40rem; brands
   have 5-6 categories, so the top list stays on one line and scrolls
   sideways inside its own scroller. The More <details> is a sibling of
   .cats-top, outside the scroller, so its panel is never clipped. */
@media (max-width: 40rem) {
  body.sxdrv[class*=" brand-"] .cats { flex-wrap: nowrap; align-items: center; }
  body.sxdrv[class*=" brand-"] .cats-top {
    flex-wrap: nowrap;
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  body.sxdrv[class*=" brand-"] .cats-top::-webkit-scrollbar { display: none; }
  body.sxdrv[class*=" brand-"] .cats-top li { flex: 0 0 auto; }
  /* Right-edge fade in the header colour; sticky so it stays at the edge.
     It keeps its own 1.25rem slot after the last link (no negative margin),
     so the list ends with trailing space as wide as the fade: scrolled fully
     right, the fade covers that space and the last link is fully readable. */
  body.sxdrv[class*=" brand-"] .cats-top::after {
    content: "";
    position: sticky;
    right: 0;
    flex: 0 0 1.25rem;
    margin-left: 0;
    background: linear-gradient(to right, transparent, var(--header));
    pointer-events: none;
  }
  body.sxdrv[class*=" brand-"] .more { flex: 0 0 auto; }
}
