/* ============================================================================
   chartnav.css — FarsiChart 4-chart switcher, per-page identity, unified band.
   Loaded AFTER chart.css so its band rules override the old per-page gradients.
   Scheme B: Top Artists=blue, Top Songs=teal, Trending=amber, New Releases=pink.
   Light colors (teal, amber) get DARK on-text for 4.5:1 contrast.
   ============================================================================ */

/* ── Per-page color tokens (set via body.page-*) ────────────────────────────
   --pa      page accent (chip text, hovers)
   --pa-on   text ON a solid --pa fill (white for dark hues, dark for light hues)
   --pa-fill solid fill for the active segment
   --pa-tint translucent tint (chip bg, soft accents)
   --pa-band the very-dark band color painted below the nav                    */
body.page-artists  { --pa:#22c55e; --pa-on:#04210f; --pa-fill:#22c55e; --pa-tint:rgba(34,197,94,.14);  --pa-band:#0c2016; } /* home = subtle brand green (calmer than the 3 charts) */
body.page-songs    { --pa:#14b8a6; --pa-on:#05312c; --pa-fill:#2dd4bf; --pa-tint:rgba(20,184,166,.15);  --pa-band:#06211e; }
body.page-trending { --pa:#f59e0b; --pa-on:#3a2702; --pa-fill:#fbbf24; --pa-tint:rgba(245,158,11,.16);  --pa-band:#201704; }
body.page-new      { --pa:#ec4899; --pa-on:#ffffff; --pa-fill:#db2777; --pa-tint:rgba(236,72,153,.15);  --pa-band:#260b19; }

/* ── Unified color BAND ─────────────────────────────────────────────────────
   Painted on the BODY so it sits BEHIND everything — including the ad banner —
   and starts the instant the 56px nav ends. Banner-independent: with no banner
   the H1 just shifts up; the band is unchanged. Fade widened (56→1120px) so
   there's ~2x more colour than before. Same mechanism on all 4 pages.          */
body.page-artists, body.page-songs, body.page-trending, body.page-new {
  background: linear-gradient(180deg, #0a0a0a 0, #0a0a0a 56px, var(--pa-band) 56px, #0a0a0a 1120px) no-repeat;
  background-color: #0a0a0a;
}
@media (max-width: 768px) { /* header is 56px tall on mobile too */
  body.page-artists, body.page-songs, body.page-trending, body.page-new {
    background: linear-gradient(180deg, #0a0a0a 0, #0a0a0a 56px, var(--pa-band) 56px, #0a0a0a 820px) no-repeat;
    background-color: #0a0a0a;
  }
}
/* Heroes stay transparent so the body band shows through */
body.page-artists .hero, body.page-songs .hero, body.page-new .hero,
body.page-trending .tr-hero { background: transparent !important; }

/* ── THE PERMANENT BANNER-INDEPENDENCE FIX ──────────────────────────────────
   The colour band lives on <body> and starts at the nav bottom (above). The
   ONLY thing that ever made it look like it "starts below the ad banner" is the
   ad/reserve element painting an OPAQUE bar over it. There are two engines and
   they ship that opaque bar via an inline <style> (so a normal rule loses):
     • home + CLS reserve → <div class="fc-banner-slot" id="fc-banner-mount">
       with  .fc-banner-slot{background:var(--bg-secondary,#111)}
     • music (monetize)   → .fc-ad-band{background:#111}  (scoped #slot.fc-ad-band)
   Force every one transparent so the band shows through behind/around the banner
   on EVERY chart page, for ANY slot id, from either engine. !important beats the
   inline <style> regardless of its specificity or source order — this is why the
   band now begins the instant the nav ends, banner present or not, forever. */
body.page-artists  .fc-banner-slot, body.page-artists  #fc-banner-mount, body.page-artists  .fc-ad-band,
body.page-songs    .fc-banner-slot, body.page-songs    #fc-banner-mount, body.page-songs    .fc-ad-band,
body.page-trending .fc-banner-slot, body.page-trending #fc-banner-mount, body.page-trending .fc-ad-band,
body.page-new      .fc-banner-slot, body.page-new      #fc-banner-mount, body.page-new      .fc-ad-band {
  background: transparent !important;
}
/* The brief loading shimmer that sits inside the reserve must not punch an
   opaque grey hole in the band either — keep it transparent on chart pages. */
body.page-artists  .fc-banner-rsv, body.page-songs .fc-banner-rsv,
body.page-trending .fc-banner-rsv, body.page-new   .fc-banner-rsv { background: transparent !important; }

/* ── Consistent chip→top gap, banner ON or OFF ──────────────────────────────
   The ad reserve otherwise collapses the hero's top padding (banner.js injects
   .fc-banner-slot+.hero{padding-top:0}; monetize injects .fc-ad-band+.hero{...0})
   AND adds its own 16px bottom padding — so the gap above the page chip differs
   with the banner on vs off. Force the hero's top padding back to the page value
   (28px desktop / 20px mobile) and drop the slot's bottom padding, so the chip sits
   the SAME distance below the nav (banner off) or below the banner (banner on),
   identical on every chart page. (.hero base + .tr-head carry the banner-off value.) */
body.page-artists .fc-banner-slot + .hero, body.page-songs .fc-banner-slot + .hero, body.page-new .fc-banner-slot + .hero,
body.page-artists .fc-ad-band     + .hero, body.page-songs .fc-ad-band     + .hero, body.page-new .fc-ad-band     + .hero {
  padding-top: 28px !important;
}
body.page-artists .fc-banner-slot, body.page-songs .fc-banner-slot,
body.page-trending .fc-banner-slot, body.page-new .fc-banner-slot { padding-bottom: 0 !important; }
@media (max-width: 768px) {
  body.page-artists .fc-banner-slot + .hero, body.page-songs .fc-banner-slot + .hero, body.page-new .fc-banner-slot + .hero,
  body.page-artists .fc-ad-band     + .hero, body.page-songs .fc-ad-band     + .hero, body.page-new .fc-ad-band     + .hero {
    padding-top: 20px !important;
  }
}

/* ── The 4-chart switcher pill ──────────────────────────────────────────────
   Two instances share these styles: one lives in the desktop header (centered),
   one is a full-width sticky bar on mobile. Each shows the right one per width. */
.fc-cnav { display: inline-flex; background: #141414; border: 1px solid #262626;
  border-radius: 999px; padding: 3px; gap: 1px; position: relative; }
.fc-cseg { display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 15px; border-radius: 999px; font-family: var(--font); font-size: .82rem;
  font-weight: 600; color: var(--text-muted, #8a8a8a); white-space: nowrap; line-height: 1.2;
  text-decoration: none; min-height: 36px; box-sizing: border-box;
  transition: color .16s ease, background-color .16s ease; }
.fc-cseg i, .fc-cseg .fc-cico { font-size: 1rem; flex-shrink: 0; }
.fc-cseg:hover { color: var(--text-secondary, #c9c9c9); }
/* Active segment = filled in THAT chart's own color (each seg carries its color) */
.fc-cseg.is-artists.active  { background:#22c55e; color:#04210f; }
.fc-cseg.is-songs.active    { background:#2dd4bf; color:#05312c; }
.fc-cseg.is-trending.active { background:#fbbf24; color:#3a2702; }
.fc-cseg.is-new.active      { background:#db2777; color:#fff; }
.fc-cseg.active { font-weight: 700; }
.fc-cseg:focus-visible { outline: 2px solid var(--pa, #3b82f6); outline-offset: 2px; }
/* When no segment is active (artist/hub/info pages): each button gets its own
   chart colour at very low opacity — readable, professional, clearly clickable. */
.fc-cnav:not(:has(.fc-cseg.active)) .fc-cseg.is-artists {
  background: rgba(34,197,94,.07);  box-shadow: inset 0 0 0 1px rgba(34,197,94,.22);  color: rgba(34,197,94,.78); }
.fc-cnav:not(:has(.fc-cseg.active)) .fc-cseg.is-songs {
  background: rgba(20,184,166,.07); box-shadow: inset 0 0 0 1px rgba(20,184,166,.22); color: rgba(20,184,166,.78); }
.fc-cnav:not(:has(.fc-cseg.active)) .fc-cseg.is-trending {
  background: rgba(245,158,11,.07); box-shadow: inset 0 0 0 1px rgba(245,158,11,.22); color: rgba(245,158,11,.78); }
.fc-cnav:not(:has(.fc-cseg.active)) .fc-cseg.is-new {
  background: rgba(236,72,153,.07); box-shadow: inset 0 0 0 1px rgba(236,72,153,.22); color: rgba(236,72,153,.78); }
.fc-cnav:not(:has(.fc-cseg.active)) .fc-cseg.is-artists:hover  { background: rgba(34,197,94,.13);  box-shadow: inset 0 0 0 1px rgba(34,197,94,.38);  color: rgba(34,197,94,.95); }
.fc-cnav:not(:has(.fc-cseg.active)) .fc-cseg.is-songs:hover    { background: rgba(20,184,166,.13); box-shadow: inset 0 0 0 1px rgba(20,184,166,.38); color: rgba(20,184,166,.95); }
.fc-cnav:not(:has(.fc-cseg.active)) .fc-cseg.is-trending:hover { background: rgba(245,158,11,.13); box-shadow: inset 0 0 0 1px rgba(245,158,11,.38); color: rgba(245,158,11,.95); }
.fc-cnav:not(:has(.fc-cseg.active)) .fc-cseg.is-new:hover      { background: rgba(236,72,153,.13); box-shadow: inset 0 0 0 1px rgba(236,72,153,.38); color: rgba(236,72,153,.95); }

/* Desktop instance: sits in the header center, hidden on mobile */
.fc-cnav-desktop { display: inline-flex; }
@media (max-width: 768px) { .fc-cnav-desktop { display: none; } }

/* Mobile instance: a full-width sticky bar directly under the header */
.fc-cnav-mobile { display: none; }
@media (max-width: 768px) {
  .fc-cnav-mobile {
    display: flex; position: sticky; top: 0; z-index: 90;
    background: rgba(18,20,25,.97); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(255,255,255,.07); padding: 6px 10px;
    padding-left: max(10px, env(safe-area-inset-left)); padding-right: max(10px, env(safe-area-inset-right));
  }
  .fc-cnav-mobile .fc-cnav { display: flex; width: 100%; }
  .fc-cnav-mobile .fc-cseg { flex: 1; padding: 9px 4px; font-size: .74rem; gap: 4px; min-width: 0; }
  .fc-cnav-mobile .fc-cseg i, .fc-cnav-mobile .fc-cseg .fc-cico { font-size: .95rem; }
  /* overflow:visible + roomy line-height so the descender of "Songs"/"Trending"
     (the g) is never clipped by the flex item's box. Labels always fit the
     quarter-width segments, so no ellipsis is needed. */
  .fc-cnav-mobile .fc-cseg .fc-clabel { overflow: visible; line-height: 1.2; }
}
/* very small phones: drop the icons so 4 labels never crowd/wrap */
@media (max-width: 360px) {
  .fc-cnav-mobile .fc-cseg i, .fc-cnav-mobile .fc-cseg .fc-cico { display: none; }
  .fc-cnav-mobile .fc-cseg { font-size: .72rem; }
}

/* ── Per-page identity CHIP (above the H1; visual only, not the SEO H1) ──── */
.fc-chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 14px;
  border-radius: 999px; background: var(--pa-tint); border: 1px solid var(--pa);
  color: var(--pa); font-family: var(--font); font-size: .78rem; font-weight: 700;
  letter-spacing: .02em; line-height: 1; margin: 0 auto 12px; }
.fc-chip i { font-size: .95rem; }
@media (max-width: 480px) { .fc-chip { font-size: .72rem; padding: 4px 12px; } }

/* Desktop Newsletter button (moved out of the old text nav into header-actions) */
.fc-nl-desktop { display: inline-flex; }
@media (max-width: 768px) { .fc-nl-desktop { display: none; } }
/* Center the desktop pill between logo and actions */
.header-inner > .fc-cnav-desktop { margin: 0 auto; }
