/* =========================================
   EXPERTPULSE HEADER STYLES
   Styles 1-7 + Mobile + Search + Dropdowns
   ========================================= */

/* --- 1. CORE HEADER LAYOUT --- */
header.site-header {
    height: var(--header-height);
    background: var(--bg-body);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    transition: background 0.3s ease, border-color 0.3s ease;
    width: 100%;
    z-index: 1000;
}

.header-inner { display: flex; align-items: center; width: 100%; height: 100%; position: relative; }

/* --- COMPONENTS --- */
.logo { font-size: 1.4rem; font-weight: 900; letter-spacing: -0.5px; display: flex; align-items: center; gap: 6px; color: var(--text-main); flex-shrink: 0; }
.logo i, .logo span { color: var(--accent); }

.header-actions { display: flex; gap: 12px; align-items: center; flex-shrink: 0; }
.icon-btn {
    background: transparent; border: 1px solid transparent; width: 42px; height: 42px; border-radius: 50%;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    color: var(--desk-icon-color); transition: 0.2s; font-size: 1.2rem;
}
.icon-btn:hover { background: var(--desk-icon-hover-bg, var(--bg-section-alt)); color: var(--desk-icon-hover-color, var(--accent)); }

.header-socials-group { display: flex; gap: 8px; margin-right: 10px; padding-right: 22px; border-right: 1px solid var(--border); }
@media (max-width: 992px) { .header-socials-group { display: none !important; } }

/* =========================================
   2. DESKTOP NAVIGATION
   ========================================= */
.nav-menu { display: flex; align-items: center; margin: 0 auto; height: 100%; }
.ep-main-menu { display: flex; gap: 32px; align-items: center; margin: 0; padding: 0; height: 100%; }
.ep-main-menu li { position: relative; list-style: none; height: 100%; display: flex; align-items: center; }

.ep-main-menu > li > a {
    font-weight: 700; font-size: var(--desk-menu-size); color: var(--menu-text);
    display: flex; align-items: center; gap: 6px; transition: color 0.2s;
    padding: var(--nav-padding, 15px) 0; position: relative;
}
.ep-main-menu a:hover { color: var(--desk-nav-hover-color, var(--accent)); }
.dropdown-icon { font-size: 1.1em; transition: transform 0.3s ease; }
.ep-main-menu li:hover > a .dropdown-icon { transform: rotate(180deg); }

/* --- HOVER EFFECTS --- */
[data-nav-hover="underline"] .ep-main-menu > li > a .ep-menu-title { position: relative; }
[data-nav-hover="underline"] .ep-main-menu > li > a .ep-menu-title::after {
    content: ''; position: absolute; bottom: -6px; left: 0; width: 0; height: 2px;
    background-color: var(--desk-nav-hover-color, var(--accent)); transition: width 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}
[data-nav-hover="underline"] .ep-main-menu > li:hover > a .ep-menu-title::after { width: 100%; }

[data-nav-hover="dot"] .ep-main-menu > li > a .ep-menu-title { position: relative; }
[data-nav-hover="dot"] .ep-main-menu > li > a .ep-menu-title::after {
    content: ''; position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%) scale(0);
    width: 6px; height: 6px; border-radius: 50%; background-color: var(--desk-nav-hover-color, var(--accent));
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
[data-nav-hover="dot"] .ep-main-menu > li:hover > a .ep-menu-title::after { transform: translateX(-50%) scale(1); }

[data-nav-hover="background"] .ep-main-menu > li > a::before {
    content: ''; position: absolute; top: 50%; left: -14px; right: -14px; height: 42px;
    transform: translateY(-50%) scale(0.9); background-color: var(--bg-section-alt);
    border-radius: 50px; opacity: 0; transition: all 0.25s ease; z-index: 0;
}
[data-nav-hover="background"] .ep-main-menu > li:hover > a::before { opacity: 1; transform: translateY(-50%) scale(1); }
[data-nav-hover="background"] .ep-main-menu > li > a .ep-menu-title, 
[data-nav-hover="background"] .ep-main-menu > li > a i { position: relative; z-index: 1; }

/* =========================================
   3. DROPDOWN MENUS
   ========================================= */
.ep-main-menu .sub-menu {
    position: absolute; top: 100%; left: 0; min-width: 250px;
    opacity: 0; visibility: hidden;
    transform: translateY(15px) scale(0.97); transform-origin: top left;
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
    z-index: 999; display: flex; flex-direction: column;
}
.ep-main-menu li:hover > .sub-menu { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.ep-main-menu .sub-menu li { width: 100%; display: block; height: auto; position: relative; }
.ep-main-menu .sub-menu a {
    font-size: 0.95rem; color: var(--submenu-text, var(--text-main)); width: 100%;
    display: flex; align-items: center; gap: 12px; font-weight: 600;
    padding: 10px 15px; transition: all 0.25s ease;
}
.ep-main-menu .sub-menu .sub-menu { top: 0; left: 100%; margin-left: 5px; }

[data-submenu="modern"] .ep-main-menu .sub-menu {
    background: var(--submenu-bg, var(--bg-card)); border: 1px solid var(--border);
    border-radius: 16px; box-shadow: 0 20px 40px rgba(0,0,0,0.06); padding: 12px;
}
[data-submenu="modern"] .ep-main-menu .sub-menu a { border-radius: 8px; }
[data-submenu="modern"] .ep-main-menu .sub-menu a:hover { background: var(--submenu-hover-bg, var(--desk-icon-hover-bg, var(--bg-section-alt))); color: var(--submenu-hover-text, var(--desk-nav-hover-color, var(--accent))); padding-left: 20px; }

[data-submenu="minimal"] .ep-main-menu .sub-menu {
    background: var(--submenu-bg, var(--bg-card)); border: none; border-radius: 0 0 4px 4px;
    border-top: 3px solid var(--submenu-hover-text, var(--desk-nav-hover-color, var(--accent))); box-shadow: 0 15px 35px rgba(0,0,0,0.08); padding: 0;
}
[data-submenu="minimal"] .ep-main-menu .sub-menu a { border-radius: 0; border-bottom: 1px solid rgba(0,0,0,0.04); padding: 14px 25px; }
[data-submenu="minimal"] .ep-main-menu .sub-menu a:hover { background: transparent; color: var(--submenu-hover-text, var(--desk-nav-hover-color, var(--accent))); }

[data-submenu="glass"] .ep-main-menu .sub-menu {
    background: rgba(255, 255, 255, 0.7); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 20px; padding: 12px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.05);
}
[data-theme="dark"][data-submenu="glass"] .ep-main-menu .sub-menu { background: rgba(20, 20, 25, 0.7); border-color: rgba(255, 255, 255, 0.05); }
[data-submenu="glass"] .ep-main-menu .sub-menu a:hover { background: rgba(255, 255, 255, 0.4); color: var(--submenu-hover-text, var(--desk-nav-hover-color, var(--accent))); }

/* "Match Header Style": each header style 8–15 ships its own dropdown design (in its style file).
   Shared behaviour below; the hover bridge stops menus closing in the gap under the bar. */
[data-submenu="match"] .ep-main-menu .sub-menu { background: var(--submenu-bg, var(--bg-card)); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 20px 40px rgba(0,0,0,0.08); padding: 10px; }
[data-submenu="match"] .ep-main-menu .sub-menu a:hover { color: var(--submenu-hover-text, var(--desk-nav-hover-color, var(--accent))); }
[data-submenu="match"] .ep-main-menu .sub-menu .sub-menu { top: -10px; margin-left: 8px; }
[data-submenu="match"] .ep-main-menu .sub-menu .sub-menu::after { content: ''; position: absolute; top: 0; bottom: 0; left: -10px; width: 10px; }
[data-submenu="match"] .ep-main-menu .sub-menu .dropdown-icon { margin-left: auto; transform: rotate(-90deg); }
@media (prefers-reduced-motion: reduce) { [data-submenu="match"] .ep-main-menu .sub-menu, [data-submenu="match"] .ep-main-menu .sub-menu a, [data-submenu="match"] .ep-main-menu .sub-menu a::before { transition: none !important; } }

/* =========================================
   4. HEADER LAYOUTS 1-7 (Standard)
   ========================================= */
.header-style-1 .header-inner { justify-content: space-between; }
.header-style-1 .nav-menu { margin-left: auto; margin-right: 40px; }

/* Style 2: Split navigation — CSS Grid approach
   ┌─────────────────┬──────┬──────────────────────┐
   │  nav-side-left  │ logo │   nav-side-right      │
   │     (1fr)       │(auto)│       (1fr)           │
   └─────────────────┴──────┴──────────────────────┘
   grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) guarantees the two side columns are
   always equal, so the logo is mathematically centred no matter how many
   menu items exist. No overlap is possible by design. */
.header-style-2 .header-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    height: 100%;
}

/* Each arm fills its grid cell and arranges its children with flex */
.header-style-2 .nav-side {
    display: flex;
    align-items: center;
    height: 100%;
    min-width: 0;
    overflow: visible;
}
.header-style-2 .nav-side-left  { justify-content: flex-end; }
.header-style-2 .nav-side-right { justify-content: flex-start; }

/* Logo in the auto centre column */
.header-style-2 .logo {
    position: static;
    transform: none;
    padding: 0 20px;
    justify-content: center;
}

/* Nav halves inside their grid cells — reset global margin: 0 auto */
.header-style-2 .nav-split-left,
.header-style-2 .nav-split-right {
    display: flex;
    align-items: center;
    height: 100%;
    margin: 0;
    overflow: visible;
}
.header-style-2 .nav-split-right { flex: 1; min-width: 0; }

/* Actions sit flush at the end of the right arm */
.header-style-2 .header-actions { flex-shrink: 0; margin-left: 0; }

.header-style-3 {
    position: absolute !important; top: 0; left: 0; right: 0; width: 100%;
    background: transparent !important; border-bottom: none !important; z-index: 2000;
}
.header-style-3 .header-inner { justify-content: space-between; }
.header-style-3 .nav-menu { margin-left: auto; margin-right: 40px; }

.header-style-4 .header-inner { justify-content: space-between; }
.header-style-4 .nav-menu { margin-left: 40px; margin-right: auto; }

.header-style-5 .header-inner { justify-content: space-between; }
.header-style-5 .logo { flex: 1; justify-content: flex-start; }
.header-style-5 .nav-menu { flex: 2; display: flex; justify-content: center; }
.header-style-5 .header-actions { flex: 1; justify-content: flex-end; }

/* Stacked Headers with fix for Spacing */
/* --- Style 6: Stacked (Center Logo, Inline Date & Actions) --- */
.header-style-6 { 
    height: auto !important; 
    padding-top: 20px; 
    padding-bottom: 0; 
    background-color: var(--bg-body) !important; 
}

/* Ensure the inner container uses flex wrap so the nav menu can drop down */
.header-style-6 .header-inner { 
    display: flex !important;
    flex-wrap: wrap; 
    justify-content: space-between; 
    align-items: center; 
    min-height: auto; 
}

/* 1. Left Wrap (Socials & Date) - Fixed width basis to balance the right side */
.header-style-6 .header-left-wrap { 
    position: static !important; /* Remove absolute positioning */
    flex: 1 1 0%; /* Allow it to grow and shrink equally */
    display: flex; 
    align-items: center; 
    justify-content: flex-start; /* Flush left */
}

/* 2. Center Wrap (Logo) */
.header-style-6 .logo { 
    position: static !important; 
    transform: none !important; 
    flex: 0 0 auto; /* Keep exact size of logo */
    display: flex; 
    justify-content: center; 
    margin: 0 20px !important; /* Add slight breathing room */
    padding-bottom: 0 !important; 
    order: unset !important;
}

/* 3. Right Wrap (Search/User/Theme) */
.header-style-6 .header-actions { 
    position: static !important; 
    flex: 1 1 0%; /* Match the flex basis of the left wrap to perfectly center the logo */
    display: flex; 
    justify-content: flex-end; /* Flush right */
    order: unset !important;
}

/* 4. Bottom Wrap (Nav Menu) */
.header-style-6 .nav-menu { 
    width: 100%; /* Force it to take up the entire second row */
    display: flex; 
    justify-content: center; 
    border-top: 1px solid var(--border); 
    padding: 5px 0; 
    margin-top: 15px !important; 
    order: 4 !important; /* Ensure it stays at the bottom */
}

.header-style-7 { height: auto !important; padding-top: 25px; background-color: var(--bg-body) !important; }
.header-style-7 .header-inner { flex-wrap: wrap; justify-content: space-between; align-items: center; }
.header-style-7 .logo { order: 1; position: relative; }
.header-style-7 .header-actions { order: 2; margin-left: auto; }
.header-style-7 .nav-menu { 
    order: 3; width: 100%; display: flex; justify-content: flex-start; 
    border-top: 1px solid var(--border); padding: 5px 0; margin-top: 15px; 
}

/* Push content down for stacked headers */
body:has(header.header-style-6) .site-main > section:first-child,
body:has(header.header-style-7) .site-main > section:first-child {
    padding-top: 40px !important;
}

/* =========================================
   WP ADMIN BAR FIXES (CRITICAL UPDATE)
   ========================================= */

/* 1. Standard Headers (static/sticky position) */
body.admin-bar header.site-header { margin-top: 32px; }

/* 1b. When header is fixed (sticky enabled), use top instead of margin-top */
body.admin-bar header.site-header[style*="position: fixed"],
body.admin-bar header.site-header.is-fixed {
    margin-top: 0 !important;
    top: 32px !important;
}

/* 2. Transparent Header (Style 3) - Uses top instead of margin-top since it's fixed */
body.admin-bar header.site-header.header-style-3 {
    margin-top: 0 !important;
    top: 32px !important;
}

/* 3. Adjust for mobile admin bar thickness */
@media screen and (max-width: 782px) {
    body.admin-bar header.site-header { margin-top: 46px; }
    
    /* Fixed mobile header with admin bar: shift top, not margin */
    body.admin-bar header.site-header[style*="position: fixed"],
    body.admin-bar header.site-header.is-fixed {
        margin-top: 0 !important;
        top: 46px !important;
    }
    body.admin-bar header.site-header.header-style-3 { top: 46px !important; }
}

/* 4. Fix Shortcut Nav Sticky Position with Admin Bar */
body.admin-bar .shortcut-nav-container {
    top: calc(var(--ep-header-stick, var(--header-height)) + 32px);
}

@media screen and (max-width: 782px) {
    body.admin-bar .shortcut-nav-container {
        top: calc(var(--ep-header-stick, var(--header-height)) + 46px);
    }
}

/* =========================================
   5. SMART TICKER
   ========================================= */
.ticker-wrap { 
    background: #0B1120; 
    color: white; 
    padding: 0.6rem 0; 
    font-size: 0.85rem; 
    width: 100%; 
    display: block; 
    border-top: 1px solid rgba(255,255,255,0.05);
    position: relative; /* Ensure it stays above other content */
    z-index: 100;
}

/* --- PREMIUM FIX: Transparent Header Conflict --- */
/* Push the ticker down ONLY on desktop screens where the transparent header overlaps */
@media (min-width: 993px) {
    body:has(header.header-style-3) .ticker-wrap {
        margin-top: var(--ep-header-stick, var(--header-height));
    }
}

/* Remove margin on mobile as the header layout structure naturally separates them */
@media (max-width: 992px) {
    body:has(header.header-style-3) .ticker-wrap {
        margin-top: 0;
    }
    
    /* Ensure the mobile shortcut nav (News style) doesn't push down unnecessarily either */
    .shortcut-nav-container {
        margin-top: 0 !important;
    }
}

.ticker-content { display: flex; align-items: center; overflow: hidden; width: 100%; }
.ticker-label { 
    font-weight: 800; color: var(--accent); text-transform: uppercase; 
    margin-right: 1.5rem; white-space: nowrap; z-index: 10; 
    background: #0B1120; padding-right: 1.5rem; position: relative; 
}

/* Fades the text as it goes behind the label */
.ticker-label::before { 
    content: ''; 
    position: absolute; 
    top: -50px; 
    bottom: -50px; 
    right: 100%; 
    width: 100vw; 
    background: #0B1120; 
    z-index: 10; 
}
.ticker-text { white-space: nowrap; animation: ticker var(--ticker-dur, 35s) linear infinite; position: relative; z-index: 1; display: flex; align-items: center;}
.ticker-text a { color: white; text-decoration: none; transition: 0.3s; }
.ticker-text a:hover { color: var(--accent); }
@keyframes ticker { 0% { transform: translateX(100%); } 100% { transform: translateX(-100%); } }

/* =========================================
   6. MOBILE, SHORTCUTS & SEARCH
   ========================================= */
.mobile-menu-trigger {
    display: none; background: var(--mob-icon-bg, #1a1a1a); border: none; color: var(--mob-icon-color, #ffffff);
    width: 42px; height: 42px; border-radius: 12px; font-size: 1.4rem; cursor: pointer;
    align-items: center; justify-content: center; transition: background 0.2s, color 0.2s;
}
[data-theme="dark"] .mobile-menu-trigger {
    background: var(--mob-icon-bg, #2d2d2d);
}
.mobile-menu-trigger:hover {
    background: var(--mob-icon-hover-bg, var(--accent));
    color: var(--mob-icon-hover-color, var(--mob-icon-color, #ffffff));
}
.mobile-nav-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100vh;
    background: var(--bg-card); padding: 80px 20px 30px; transform: translateY(-100%);
    transition: transform 0.3s; z-index: 2000; overflow-y: auto;
}
.mobile-nav-overlay.active { transform: translateY(0); }
.mobile-nav-close { position: absolute; top: 25px; right: 25px; background: var(--bg-section-alt); width: 42px; height: 42px; border-radius: 50%; font-size: 1.5rem; cursor: pointer; display: flex; align-items: center; justify-content: center; }

/* =========================================
   MOBILE SUBMENUS
   ========================================= */
.mobile-nav-links { width: 100%; }
.ep-mobile-menu { display: flex; flex-direction: column; text-align: left; padding: 0; margin: 0; }
.ep-mobile-menu li { list-style: none; }
.ep-mobile-menu > li > a { 
    font-size: 1.15rem; font-weight: 700; color: var(--text-main); 
    display: flex; align-items: center; justify-content: space-between; 
    padding: 14px 0; border-bottom: 1px solid rgba(0,0,0,0.05);
}
[data-theme="dark"] .ep-mobile-menu > li > a { border-bottom-color: rgba(255,255,255,0.05); }

/* The fix: Keeps icon and text together */
.ep-menu-title { display: flex; align-items: center; gap: 12px; }
.ep-main-menu .ep-menu-title { gap: 6px; }

/* Enhanced Submenu Spacing for better Mobile UX */
.ep-mobile-menu .sub-menu { 
    display: none; 
    padding: 15px 0 15px 20px; 
    flex-direction: column; 
    gap: 8px; 
    border-left: 2px solid var(--border); 
    margin-left: 10px; 
    margin-top: 5px; 
    margin-bottom: 10px;
}
.ep-mobile-menu li.mobile-dropdown-active > .sub-menu { display: flex; animation: slideDown 0.3s ease; }
.ep-mobile-menu li.mobile-dropdown-active > a .dropdown-icon { transform: rotate(180deg); color: var(--accent); }

/* Dropdown arrow: large tap target so it's easy to hit without triggering parent link navigation */
.ep-mobile-menu .has-dropdown > a .dropdown-icon {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 44px; min-height: 44px; margin: -10px -4px -10px 4px;
    font-size: 1.3rem; cursor: pointer; flex-shrink: 0;
}

/* Increased padding on the links for easier tapping */
.ep-mobile-menu .sub-menu a { 
    font-size: 1rem; 
    color: var(--text-muted); 
    font-weight: 600; 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    padding: 10px 0; 
}
.ep-mobile-menu .sub-menu a:hover { color: var(--accent); }

/* STANDARD SHORTCUT NAV */
.shortcut-nav-container { position: sticky; top: var(--ep-header-stick, var(--header-height)); z-index: 800; background: var(--shortcut-nav-bg, var(--bg-body)); border-bottom: 1px solid var(--border); padding: 12px 0; width: 100%; overflow-x: auto; }

.shortcut-nav-list { display: flex; gap: 12px; margin: 0; padding: 0; white-space: nowrap; }
.shortcut-nav-list a { padding: 8px 16px; background: var(--shortcut-nav-link-bg, var(--bg-section-alt)); border-radius: 50px; font-size: 0.85rem; font-weight: 700; color: var(--shortcut-nav-link-text, var(--text-muted)); display: flex; align-items: center; gap: 6px; }
.shortcut-nav-list a:hover { background: var(--shortcut-nav-hover-bg, var(--accent)); color: var(--shortcut-nav-hover-text, var(--bg-body)); }

/* NEWS-STYLE SHORTCUT NAV */
.shortcut-nav-container.style-news {
    border-top: 1px solid var(--border);
    border-bottom: 2px solid var(--text-main);
    padding: 0.2rem 0;
    background: var(--shortcut-nav-bg, var(--bg-body));
}
.shortcut-nav-container.style-news .shortcut-nav-list {
    display: flex;
    justify-content: center;
    gap: 2rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.shortcut-nav-container.style-news .shortcut-nav-list a {
    background: transparent;
    border: none;
    min-height: 34px; /* comfortable touch target (the bar stays the same height) */
    padding: 0 2px;
    border-radius: 0;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--shortcut-nav-link-text, var(--text-main));
    text-transform: uppercase;
}
.shortcut-nav-container.style-news .shortcut-nav-list a:hover {
    color: var(--shortcut-nav-hover-text, var(--accent));
    background: transparent;
    box-shadow: none;
    transform: none;
}
@media (max-width: 900px) {
    .shortcut-nav-container.style-news .shortcut-nav-list {
        justify-content: flex-start;
        padding: 0 1rem;
    }
}


/* VISIBILITY UTILITY */
@media (min-width: 993px) {
    .ep-hide-desktop { display: none !important; }
}

/* SEARCH OVERLAY */
.search-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(255,255,255,0.98); z-index: 2000; display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transition: 0.3s; }
.search-overlay.active { opacity: 1; visibility: visible; }
.search-input { width: 100%; background: transparent; border: none; border-bottom: 2px solid var(--border); font-size: 3rem; font-weight: 800; color: var(--text-main); padding: 20px 0; text-align: center; outline: none; }
.search-close { position: absolute; top: 30px; right: 30px; font-size: 2.5rem; cursor: pointer; background: transparent; border: none; }

/* =========================================
   7. RESPONSIVE OVERRIDES
   ========================================= */
@media (max-width: 992px) {
    .site-header { 
        height: var(--header-height) !important; 
        padding-top: 0 !important; 
    }
    .nav-menu { 
        display: none !important; 
    }
    .mobile-menu-trigger {
        display: flex;
        flex-shrink: 0;
    }

    /* Mobile icon-btn color — light default #1a1a1a, dark default #ffffff */
    .site-header .header-actions .icon-btn {
        color: var(--mob-icon-color, #1a1a1a);
    }
    [data-theme="dark"] .site-header .header-actions .icon-btn {
        color: var(--mob-icon-color, #ffffff);
    }
    /* Mobile icon-btn hover */
    .site-header .header-actions .icon-btn:hover {
        background: var(--mob-icon-hover-bg, var(--accent));
        color: var(--mob-icon-hover-color, var(--mob-icon-color, #1a1a1a));
    }
    [data-theme="dark"] .site-header .header-actions .icon-btn:hover {
        color: var(--mob-icon-hover-color, var(--mob-icon-color, #ffffff));
    }

    /* --- Universal Mobile Header Inner --- */
    .site-header .header-inner {
        display: flex !important;
        flex-wrap: nowrap !important;
        justify-content: space-between !important;
        align-items: center !important;
        gap: 12px !important;
    }

    /* --- Universal Logo Constraint (Prevents Overlap on non-style-2 headers) --- */
    .site-header:not(.header-style-2) .logo {
        position: static !important;
        transform: none !important;
        flex: 1 1 0% !important;
        min-width: 0 !important;
        justify-content: flex-start !important;
        margin: 0 !important;
        padding-left: 0 !important;
    }

    /* --- Style 2 Mobile: hide nav halves; grid 1fr auto 1fr keeps logo centred ---
       The grid columns remain 1fr auto 1fr; the two arms shrink to their visible
       content (just the mobile trigger / action icons), so the auto logo column
       stays naturally centred between them. No position:absolute needed. */
    .site-header.header-style-2 .nav-split-left,
    .site-header.header-style-2 .nav-split-right { display: none !important; }

    .site-header.header-style-2 .logo {
        position: static !important;
        transform: none !important;
        justify-content: center !important;
        max-width: calc(100vw - 160px) !important;
    }

    /* --- Text Logo Truncation & Scaling --- */
    .site-header .ep-logo-link {
        width: 100% !important;
        max-width: var(--logo-width, 150px) !important;
        display: flex;
        align-items: center;
        min-width: 0;
    }
    
    .site-header.header-style-2 .ep-logo-link {
        justify-content: center;
    }

    /* PREMIUM FIX: Target ONLY the text logo div by explicitly excluding the SVG wrappers */
    .site-header .ep-logo-link > div:not(.ep-logo-light):not(.ep-logo-dark) {
        font-size: 1.25rem !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        display: block !important; /* Required for ellipsis, now safely isolated */
        width: 100%;
    }
    
    .site-header.header-style-2 .ep-logo-link > div:not(.ep-logo-light):not(.ep-logo-dark) {
        text-align: center;
    }
    
    .site-header .ep-logo-link > div span {
        display: inline !important;
    }
    
    .site-header .ep-logo-link > div span {
        display: inline !important;
    }

    /* SVG/Image Logo Mobile Scaling */
    .site-header .ep-logo-link svg,
    .site-header .ep-logo-link img {
        max-width: 100% !important;
        height: auto !important;
        max-height: calc(var(--header-height) - 20px);
    }

    /* --- Header Actions Space Optimization --- */
    .site-header .header-actions {
        flex: 0 0 auto !important;
        justify-content: flex-end !important;
        margin: 0 !important;
        position: static !important;
        gap: 6px !important; /* Reduced from 12px to save horizontal space */
    }

    .site-header .header-actions .icon-btn {
        width: 36px !important; /* Reduced from 42px */
        height: 36px !important;
        font-size: 1.15rem !important;
    }

    /* Stacked Headers Mobile Fixes */
    .header-style-6 .left-socials,
    .header-style-6 .header-date,
    .header-style-7 .header-date { 
        display: none !important; 
    }
    
    body:has(header.header-style-6) .site-main > section:first-child,
    body:has(header.header-style-7) .site-main > section:first-child {
        padding-top: 40px !important;
    }
}

/* Fix spacing between left-aligned mobile menu and logo */
@media (max-width: 992px) {
    .header-inner > .mobile-menu-trigger {
        margin-right: 5px !important; /* Reduced from 20px to save space */
    }
    .header-style-6 .header-left-wrap { display: none !important; }
}

/* Fix spacing between left-aligned mobile menu and logo */
@media (max-width: 992px) {
    .header-inner > .mobile-menu-trigger {
        margin-right: 20px !important;
    }
    .site-header .logo {
        padding-left: 5px !important;
    }
}

/* =========================================
   MOBILE MENU SOCIAL ICONS
   ========================================= */
.mobile-menu-socials {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(0,0,0,0.05);
}

[data-theme="dark"] .mobile-menu-socials {
    border-top-color: rgba(255,255,255,0.05);
}

.mobile-menu-socials a {
    font-size: 1.4rem;
    color: var(--text-main);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--bg-section-alt);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    text-decoration: none;
}

.mobile-menu-socials a:hover {
    color: var(--eph-on-fill, var(--on-accent-fill, #fff));
    background: var(--accent);
    border-color: var(--accent);
    transform: translateY(-3px);
}

/* Hide dropdown arrows in the horizontal shortcut nav */
.shortcut-nav-list .dropdown-icon {
    display: none !important;
}

/* =========================================
   AJAX DROPDOWN SEARCH
   ========================================= */
.header-search-wrap { position: relative; display: flex; align-items: center; }

.ep-search-dropdown {
    position: absolute;
    top: calc(100% + 15px);
    right: -10px;
    width: 360px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-hover);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1000;
    padding: 15px;
}

.ep-search-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.ep-dropdown-search-form {
    display: flex;
    align-items: center;
    background: var(--bg-section-alt);
    border-radius: 50px;
    padding: 10px 15px;
    border: 1px solid var(--border);
    transition: border-color 0.3s;
}
.ep-dropdown-search-form:focus-within { border-color: var(--accent); }
.ep-dropdown-search-form i.ri-search-line { color: var(--text-muted); margin-right: 10px; font-size: 1.1rem; }

.ep-ajax-search-input {
    flex-grow: 1;
    border: none;
    background: transparent;
    color: var(--text-main);
    outline: none;
    font-size: 0.95rem;
}
.ep-ajax-search-input::placeholder { color: var(--text-muted); opacity: 0.7; }

.ep-ajax-search-results {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 380px;
    overflow-y: auto;
    scrollbar-width: thin; 
    scrollbar-color: var(--border) transparent;
}
.ep-ajax-search-results::-webkit-scrollbar { width: 4px; }
.ep-ajax-search-results::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.ep-ajax-result-item {
    display: flex;
    gap: 12px;
    align-items: center;
    text-decoration: none;
    transition: 0.2s ease;
    padding-top: 15px;
}
.ep-ajax-result-item:first-child { margin-top: 5px; }
.ep-ajax-result-item:hover .ep-ajax-result-title { color: var(--accent-text, var(--accent)); }

.ep-ajax-result-thumb { 
    width: 60px; height: 60px; 
    border-radius: 8px; 
    object-fit: cover; 
    flex-shrink: 0; 
    background: var(--bg-section-alt);
}
.ep-ajax-result-info { display: flex; flex-direction: column; }
.ep-ajax-result-title { 
    font-size: 0.9rem; 
    font-family: var(--font-heading);
    font-weight: 700; 
    color: var(--text-main); 
    margin-bottom: 4px; 
    line-height: 1.3; 
    transition: color 0.2s;
}
.ep-ajax-result-meta { font-size: 0.75rem; color: var(--text-muted); font-weight: 600; }

.ep-search-view-all {
    display: block; text-align: center; margin-top: 15px; padding-top: 15px;
    border-top: 1px solid var(--border); font-size: 0.85rem; font-weight: 700; 
    color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px;
}
.ep-search-view-all:hover { color: var(--accent); }

@media (max-width: 768px) {
    .ep-search-dropdown {
        position: fixed;
        top: var(--ep-header-stick, var(--header-height));
        left: 20px;
        right: 20px;
        width: auto;
        transform: translateY(-10px);
    }
}

@media (max-width: 992px) {
    .ep-search-dropdown {
        position: fixed; /* Attaches to viewport so it overlaps everything perfectly */
        top: calc(var(--ep-header-stick, var(--header-height)) + 10px);
        left: 15px;
        right: 15px;
        width: auto;
        transform: translateY(-10px);
    }
}
/* --- HEADER AD WRAPPER --- */
.ep-header-ad-wrapper {
    /* Remove container's default vertical padding so the ad sits flush */
    padding-top: 0;
    padding-bottom: 0;
    background: var(--bg-body);
}

/* Override the inline margin that ad-manager.php injects */
.ep-header-ad-wrapper .ep-ad-container {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding: 8px 0;
}

/* The fixed header's real height is reserved on <body> (--ep-header-offset, measured
   in header.php), so the ad needs no offset of its own on any layout or header style. */

/* =========================================
   SEARCH DESIGNS — Fullscreen · Spotlight · Sheet
   Shared markup: template-parts/header/search-overlay.php
   Themed by the active demo: accent, heading font, radius (--sk-* from the demo skins).
   ========================================= */
.ep-so {
    --so-radius: var(--sk-radius, 14px);
    --so-bg: var(--so-bg-c, var(--bg-body, #fff));
    /* Colours › Search Overlay (empty = accent) */
    --so-acc: var(--so-accent-c, var(--accent));
    --so-acc-text: var(--so-accent-c, var(--accent-text, var(--accent)));
    --so-fg: var(--text-main, #111);
    --so-muted: var(--text-muted, #666);
    --so-line: var(--border, rgba(0,0,0,.1));
    position: fixed; inset: 0; z-index: 2000;
    display: block; width: auto; height: auto;
    background: transparent;
    opacity: 0; visibility: hidden;
    transition: opacity .28s ease, visibility .28s;
}
.ep-so.active { opacity: 1; visibility: visible; }
.ep-so, .ep-so *, .ep-so *::before, .ep-so *::after { box-sizing: border-box; }
.ep-so__backdrop { position: absolute; inset: 0; background: color-mix(in srgb, var(--so-bg) 96%, transparent); }
.ep-so__panel {
    position: relative; z-index: 1;
    width: min(880px, calc(100% - 40px)); max-width: none;
    margin: 0 auto; padding: 0;
    display: flex; flex-direction: column;
    color: var(--so-fg);
}
.ep-so__top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.ep-so__label {
    color: var(--so-label-c, var(--accent-text, var(--accent)));
    font-family: var(--sk-label-font, var(--font-body));
    font-size: 12px; font-weight: 700; letter-spacing: var(--sk-label-ls, 2px);
    text-transform: var(--sk-label-tt, uppercase);
}
.ep-so .ep-so__close {
    position: static; display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; padding: 0;
    border: 1px solid var(--so-line); border-radius: 50%;
    background: transparent; color: var(--so-fg);
    font-size: 22px; line-height: 1; cursor: pointer;
    transition: background-color .2s, color .2s, border-color .2s, transform .2s;
}
.ep-so .ep-so__close:hover, .ep-so .ep-so__close:focus-visible { border-color: var(--accent); background: var(--accent); color: var(--on-accent, #fff); transform: rotate(90deg); }
.ep-so__form { position: relative; display: flex; align-items: center; gap: 14px; margin: 0; }
.ep-so__icon { flex: 0 0 auto; color: var(--so-acc-text); }
.ep-so .search-input.ep-ajax-search-input {
    flex: 1 1 auto; min-width: 0; width: auto;
    margin: 0; padding: 0; border: 0; background: transparent; box-shadow: none;
    color: var(--so-fg); font-family: var(--font-heading);
    font-style: var(--sk-title-style, normal);
    font-weight: var(--sk-title-weight, 800); letter-spacing: var(--sk-title-ls, -0.02em);
    text-align: left; outline: none;
}
.ep-so .search-input::placeholder { color: var(--so-muted); opacity: 1; } /* full muted colour: ≥4.5:1 in light and dark */
.ep-so .search-input::-webkit-search-cancel-button { display: none; }
.ep-so .ep-search-spinner { display: none; color: var(--so-acc-text); font-size: 20px; }
.ep-so__kbd {
    flex: 0 0 auto; padding: 4px 8px;
    border: 1px solid var(--so-line); border-bottom-width: 2px; border-radius: 6px;
    color: var(--so-muted); font: 600 11px/1 var(--font-body, system-ui);
}
.ep-so__results { max-height: none; gap: 0; }
.ep-so__results:empty { display: none; }
.ep-so .ep-ajax-result-item { padding: 12px 0; border-bottom: 1px solid var(--so-line); }
.ep-so .ep-ajax-result-item:first-child { margin-top: 0; }
.ep-so .ep-ajax-result-thumb { width: 64px; height: 64px; border-radius: calc(var(--so-radius) * .6); }
.ep-so .ep-ajax-result-title { font-size: 1rem; }
.ep-so .ep-search-view-all { display: none; margin-top: 4px; border-top: 0; text-align: left; color: var(--so-acc-text); }
.ep-so__topics { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.ep-so.has-results .ep-so__topics { display: none; }
.ep-so__topics-title { color: var(--so-muted); font: 600 12px/1 var(--sk-label-font, var(--font-body)); letter-spacing: 1px; text-transform: uppercase; }
.ep-so__topics ul { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.ep-so__topics a {
    display: inline-block; padding: 7px 14px;
    border: 1px solid var(--so-chip-border, var(--so-line)); border-radius: var(--sk-btn-radius, 50px);
    background: var(--so-chip-bg, transparent);
    color: var(--so-chip-text, var(--so-fg)); font-size: 13px; font-weight: 600; text-decoration: none;
    transition: border-color .2s, background-color .2s, color .2s;
}
.ep-so__topics a:hover, .ep-so__topics a:focus-visible { border-color: var(--accent); background: var(--accent); color: var(--on-accent, #fff); }
/* Dark mode: borders and keycaps need a touch more presence on near-black */
[data-theme="dark"] .ep-so { --so-line: color-mix(in srgb, var(--so-fg) 18%, transparent); }
[data-theme="dark"] .ep-so--spotlight .ep-so__panel { box-shadow: 0 0 0 1px var(--so-line), 0 30px 80px -20px rgba(0, 0, 0, .8); }

/* --- Fullscreen (editorial) --- */
.ep-so--overlay .ep-so__panel { height: 100%; padding: 8vh 0 40px; gap: 26px; overflow-y: auto; transform: translateY(14px); transition: transform .35s cubic-bezier(.16,1,.3,1); }
.ep-so--overlay.active .ep-so__panel { transform: none; }
.ep-so--overlay .ep-so__form { padding-bottom: 14px; border-bottom: 3px solid var(--so-fg); }
.ep-so--overlay .ep-so__form:focus-within { border-bottom-color: var(--so-acc); }
.ep-so--overlay .ep-so__icon { font-size: clamp(28px, 4vw, 44px); }
.ep-so--overlay .search-input.ep-ajax-search-input { font-size: clamp(2rem, 1.2rem + 3.6vw, 4rem); line-height: 1.1; }
.ep-so--overlay .ep-so__kbd { display: none; }
.ep-so--overlay .ep-so__results { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 36px; }

/* --- Spotlight (app-like modal) --- */
.ep-so--spotlight .ep-so__backdrop { background: rgba(8, 10, 18, .55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.ep-so--spotlight .ep-so__panel {
    width: min(640px, calc(100% - 32px)); margin-top: 12vh;
    max-height: 76vh; overflow: hidden;
    border: 1px solid var(--so-line); border-radius: var(--so-radius);
    background: var(--so-bg);
    box-shadow: 0 30px 80px rgba(0, 0, 0, .35), 0 0 0 1px color-mix(in srgb, var(--accent) 12%, transparent);
    transform: translateY(-10px) scale(.98); transition: transform .28s cubic-bezier(.16,1,.3,1);
}
.ep-so--spotlight.active .ep-so__panel { transform: none; }
.ep-so--spotlight .ep-so__top { order: 3; padding: 10px 18px; border-top: 1px solid var(--so-line); background: color-mix(in srgb, var(--so-acc) 5%, var(--so-bg)); }
.ep-so--spotlight .ep-so__label { font-size: 11px; }
.ep-so--spotlight .ep-so__close { width: 32px; height: 32px; font-size: 18px; }
.ep-so--spotlight .ep-so__form { order: 1; padding: 16px 18px; border-bottom: 1px solid var(--so-line); }
.ep-so--spotlight .ep-so__icon { font-size: 22px; }
.ep-so--spotlight .search-input.ep-ajax-search-input { font-family: var(--font-body); font-style: normal; font-size: 1.15rem; font-weight: 500; letter-spacing: 0; }
.ep-so--spotlight .ep-so__results { order: 2; padding: 6px 10px; overflow-y: auto; }
.ep-so--spotlight .ep-ajax-result-item { padding: 10px 8px; border: 0; border-radius: calc(var(--so-radius) * .6); }
.ep-so--spotlight .ep-ajax-result-item:hover { background: color-mix(in srgb, var(--so-acc) 9%, transparent); }
.ep-so--spotlight .ep-ajax-result-thumb { width: 48px; height: 48px; }
.ep-so--spotlight .ep-search-view-all { order: 2; padding: 10px 18px 12px; margin: 0; }
.ep-so--spotlight .ep-so__topics { order: 2; padding: 16px 18px 18px; }

/* --- Sheet (drops from the top) --- */
.ep-so--sheet .ep-so__backdrop { background: rgba(10, 12, 20, .42); }
.ep-so--sheet .ep-so__panel {
    width: 100%; max-width: none; padding: 26px max(20px, calc((100% - 1040px) / 2)) 30px; gap: 18px;
    max-height: 88vh; overflow-y: auto;
    border-radius: 0 0 calc(var(--so-radius) * 1.6) calc(var(--so-radius) * 1.6);
    background: var(--so-bg); box-shadow: 0 24px 60px rgba(0, 0, 0, .22);
    transform: translateY(-100%); transition: transform .38s cubic-bezier(.16,1,.3,1);
}
.ep-so--sheet.active .ep-so__panel { transform: none; }
.ep-so--sheet .ep-so__form {
    padding: 6px 8px 6px 20px;
    border: 2px solid var(--so-line); border-radius: var(--sk-btn-radius, 50px);
    background: color-mix(in srgb, var(--accent) 5%, var(--so-bg));
    transition: border-color .2s, box-shadow .2s;
}
.ep-so--sheet .ep-so__form:focus-within { border-color: var(--so-acc); box-shadow: 0 0 0 4px color-mix(in srgb, var(--so-acc) 16%, transparent); }
.ep-so--sheet .ep-so__icon { font-size: 22px; }
.ep-so--sheet .search-input.ep-ajax-search-input { padding: 12px 0; font-size: 1.35rem; font-weight: 700; }
.ep-so--sheet .ep-so__kbd { margin-right: 8px; }
.ep-so--sheet .ep-so__results { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); column-gap: 28px; }

body.admin-bar .ep-so--sheet .ep-so__panel,
body.admin-bar .ep-so--overlay .ep-so__panel { margin-top: 32px; }

@media (max-width: 782px) {
    body.admin-bar .ep-so--sheet .ep-so__panel,
    body.admin-bar .ep-so--overlay .ep-so__panel { margin-top: 46px; }
}
@media (max-width: 768px) {
    .ep-so__kbd { display: none; }
    .ep-so--overlay .ep-so__panel { padding-top: 40px; }
    .ep-so--overlay .ep-so__results { grid-template-columns: minmax(0, 1fr); }
    .ep-so--spotlight .ep-so__panel { margin-top: 16px; max-height: calc(100vh - 32px); }
    .ep-so--sheet .ep-so__panel { padding: 18px 16px 22px; }
    .ep-so--sheet .search-input.ep-ajax-search-input { font-size: 1.1rem; }
}
@media (prefers-reduced-motion: reduce) {
    .ep-so, .ep-so__panel { transition: none !important; }
}

/* =========================================
   MOBILE MENU DESIGNS — Classic · Drawer · Editorial · Sheet
   Markup: template-parts/header/mobile-nav.php. Themed by the active demo
   (accent, heading font, radius from the demo skins).
   ========================================= */
.mobile-nav-overlay.ep-mn {
    --mn-bg: var(--bg-body, #fff);
    --mn-fg: var(--text-main, #111);
    --mn-muted: var(--text-muted, #666);
    --mn-line: var(--border, rgba(0,0,0,.1));
    --mn-soft: color-mix(in srgb, var(--accent) 7%, var(--mn-bg));
    --mn-radius: var(--sk-radius, 16px);
    --mn-pill: var(--sk-btn-radius, 50px);
    position: fixed; inset: 0; z-index: 2100;
    width: auto; height: auto; padding: 0; margin: 0;
    background: transparent; overflow: visible; transform: none;
    visibility: hidden; pointer-events: none;
    transition: visibility 0s linear .38s;
}
.mobile-nav-overlay.ep-mn.active { visibility: visible; pointer-events: auto; transition: none; }
.ep-mn, .ep-mn *, .ep-mn *::before, .ep-mn *::after { box-sizing: border-box; }
.ep-mn__backdrop { position: absolute; inset: 0; background: rgba(8, 10, 18, .5); opacity: 0; transition: opacity .3s ease; }
.ep-mn.active .ep-mn__backdrop { opacity: 1; }
.ep-mn__panel {
    position: absolute; display: flex; flex-direction: column; gap: 20px;
    padding: 16px 20px calc(24px + env(safe-area-inset-bottom, 0px));
    background: var(--mn-bg); color: var(--mn-fg);
    overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
    transition: transform .38s cubic-bezier(.16, 1, .3, 1), opacity .3s ease;
}
body.admin-bar .ep-mn__panel { padding-top: calc(16px + var(--ep-admin-bar, 0px)); }

/* Head: brand + close */
.ep-mn__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--mn-line); }
.ep-mn__brand { color: var(--mn-fg); font-family: var(--font-heading); font-size: 1.25rem; font-style: var(--sk-title-style, normal); font-weight: var(--sk-title-weight, 800); letter-spacing: var(--sk-title-ls, -0.02em); text-decoration: none; }
.ep-mn .ep-mn__close {
    position: static; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
    width: 42px; height: 42px; padding: 0; border: 1px solid var(--mn-line); border-radius: 50%;
    background: transparent; color: var(--mn-fg); font-size: 22px; cursor: pointer;
    transition: background-color .2s, color .2s, border-color .2s, transform .2s;
}
.ep-mn .ep-mn__close:hover { border-color: var(--accent); background: var(--accent); color: var(--eph-on-accent, var(--on-accent-fill, #fff)); transform: rotate(90deg); }

/* Search with live results */
.ep-mn__form {
    display: flex; align-items: center; gap: 10px;
    padding: 4px 4px 4px 16px;
    border: 1.5px solid var(--mn-line); border-radius: var(--mn-pill);
    background: var(--mn-soft);
    transition: border-color .2s, box-shadow .2s;
}
.ep-mn__form:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 15%, transparent); }
.ep-mn__form > i.ri-search-line { color: var(--accent); font-size: 18px; }
.ep-mn__form .ep-ajax-search-input { min-width: 0; padding: 10px 0; border: 0; background: transparent; color: var(--mn-fg); font-size: 16px; /* 16px stops iOS zoom */ }
.ep-mn__form .ep-ajax-search-input::-webkit-search-cancel-button { display: none; }
.ep-mn .ep-search-spinner { display: none; color: var(--accent); }
.ep-mn__go { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 38px; height: 38px; padding: 0; border: 0; border-radius: var(--mn-pill); background: var(--accent); color: var(--eph-on-accent, var(--on-accent-fill, #fff)); font-size: 18px; cursor: pointer; }
.ep-mn__results { max-height: none; gap: 0; }
.ep-mn__results:empty { display: none; }
.ep-mn .ep-ajax-result-item { padding: 10px 0; border-bottom: 1px solid var(--mn-line); }
.ep-mn .ep-ajax-result-item:first-child { margin-top: 6px; }
.ep-mn .ep-ajax-result-thumb { width: 52px; height: 52px; border-radius: calc(var(--mn-radius) * .5); }
.ep-mn .ep-search-view-all.ep-mn__all { display: none; margin-top: 6px; padding-top: 8px; border-top: 0; text-align: left; color: var(--accent); }
.ep-mn:has(.ep-mn__search.has-results) .ep-mn__nav,
.ep-mn:has(.ep-mn__search.has-results) .ep-mn__topics { display: none; }

/* Menu */
.ep-mn .ep-mobile-menu > li > a { padding: 14px 0; border-bottom: 1px solid var(--mn-line); color: var(--mn-fg); font-family: var(--font-heading); font-size: 1.12rem; font-weight: 700; }
.ep-mn .ep-mobile-menu > li.current-menu-item > a,
.ep-mn .ep-mobile-menu > li > a:hover { color: var(--accent); }
.ep-mn .ep-mobile-menu .sub-menu { border-left-color: color-mix(in srgb, var(--accent) 40%, var(--mn-line)); }

/* Topics + footer */
.ep-mn__label { display: block; margin-bottom: 10px; color: var(--mn-muted); font: 700 11px/1 var(--sk-label-font, var(--font-body)); letter-spacing: 1.5px; text-transform: uppercase; }
.ep-mn__topics ul { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.ep-mn__topics a { display: inline-block; padding: 7px 14px; border: 1px solid var(--mn-line); border-radius: var(--mn-pill); color: var(--mn-fg); font-size: 13px; font-weight: 600; text-decoration: none; transition: background-color .2s, border-color .2s, color .2s; }
.ep-mn__topics a:hover { border-color: var(--accent); background: var(--accent); color: var(--eph-on-accent, var(--on-accent-fill, #fff)); }
.ep-mn__foot { display: flex; flex-direction: column; gap: 16px; margin-top: auto; padding-top: 6px; }
.ep-mn__cta .eph-cta { display: flex !important; justify-content: center; box-sizing: border-box; width: 100%; margin: 0; padding: 14px 18px; }
.ep-mn .mobile-menu-socials { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; border: 0; }
.ep-mn .mobile-menu-socials a { background: transparent; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 1px solid var(--mn-line); border-radius: 50%; color: var(--mn-fg); font-size: 18px; transition: background-color .2s, color .2s, border-color .2s; }
.ep-mn .mobile-menu-socials a:hover { border-color: var(--accent); background: var(--accent); color: var(--eph-on-accent, var(--on-accent-fill, #fff)); }
.ep-mn .mobile-menu-socials:empty { display: none; }

/* --- Classic: full screen, drops from the top --- */
.ep-mn--classic .ep-mn__backdrop { display: none; }
.ep-mn--classic .ep-mn__panel { inset: 0; transform: translateY(-100%); }
.ep-mn--classic.active .ep-mn__panel { transform: none; }

/* --- Drawer: side panel over a dimmed page --- */
.ep-mn--drawer .ep-mn__backdrop { -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.ep-mn--drawer .ep-mn__panel { top: 0; bottom: 0; width: min(380px, 88vw); box-shadow: 0 0 60px rgba(0, 0, 0, .3); }
.ep-mn--drawer.ep-mn--from-right .ep-mn__panel { right: 0; border-radius: var(--mn-radius) 0 0 var(--mn-radius); transform: translateX(105%); }
.ep-mn--drawer.ep-mn--from-left .ep-mn__panel { left: 0; border-radius: 0 var(--mn-radius) var(--mn-radius) 0; transform: translateX(-105%); }
.ep-mn--drawer.active .ep-mn__panel { transform: none; }
.ep-mn--drawer .ep-mobile-menu > li > a { border-bottom: 0; padding: 12px 14px; margin: 0 -14px; border-radius: calc(var(--mn-radius) * .6); font-family: var(--font-body); font-size: 1.02rem; font-weight: 600; }
.ep-mn--drawer .ep-mobile-menu > li > a:hover,
.ep-mn--drawer .ep-mobile-menu > li.current-menu-item > a { background: color-mix(in srgb, var(--accent) 10%, transparent); }

/* --- Editorial: full screen, large headline links (numbered when "Number the Menu Items" is on) --- */
.ep-mn--editorial .ep-mn__backdrop { display: none; }
.ep-mn--editorial .ep-mn__panel { inset: 0; padding-left: 24px; padding-right: 24px; opacity: 0; transform: translateY(16px); }
.ep-mn--editorial.active .ep-mn__panel { opacity: 1; transform: none; }
.ep-mn--editorial .ep-mn__head { border-bottom: 3px solid var(--mn-fg); }
.ep-mn--editorial .ep-mn__brand { font-size: 1.5rem; }
.ep-mn--editorial .ep-mobile-menu { counter-reset: mn; }
.ep-mn--editorial .ep-mobile-menu > li > a { justify-content: flex-start; gap: 14px; padding: 16px 0; font-size: clamp(1.5rem, 6.5vw, 2rem); font-style: var(--sk-title-style, normal); font-weight: var(--sk-title-weight, 800); letter-spacing: var(--sk-title-ls, -0.02em); line-height: 1.1; }
.ep-mn--editorial.ep-mn--numbered .ep-mobile-menu > li > a::before { counter-increment: mn; content: counter(mn, decimal-leading-zero); align-self: flex-start; margin-top: .35em; color: var(--accent); font: 700 12px/1 var(--sk-label-font, var(--font-body)); letter-spacing: 1px; }
.ep-mn--editorial .ep-mobile-menu > li > a .dropdown-icon { margin-left: auto; }
.ep-mn--editorial .ep-mobile-menu .ep-menu-title i { display: none; }

/* --- Sheet: rounded bottom sheet with tiles --- */
.ep-mn--sheet .ep-mn__panel { left: 0; right: 0; bottom: 0; max-height: 90vh; padding-top: 26px; border-radius: calc(var(--mn-radius) * 1.6) calc(var(--mn-radius) * 1.6) 0 0; box-shadow: 0 -20px 60px rgba(0, 0, 0, .25); transform: translateY(105%); }
.ep-mn--sheet .ep-mn__panel::before { content: ''; position: absolute; top: 9px; left: 50%; width: 44px; height: 5px; margin-left: -22px; border-radius: 5px; background: var(--mn-line); }
.ep-mn--sheet.active .ep-mn__panel { transform: none; }
body.admin-bar .ep-mn--sheet .ep-mn__panel { padding-top: 26px; }
.ep-mn--sheet .ep-mn__head { padding-bottom: 0; border-bottom: 0; }
.ep-mn--sheet .ep-mobile-menu { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ep-mn--sheet .ep-mobile-menu > li > a { height: 100%; padding: 14px 14px; border: 1px solid var(--mn-line); border-radius: var(--mn-radius); background: var(--mn-soft); font-family: var(--font-body); font-size: .98rem; font-weight: 700; }
.ep-mn--sheet .ep-mobile-menu > li > a:hover,
.ep-mn--sheet .ep-mobile-menu > li.current-menu-item > a { border-color: var(--accent); }
.ep-mn--sheet .ep-mobile-menu > li.mobile-dropdown-active,
.ep-mn--sheet .ep-mobile-menu > li:has(> .sub-menu):last-child:nth-child(odd) { grid-column: 1 / -1; }
.ep-mn--sheet .ep-mobile-menu > li:last-child:nth-child(odd) { grid-column: 1 / -1; }

@media (min-width: 993px) { .mobile-nav-overlay.ep-mn { display: none; } }
@media (prefers-reduced-motion: reduce) { .ep-mn__panel, .ep-mn__backdrop { transition: none !important; } }

/* Header menu "More" dropdown (built by main.js when the menu is too long) */
.ep-main-menu > .ep-menu-more > .sub-menu { left: auto; right: 0; }
.ep-main-menu .ep-menu-more .sub-menu .sub-menu { left: auto; right: 100%; margin: 0 5px 0 0; }
.ep-main-menu .ep-menu-more > .sub-menu > li > a .dropdown-icon { transform: rotate(-90deg); }

/* "More" button: text, menu icon, or both (option "More" Button; demos pick one) */
.ep-main-menu > .ep-menu-more .ep-more-ico { font-size: 1.25em; line-height: 1; vertical-align: -0.2em; }
.ep-main-menu > .ep-more--icon_text .ep-more-ico { margin-right: 6px; }
.ep-main-menu > .ep-more--icon > a .dropdown-icon,
.ep-main-menu > .ep-more--icon_text > a .dropdown-icon { display: none; }
.ep-main-menu > .ep-more--icon > a { min-width: 34px; justify-content: center; }
.ep-main-menu > .ep-more--icon > a::after { display: none !important; }
.ep-main-menu > .ep-menu-more .screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }

/* Live markets in the ticker */
.ticker-content:hover .ticker-text { animation-play-state: paused; }
.ep-mkt { display: inline-flex; align-items: baseline; gap: 6px; margin-right: 2rem; font-variant-numeric: tabular-nums; }
.ep-mkt__n { font-weight: 700; color: #fff; }
.ep-mkt__p { color: rgba(255,255,255,.82); }
.ep-mkt__c { font-weight: 600; font-size: .92em; color: rgba(255,255,255,.6); }
.ep-mkt__c.is-up { color: #34d399; }
.ep-mkt__c.is-down { color: #fb7185; }
.ep-mkt--wait { color: rgba(255,255,255,.6); }
@media (prefers-reduced-motion: reduce) { .ticker-text[data-ep-market] { animation: none; overflow-x: auto; } }
