/* Responsive Design Enhancements for Neeon Template */

/* Mobile-first approach improvements */

/* Extra small devices (phones, 576px and down) */
@media (max-width: 575.98px) {
    /* Header improvements */
    .topbar .rt-trending .trending-title {
        font-size: 0.875rem;
    }
    
    .topbar .rt-topbar-right .meta-wrap {
        display: none;
    }
    
    /* Post cards mobile optimization */
    .rt-post-overlay-lg .post-content {
        padding: 15px;
    }
    
    .rt-post-overlay-lg .post-title {
        font-size: 1.25rem;
        line-height: 1.4;
    }
    
    .rt-post-overlay-md .post-content {
        padding: 12px;
    }
    
    .rt-post-overlay-md .post-title {
        font-size: 1.125rem;
        line-height: 1.3;
    }
    
    /* Grid adjustments */
    .whats-new-style-1 .row.gutter-24 > [class*="col-"] {
        margin-bottom: 20px;
    }
    
    /* Tab menu mobile optimization */
    .rt-tab-menu {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .rt-tab-menu .menu-item {
        flex: 1;
        min-width: calc(50% - 4px);
    }
    
    .rt-tab-menu .menu-link {
        padding: 8px 12px;
        font-size: 0.875rem;
        text-align: center;
    }
    
    /* Mobile navigation improvements */
    .rt-mobile-header .mobile-menu-bar {
        padding: 10px 15px;
    }
    
    .rt-slide-nav .menu {
        padding: 0;
    }
    
    .rt-slide-nav .menu li a {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
    
    /* Footer mobile optimization */
    .footer-widget {
        margin-bottom: 30px;
    }
    
    .footer-widget .widget-title {
        font-size: 1.125rem;
        margin-bottom: 15px;
    }
}

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
    /* Featured post adjustments */
    .rt-post-overlay-lg {
        min-height: 300px;
    }
    
    .rt-post-overlay-lg .post-content {
        padding: 20px;
    }
    
    /* Tab menu improvements */
    .rt-tab-menu .menu-link {
        padding: 10px 16px;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
    /* Header tablet optimization */
    .header-main .site-branding img {
        max-width: 140px;
        height: auto;
    }
    
    /* Post grid tablet layout */
    .whats-new-style-1 .col-lg-7 {
        margin-bottom: 30px;
    }
    
    /* Sidebar tablet adjustments */
    .sticky-coloum-item:last-child {
        margin-top: 40px;
    }
    
    /* Navigation tablet improvements */
    .main-menu__nav ul li {
        margin-right: 20px;
    }
    
    .main-menu__nav ul li a {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    /* Container adjustments for large screens */
    .container {
        max-width: 960px;
    }
    
    /* Post overlay adjustments */
    .rt-post-overlay-lg .post-content {
        padding: 25px;
    }
    
    /* Navigation spacing */
    .main-menu__nav ul li {
        margin-right: 25px;
    }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    /* Optimal spacing for large screens */
    .rt-post-overlay-lg .post-content {
        padding: 30px;
    }
    
    .section-padding {
        padding-top: 40px;
        padding-bottom: 40px;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Increase touch targets */
    .rt-tab-menu .menu-link {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .header-action-items .item a {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Remove hover effects on touch devices */
    .rt-post-overlay:hover .post-img img {
        transform: none;
    }
    
    .main-menu__nav ul li:hover .main-menu__dropdown {
        display: none;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Optimize images for retina displays */
    .post-img img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Landscape orientation optimizations */
@media (orientation: landscape) and (max-height: 500px) {
    /* Reduce header height in landscape mode */
    .topbar {
        padding: 8px 0;
    }
    
    .header-main {
        padding: 15px 0;
    }
    
    .rt-mobile-header .mobile-top-bar {
        padding: 5px 0;
    }
}

/* Print styles */
@media print {
    .rt-header,
    .rt-mobile-header,
    .footer,
    .header-action-items,
    .rt-tab-menu,
    .offcanvas-menu-wrap,
    .template-search {
        display: none !important;
    }
    
    .rt-post-overlay .post-content {
        position: static;
        background: transparent;
        color: #000;
    }
    
    .rt-post-overlay .post-img {
        margin-bottom: 20px;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --color-body-bg: #1a1a1a;
        --color-white: #2d2d2d;
        --color-black: #ffffff;
        --color-body: #e0e0e0;
        --color-border: #404040;
    }
}

/* Focus improvements for keyboard navigation */
.main-menu__nav ul li a:focus,
.rt-tab-menu .menu-link:focus,
.header-action-items .item a:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Loading states for better UX */
.rt-post-overlay .post-img img {
    transition: opacity 0.3s ease;
}

.rt-post-overlay .post-img img[loading="lazy"] {
    opacity: 0;
}

.rt-post-overlay .post-img img[loading="lazy"].loaded {
    opacity: 1;
}