/* =============================================
   VISAVERGE HEADER STYLES
   Ticker → Masthead → Tab Navigation → Mobile
   ============================================= */

/* ─────────────────────────────────────────────
   SITE HEADER SHELL
   ───────────────────────────────────────────── */
.vv-site-header {
    background: var(--vv-paper-white);
    border-top: 4px solid var(--vv-nav-bg);
    position: relative;
    z-index: 100;
}


/* ─────────────────────────────────────────────
   TICKER BAR
   ───────────────────────────────────────────── */
.vv-ticker-bar {
    background: var(--vv-bg-dark);
    color: #fff;
    padding: 6px 0;
    font-family: var(--vv-font-mono);
    font-size: var(--vv-text-xs);
    overflow: hidden;
}

.vv-ticker-inner {
    display: flex;
    align-items: center;
    gap: 16px;
}

.vv-ticker-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    color: #fff !important;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    flex-shrink: 0;
    font-size: 0.7rem;
    background: var(--vv-bg-dark);
    padding-right: 16px;
    position: relative;
    z-index: 2;
}

/* Ensure LIVE text is visible in all color modes */
[data-theme="dark"] .vv-ticker-label,
[data-theme="light"] .vv-ticker-label,
.vv-ticker-label {
    color: #fff !important;
}

.vv-ticker-dot {
    width: 6px;
    height: 6px;
    background: var(--vv-alert);
    border-radius: 50%;
    animation: vv-pulse 1.5s ease-in-out infinite;
}

@keyframes vv-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.3; }
}

.vv-ticker-track {
    overflow: hidden;
    flex: 1;
    /* Prevent FOUC — raw items hidden until JS builds .vv-ticker-scroll */
    height: 1.4em;
    /* Fade edges relative to track bounds — track stays fixed, only inner scroll moves */
    mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
/* Hide raw items before JS wraps them */
.vv-ticker-track > .vv-ticker-item {
    opacity: 0;
}

/* Inner scroll element — animates inside the fixed track container */
.vv-ticker-scroll {
    display: inline-flex;
    gap: 0;
    white-space: nowrap;
}
.vv-ticker-scroll > .vv-ticker-item {
    opacity: 1;
}

/* Continuous scroll animation */
.vv-ticker-scroll.vv-ticker-animate {
    animation: vv-ticker-scroll var(--vv-ticker-duration, 20s) linear infinite;
}

.vv-ticker-scroll.vv-ticker-animate:hover {
    animation-play-state: paused;
}

@keyframes vv-ticker-scroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.vv-ticker-item {
    color: rgba(255, 255, 255, 0.8);
    white-space: nowrap;
    text-decoration: none;
    transition: color 0.2s;
    flex-shrink: 0;
    padding: 0 20px;
}

.vv-ticker-item:hover {
    color: #fff;
}

.vv-ticker-item::after {
    content: '\2022';
    margin-left: 20px;
    color: rgba(255, 255, 255, 0.25);
}

.vv-ticker-date {
    white-space: nowrap;
    color: rgba(255, 255, 255, 0.8) !important;
    font-weight: 600;
    flex-shrink: 0;
    font-size: 0.7rem;
    background: var(--vv-bg-dark);
    padding-left: 16px;
    position: relative;
    z-index: 2;
}

/* ─────────────────────────────────────────────
   MASTHEAD
   ───────────────────────────────────────────── */
.vv-masthead {
    padding: 28px 0 24px;
    background: var(--vv-paper);
    border-bottom: var(--vv-border-heavy);
    text-align: center;
}

.vv-masthead-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

/* Brand */
.vv-masthead-brand {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.vv-logo-text {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--vv-ink);
    line-height: 1;
    flex-shrink: 0;
}

.vv-logo-text:hover {
    text-decoration: none;
    color: var(--vv-ink);
}

.vv-logo-icon {
    font-size: 1.8rem;
    color: var(--vv-navy);
}

.vv-logo-name {
    font-family: var(--vv-font-head);
    font-size: 2.2rem;
    letter-spacing: -0.5px;
    transition: font-size 0.2s ease;
}

.vv-tagline {
    font-family: var(--vv-font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--vv-navy);
    padding-left: 16px;
    border-left: var(--vv-border-faint);
    white-space: nowrap;
    transition: opacity 0.2s;
}

/* Custom logo */
.vv-masthead-brand .custom-logo-link,
.vv-masthead-brand .vv-logo-link {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.vv-masthead-brand .custom-logo,
.vv-masthead-brand .vv-logo-light,
.vv-masthead-brand .vv-logo-dark {
    max-height: 50px;
    width: auto;
}

/* Tagline below logo */
.vv-masthead-tagline {
    font-family: var(--vv-font-mono);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--vv-ink-muted);
    margin: 6px 0 0;
}

/* CSS-based dual-logo dark/light swap — no JS needed */
.vv-masthead-brand .vv-logo-light { display: block; }
.vv-masthead-brand .vv-logo-dark  { display: none; }
[data-theme="dark"] .vv-masthead-brand .vv-logo-light { display: none; }
[data-theme="dark"] .vv-masthead-brand .vv-logo-dark  { display: block; }

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .vv-masthead-brand .vv-logo-light { display: none; }
    :root:not([data-theme="light"]) .vv-masthead-brand .vv-logo-dark  { display: block; }
}


/* Right side — absolute on desktop, static on mobile */
.vv-masthead-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

/* ── Inline Expanding Search ── */
.vv-header-search {
    display: flex;
    align-items: center;
    position: relative;
}

.vv-search-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: var(--vv-border-light);
    border-radius: var(--vv-radius-sm);
    background: none;
    color: var(--vv-ink-sub);
    cursor: pointer;
    transition: var(--vv-transition);
    position: relative;
    z-index: 2;
}

.vv-search-toggle:hover {
    background: var(--vv-paper);
    color: var(--vv-navy);
    border-color: var(--vv-navy);
}

.vv-search-form {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    background: var(--vv-paper-white);
    border: var(--vv-border-heavy);
    border-radius: var(--vv-radius-md);
    overflow: hidden;
    width: 0;
    opacity: 0;
    pointer-events: none;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
    z-index: 3;
}

.vv-header-search.vv-search-active .vv-search-toggle {
    opacity: 0;
    pointer-events: none;
}

.vv-header-search.vv-search-active .vv-search-form {
    width: 380px;
    opacity: 1;
    pointer-events: auto;
}

.vv-search-input {
    flex: 1;
    border: none;
    padding: 10px 14px;
    font-family: var(--vv-font-body);
    font-size: var(--vv-text-sm);
    color: var(--vv-ink);
    background: transparent;
    outline: none;
    min-width: 0;
}

.vv-search-input::placeholder {
    color: var(--vv-ink-muted);
}

.vv-search-input::-webkit-search-cancel-button,
.vv-search-input::-webkit-search-decoration {
    -webkit-appearance: none;
    appearance: none;
}

.vv-search-submit {
    background: var(--vv-navy);
    color: #fff;
    border: none;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.15s;
    flex-shrink: 0;
}

.vv-search-submit:hover {
    background: var(--vv-navy-light);
}

/* Clear button — desktop search */
.vv-search-clear {
    position: relative;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    color: var(--vv-ink-muted);
    cursor: pointer;
    transition: color 0.15s;
}

.vv-search-clear:hover {
    color: var(--vv-alert);
}

@keyframes vv-fadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─────────────────────────────────────────────
   PRIMARY NAV — TAB STYLE
   ───────────────────────────────────────────── */
.vv-primary-nav {
    background: var(--vv-nav-bg);
}

.vv-nav-inner {
    display: flex;
    align-items: stretch;
    position: relative;
}

/* Menu list */
.vv-nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0;
    width: 100%;
}

.vv-nav-menu > li {
    position: relative;
}

/* Top-level links — light text on dark nav bar */
.vv-nav-menu > li > a {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 14px 22px;
    font-family: var(--vv-font-body);
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 3px solid transparent;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
    white-space: nowrap;
}

.vv-nav-menu > li > a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    border-bottom-color: var(--vv-teal-light);
}

.vv-nav-menu > li.current-menu-item > a,
.vv-nav-menu > li.current-menu-parent > a,
.vv-nav-menu > li.current-menu-ancestor > a {
    color: #fff;
    border-bottom-color: var(--vv-teal-light);
    background: rgba(255, 255, 255, 0.08);
}

/* Alert tab — soft red on dark nav */
.vv-nav-menu > li.vv-nav-alert > a {
    color: #FCA5A5;
}

.vv-nav-menu > li.vv-nav-alert > a:hover {
    color: #FCA5A5;
    border-bottom-color: #FCA5A5;
}

/* Caret icon */
.vv-caret {
    margin-left: 2px;
    transition: transform 0.2s;
}

.vv-nav-menu > li:hover > a .vv-caret {
    transform: rotate(180deg);
}

/* ─────────────────────────────────────────────
   DROPDOWN MENUS
   ───────────────────────────────────────────── */
.vv-nav-menu .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--vv-paper-white);
    border: var(--vv-border-heavy);
    border-top: 3px solid var(--vv-navy);
    min-width: 240px;
    z-index: 200;
    list-style: none;
    padding: 6px 0;
    margin: 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity 0.15s, visibility 0.15s, transform 0.15s;
}

.vv-nav-menu > li:hover > .sub-menu,
.vv-nav-menu > li:focus-within > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Submenu items */
.vv-nav-menu .sub-menu li {
    position: relative;
}

.vv-nav-menu .sub-menu a {
    display: block;
    padding: 10px 20px;
    font-family: var(--vv-font-body);
    font-size: var(--vv-text-sm);
    font-weight: 500;
    color: var(--vv-ink-sub);
    text-decoration: none;
    transition: background 0.12s, color 0.12s, padding-left 0.15s;
    line-height: 1.4;
}

.vv-nav-menu .sub-menu a:hover {
    background: var(--vv-paper);
    color: var(--vv-navy);
    padding-left: 24px;
}

.vv-nav-menu .sub-menu .current-menu-item > a {
    color: var(--vv-navy);
    font-weight: 600;
    background: var(--vv-paper);
    border-left: 3px solid var(--vv-navy);
    padding-left: 17px;
}

/* Description text in submenus */
.vv-menu-desc {
    display: block;
    padding: 0 20px 8px;
    font-size: var(--vv-text-xs);
    color: var(--vv-ink-muted);
    line-height: 1.3;
    margin-top: -4px;
}

/* Nested sub-sub-menu */
.vv-nav-menu .sub-menu .sub-menu {
    top: -6px;
    left: 100%;
    border-top-color: var(--vv-teal);
}

.vv-nav-menu .sub-menu li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Divider for visual grouping */
.vv-nav-menu .sub-menu li.vv-menu-divider {
    height: 1px;
    background: var(--vv-paper-dark);
    margin: 4px 12px;
}

/* ─────────────────────────────────────────────
   HAMBURGER TOGGLE (mobile only)
   ───────────────────────────────────────────── */
.vv-nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: none;
    border: var(--vv-border-light);
    border-radius: var(--vv-radius-sm);
    cursor: pointer;
    padding: 8px;
    transition: var(--vv-transition);
}

.vv-nav-toggle:hover {
    border-color: var(--vv-navy);
    background: var(--vv-paper);
}

.vv-hamburger {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--vv-ink);
    transition: transform 0.25s ease, opacity 0.15s ease;
    border-radius: 1px;
}

.vv-nav-toggle[aria-expanded="true"] .vv-hamburger:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.vv-nav-toggle[aria-expanded="true"] .vv-hamburger:nth-child(2) {
    opacity: 0;
}

.vv-nav-toggle[aria-expanded="true"] .vv-hamburger:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ─────────────────────────────────────────────
   MOBILE MENU DRAWER
   ───────────────────────────────────────────── */
.vv-mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 320px;
    max-width: 85vw;
    height: 100vh;
    background: var(--vv-paper-white);
    z-index: 9999;
    overflow-y: auto;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0);
}

.vv-mobile-menu.vv-mobile-open {
    right: 0;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
}

.vv-mobile-menu-inner {
    padding: 24px;
}

/* Mobile search */
.vv-mobile-search {
    margin-bottom: 24px;
}

.vv-mobile-search form {
    display: flex;
}

.vv-mobile-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.vv-mobile-search-icon {
    position: absolute;
    left: 12px;
    color: var(--vv-ink-muted);
    pointer-events: none;
    font-size: 0.9rem;
}

.vv-mobile-search input {
    width: 100%;
    padding: 10px 40px 10px 36px;
    border: var(--vv-border-heavy);
    border-radius: var(--vv-radius-md);
    font-family: var(--vv-font-body);
    font-size: var(--vv-text-sm);
    background: var(--vv-paper);
    color: var(--vv-ink);
    outline: none;
}

.vv-mobile-search input:focus {
    border-color: var(--vv-navy);
    background: var(--vv-paper-white);
}

/* Hide native browser clear button — we use our own */
.vv-mobile-search input[type="search"]::-webkit-search-cancel-button,
.vv-mobile-search input[type="search"]::-webkit-search-decoration {
    -webkit-appearance: none;
    appearance: none;
}

/* Clear button — mobile search */
.vv-mobile-search-clear {
    position: absolute;
    right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    background: none;
    color: var(--vv-ink-muted);
    cursor: pointer;
    transition: color 0.15s;
    font-size: 0.85rem;
}

.vv-mobile-search-clear:hover {
    color: var(--vv-alert);
}

/* Mobile nav list */
.vv-mobile-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.vv-mobile-nav-list > li {
    border-bottom: var(--vv-border-faint);
}

.vv-mobile-nav-list > li:last-child {
    border-bottom: none;
}

/* Item row — link + toggle button side by side */
.vv-mobile-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.vv-mobile-nav-list a {
    flex: 1;
    display: block;
    padding: 14px 0;
    font-family: var(--vv-font-body);
    font-size: var(--vv-text-base);
    font-weight: 600;
    color: var(--vv-ink);
    text-decoration: none;
    transition: color 0.15s;
}

.vv-mobile-nav-list a:hover {
    color: var(--vv-navy);
}

.vv-mobile-nav-list .current-menu-item > .vv-mobile-item-row > a,
.vv-mobile-nav-list .current-menu-item > a {
    color: var(--vv-navy);
}

/* Submenu toggle button */
.vv-submenu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: var(--vv-border-faint);
    border-radius: var(--vv-radius-sm);
    background: var(--vv-paper);
    color: var(--vv-ink-sub);
    cursor: pointer;
    flex-shrink: 0;
    transition: var(--vv-transition);
}

.vv-submenu-toggle:hover {
    background: var(--vv-paper-dark);
}

.vv-submenu-toggle[aria-expanded="true"] {
    background: var(--vv-navy);
    color: #fff;
    border-color: var(--vv-navy);
}

.vv-submenu-toggle[aria-expanded="true"] svg {
    transform: rotate(45deg);
}

.vv-submenu-toggle svg {
    transition: transform 0.2s;
}

/* Mobile sub-menu */
.vv-mobile-nav-list .sub-menu {
    list-style: none;
    padding: 0 0 8px 16px;
    margin: 0;
    display: none;
    border-left: 2px solid var(--vv-navy);
}

.vv-mobile-nav-list .sub-menu.vv-submenu-open {
    display: block;
    animation: vv-fadeIn 0.2s ease;
}

.vv-mobile-nav-list .sub-menu a {
    font-size: var(--vv-text-sm);
    font-weight: 500;
    color: var(--vv-ink-sub);
    padding: 8px 0 8px 8px;
}

.vv-mobile-nav-list .sub-menu a:hover {
    color: var(--vv-navy);
}

/* Nested sub-sub-menu in mobile */
.vv-mobile-nav-list .sub-menu .sub-menu {
    padding-left: 12px;
    border-left-color: var(--vv-teal);
}

/* Mobile overlay backdrop */
.vv-mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.2);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.vv-mobile-overlay.vv-overlay-visible {
    opacity: 1;
    visibility: visible;
}

/* Body lock when menu is open */
html.vv-menu-open,
body.vv-menu-open {
    overflow: hidden;
    touch-action: none;
}

/* ─────────────────────────────────────────────
   DARK MODE TOGGLE BUTTON
   ───────────────────────────────────────────── */
.vv-dark-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: var(--vv-border-light);
    border-radius: var(--vv-radius-sm);
    background: none;
    color: var(--vv-ink-sub);
    cursor: pointer;
    transition: var(--vv-transition);
    flex-shrink: 0;
    font-size: 0.9rem;
}

.vv-dark-toggle:hover {
    background: var(--vv-paper-dark);
    color: var(--vv-navy);
    border-color: var(--vv-navy);
}

/* Show moon in light mode (clicking switches to dark) */
.vv-dark-toggle .fa-sun  { display: none; }
.vv-dark-toggle .fa-moon { display: block; }

/* Show sun in dark mode (clicking switches to light) */
[data-theme="dark"] .vv-dark-toggle .fa-sun  { display: block; }
[data-theme="dark"] .vv-dark-toggle .fa-moon { display: none; }

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .vv-dark-toggle .fa-sun  { display: block; }
    :root:not([data-theme="light"]) .vv-dark-toggle .fa-moon { display: none; }
}
