/**
 * News Section Styles - أنماط قسم الأخبار
 * @package Lahzat_News
 * @version 1.0
 */

/* ===== قسم الأخبار الرئيسي ===== */
.news-section {
    margin-bottom: 40px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    position: relative;
}

.news-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #007bff, #28a745, #ffc107, #dc3545);
    z-index: 1;
}

.news-container {
    padding: 30px;
}

/* ===== عنوان القسم ===== */
.news-header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

.news-title {
    font-size: 28px; /* Increased font size */
    font-weight: 700;
    color: #333;
    margin: 0 0 15px 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    height: 40px; /* Fixed height 40px */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px; /* مسافة بين الأيقونة والنص */
}

.news-title::before {
    content: '';
    font-size: 32px;
    line-height: 1;
    flex-shrink: 0;
}

.title-lines {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.red-line {
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, #dc3545, #ff6b6b);
    border-radius: 2px;
}

.blue-line {
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, #007bff, #4dabf7);
    border-radius: 2px;
}

/* ===== الشكل الأول: 4 مقالات في صف واحد مع أسهم ===== */
.news-layout-1 {
    position: relative;
}

.news-slider-container {
    position: relative;
    overflow: hidden;
}

.news-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    transition: transform 0.5s ease;
}

.news-row.hidden {
    display: none;
}

.news-row.active {
    display: grid;
}

.news-item {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
    position: relative;
}

.news-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #007bff, #28a745);
    z-index: 1;
    border-radius: 8px 8px 0 0;
}

.news-item::after {
    content: '';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: #28a745;
    border-radius: 50%;
    z-index: 2;
    box-shadow: 0 0 0 2px #fff;
}

.news-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: #007bff;
}

.news-image {
    position: relative;
    overflow: hidden;
    height: 200px;
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.news-item:hover .news-image img {
    transform: scale(1.05);
}

.no-image {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: white;
}

.news-content {
    padding: 20px;
}

.news-item-title {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    height: 2.8em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.news-item-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.news-item-title a:hover {
    color: #007bff;
}

.news-meta {
    margin-top: 10px;
}

.news-date {
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    background: linear-gradient(135deg, #007bff, #28a745);
    padding: 6px 12px;
    border-radius: 15px;
    display: inline-block;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.news-date::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.news-date:hover::before {
    left: 100%;
}

/* ===== الشكل الثاني: صف 2 + صف 4 ===== */
.news-layout-2 {
    position: relative;
}

.news-row-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.news-row-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.news-item-large {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
    position: relative;
}

.news-item-large::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #007bff, #28a745);
    z-index: 1;
    border-radius: 8px 8px 0 0;
}

.news-item-large::after {
    content: '';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: #28a745;
    border-radius: 50%;
    z-index: 2;
    box-shadow: 0 0 0 2px #fff;
}

.news-item-large:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: #007bff;
}

.news-item-large .news-image {
    height: 250px;
}

.news-item-large .news-content {
    padding: 25px;
}

.news-item-large .news-item-title {
    font-size: 18px;
    height: 3.6em;
    -webkit-line-clamp: 3;
    line-clamp: 3;
}

/* ===== الشكل الثالث: مقال كبير + عمود جانبي ===== */
.news-layout-3 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    width: 100%;
    max-width: 100%;
    align-items: start;
}

/* جعل الشكل الثالث بعرض الصفحة كاملة */
.news-section.news-layout-3 {
    margin-left: -50px;
    margin-right: -50px;
    width: calc(100% + 100px);
    max-width: none;
    position: relative;
}

.news-section.news-layout-3 .news-container {
    padding: 40px 60px;
    max-width: 1400px;
    margin: 0 auto;
}

.news-main-article {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
    position: relative;
}

.news-main-article::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #007bff, #28a745);
    z-index: 1;
    border-radius: 8px 8px 0 0;
}

.news-main-article::after {
    content: '';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: #28a745;
    border-radius: 50%;
    z-index: 2;
    box-shadow: 0 0 0 2px #fff;
}

.news-main-article:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border-color: #007bff;
}

.news-main-article .news-image {
    height: 350px;
}

.news-main-article .news-content {
    padding: 35px;
}

.news-main-title {
    font-size: 26px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 18px 0;
    height: 3.9em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
}

.news-main-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.news-main-title a:hover {
    color: #007bff;
}

/* ===== العمود الجانبي ===== */
.news-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.news-sidebar-item {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
    position: relative;
    display: flex;
    gap: 15px;
    padding: 18px;
}

.news-sidebar-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #007bff, #28a745);
    z-index: 1;
    border-radius: 8px 8px 0 0;
}

.news-sidebar-item::after {
    content: '';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 6px;
    height: 6px;
    background: #28a745;
    border-radius: 50%;
    z-index: 2;
    box-shadow: 0 0 0 2px #fff;
}

.news-sidebar-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    border-color: #007bff;
}

.news-sidebar-image {
    width: 90px;
    height: 70px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.news-sidebar-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.news-sidebar-item:hover .news-sidebar-image img {
    transform: scale(1.05);
}

.no-image-small {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.news-sidebar-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.news-sidebar-title {
    margin: 0 0 10px 0;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    height: 2.6em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.news-sidebar-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.news-sidebar-title a:hover {
    color: #007bff;
}

.news-sidebar-meta {
    margin-top: 5px;
}

.news-sidebar-meta .news-date {
    font-size: 11px;
    padding: 4px 8px;
}

/* ===== أزرار التنقل ===== */
.news-arrows {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 10px;
    pointer-events: auto;
    z-index: 10;
}

.news-arrow {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #007bff, #28a745);
    color: white;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
    position: relative;
    overflow: hidden;
    pointer-events: auto;
    opacity: 0.8;
}

.news-arrow::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.news-arrow:hover::before {
    left: 100%;
}

.news-arrow:hover {
    transform: translateY(-2px) scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
    opacity: 1;
}

.news-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

.news-arrow:disabled:hover {
    transform: none;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.news-arrow:active {
    transform: translateY(-1px);
}

/* ===== التصميم المتجاوب ===== */
@media (max-width: 1200px) {
    .news-row {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .news-row-4 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .news-layout-3 {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    /* إعادة تعيين عرض شكل 3 للشاشات الصغيرة */
    .news-section.news-layout-3 {
        margin-left: -20px;
        margin-right: -20px;
        width: calc(100% + 40px);
    }
    
    .news-section.news-layout-3 .news-container {
        padding: 20px 30px;
    }
}

@media (max-width: 768px) {
    .news-container {
        padding: 20px;
    }
    
    .news-title {
        font-size: 20px;
    }
    
    .news-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .news-row-2 {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .news-row-4 {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .news-item .news-image {
        height: 150px;
    }
    
    .news-item-large .news-image {
        height: 200px;
    }
    
    .news-main-article .news-image {
        height: 250px;
    }
    
    .news-sidebar-item {
        flex-direction: column;
        gap: 10px;
    }
    
    .news-sidebar-image {
        width: 100%;
        height: 120px;
    }
    
    /* إعادة تعيين عرض شكل 3 للشاشات الصغيرة */
    .news-section.news-layout-3 {
        margin-left: -20px;
        margin-right: -20px;
        width: calc(100% + 40px);
    }
    
    .news-section.news-layout-3 .news-container {
        padding: 20px;
    }
    
    /* عرض موبايل خاص - مقال أو مقالين */
    .news-layout-1.mobile-single {
        grid-template-columns: 1fr;
    }
    
    .news-layout-1.mobile-double {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .news-row {
        grid-template-columns: 1fr;
    }
    
    .news-row-4 {
        grid-template-columns: 1fr;
    }
    
    .news-arrows {
        gap: 15px;
    }
    
    .news-arrow {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}
