/**
 * CoinExtra Theme - Main Stylesheet
 * Imports all CSS modules
 */

@import 'variables.css';
@import 'base.css';
@import 'layout.css';
@import 'components.css';
@import 'content.css?v=101';
@import 'dark-mode.css';

/* ===========================
   RESPONSIVE
   =========================== */

@media (max-width: 1024px) {
    .hero-grid { grid-template-columns: 1fr; }
    .hero-main { height: 350px; }
    .hero-sidebar { flex-direction: row; flex-wrap: wrap; overflow: hidden; }
    .hero-sidebar-item { flex: 1 1 calc(50% - 10px); min-width: 0; overflow: hidden; }
    .news-grid { grid-template-columns: repeat(2, 1fr); }
    .stories-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 1024px) {
    /* Main nav - hidden on mobile+tablet (hamburger replaces it) */
    .main-nav { display: none !important; }

    /* HEADER - Mobile: flex row, not grid */
    .header-inner {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: space-between;
        padding: 8px 0;
        gap: 0;
        overflow: hidden;
    }

    /* Hamburger - fixed width left */
    .mobile-menu-btn {
        display: flex !important;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 44px;
        min-width: 44px;
        height: 44px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 8px;
        flex-shrink: 0;
    }
    
    .mobile-menu-btn span {
        display: block;
        width: 22px;
        height: 2px;
        background: var(--yellow);
        margin: 3px 0;
        border-radius: 2px;
        transition: var(--transition);
    }

    /* Logo - center, takes remaining space */
    .logo {
        flex: 1 1 0;
        display: flex;
        justify-content: center;
        align-items: center;
        min-width: 0;
    }
    
    .logo img { 
        height: 50px; 
        width: auto;
        max-width: 160px;
        object-fit: contain;
    }

    /* Main Nav - HIDDEN on mobile */
    .main-nav {
        display: none !important;
    }

    /* Header Actions - right side, fixed width */
    .header-actions {
        display: flex !important;
        flex-direction: row !important;
        align-items: center;
        gap: 6px;
        padding-bottom: 0 !important;
        flex-shrink: 0;
    }
    
    .header-actions .dark-toggle { 
        display: none !important; 
    }
    
    .header-actions .search-toggle {
        width: 36px;
        min-width: 36px;
        height: 36px;
        padding: 4px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: transparent;
        border: none;
        color: #fff;
    }
    
    .header-actions .search-toggle svg {
        width: 20px;
        height: 20px;
        stroke: #F7B500;
    }
    
    .header-actions .subscribe-btn {
        padding: 6px 12px;
        font-size: 11px;
        border-radius: 20px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* Mobile Nav Overlay - full screen slide */
    .mobile-nav {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--darker);
        z-index: 2000;
        flex-direction: column;
        padding: 80px 30px 40px;
        overflow-y: auto;
    }
    
    .mobile-nav.active {
        display: flex;
    }

    .mobile-nav-close {
        position: absolute;
        top: 20px;
        right: 20px;
        width: 44px;
        height: 44px;
        background: rgba(255,255,255,0.1);
        border: none;
        border-radius: 50%;
        color: white;
        font-size: 28px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        line-height: 1;
    }

    .mobile-nav-links {
        flex: 1;
        overflow-y: auto;
    }

    .mobile-nav-links ul {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .mobile-nav-links li {
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    .mobile-nav-links a {
        display: block;
        color: white;
        font-size: 18px;
        padding: 16px 0;
        font-family: var(--font-heading);
        text-decoration: none;
    }

    .mobile-nav-links a:hover,
    .mobile-nav-links a:active {
        color: var(--yellow);
    }

    /* Ticker compact */
    .ticker { padding: 8px 0; }
    .ticker-item { padding: 0 18px; font-size: 13px; }
    .ticker-item .symbol { font-size: 12px; }

    /* Content Responsive */
    .hero-main { height: 300px; }
    .hero-main h2 { font-size: 20px; }
    .hero-sidebar-item { 
        flex: 1 1 100%; 
        min-width: 0;
        max-width: 100%;
        overflow: hidden;
        box-sizing: border-box;
        gap: 12px;
        padding: 8px;
    }
    .hero-sidebar-item img {
        width: 110px;
        height: 75px;
        object-fit: cover;
        flex-shrink: 0;
        border-radius: 6px;
    }
    .hero-sidebar-item h4 {
        font-size: 13px;
        line-height: 1.3;
        min-width: 0;
        word-wrap: break-word;
        overflow-wrap: break-word;
        flex: 1;
    }
    .hero-sidebar-item h4 {
        min-width: 0;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    .news-grid { grid-template-columns: 1fr; }
    .stories-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; text-align: center; }

    .newsletter-box { padding: 40px 20px; }
    .newsletter-box h2 { font-size: 24px; }
    .newsletter-form { flex-direction: column; }

    .entry-title { font-size: 1.75rem; }

    .author-profile {
        flex-direction: column;
        text-align: center;
    }

    .share-buttons { flex-wrap: wrap; }
    
    /* Featured image fix - ensure images render */
    .entry-thumbnail img,
    .featured-image {
        display: block;
        width: 100%;
        height: auto;
        object-fit: cover;
    }
    
    /* Hero main - full width cover image on mobile */
    .hero-main img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 0;
    }
    
    .news-card .image-wrap {
        height: 200px;
        overflow: hidden;
    }
    
    .news-card .image-wrap img {
        height: 100%;
        object-fit: cover;
    }
}

/* Extra small screens (<380px) */
@media (max-width: 380px) {
    .header-inner {
        padding: 6px 0;
    }
    
    .mobile-menu-btn {
        width: 38px;
        min-width: 38px;
        height: 38px;
    }
    
    /* Hide subscribe on very small screens */
    .header-actions .subscribe-btn {
        display: none;
    }
    
    .logo img {
        height: 42px;
    }
    
    .hero-main { height: 260px; }
    .hero-main h2 { font-size: 18px; }
}

/* ===========================
   UTILITIES
   =========================== */
.latest-news,
.more-stories { padding: 40px 0; }

/* Toast notification */
.coinextra-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    padding: 12px 24px;
    background: var(--dark);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-xs);
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s ease;
}
.coinextra-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}
