/* =============================================================================
 * Site-wide header polish.
 *
 * Applied on every non-single-gallery page: home, channel pages, tag
 * archives, discover, search, about, etc. Single video pages are excluded
 * server-side via is_singular('gallery') in render().
 *
 * Changes:
 *   - Backdrop blur so content scrolls past with a frosted-glass effect
 *   - Thin hairline border at the bottom
 *   - Vertically-centered nav/logo via flex (the original theme uses
 *     absolute-positioning inside block display, which breaks when extra
 *     items like a "Submit music video" button render)
 *   - Nav link hover goes neon-green
 *   - Gains opacity on scroll for legibility once hero is out of view
 *
 * On channel pages (body.tax-gallery-categories), the header is rendered on
 * top of the hero backdrop — no black bar — for an editorial, Netflix-style
 * effect.
 * ============================================================================= */
.main-header {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.35) 100%) !important;
    backdrop-filter: blur(14px) saturate(1.2);
    -webkit-backdrop-filter: blur(14px) saturate(1.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    transition: background 0.3s ease, border-color 0.3s ease;
    /* Force flex layout so all children align regardless of absolute-position
     * tweaks in the original theme CSS. Critical for keeping the Submit button
     * (when it renders) from resizing the bar. */
    display: flex !important;
    align-items: center !important;
    min-height: 80px;
}

/* Unbreak the absolutely-positioned children the theme ships with — reset
 * their top offsets AND margins so flex can actually center them. The theme
 * ships `margin-top: -78px` on #navigation to fake vertical alignment inside
 * the original 80px header; that wrecks our flex centering. */
.main-header #branding,
.main-header #navigation {
    position: static !important;
    top: auto !important;
    margin-top: 0 !important;
    transform: none !important;
}

/* Logo gets reasonable auto-sizing within the flex row */
.main-header #branding {
    margin-right: auto; /* push everything else to the right */
}

/* On scroll the header gets a touch more opaque. Adds perceived depth. */
.main-header.alts-scrolled {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.82) 100%) !important;
    border-bottom-color: rgba(255, 255, 255, 0.12) !important;
}

/* Nav links — subtle neon accent on hover */
.main-header #navigation a {
    transition: color 0.15s ease;
    letter-spacing: 0.015em;
}
.main-header #navigation a:hover,
.main-header #navigation a:focus {
    color: #BFFF00 !important;
}

/* Logo crispness — prevents blurry scaling on retina */
.main-header .logo,
.main-header .logo-retina {
    image-rendering: -webkit-optimize-contrast;
}

/* Mobile menu toggle — subtle refinement */
.main-header .max-mobile-menu-toggle-bar {
    transition: background 0.15s ease;
}

/* =================== CHANNEL PAGE HERO OVERLAP ===================
 * On taxonomy archive pages (channel pages), let the hero slide up
 * under the header and drop the header's background entirely. The
 * hero's dark blurred backdrop provides all the contrast the menu
 * needs. Menu items get bigger and more padded to feel bolder and
 * more editorial.
 * =================================================================== */
/* =============================================================================
 * CHANNEL PAGE HEADER — COMPLETE OVERRIDE
 *
 * The theme ships a Superfish-powered icon nav with dropdown submenus:
 *   - Top-level items are Font Awesome icons (home, bullhorn, genres, decades,
 *     shuffle, search) with their text labels hidden
 *   - Most items have dropdown submenus (sub-menu UL children)
 *   - Shopify Buy SDK injects the "Submit Music Video" button as a floating
 *     iframe that we hoist into the header via JS
 *
 * Applies on body.tax-gallery-categories only. Single-video pages use their
 * own immersive menu. Non-channel pages use the theme's original look.
 * ============================================================================= */
body.tax-gallery-categories {
    --alts-header-padding-y: 50px;
    --alts-header-padding-x: 50px;
    --alts-header-logo-height: 84px;
    --alts-header-height: calc(var(--alts-header-padding-y) * 2 + var(--alts-header-logo-height));
    --alts-header-scrolled-padding-y: 14px;
    --alts-header-scrolled-height: calc(var(--alts-header-scrolled-padding-y) * 2 + 52px);
    --alts-nav-icon-size: 52px;
}

/* Header strip — fully transparent, no bar. Hero backdrop provides contrast. */
body.tax-gallery-categories .main-header,
body.tax-gallery-categories header.main-header {
    all: unset;
    display: flex !important;
    flex-direction: row;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 24px;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
    width: 100%;
    box-sizing: border-box;
    padding: var(--alts-header-padding-y) var(--alts-header-padding-x);
    min-height: var(--alts-header-height);
    background: transparent !important;
    background-image: none !important;
    background-color: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: 0 !important;
    border-bottom: 0 none !important;
    box-shadow: none !important;
    transition: background 0.3s ease, padding 0.25s ease, min-height 0.25s ease;
    font-family: inherit;
}

/* Branding (logo) */
body.tax-gallery-categories .main-header #branding,
body.tax-gallery-categories .main-header #site-title,
body.tax-gallery-categories .main-header .navbar {
    all: unset;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
body.tax-gallery-categories .main-header #branding a,
body.tax-gallery-categories .main-header #site-title a {
    display: inline-flex;
    align-items: center;
    line-height: 0;
    text-decoration: none;
}

/* Single logo. Nuke the regular one with attribute+class specificity chained. */
body.tax-gallery-categories .main-header img.logo:not(.logo-retina),
body.tax-gallery-categories header.main-header img.logo:not(.logo-retina),
body.tax-gallery-categories #branding img.logo:not(.logo-retina),
html body.tax-gallery-categories .main-header img.logo:not(.logo-retina) {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    max-width: 0 !important;
    max-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    opacity: 0 !important;
    position: absolute !important;
}
body.tax-gallery-categories .main-header img.logo-retina,
html body.tax-gallery-categories .main-header img.logo-retina {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: static !important;
    height: var(--alts-header-logo-height) !important;
    max-height: var(--alts-header-logo-height) !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    object-fit: contain;
}

/* =============================================================================
 * ICON NAV
 *
 * Top-level nav items are icon buttons. Text labels ("Home", etc.) are hidden
 * — only the Font Awesome icon shows. Dropdowns appear on hover for items
 * that have sub-menus. We preserve Superfish's dropdown behavior via CSS
 * (hover + focus-within) rather than relying on the theme's JS.
 * ============================================================================= */
body.tax-gallery-categories .main-header #navigation,
body.tax-gallery-categories .main-header nav#navigation {
    all: unset;
    display: flex !important;
    align-items: center !important;
    gap: 6px;
    flex: 1 1 auto;
    justify-content: flex-end;
    min-width: 0;
    margin: 0 !important;
    margin-top: 0 !important;
    padding: 0 !important;
    position: static !important;
    top: auto !important;
    transform: none !important;
}

/* Top-level UL */
body.tax-gallery-categories .main-header #navigation > ul,
body.tax-gallery-categories .main-header #navigation ul.sf-menu,
body.tax-gallery-categories .main-header #navigation .navigation {
    all: unset;
    display: flex !important;
    align-items: center;
    gap: 2px;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Top-level LI (positioning context for dropdown) */
body.tax-gallery-categories .main-header #navigation > ul > li,
body.tax-gallery-categories .main-header #navigation ul.sf-menu > li {
    all: unset;
    display: inline-flex !important;
    align-items: center;
    position: relative;         /* anchor for dropdown */
    list-style: none;
}

/* Top-level link (the icon button) */
body.tax-gallery-categories .main-header #navigation > ul > li > a,
body.tax-gallery-categories .main-header #navigation ul.sf-menu > li > a {
    all: unset;
    cursor: pointer;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: var(--alts-nav-icon-size);
    height: var(--alts-nav-icon-size);
    color: #e8e8e8;
    font-size: 0;                /* hide any text labels — icons only at top level */
    line-height: 1;
    text-decoration: none;
    border-radius: 50%;
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
    font-family: inherit;
}

/* The icon itself (Font Awesome <i>) — size via font-size on the glyph */
body.tax-gallery-categories .main-header #navigation > ul > li > a > i,
body.tax-gallery-categories .main-header #navigation > ul > li > a .fa,
body.tax-gallery-categories .main-header #navigation > ul > li > a [class*="fa-"] {
    font-size: 24px !important;
    line-height: 1;
    color: inherit;
    display: block;
}

/* Icon button hover — fill + accent */
body.tax-gallery-categories .main-header #navigation > ul > li > a:hover,
body.tax-gallery-categories .main-header #navigation > ul > li > a:focus,
body.tax-gallery-categories .main-header #navigation > ul > li:hover > a,
body.tax-gallery-categories .main-header #navigation > ul > li:focus-within > a {
    background: rgba(191, 255, 0, 0.15);
    color: #BFFF00;
    transform: scale(1.06);
}

/* =============================================================================
 * DROPDOWN SUBMENUS — zero gap between icon and submenu so hover path stays
 * inside the LI. The submenu sits flush at `top: 100%` (immediately below the
 * icon button) with no translate Y offset. Visual breathing room is provided
 * by the submenu's own padding instead.
 * ============================================================================= */
body.tax-gallery-categories .main-header #navigation ul ul,
body.tax-gallery-categories .main-header #navigation ul.sub-menu {
    all: unset;
    position: absolute !important;
    top: 100%;                          /* flush against icon button, no gap */
    left: 50%;
    transform: translateX(-50%);
    display: block;
    min-width: 220px;
    padding: 12px 8px 8px !important;   /* extra top padding = breathing room without gap */
    margin: 0;
    list-style: none;
    background: rgba(12, 12, 12, 0.97);
    backdrop-filter: blur(14px) saturate(1.2);
    -webkit-backdrop-filter: blur(14px) saturate(1.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s;
    z-index: 1000;
}

/* Invisible hover bridge so the mouse can travel from icon → submenu without
 * losing :hover. Sits directly above the submenu's padded area. */
body.tax-gallery-categories .main-header #navigation > ul > li.menu-item-has-children::after,
body.tax-gallery-categories .main-header #navigation > ul > li:has(> ul)::after {
    content: '';
    position: absolute;
    top: 100%;
    left: -20px;
    right: -20px;
    height: 12px;
    pointer-events: none;
}
body.tax-gallery-categories .main-header #navigation > ul > li.menu-item-has-children:hover::after,
body.tax-gallery-categories .main-header #navigation > ul > li:has(> ul):hover::after,
body.tax-gallery-categories .main-header #navigation > ul > li.menu-item-has-children:focus-within::after,
body.tax-gallery-categories .main-header #navigation > ul > li:has(> ul):focus-within::after {
    pointer-events: auto;
}

/* Show on hover/focus of the PARENT li */
body.tax-gallery-categories .main-header #navigation > ul > li:hover > ul,
body.tax-gallery-categories .main-header #navigation > ul > li:focus-within > ul,
body.tax-gallery-categories .main-header #navigation > ul > li > ul.sfHover,
body.tax-gallery-categories .main-header #navigation > ul > li:hover > .sub-menu,
body.tax-gallery-categories .main-header #navigation > ul > li:focus-within > .sub-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Submenu LI */
body.tax-gallery-categories .main-header #navigation ul ul li {
    all: unset;
    display: block !important;
    list-style: none;
    margin: 0;
}

/* Submenu link */
body.tax-gallery-categories .main-header #navigation ul ul a {
    all: unset;
    cursor: pointer;
    display: block !important;
    padding: 10px 14px;
    color: #e8e8e8;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.01em;
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.12s ease, color 0.12s ease;
    font-family: inherit;
    white-space: nowrap;
    min-width: 0;
}
body.tax-gallery-categories .main-header #navigation ul ul a:hover,
body.tax-gallery-categories .main-header #navigation ul ul a:focus {
    background: rgba(191, 255, 0, 0.12);
    color: #BFFF00;
}

/* Right-align dropdown for the last nav items so they don't overflow */
body.tax-gallery-categories .main-header #navigation > ul > li:nth-last-child(-n+2) > ul,
body.tax-gallery-categories .main-header #navigation > ul > li:nth-last-child(-n+2) > .sub-menu {
    left: auto !important;
    right: 0 !important;
    transform: none !important;
}

/* =============================================================================
 * SHOPIFY "SUBMIT MUSIC VIDEO" BUTTON
 *
 * The Shopify Buy SDK injects a floating iframe. We hoist it into the header
 * via JS (see class-sitewide-styles.php) and tag it with `alts-in-header`.
 * Styled to look like a neon CTA button matching the brand.
 * ============================================================================= */
body.tax-gallery-categories .shopify-buy-frame--toggle,
body.tax-gallery-categories .shopify-buy-frame--toggle.is-sticky {
    display: none !important;
}
body.tax-gallery-categories .shopify-buy-frame--product.alts-in-header {
    position: static !important;
    display: inline-flex !important;
    align-items: center !important;
    flex-shrink: 0 !important;
    margin-left: 10px !important;
    width: auto !important;
    height: auto !important;
    max-width: 220px;
    left: auto !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
}
body.tax-gallery-categories .shopify-buy-frame--product.alts-in-header iframe {
    border: 0 !important;
    background: transparent !important;
    min-width: 180px;
    max-width: 220px;
    height: 44px !important;
}

/* =============================================================================
 * SCROLLED STATE
 *
 * When the user scrolls past a threshold, the header gets a background +
 * blur + border so it stays legible over content.
 * ============================================================================= */
body.tax-gallery-categories .main-header.alts-scrolled {
    padding: var(--alts-header-scrolled-padding-y) var(--alts-header-padding-x);
    min-height: var(--alts-header-scrolled-height);
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.85) 100%) !important;
    backdrop-filter: blur(14px) saturate(1.2);
    -webkit-backdrop-filter: blur(14px) saturate(1.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
body.tax-gallery-categories .main-header.alts-scrolled .logo,
body.tax-gallery-categories .main-header.alts-scrolled .logo-retina {
    height: 40px !important;
    max-height: 40px !important;
}

/* =============================================================================
 * BACK TO TOP BUTTON
 *
 * Theme ships #anchorTop with just the text "Back to top" (text-indented off
 * screen) and no icon. We hide the text, inject a neon arrow via ::before,
 * and position high enough to clear the footer.
 * Applies site-wide (all non-single-gallery pages).
 * ============================================================================= */
body:not(.single-gallery) #anchorTop,
body:not(.single-gallery) .back-to-top,
body:not(.single-gallery) #back-to-top {
    position: fixed !important;
    bottom: 100px !important;
    right: 100px !important;
    top: auto !important;
    left: auto !important;
    width: 48px !important;
    height: 48px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(10, 10, 10, 0.72) !important;
    border: 1.5px solid var(--alts-accent, #bbff00) !important;
    border-radius: 50% !important;
    color: var(--alts-accent, #bbff00) !important;
    font-size: 0 !important;            /* hide the "Back to top" text */
    text-decoration: none !important;
    backdrop-filter: blur(10px) saturate(1.3) !important;
    -webkit-backdrop-filter: blur(10px) saturate(1.3) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 0 0 rgba(191, 255, 0, 0.3) !important;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease,
                border-color 0.2s ease, box-shadow 0.3s ease !important;
    z-index: 990 !important;
    cursor: pointer !important;
    text-indent: 0 !important;
    overflow: visible !important;
}
/* Hide the inner <a> and its text so our pseudo-arrow is what renders */
body:not(.single-gallery) #anchorTop a,
body:not(.single-gallery) #anchorTop > * {
    text-indent: -9999px !important;
    font-size: 0 !important;
    color: transparent !important;
    line-height: 0 !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
}
/* Injected neon up arrow */
body:not(.single-gallery) #anchorTop::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 12px;
    border-top: 2px solid var(--alts-accent, #bbff00);
    border-left: 2px solid var(--alts-accent, #bbff00);
    transform: translate(-50%, -30%) rotate(45deg);
    transition: border-color 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}
body:not(.single-gallery) #anchorTop:hover {
    background: var(--alts-accent, #bbff00) !important;
    border-color: var(--alts-accent, #bbff00) !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.6), 0 0 0 8px rgba(191, 255, 0, 0.12) !important;
}
body:not(.single-gallery) #anchorTop:hover::before {
    border-color: #000;
    transform: translate(-50%, -40%) rotate(45deg);
}

/* Theme uses .opacity-hide class to hide the button when scrolled to top */
body:not(.single-gallery) #anchorTop.opacity-hide {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translateY(12px) !important;
}

/* Mobile — tuck closer to the edge */
@media (max-width: 700px) {
    body:not(.single-gallery) #anchorTop,
    body:not(.single-gallery) .back-to-top {
        bottom: 90px !important;
        right: 26px !important;             /* clear scrollbars / safe-area */
        width: 44px !important;
        height: 44px !important;
    }
}

/* Hero sits under the absolute header */
body.tax-gallery-categories .alts-channel-hero {
    margin-top: 0 !important;
    padding-top: calc(var(--alts-header-height) + 40px) !important;
    min-height: 720px !important;
}

/* Mobile */
@media (max-width: 700px) {
    body.tax-gallery-categories {
        --alts-header-padding-y: 14px;
        --alts-header-padding-x: 18px;
        --alts-header-logo-height: 38px;
        --alts-nav-icon-size: 38px;
    }
    body.tax-gallery-categories .main-header #navigation > ul > li > a > i {
        font-size: 14px !important;
    }
    body.tax-gallery-categories .alts-channel-hero {
        padding-top: calc(var(--alts-header-height) + 24px) !important;
        min-height: 480px !important;
    }
    body.tax-gallery-categories .shopify-buy-frame--product.alts-in-header {
        display: none !important;   /* hide on mobile, too tight */
    }
}

/* =============================================================================
   MENU CHROME — v4 (April 2026) hover-scale + dot box-shadow fix
   -----------------------------------------------------------------------------
   The Customizer's "Additional CSS" sets a 1.15× scale-up on top-level
   nav icon hover and a 1.4× scale on the dropdown indicator dot. Combined
   with the tooltip plugin's [data-alts-tip]::after rule (which has a
   liquid-glass box-shadow stack), the dot rendered as a giant green
   ellipse blob and the icon felt like it was launching into space.
   
   This block competes with the Customizer rule via higher specificity
   (extra `body:not(.single-gallery)` ancestor) and explicit !important
   to win cleanly. It restores the dot to a clean 4px circle with NO
   inherited box-shadow / filter / backdrop-filter, and tones the hover
   scale to 1.05 / 1.2 — visible but not aggressive.
   
   Belt-and-braces with altsounds-tooltips.js v4 which adds
   data-alts-tip-skip="1" to nav menu links so the tooltip system
   never claims them in the first place.
   ============================================================================= */

html body:not(.single-gallery) .main-header #navigation > ul > li > a:hover,
html body:not(.single-gallery) .main-header #navigation > ul > li > a:focus,
html body:not(.single-gallery) .main-header #navigation > ul > li:hover > a,
html body:not(.single-gallery) .main-header #navigation > ul > li:focus-within > a {
    /* Dial back from 1.15 → 1.05. Just enough lift to register, not enough
       to feel like the icon is leaping off the page. */
    transform: scale(1.05) !important;
}

html body:not(.single-gallery) .main-header #navigation > ul > li.menu-item-has-children > a::after,
html body:not(.single-gallery) .main-header #navigation > ul > li > a.sf-with-ul::after {
    /* Reset the tooltip plugin's box-shadow stack from this pseudo. The
       liquid-glass stack made a 4px dot render as a giant glowing ellipse. */
    box-shadow: none !important;
    filter: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    /* Force the dot to be its own size — the tooltip CSS sets padding
       and font-size that would otherwise inflate the pseudo. */
    padding: 0 !important;
    font-size: 0 !important;
    color: transparent !important;
    /* Re-assert the original dot styling at !important so the tooltip
       CSS can never bleed in. */
    background-image: none !important;
    border: 0 !important;
    width: 4px !important;
    height: 4px !important;
    max-width: 4px !important;
    max-height: 4px !important;
}

html body:not(.single-gallery) .main-header #navigation > ul > li:hover > a::after,
html body:not(.single-gallery) .main-header #navigation > ul > li:focus-within > a::after {
    /* Was scale(1.4) — too aggressive. 1.2 is a clean lift. */
    transform: translateX(-50%) scale(1.2) !important;
}

/* Submenu chevron arrow on items-with-children inside dropdowns
   (e.g. Genres → Rock → ›). Same tooltip-CSS leak; same reset. */
html body:not(.single-gallery) .main-header #navigation ul ul li.menu-item-has-children > a::after,
html body:not(.single-gallery) .main-header #navigation ul ul li:has(> ul) > a::after {
    box-shadow: none !important;
    filter: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    padding: 0 !important;
    font-size: 0 !important;
    color: inherit !important;
    background-image: none !important;
    background-color: transparent !important;
}
