/* News Section Styles */
.news-section {
    position: relative;
    margin: 50px 50px;
}

.news-container {
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    padding: 20px 0;
    scrollbar-width: thin;
    scrollbar-color: #888 #f1f1f1;
}

.news-container::-webkit-scrollbar {
    height: 8px;
}

.news-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.news-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.news-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.news-card {
    display: inline-block;
    width: 300px;
    height: 450px; /* ارتفاع ثابت للبطاقة */
    margin-right: 20px;
    white-space: normal;
    vertical-align: top;
    transition: transform 0.3s ease;
    overflow: hidden; /* مهم لمنع تجاوز المحتوى */
}

.news-card:hover {
    transform: translateY(-5px);
}

.news-card img {
    height: 180px; /* ارتفاع ثابت للصورة */
    width: 100%;
    object-fit: cover; /* تقص الصورة بدون تشويه */
    object-position: center; /* تركز على منتصف الصورة */
}

.news-card .card-body {
    height: 270px; /* ارتفاع ثابت لمحتوى البطاقة */
    display: flex;
    flex-direction: column;
    padding: 15px;
}

.news-card .card-title {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 10px;
    height: 50px; /* ارتفاع ثابت للعنوان */
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* سطرين كحد أقصى للعنوان */
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.card-text-preview {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.5;
    flex-grow: 1; /* يأخذ المساحة المتبقية */
    margin-bottom: 15px;
}

.news-card .btn {
    margin-top: auto; /* يدفع الزر للأسفل */
    width: 100%;
}

.scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.scroll-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

.scroll-left {
    left: 10px;
}

.scroll-right {
    right: 10px;
}

/* Modal Styles */
.modal-backdrop {
    z-index: 1040 !important;
    background-color: rgba(0, 0, 0, 0.5) !important;
}

.modal {
    z-index: 1050 !important;
}

.modal-dialog {
    z-index: 1060 !important;
}

body.modal-open {
    overflow: hidden;
}

#newsModal .modal-body img {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: cover;
    margin-bottom: 20px;
    border-radius: 8px;
}

#newsModal .modal-body {
    max-height: 70vh;
    overflow-y: auto;
}

#newsModal .modal-body p {
    text-align: justify;
    line-height: 1.8;
    margin-bottom: 15px;
}

#newsModal .modal-body h3 {
    margin-bottom: 20px;
    color: #333;
}
