/* ============================================
   ONAIR - RESPONSIVE & SMOOTH THEME TRANSITIONS
   ============================================ */

/* ============================================
   1. SMOOTH THEME TRANSITIONS
   ============================================ */
html {
    scroll-behavior: smooth;
}

/* Apply smooth transitions to theme-dependent properties */
body,
body *,
.site-header,
.main-nav,
footer,
.article-card,
.widget,
.latest-headlines,
.breaking-news-banner,
.breaking-news-ticker,
.hero-section,
.section-header,
.btn-primary,
.search-form,
.dropdown-content {
    transition: background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                color 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* CSS variables transition for theme switching */
:root,
body.theme-default,
body.theme-setopati,
body.theme-ratopati,
body.theme-ekantipur,
body.theme-bbc {
    transition: none; /* Variables apply instantly; children animate */
}

/* ============================================
   2. ENHANCED RESPONSIVE BREAKPOINTS
   ============================================ */

/* X-Small (phones) */
@media (max-width: 575px) {
    .container {
        padding: 0 12px;
    }
    
    .hero-featured img,
    .hero-main-card .h-96 {
        height: 220px !important;
        min-height: 220px;
    }
    
    .hero-title,
    .hero-content-bottom h1 {
        font-size: 1.5rem !important;
    }
    
    .section-title {
        font-size: 1.4rem;
    }
    
    .cards-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .nav-menu {
        display: none !important; /* Will show in mobile menu */
    }
    
    .nav-info-meta {
        display: none !important;
    }
    
    .header-row {
        flex-wrap: wrap;
    }
    
    .header-ads-wrapper {
        width: 100%;
        justify-content: center;
        margin-top: 10px;
        margin-left: 0 !important;
    }
}

/* Small (tablets portrait) */
@media (max-width: 767px) {
    .container {
        max-width: 100%;
        padding: 0 15px;
    }
    
    .grid {
        flex-direction: column;
        gap: 24px;
    }
    
    .col-8,
    .col-4 {
        flex: 1 1 100%;
        max-width: 100%;
        min-width: 0;
    }
    
    .sidebar {
        position: static;
        top: auto;
    }
    
    .top-bar {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .main-nav {
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .nav-content {
        flex-wrap: wrap;
    }
    
    .nav-right {
        width: 100%;
        margin-left: 0 !important;
        justify-content: center;
    }
    
    .search-container {
        flex: 1;
        min-width: 200px;
    }
    
    .search-form {
        width: 100%;
    }
    
    .search-form input {
        flex: 1;
        min-width: 120px;
    }
    
    .hero-grid {
        grid-template-columns: 1fr;
    }
    
    .hero-featured img {
        height: 280px;
        width: 100%;
    }
    
    .hero-title {
        font-size: 1.8rem;
    }
    
    .hero-modern-grid {
        grid-template-columns: 1fr;
    }
    
    .hero-full-overlay {
        height: 350px;
    }
    
    .hero-content-bottom h1 {
        font-size: 2rem;
    }
    
    .breaking-news-content {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .breaking-news-label {
        width: 100%;
    }
    
    .article-card img,
    .article-card-image img {
        width: 100%;
        height: 180px;
    }
    
    .form-row,
    .form-row-3 {
        grid-template-columns: 1fr;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
    }
}

/* Medium (tablets landscape) */
@media (min-width: 768px) and (max-width: 991px) {
    .col-8 {
        flex: 0 0 calc(65% - 15px);
        max-width: calc(65% - 15px);
    }
    
    .col-4 {
        flex: 0 0 calc(35% - 15px);
        max-width: calc(35% - 15px);
        min-width: 0;
    }
    
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .hero-modern-grid {
        grid-template-columns: 1fr;
    }
}

/* Large (desktops) */
@media (min-width: 992px) and (max-width: 1199px) {
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Extra large */
@media (min-width: 1200px) {
    .container {
        max-width: var(--container-max, 1280px);
    }
}

/* ============================================
   3. MOBILE MENU (Hamburger) - Optional
   Add class .has-mobile-menu to body when implemented
   ============================================ */
@media (max-width: 767px) {
    .mobile-menu-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: rgba(255,255,255,0.1);
        border: none;
        border-radius: 6px;
        color: white;
        cursor: pointer;
        font-size: 1.25rem;
    }
    
    .mobile-menu-toggle:hover {
        background: var(--primary-color);
    }
}

/* ============================================
   4. THEME EDITOR RESPONSIVE
   ============================================ */
@media (max-width: 480px) {
    .theme-editor {
        width: 100%;
        left: 0;
        right: 0;
    }
    
    .color-palette-grid {
        grid-template-columns: 1fr;
    }
    
    .scale-options,
    .radius-options,
    .shadow-options {
        flex-wrap: wrap;
    }
}

/* ============================================
   5. 404 PAGE - Design System
   ============================================ */
.page-404 {
    padding: 80px 20px 100px;
    text-align: center;
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-404-inner {
    max-width: 560px;
    margin: 0 auto;
}

.page-404-number {
    display: block;
    font-size: clamp(5rem, 15vw, 8rem);
    color: var(--border-color, #eee);
    font-weight: 900;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.page-404-title {
    color: var(--primary-color);
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

.page-404-text {
    font-size: 1.1rem;
    color: var(--text-light, #666);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.btn-404-home {
    display: inline-block;
    background: var(--primary-color);
    color: white !important;
    padding: 12px 28px;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s, background-color 0.3s;
}

.btn-404-home:hover {
    transform: translateY(-2px);
    background: var(--primary-dark, #B71C1C);
}

@media (max-width: 575px) {
    .page-404 {
        padding: 60px 15px 80px;
    }
    .page-404-title {
        font-size: 1.4rem;
    }
}

/* ============================================
   6. REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
