/* css/style.css */
:root {
    /* Corporate Blue & White */
    --primary-color: #0956fd;
    --primary-hover: #0745cc;
    --primary-light: rgba(9, 86, 253, 0.1);
    
    --text-main: #111827;
    --text-muted: #6b7280;
    --bg-main: #f9fafb;
    --bg-card: #ffffff;
    
    --border-color: #e5e7eb;
    --danger: #ef4444;
    
    --font-sans: 'Inter', sans-serif;
    --font-serif: 'Playfair Display', serif;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    --radius-md: 8px;
    --radius-lg: 12px;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg-main: #060914;
    --bg-card: #0b1120;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: #1e293b;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.6), 0 4px 6px -2px rgba(0, 0, 0, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    color: var(--text-main);
    background-color: var(--bg-main);
    line-height: 1.5;
    overflow-y: scroll;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Typography */
h1, h2, h3, h4 {
    color: var(--text-main);
    font-weight: 800;
}

/* Topbar */
.topbar {
    background-color: #111827; /* Very dark blue/black */
    color: #fff;
    font-size: 0.875rem;
    padding: 0.5rem 0;
}

.topbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.social-links a {
    color: #9ca3af;
    margin-left: 1rem;
    font-size: 1.1rem;
}

.social-links a:hover {
    color: #fff;
}

/* Header */
.header {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
    transition: background-color 0.3s, border-color 0.3s;
}

#reading-progress {
    position: absolute;
    bottom: -1px;
    left: 0;
    height: 3px;
    background: var(--primary-color);
    width: 0%;
    z-index: 101;
    transition: width 0.1s ease-out;
}


.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100px;
}


.logo h1, .logo .logo-title {
    font-size: 2.2rem;
    letter-spacing: -1px;
}

/* Slogan: GPU-only with opacity */
.logo .slogan-text {
    transition: opacity 0.25s ease;
    opacity: 1;
    overflow: hidden;
}
/* Slogan is maintained when scrolling down per user request */

/* Logo image: use transform scale instead of changing height */
.logo img {
    will-change: transform;
    transition: transform 0.25s ease;
    transform-origin: left center;
}
.header.shrink .logo img {
    transform: scale(0.8);
}

/* Logo text: use transform scale instead of font-size */
.logo {
    will-change: transform;
    transition: transform 0.25s ease;
    transform-origin: left center;
}
.header.shrink .logo {
    transform: scale(0.9);
}

/* Search bar: already uses transform â€” good */
.search-bar-modern {
    will-change: transform;
    transition: transform 0.25s ease;
    transform-origin: right center;
}
.header.shrink .search-bar-modern {
    transform: scale(0.92);
}

/* Action buttons: use transform instead of width/height */
.header-actions .hover-circle {
    will-change: transform;
    transition: transform 0.25s ease;
}
.header.shrink .header-actions .hover-circle {
    transform: scale(0.88);
}
.header-actions #weather-widget {
    will-change: transform;
    transition: transform 0.25s ease;
    transform-origin: center center;
}
.header.shrink .header-actions #weather-widget {
    transform: scale(0.9);
}

.logo span {
    color: var(--primary-color);
}

.nav-list {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-list a {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-list a:hover, .nav-list a.active {
    color: var(--primary-color);
}

.btn-login {
    background-color: var(--primary-light);
    color: var(--primary-color) !important;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
}
.btn-login:hover {
    background-color: var(--primary-color);
    color: #fff !important;
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border-radius: 50%;
    transition: var(--transition);
    margin-left: 0.5rem;
}
.theme-toggle:hover {
    background: var(--primary-light);
    color: var(--primary-color);
}


/* Custom Live Buttons */
.btn-live, .btn-radio {
    padding: 0.4rem 1rem;
    border-radius: var(--radius-md);
    color: white !important;
    font-weight: 800;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
    text-decoration: none;
    border: none;
}
.btn-live { background-color: var(--primary-color); }
.btn-live:hover { background-color: var(--primary-hover); transform: scale(1.05); }
.btn-radio { background-color: var(--danger); }
.btn-radio:hover { background-color: #dc2626; transform: scale(1.05); }

/* Mega Menú Hover Dropdown */
.mega-nav-list li.has-dropdown.mega-hover .mega-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    transition-delay: 0s; /* show immediately */
}
.mega-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--bg-card);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(10px) translateZ(0);
    transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transition-delay: 0.1s; /* hover-out delay buffer */
    will-change: opacity, transform;
    z-index: 50;
    padding: 2rem 0;
    border-top: 2px solid var(--primary-light);
    color: var(--text-main);
}
.mega-menu::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 0;
    width: 100%;
    height: 15px;
    background: transparent;
}
.mega-menu-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}
.mega-menu-item {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    color: var(--text-main) !important;
    text-transform: none;
    opacity: 1 !important;
}
.mega-menu-item:hover { color: var(--primary-color) !important; }
.mega-menu-img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
    transform: translateZ(0) scale(1.001);
    backface-visibility: hidden;
}
.mega-menu-item:hover .mega-menu-img { transform: translateZ(0) scale(1.04); }
.mega-menu-item span {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.3;
}

.nav-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Ticker */
.ticker-wrap {
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    overflow: hidden;
}
.ticker-title {
    background-color: #111827;
    padding: 0.75rem 1.5rem;
    font-weight: 800;
    white-space: nowrap;
    z-index: 2;
    position: relative;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    color: white;
}
.ticker {
    display: flex;
    width: max-content;
    animation: ticker 40s linear infinite;
    align-items: center;
}
.ticker:hover {
    animation-play-state: paused;
}
.ticker__inner {
    display: flex;
    will-change: transform;
}
.ticker__item {
    white-space: nowrap;
    margin-right: 3rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    color: white;
}
.ticker__item:hover {
    color: rgba(255,255,255,0.8);
}

@keyframes ticker {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-50%, 0, 0); }
}

/* Main Content */
.main-content {
    padding: 3rem 1.5rem;
}

/* Hero Section */
.hero {
    margin-bottom: 3rem;
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    height: 500px;
    box-shadow: var(--shadow-md);
}
.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1;
    pointer-events: none;
}
.hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.hero:hover .hero-img {
    transform: scale(1.05);
}
.hero-content {
    position: absolute;
    bottom: 0;
    left: 0;
    padding: 2.5rem;
    z-index: 2;
    color: white;
    width: 100%;
}
.category-badge {
    background-color: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-block;
    margin-bottom: 1.5rem;
    border: 1px solid white;
}
.category-badge.urgente { background-color: var(--danger); }
.hero-title {
    font-family: var(--font-sans);
    font-weight: 800;
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}
.hero-meta {
    font-size: 0.875rem;
    color: rgba(255,255,255,0.8);
    display: flex;
    gap: 1rem;
}

/* Layout */
.content-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 3rem;
}

/* Headings */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 1rem;
}
.section-header h2 {
    font-size: 1.5rem;
    position: relative;
}
.section-header h2::after {
    content: '';
    position: absolute;
    bottom: -18px; /* aligns with border */
    left: 0;
    width: 50px;
    height: 4px;
    background-color: var(--primary-color);
    border-radius: 2px;
}
.view-all {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.875rem;
}

/* Grid */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}
.news-card {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    height: 300px;
    display: block;
    background-color: var(--bg-card);
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}
.news-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1;
    pointer-events: none;
    transition: opacity 0.3s;
}
.news-card:hover {
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
    transform: translateY(-4px) translateZ(0);
}
.news-card:hover::after {
    opacity: 0.85;
}
.card-img-wrap {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0; 
    left: 0;
    z-index: 0;
}
.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
    transform: translateZ(0) scale(1.001);
    backface-visibility: hidden;
}
.news-card:hover .card-img {
    transform: translateZ(0) scale(1.05);
}
.card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 2rem 1.5rem;
    z-index: 2;
    display: flex;
    flex-direction: column;
}
.card-category {
    background-color: var(--primary-color);
    color: white;
    padding: 2px 8px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    display: inline-block;
    width: fit-content;
    margin-bottom: 1rem;
    border-radius: 2px;
    border: 1px solid rgba(255, 255, 255, 0.8);
}
.card-category:hover {
    background-color: var(--primary-hover);
}
.card-title {
    color: white;
    font-size: 1.1rem;
    margin-bottom: 0;
    line-height: 1.3;
    font-family: var(--font-sans);
    font-weight: 800;
}
.card-title a {
    color: white;
    transition: color 0.3s ease;
}
.card-title a:hover,
.news-card:hover .card-title {
    color: #93c5fd; /* Soft light blue instead of dark primary color to keep contrast over images */
}
.card-excerpt, .card-footer {
    display: none; /* Hide snippet to mimic Halcon TV cards */
}

/* Sidebar */
.sidebar-area {
    position: sticky;
    top: 2rem;
}
.sidebar-widget {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
}
.sidebar-widget h3 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}
.trending-list li {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-color);
}
.trending-list li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}
.trending-number {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-light);
    line-height: 1;
}
.trending-content h4 {
    font-size: 1rem;
    line-height: 1.3;
    margin-bottom: 0.25rem;
}
.trending-content h4 a:hover { color: var(--primary-color); }
.trending-meta { font-size: 0.75rem; color: var(--text-muted); }

.ad-banner {
    background-color: #e5e7eb;
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-weight: 600;
    border-radius: var(--radius-md);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Footer */
.footer {
    background-color: #111827;
    color: #fff;
    padding: 4rem 0 0 0;
}
.footer-inner {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 3rem;
    padding-bottom: 3rem;
}
.footer-brand h2 {
    color: #fff;
    font-size: 2rem;
    margin-bottom: 1rem;
}
.footer-brand span { color: var(--primary-color); }
.footer-brand p {
    color: #9ca3af;
    max-width: 300px;
}
.footer-links h3 {
    color: #fff;
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
}
.footer-links ul li {
    margin-bottom: 0.75rem;
}
.footer-links ul a {
    color: #9ca3af;
    display: inline-block;
    transition: transform 0.2s ease, color 0.2s ease;
}
.footer-links ul a:hover {
    color: var(--primary-color) !important;
    transform: translateX(5px);
}
.footer-bottom {
    background-color: #030712;
    padding: 1.5rem 0;
    text-align: center;
    color: #4b5563;
    font-size: 0.875rem;
}

/* Skeletons Premium */
.skeleton {
    background: var(--border-color);
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-md);
}
.skeleton::after {
    display: none;
}
[data-theme="light"] .skeleton::after,
html:not([data-theme="dark"]) .skeleton::after {
    display: none;
}
.news-card.skeleton { height: 350px; box-shadow: none; border: 1px solid var(--border-color); }

/* Grid Asimétrico para el Frontend (Fase 14) */
.grid-container.masonry-like {
    grid-auto-flow: dense;
}
.grid-container.masonry-like .news-card:nth-child(1) {
    grid-column: span 2;
    grid-row: span 2;
    height: 624px;
}
.grid-container.masonry-like .news-card:nth-child(1) .card-title {
    font-size: 1.8rem;
}
@media (max-width: 768px) {
    .grid-container.masonry-like .news-card:nth-child(1) { grid-column: auto; grid-row: auto; height: 300px; }
    .grid-container.masonry-like .news-card:nth-child(1) .card-title { font-size: 1.25rem; }
}

/* Responsive */
@media (max-width: 992px) {
    .content-layout {
        grid-template-columns: 1fr;
    }
    .hero {
        height: 400px;
    }
}
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block !important;
    }
    .nav-list {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%; 
        left: 0; 
        width: 100%;
        background: var(--primary-color);
        z-index: 100;
        box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    }
    .nav-list.active {
        display: flex !important;
    }
    .nav-list li {
        width: 100%;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    .nav-list a {
        padding: 1rem 1.5rem !important;
        justify-content: space-between;
    }
    .mega-menu {
        position: static !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        background: rgba(0,0,0,0.2) !important;
        display: none;
    }
    .nav-item:hover .mega-menu {
        display: block;
    }
    .mega-menu-grid {
        grid-template-columns: 1fr 1fr;
        padding: 1rem;
        gap: 1rem;
    }
    .nav-toggle {
        display: block;
    }
    .hero-title {
        font-size: 2rem;
    }
    .grid-container {
        grid-template-columns: 1fr;
    }
    .footer-inner {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* MODERN HEADER ACTIONS */
.search-bar-modern:focus-within { border-color: var(--primary-color) !important; box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15) !important; }
.search-bar-modern button:hover { transform: scale(1.05); background: #1d4ed8 !important; }
.hover-circle:hover { color: var(--primary-color) !important; border-color: var(--primary-color) !important; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
.btn-live { background: #ef4444 !important; color: white !important; border: none !important; padding: 0.5rem 1.25rem; border-radius: 50px; font-weight: 800; text-decoration: none; display: flex; align-items: center; gap: 0.5rem; box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3) !important; transition: all 0.2s ease; }
.btn-live:hover { background: #dc2626 !important; transform: scale(1.05) !important; box-shadow: 0 4px 15px rgba(220, 38, 38, 0.4) !important; }

/* FIX LOGO IN DIFFERENTIAL BACKGROUNDS */
.login-logo img {
    /* If the login card goes dark, invert it automatically */
    mix-blend-mode: normal;
}

/* SKELETON LOADING UI */
.skeleton { background: #e2e8f0; border-radius: 4px; overflow: hidden; position: relative; }
[data-theme='dark'] .skeleton { background: #374151; }
.skeleton::after { content: ''; display: block; position: absolute; left: -150px; top: 0; height: 100%; width: 150px; background: linear-gradient(to right, transparent 0%, rgba(255,255,255,0.4) 50%, transparent 100%); animation: skeleton_load 1.5s infinite; }
[data-theme='dark'] .skeleton::after { background: linear-gradient(to right, transparent 0%, rgba(255,255,255,0.05) 50%, transparent 100%); }
@keyframes skeleton_load { 0% { left: -150px; } 100% { left: 100%; } }
.skel-text { height: 1rem; width: 100%; margin-bottom: 0.5rem; }
.skel-text-short { width: 60%; }
.skel-title { height: 1.5rem; width: 80%; margin-bottom: 1rem; }
.skel-img { width: 100%; height: 200px; }

/* FIX WORD OVERFLOW (ASDASDASD...) */
h1, h2, h3, h4, h5, h6, .card-title, .article-title, p { overflow-wrap: break-word; word-break: break-word; hyphens: auto; }

/* FIX FOOTER VISIBILITY */
.footer { background-color: #111827 !important; color: #fff !important; }
.footer-links h3, .footer-links h4, .footer-contact h4 { color: #fff !important; }
.footer-links ul a { color: #9ca3af !important; }
.footer-bottom { background-color: #030712 !important; color: #6b7280 !important; }

/* --- UNIFIED ADMIN SIDEBAR STYLES --- */
.admin-sidebar { background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%) !important; }
.admin-nav ul li a { transition: all 0.2s ease !important; }
.admin-nav ul li a:hover, 
.admin-nav ul li a.active { 
    background: linear-gradient(90deg, #0037a5 0%, #1d4ed8 100%) !important; 
    color: white !important; 
    transform: translateX(5px) !important; 
    box-shadow: 0 4px 10px rgba(0, 61, 179, 0.2) !important; 
}

/* FIX FOOTER CONTACT AESTHETICS */
.footer-contact p { color: #9ca3af; margin-bottom: 0.5rem; display: flex; align-items: center; gap: 0.5rem; }
.footer-contact h4 { color: #fff !important; margin-bottom: 1.5rem; font-size: 1.125rem; }
.footer-social a { color: #9ca3af !important; background: rgba(255,255,255,0.05); padding: 0.5rem; border-radius: 50%; display: flex; justify-content: center; align-items: center; transition: all 0.3s; }
.footer-social a:hover { color: #fff !important; background: var(--primary-color); transform: translateY(-3px); box-shadow: 0 4px 10px rgba(0,0,0,0.3); }

/* =========================================
   PHASE 13: STICKY HEADER & SEARCH MODAL (GLOBAL)
   ========================================= */
.header {
    position: sticky !important;
    top: 0;
    z-index: 9999;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transform: translateZ(0);
    will-change: transform;
    -webkit-transform: translate3d(0,0,0);
}

#searchModal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.95);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.search-container {
    width: 100%;
    max-width: 800px;
    padding: 2rem;
    position: relative;
}

.search-box {
    display: flex;
    width: 100%;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    overflow: hidden;
}

.search-box input {
    width: 100%;
    padding: 1.5rem;
    font-size: 1.5rem;
    border: none;
    outline: none;
    font-family: var(--font-sans);
}

.search-box button {
    padding: 1.5rem 2.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    transition: background 0.3s;
}

.search-box button:hover {
    background: #1d4ed8;
}

.btn-close-search {
    position: absolute;
    top: -40px;
    right: 20px;
    color: white;
    font-size: 2.5rem;
    text-decoration: none;
    transition: color 0.3s;
}

.btn-close-search:hover {
    color: var(--primary-color);
}

/* Anti-flicker: freeze header transitions when mega-menu is open */
.header.mega-open {
    transition: none !important;
}
.header.mega-open .header-inner {
    transition: none !important;
}
.header.mega-open .logo {
    transition: none !important;
}

/* Mobile-only elements hidden on desktop */
.mobile-only-nav-item { display: none !important; }

/* =========================================
   PHASE 3: MOBILE RESPONSIVENESS FIXES
   ========================================= */
@media (max-width: 768px) {
    /* 1. Body & Container Fixes */
    body { overflow-x: hidden; }
    
    /* 2. Topbar */
    .topbar { display: none !important; }
    
    /* 3. Header & Logo Fixes */
    .header-inner { height: auto !important; padding: 1rem 0 !important; flex-wrap: wrap; gap: 1rem; }
    .logo img { height: 45px !important; }
    .logo-title { font-size: 1.8rem !important; }
    .slogan-text { display: none !important; }
    .header-actions { flex: 1; justify-content: flex-end; }
    .search-bar-modern, .btn-live, #weather-widget { display: none !important; }
    
    /* 4. Navigation & Hamburger Menu */
    .mobile-menu-btn { display: block !important; width: 100%; }
    .nav-list { display: none !important; flex-direction: column !important; width: 100%; background: #0f172a; position: absolute; left: 0; top: 100%; z-index: 100; box-shadow: 0 10px 20px rgba(0,0,0,0.5); }
    .nav-list.active { display: flex !important; }
    .nav-list li { width: 100%; border-bottom: 1px solid rgba(255,255,255,0.05); }
    .nav-list li.mobile-only-nav-item { display: flex !important; }
    .nav-list a { display: flex !important; width: 100%; justify-content: space-between; }
    .has-dropdown .mega-menu { display: none !important; position: static !important; box-shadow: none !important; background: #1e293b !important; padding: 0 !important; }
    .has-dropdown:active .mega-menu, .has-dropdown:hover .mega-menu { display: block !important; }
    .mega-menu-grid { grid-template-columns: 1fr !important; gap: 0.5rem !important; padding: 1rem !important; }
    .mega-menu .news-card { height: 100px !important; flex-direction: row !important; display: flex !important; }
    .mega-menu .card-img-wrap { width: 100px !important; height: 100px !important; flex-shrink: 0; }
    
    /* 5. Hero Carousel */
    .heroSwiper { height: 300px !important; }
    .mega-hero-grid { grid-template-columns: 1fr !important; height: auto !important; display: flex !important; flex-direction: column !important; }
    .mega-hero-grid > .news-card:first-child { height: 250px !important; }
    .mega-hero-grid > div { display: none !important; }
    
    /* 6. Layout */
    .layout-wrapper { flex-direction: column !important; }
    .content-area, .sidebar-area { width: 100% !important; flex: none !important; }
    
    /* 7. Regional Tabs and Grid */
    #regional-grid { grid-template-columns: 1fr !important; }
    .regional-card { height: 220px !important; }
    .regional-tabs-wrapper { margin-top: 1rem; width: 100%; justify-content: flex-start !important; overflow-x: auto; padding-bottom: 0.5rem; gap: 0.5rem !important; }
    .regional-tabs-wrapper button { white-space: nowrap; }
    
    /* 8. Stories */
    .stories-container > a > div { width: 60px !important; height: 60px !important; }
    
    /* 9. General News Grids */
    [style*="display: grid"] { grid-template-columns: 1fr !important; }
    .news-card { min-height: 250px; }
    
    /* 10. Ads & Footer */
    .ad-banner { height: auto !important; min-height: 100px; padding: 1rem; }
    .footer-inner { flex-direction: column; gap: 2rem; }
    .footer-bottom-inner { flex-direction: column; text-align: center; gap: 1rem; }
}

