/* Advanced Responsive Design for Hero Carousel */

/* Extra Small Devices (phones, 320px and up) */
@media (max-width: 374px) {
    .carousel-item {
        height: 40vh;
        min-height: 300px;
    }
    
    .carousel-caption {
        left: 0.5rem;
        right: 0.5rem;
        bottom: 0.5rem;
        padding: 1rem;
        border-radius: 10px;
    }
    
    .slide-title {
        font-size: 1.2rem;
        margin-bottom: 0.5rem;
    }
    
    .slide-meta {
        font-size: 0.75rem;
        margin-bottom: 1rem;
        gap: 0.5rem;
    }
    
    .slide-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .btn-read, .btn-share {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
        min-width: auto;
        width: 100%;
    }
    
    .category-badge {
        font-size: 0.75rem;
        padding: 0.3rem 0.8rem;
    }
}

/* Small Devices (landscape phones, 375px and up) */
@media (min-width: 375px) and (max-width: 575px) {
    .carousel-item {
        height: 45vh;
        min-height: 350px;
    }
    
    .carousel-caption {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
        padding: 1.5rem;
    }
    
    .slide-title {
        font-size: 1.4rem;
    }
    
    .slide-actions {
        flex-direction: row;
        justify-content: center;
    }
    
    .btn-read, .btn-share {
        min-width: 120px;
    }
}

/* Medium Devices (tablets, 576px and up) */
@media (min-width: 576px) and (max-width: 767px) {
    .carousel-item {
        height: 50vh;
        min-height: 400px;
    }
    
    .slide-title {
        font-size: 1.8rem;
    }
    
    .carousel-caption {
        padding: 2rem 1.5rem;
    }
}

/* Large Devices (desktops, 768px and up) */
@media (min-width: 768px) and (max-width: 991px) {
    .carousel-item {
        height: 60vh;
        min-height: 500px;
    }
    
    .slide-title {
        font-size: 2rem;
    }
    
    .carousel-caption {
        left: 2rem;
        right: 2rem;
        bottom: 2rem;
        padding: 2.5rem 2rem;
    }
}

/* Extra Large Devices (large desktops, 992px and up) */
@media (min-width: 992px) and (max-width: 1199px) {
    .carousel-item {
        height: 65vh;
        min-height: 550px;
        max-height: 700px;
    }
    
    .slide-title {
        font-size: 2.2rem;
    }
    
    .carousel-caption {
        left: 3rem;
        right: 3rem;
        bottom: 3rem;
        padding: 3rem 2.5rem 2rem;
    }
}

/* XXL Devices (larger desktops, 1200px and up) */
@media (min-width: 1200px) {
    .carousel-item {
        height: 70vh;
        min-height: 600px;
        max-height: 800px;
    }
    
    .slide-title {
        font-size: 2.5rem;
    }
    
    .carousel-caption {
        left: 4rem;
        right: 4rem;
        bottom: 4rem;
        padding: 3.5rem 3rem 2.5rem;
    }
    
    .btn-read, .btn-share {
        padding: 0.8rem 2.5rem;
        font-size: 1rem;
    }
}

/* Ultra-wide Screens (1400px and up) */
@media (min-width: 1400px) {
    .carousel-item {
        height: 75vh;
        max-height: 900px;
    }
    
    .slide-title {
        font-size: 3rem;
    }
    
    .carousel-caption {
        left: 5rem;
        right: 5rem;
        bottom: 5rem;
        padding: 4rem 3.5rem 3rem;
    }
}

/* Landscape orientation optimizations */
@media (orientation: landscape) and (max-height: 500px) {
    .carousel-item {
        height: 80vh;
        min-height: 350px;
    }
    
    .carousel-caption {
        padding: 1rem;
        bottom: 1rem;
    }
    
    .slide-title {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
    
    .slide-meta {
        margin-bottom: 1rem;
    }
    
    .category-badge {
        margin-bottom: 0.5rem;
    }
}

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

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .carousel-caption {
        background: rgba(0, 0, 0, 0.3);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .category-badge {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    }
    
    .meta-item {
        background: rgba(0, 0, 0, 0.2);
    }
    
    .btn-share {
        background: rgba(0, 0, 0, 0.2);
        border-color: rgba(255, 255, 255, 0.2);
    }
}

/* Reduced transparency for low-end devices */
@media (max-width: 768px) {
    .carousel-caption {
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
    
    .meta-item,
    .btn-share {
        backdrop-filter: blur(5px);
        -webkit-backdrop-filter: blur(5px);
    }
}

/* Performance optimizations for older browsers */
@supports not (backdrop-filter: blur(20px)) {
    .carousel-caption {
        background: rgba(0, 0, 0, 0.7);
    }
    
    .meta-item {
        background: rgba(255, 255, 255, 0.2);
    }
    
    .btn-share {
        background: rgba(255, 255, 255, 0.15);
    }
}
