/* Extracted from functions.php on 2026-06-10 (Phase 5: enqueue instead of inline). */
.news-grid-container {
        display: grid;
        grid-template-columns: 2fr 1fr;
        grid-template-rows: repeat(2, 1fr);
        gap: 20px;
        margin: 0 !important;
        max-width: 1600px;
        width: 100%;
        min-height: 500px;
    }

    /* اتجاه النص حسب اللغة */
    .news-grid-container[data-direction="rtl"] {
        direction: rtl;
    }

    .news-grid-container[data-direction="ltr"] {
        direction: ltr;
    }

    .news-card {
        position: relative;
        border-radius: 16px;
        overflow: hidden;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 0 4px 20px rgba(0,0,0,0.08);
        background: #ffffff;
        border: 1px solid rgba(0,0,0,0.06);
        height: 100%;
        cursor: pointer;
    }

    .news-item-main {
        grid-column: 1;
        grid-row: 1 / 3;
    }

    .news-item-secondary {
        grid-column: 2;
        grid-row: auto;
    }

    .news-item-small {
        display: none;
    }

    .news-card:hover {
        transform: translateY(-8px);
        box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    }

    .news-card-inner {
        position: relative;
        height: 100%;
        display: flex;
        flex-direction: column;
        background: #ffffff;
        border-radius: 16px;
        overflow: hidden;
    }

    .news-image-container {
        position: relative;
        flex: 1;
        overflow: hidden;
        background: #000000;
        min-height: 200px;
    }

    .news-item-main .news-image-container {
        min-height: 300px;
    }

    .news-image {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
        transition: transform 0.6s ease;
        display: block;
        min-height: 100%;
    }

    .news-card:hover .news-image {
        transform: scale(1.15);
    }

    .news-gradient-overlay {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(
            to bottom,
            rgba(0,0,0,0.1) 0%,
            rgba(0,0,0,0.3) 100%
        );
        opacity: 0;
        transition: opacity 0.4s ease;
    }

    .news-card:hover .news-gradient-overlay {
        opacity: 1;
    }

    .news-badges {
        position: absolute;
        top: 16px;
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        z-index: 2;
        gap: 10px;
        width: calc(100% - 32px);
    }

    /* تموضع الشارات حسب اتجاه النص */
    .news-grid-container[data-direction="rtl"] .news-badges {
        right: 16px;
        flex-direction: row-reverse;
    }

    .news-grid-container[data-direction="ltr"] .news-badges {
        left: 16px;
        flex-direction: row;
    }

    .news-date, .news-category {
        background: rgba(255,255,255,0.95);
        backdrop-filter: blur(10px);
        padding: 8px 12px;
        border-radius: 20px;
        font-size: 12px;
        font-weight: 600;
        color: #495057;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        border: 1px solid rgba(255,255,255,0.3);
        transition: all 0.3s ease;
    }

    .news-category {
        background: rgba(37, 33, 99, 0.9);
        color: #ffffff;
    }

    .news-content {
        padding: 24px;
        background: #ffffff;
        display: flex;
        flex-direction: column;
        gap: 16px;
        min-height: 140px;
        justify-content: space-between;
    }

    .news-item-main .news-content {
        padding: 30px;
        min-height: 180px;
    }

    .news-title {
        margin: 0;
        font-size: 18px;
        font-weight: 700;
        line-height: 1.4;
        color: #2c3e50;
        flex-grow: 1;
    }

    .news-item-main .news-title {
        font-size: 24px;
        line-height: 1.3;
    }

    .news-title a {
        color: inherit;
        text-decoration: none;
        transition: color 0.3s ease;
        display: block;
    }

    .news-title a:hover {
        color: #252163;
    }

    .news-excerpt {
        color: #6c757d;
        line-height: 1.6;
        font-size: 14px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        margin: 8px 0;
    }

    .news-item-main .news-excerpt {
        font-size: 16px;
        -webkit-line-clamp: 3;
        margin: 12px 0;
    }

    .news-footer {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-top: auto;
        padding-top: 12px;
        border-top: 1px solid #f1f3f4;
    }

    .news-author {
        display: flex;
        align-items: center;
        gap: 10px;
        flex: 1;
        min-width: 0; /* للسماح بانكماش النص الطويل */
    }

    .news-author img {
        border-radius: 50%;
        width: 28px;
        height: 28px;
        border: 2px solid #f8f9fa;
        flex-shrink: 0;
    }

    .author-name {
        font-size: 13px;
        color: #6c757d;
        font-weight: 600;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* تنسيق خاص لأسماء المؤلفين في الإنجليزية */
    .news-grid-container[data-lang="en"] .author-name {
        font-size: 12px;
        line-height: 1.2;
    }

    .read-more-btn {
        background: linear-gradient(135deg, #252163 0%, #1a1a4a 100%);
        color: #ffffff;
        padding: 10px 18px;
        border-radius: 25px;
        text-decoration: none;
        font-size: 12px;
        font-weight: 600;
        transition: all 0.3s ease;
        display: inline-flex;
        align-items: center;
        gap: 8px;
        border: none;
        cursor: pointer;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .read-more-btn:hover {
        background: linear-gradient(135deg, #1a1a4a 0%, #0f0f2a 100%);
        color: #ffffff;
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(37, 33, 99, 0.4);
    }

    .read-more-btn i {
        transition: transform 0.3s ease;
    }

    /* تحريك السهم حسب اتجاه النص */
    .news-grid-container[data-direction="rtl"] .read-more-btn:hover i {
        transform: translateX(-3px);
    }

    .news-grid-container[data-direction="ltr"] .read-more-btn:hover i {
        transform: translateX(3px);
    }

    /* استجابة للشاشات المتوسطة */
    @media (max-width: 1024px) {
        .news-grid-container {
            min-height: 450px;
            gap: 16px;
        }
        
        .news-title {
            font-size: 16px;
        }
        
        .news-item-main .news-title {
            font-size: 20px;
        }
        
        .news-content {
            padding: 20px;
        }
    }

    /* استجابة للتابلت */
    @media (max-width: 768px) {
        .news-grid-container {
            grid-template-columns: 1fr;
            grid-template-rows: auto;
            gap: 20px;
            min-height: auto;
        }
        
        .news-item-main,
        .news-item-secondary,
        .news-item-small {
            grid-column: 1;
            grid-row: auto;
            height: auto;
            min-height: 300px;
        }
        
        .news-item-small {
            display: block;
            min-height: 280px;
        }
        
        .news-image-container {
            min-height: 200px;
            background: #000000;
        }
        
        .news-item-main .news-image-container {
            min-height: 250px;
        }
        
        .news-image {
            min-height: 100%;
            object-position: center;
        }
        
        .news-content {
            min-height: 120px;
        }

        .news-badges {
            position: absolute;
            top: 16px;
            left: 16px;
            right: 16px;
            width: auto;
        }
    }

    /* استجابة للهواتف */
    @media (max-width: 480px) {
        .news-grid-container {
            margin: 20px 0;
            gap: 16px;
        }
        
        .news-badges {
            flex-direction: column;
            gap: 8px;
            align-items: flex-start;
            position: absolute;
            top: 16px;
            left: 16px;
            right: 16px;
            width: auto;
        }

        /* ترتيب الشارات في الهاتف حسب اللغة */
        .news-grid-container[data-direction="rtl"] .news-badges {
            align-items: flex-end;
        }

        .news-grid-container[data-direction="ltr"] .news-badges {
            align-items: flex-start;
        }
        
        .news-date, .news-category {
            font-size: 11px;
            padding: 6px 10px;
        }
        
        .news-content {
            padding: 16px;
            min-height: 100px;
        }
        
        .news-title {
            font-size: 16px;
        }
        
        .news-item-main .news-title {
            font-size: 18px;
        }
        
        .news-excerpt {
            font-size: 13px;
        }
        
        .news-footer {
            flex-direction: column;
            gap: 12px;
            align-items: stretch;
        }

        .news-author {
            justify-content: center;
        }
        
        .read-more-btn {
            justify-content: center;
            width: 100%;
        }
        
        .news-image-container {
            min-height: 180px;
            background: #000000;
        }
        
        .news-image {
            min-height: 100%;
            object-position: center;
        }
    }
