/* قسم الأخبار */
.news-page {
    padding: 80px 0;
    background-color: var(--white);
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
    color: var(--dark-color);
    position: relative;
    padding-bottom: 15px;
}

.section-title:after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 50%;
    transform: translateX(50%);
    width: 80px;
    height: 3px;
    background-color: var(--primary-color);
}

/* ✅ الشبكة الرئيسية */
.news-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* افتراضي: 4 أعمدة */
    gap: 25px;
    margin-bottom: 40px;
}

/* ✅ التجاوب */
@media (max-width: 1200px) {
    .news-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .news-grid {
        grid-template-columns: 1fr;
    }
}

/* البطاقة */
.news-card {
    background-color: var(--light-color);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
}

.news-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.news-img {
    height: 200px;
    overflow: hidden;
}

.news-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.news-card:hover .news-img img {
    transform: scale(1.1);
}

.news-content {
    padding: 20px;
}

.news-meta {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    color: #777;
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.news-meta i {
    margin-left: 8px;
    color: var(--primary-color);
}

.news-title {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: var(--dark-color);
    line-height: 1.4;
}

.news-excerpt {
    margin-bottom: 20px;
    color: #555;
    line-height: 1.6;
}

.read-more {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: var(--white);
    text-decoration: none;
    border-radius: 5px;
    font-weight: 500;
    transition: var(--transition);
}

.read-more:hover {
    background-color: var(--black);
}

/* ✅ الترقيم */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 50px;
    flex-wrap: wrap;
    gap: 10px;
}

.pagination-item {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    background-color: var(--light-color);
    color: var(--dark-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.pagination-item:hover,
.pagination-item.active {
    background-color: var(--primary-color);
    color: var(--white);
}


/* خاص بالايقونات */
.news-icons {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    gap: 10px;
    z-index: 2;
}

/* تأكد أن parent relative */
.news-img {
    position: relative; /* جديد */
    height: 200px;
    overflow: hidden;
}

/* الأزرار كروابط */
.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    color: white;
    font-size: 16px;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* عند الضغط */
.icon-button:active {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transform: scale(0.95);
}

/* لون زر الحذف */
.delete-btn {
    background-color: #f44336;
}

/* لون زر التعديل */
.edit-btn {
    background-color: #2196f3;
}

/* تأثير عند المرور */
.delete-btn:hover {
    animation: shake 0.4s;
}

.edit-btn:hover {
    animation: spin 0.5s;
}

/* حركة هز */
@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    50% { transform: translateX(3px); }
    75% { transform: translateX(-3px); }
    100% { transform: translateX(0); }
}

/* حركة دوران */
@keyframes spin {
    0% { transform: rotate(0deg); }
    50% { transform: rotate(15deg); }
    100% { transform: rotate(0deg); }
}

.btn {
    cursor: pointer;
    border: none;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.btn-primary {
    background-color: #007bff;
    color: white;
    padding: 6px 12px;
    font-size: 14px;
}

.btn-primary:hover {
    background-color: #0056b3;
}
