﻿/* areaResponsive.css - Responsive styles for content areas, cards, and grids */

/* Base responsive adjustments */
@media (max-width: 1200px) {
    .main-container {
        width: 100%;
        padding: 0 15px;
    }

    .content-grid {
        grid-gap: 15px;
    }

    .primary-grid {
        grid-gap: 20px;
    }

    .section-primary,
    .section-secondary {
        padding: 25px 0;
    }

    .news-card .card-content h3 {
        font-size: 18px;
    }
}

/* Large tablets and smaller desktops */
@media (max-width: 992px) {
    /* Content grid adjustments */
    .content-grid {
        grid-template-columns: 1fr;
        grid-gap: 20px;
    }

    .slider-sidebar {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        grid-gap: 15px;
        margin-top: 0;
    }

    /* Primary grid layout */
    .primary-grid {
        grid-template-columns: 1fr;
    }

    .main-news-grid {
        margin-bottom: 30px;
    }

    /* Widget sidebar */
    .widgets-sidebar {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        grid-gap: 20px;
        margin-top: 0;
    }

    .widget-card.big {
        grid-column: span 2;
    }

    /* News cards in various layouts */
    .full-news-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .card-row {
        display: flex;
        flex-direction: column;
    }

    .card-grid {
        grid-column: span 2 !important;
    }

    /* Slider improvements */
    .news-slider {
        height: 400px;
    }

        .news-slider .slider-wrapper {
            border-radius: 8px;
        }

    .news-slide .slide-content {
        padding: 20px;
        margin-bottom: 50px;
    }

    .news-slide .slide-title {
        font-size: 20px;
        margin-bottom: 10px;
    }

    .news-slide .slide-meta {
        display: none;
    }

    /* Featured news card */
    .news-card.featured {
        height: 380px;
    }

        .news-card.featured .card-content h3 {
            font-size: 22px;
        }

    /* Author Cards */
    .authors-carousel {
        grid-template-columns: repeat(4, 1fr);
        padding: 0 15px;
    }

        .authors-carousel .flickity-page-dots {
            display: none;
        }

    /* Secondary news grid spacing */
    .secondary-news-grid {
        grid-gap: 15px;
        margin-top: 15px;
    }
}

/* Medium tablets */
@media (max-width: 768px) {
    /* Main container padding */
    .main-section {
        padding-top: 10px;
    }

    .main-container {
        padding: 0 12px;
    }

    /* Slider size */
    .news-slider {
        height: 350px;
    }

    /* Slide content */
    .news-slide .slide-title {
        font-size: 18px;
    }

    .news-slide .slide-excerpt {
        font-size: 13px;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }

    /* Sidebar cards */
    .slider-sidebar {
        grid-template-columns: repeat(2, 1fr);
    }

    /* News cards */
    .full-news-grid {
        grid-template-columns: 1fr !important;
    }

        .full-news-grid[data-mob-slider] .news-card,
        .main-news-grid[data-mob-slider] .news-card {
            margin: 0 8px;
            height: 230px;
            width: 80%;
        }

        .full-news-grid[data-mob-slider] .card-row .news-card,
        .main-news-grid[data-mob-slider] .card-row .news-card {
            margin: 0 10px;
            width: 90%;
            height: auto;
        }

    .news-card.featured .card-excerpt {
        display: none;
    }


    .card-grid {
        grid-template-columns: 1fr !important;
    }

    /* Widget sidebar */
    .widgets-sidebar {
        grid-template-columns: 1fr;
    }

    .widget-card.big {
        grid-column: span 1;
    }

    .widget-card {
        width: calc(50% - 40px);
        margin: 0 10px;
        height: 200px;
    }

    .podcast-widget {
        padding-top: 10px;
    }

    /* Section spacing */
    .section-primary,
    .section-secondary {
        padding: 20px 0;
    }

    .section-title {
        font-size: 18px;
    }

    /* Author cards */
    .authors-carousel {
        grid-template-columns: repeat(3, 1fr);
        grid-gap: 12px;
        margin-bottom: 40px;
    }

    .author-card {
        height: 110px;
        margin-top: 20px;
    }

    .author-name {
        font-size: 14px;
    }

    /* Breaking news */
    .breaking-news {
        margin-bottom: 2px;
    }

    .breaking-label {
        padding: 6px 15px;
        width: 140px;
        font-size: 12px;
    }

    .breaking-news-ticker {
        padding: 0 2px;
    }

    .breaking-container .ticker-list {
        animation: ticker 10s linear infinite !important;
    }
}

/* Small tablets and large phones */
@media (max-width: 576px) {

    .widget-card {
        width: calc(90% - 40px);
        margin: 0 10px;
        height: 200px;
    }


    /* Main container */
    .main-section {
        padding-top: 5px;
    }

    /* Slider height */
    .news-slider {
        height: 280px;
    }

    .news-slide .slide-image {
        height: 280px;
    }

    /* Slide content adjustments */
    .news-slide .slide-content {
        padding: 15px;
    }

    .news-slide .slide-category {
        font-size: 10px;
        padding: 4px 8px;
    }

    .news-slide .slide-title {
        font-size: 16px;
        margin-bottom: 6px;
        -webkit-line-clamp: 3;
        line-clamp: 3;
    }

    .news-slide .slide-excerpt {
        display: none;
    }

    /* Sidebar cards */
    .slider-sidebar {
        grid-template-columns: 1fr;
        width: 100%;
        grid-gap: 10px;
    }

    .mini-card-title {
        font-size: 14px;
    }

    /* Featured news card */
    .news-card.featured {
        height: 280px;
    }

        .news-card.featured .card-content {
            padding: 15px;
        }

            .news-card.featured .card-content h3 {
                font-size: 18px;
            }

    /* Author cards */
    .authors-carousel {
        grid-template-columns: repeat(2, 1fr);
        grid-gap: 10px;
    }

    .author-card {
        height: 120px;
    }

    .author-image {
        width: 70px;
        height: 70px;
    }

    /* News cards styles */
    .news-card.style1, .news-card.style2, .news-card.style3, .news-card.style4 {
        margin-bottom: 10px;
    }

    .news-card .card-content {
        padding: 10px;
    }

        .news-card .card-content h3 {
            font-size: 15px;
            margin-bottom: 5px;
        }

    .section-title {
        font-size: 16px;
    }


    .breaking-container {
        display: block;
    }

    .breaking-label {
        width: max-content;
        text-align: center;
        border-radius: 6px 6px 0 0;
        padding: 5px;
        font-size: 10px !important;
    }

    .breaking-news-ticker {
        border-radius: 0 0 6px 6px;
        width: 100%;
        padding: 0px 10px;
    }



    .news-card {
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
        transition: transform 0.2s ease;
    }

        .news-card:active {
            transform: scale(0.98);
        }

    .section-primary,
    .section-secondary {
        padding: 15px 0;
    }

    .secondary-news-grid {
        grid-template-columns: repeat(1, 1fr) !important;
    }
}


@media (max-width: 480px) {
    .main-container {
        padding: 0 10px;
        width: calc(100% - 20px);
    }

    .news-slider {
        height: 240px;
        margin-bottom: 10px;
    }

    .news-slide .slide-image {
        height: 240px;
    }

    .news-slide .slide-content {
        padding: 12px;
    }

    /* Slider pagination */
    .slider-pagination {
        bottom: 10px;
        padding: 0 0.2rem;
    }

    .slider-pagination-bullet {
        width: 6px;
        height: 6px;
        margin: 0 3px;
    }

    /* Featured news card */
    .news-card.featured {
        height: 220px;
    }

        .news-card.featured .card-content h3 {
            font-size: 16px;
            -webkit-line-clamp: 3;
            line-clamp: 2;
        }

    /* Author cards */
    .authors-carousel {
        padding: 0 10px;
    }

    .author-card {
        height: 70px;
        width: 70%;
        padding: 10px;
    }

    .author-image {
        width: 60px;
        height: 60px;
    }

    .author-name {
        font-size: 13px;
    }

    .author-title {
        font-size: 11px;
    }

    /* Card styles */
    .news-card .card-image {
        height: 100px;
    }

    .news-card .card-content h3 {
        font-size: 14px;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        margin-bottom: 3px;
    }

    .news-card .card-content .card-meta {
        font-size: 10px;
    }

    .mini-card {
        height: 90px;
    }

    .mini-card-image {
        width: 90px;
    }

    .mini-card-content {
        width: unset;
        left: unset;
        right: 0;
        width: 70%;
    }

    .mini-card-title {
        font-size: 13px;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        color: var(--text-dark);
    }

    .mini-card-category {
        font-size: 9px;
        padding: 2px 6px;
    }
    /* Card grid gaps */
    .full-news-grid,
    .secondary-news-grid,
    .card-grid {
        grid-gap: 10px;
    }
}

/* Extra small phones */
@media (max-width: 360px) {
    /* Slider height */
    .news-slider {
        height: 200px;
    }

    .news-slide .slide-image {
        height: 200px;
    }

    /* Slide title */
    .news-slide .slide-title {
        font-size: 14px;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }



    .news-card.featured .card-content h3 {
        font-size: 14px;
    }



    .author-image {
        width: 50px;
        height: 50px;
    }


    .news-card .card-content h3 {
        font-size: 13px;
    }

    /* Mini card */
    .mini-card {
        height: 80px;
    }

    .mini-card-image {
        width: 80px;
    }

    .mini-card-title {
        font-size: 12px;
    }
}

/* Enhanced Image Loading for Mobile Data Savings */
@media (max-width: 768px) {
    img[loading="lazy"] {
        transition: opacity 0.3s ease;
        opacity: 0;
    }

        img[loading="lazy"].loaded {
            opacity: 1;
        }

    .news-card .card-image,
    .mini-card-image,
    .author-image {
        background-color: #f0f0f0;
        position: relative;
        overflow: hidden;
    }

        .news-card .card-image::before,
        .mini-card-image::before,
        .author-image::before {
            content: "";
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
            animation: loading 1.5s infinite;
            display: none;
        }

    .news-card.loading .card-image::before,
    .mini-card.loading .mini-card-image::before,
    .author-card.loading .author-image::before {
        display: block;
    }

    @keyframes loading {
        0% {
            transform: translateX(-100%);
        }

        100% {
            transform: translateX(100%);
        }
    }
}

/* Touch interactions */
@media (hover: none) and (pointer: coarse) {
    .news-card:hover,
    .mini-card:hover,
    .author-card:hover {
        transform: none;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    }

    .news-card:active,
    .mini-card:active,
    .author-card:active {
        transform: scale(0.98);
    }
}

/* Orientation-specific styles */
@media (orientation: landscape) and (max-width: 992px) {
    .news-slider {
        height: 260px;
    }

    .authors-carousel {
        grid-template-columns: repeat(4, 1fr);
    }

    .slider-sidebar {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* High-DPI screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .news-card .card-content h3,
    .mini-card-title,
    .news-slide .slide-title {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Responsive styles for section headings */
@media (max-width: 992px) {
    .section-heading {
        margin-bottom: 20px;
        gap: 15px;
    }

    .section-title {
        font-size: 18px;
        padding: 8px 20px;
        min-width: 160px;
    }

    .section-link {
        padding: 8px 20px;
        font-size: 13px;
    }
}

@media (max-width: 768px) {
    .section-heading {
        margin-bottom: 15px;
        gap: 10px;
    }

    .section-line {
        height: 38px;
    }

    .section-title {
        font-size: 14px;
        padding: 6px 16px;
        min-width: 140px;
    }

    .section-link {
        padding: 6px 16px;
        font-size: 12px;
    }

        .section-link span {
            display: none;
        }

        .section-link::after {
            content: "\f054";
            font-size: 15px;
            margin-left: 5px;
            font-family: "Font Awesome 5 Free";
            font-weight: 900;
        }
}
