/*
Theme Name: 7srey News
Author: Ehab
Description: قالب إخباري خفيف وسريع، للسرعة والـ SEO.
Version: 1.2
Text Domain: 7srey
*/

/* 1. إعدادات عامة (General Styles) */
* {
    box-sizing: border-box;
}

body {
    direction: rtl;
    font-family: 'Cairo', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.3s;
}

/* 2. الهيدر (Header) */
.main-header {
    background-color: #8b0000; /* اللون الأحمر الداكن */
    padding: 12px 0;
    color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    /* row-reverse تعكس العناصر: الشعار يمين والبحث يسار */
    flex-direction: row-reverse; 
    justify-content: space-between;
    align-items: center;
}

.header-search form {
    display: flex;
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
}

.header-search input {
    border: none;
    padding: 8px 15px;
    outline: none;
    width: 250px;
    font-family: 'Cairo', sans-serif;
}

.header-search button {
    background: #eee;
    border: none;
    padding: 0 12px;
    cursor: pointer;
    font-size: 16px;
    color: #333;
}

.logo h1 {
    margin: 0;
    font-size: 26px;
    font-weight: bold;
    color: #fff;
}

/* 3. التنقل (Navigation) */
.main-navigation {
    background: #fff;
    border-bottom: 1px solid #eee;
    padding: 10px 0;
}

.top-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 20px;
}

.top-menu a {
    color: #333;
    font-weight: bold;
    font-size: 15px;
}

.top-menu a:hover {
    color: #8b0000;
}

/* 4. شبكة المقالات (News Grid) */
.news-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding: 30px 0;
}

.news-card {
    background: #fff;
    border: 1px solid #ddd;
    overflow: hidden;
    text-align: center;
    transition: 0.3s;
}

.news-card:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transform: translateY(-3px);
}

.card-image img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.card-content h3 {
    font-size: 16px;
    color: #b22222;
    padding: 12px 10px;
    margin: 0;
    font-weight: 700;
}

/* 5. صفحة المقال المنفرد (Single Post) */
.single-post-container {
    max-width: 850px;
    margin: 30px auto;
    background: #fff;
    padding: 30px;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.breadcrumb {
    font-size: 14px;
    color: #888;
    margin-bottom: 20px;
}

.post-title {
    font-size: 32px;
    line-height: 1.4;
    color: #222;
    margin-bottom: 15px;
}

.post-meta {
    font-size: 13px;
    color: #777;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.post-meta span { margin-left: 15px; }

.post-thumbnail img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 25px;
}

.entry-content {
    font-size: 20px;
    line-height: 2;
    color: #333;
    text-align: justify;
}

.entry-content p { margin-bottom: 25px; }

/* 6. المقالات ذات الصلة */
.related-posts {
    margin-top: 50px;
    padding-top: 20px;
    border-top: 3px solid #8b0000;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.related-item h4 {
    font-size: 14px;
    margin-top: 10px;
    color: #8b0000;
}

/* 7. الفوتر (Footer) */
.main-footer {
    background-color: #222;
    color: #fff;
    padding: 40px 0 20px;
    margin-top: 50px;
    text-align: center;
}

.footer-links ul {
    list-style: none;
    padding: 0;
    margin: 20px 0;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.footer-links a:hover {
    color: #ff4d4d;
}

.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: #8b0000;
    color: #fff;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

/* 8. التجاوب مع الجوال (Responsive Design) */
@media (max-width: 1024px) {
    .news-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .news-grid { grid-template-columns: repeat(2, 1fr); }
    .header-content { 
        flex-direction: column; /* في الجوال نجعلهم تحت بعض */
        gap: 15px; 
    }
    .header-search input { width: 100%; }
    .related-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .news-grid { grid-template-columns: 1fr; }
    .post-title { font-size: 24px; }
}

/* 9. أرقام الصفحات (Pagination) */
.pagination {
    text-align: center;
    margin: 30px 0;
}

.pagination .page-numbers {
    padding: 8px 16px;
    background: #fff;
    border: 1px solid #ddd;
    margin: 0 3px;
}

.pagination .current {
    background: #8b0000;
    color: #fff;
    border-color: #8b0000;
}
/* تنسيق قسم التعليقات (Comments Section) */
#respond {
    background: #fff;
    padding: 30px;
    margin-top: 40px;
    border-top: 3px solid #8b0000; /* خط أحمر علوي للتميز */
    border-radius: 4px;
}

#reply-title {
    font-size: 24px;
    color: #222;
    margin-bottom: 20px;
    display: block;
}

/* تنسيق حقول الإدخال */
.comment-form textarea {
    width: 100%;
    border: 1px solid #ddd;
    padding: 15px;
    font-family: 'Cairo', sans-serif;
    font-size: 16px;
    border-radius: 4px;
    background-color: #f9f9f9;
    resize: vertical;
    min-height: 150px;
}

.comment-form textarea:focus {
    border-color: #8b0000;
    outline: none;
    background-color: #fff;
}

/* تنسيق زر إرسال التعليق */
.form-submit {
    margin-top: 20px;
    text-align: left; /* جعل الزر جهة اليسار كما في المواقع الإخبارية */
}

#submit {
    background-color: #8b0000;
    color: #fff;
    border: none;
    padding: 12px 35px;
    font-family: 'Cairo', sans-serif;
    font-size: 18px;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    transition: 0.3s;
}

#submit:hover {
    background-color: #5d0000;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* تنظيف النصوص المساعدة */
.logged-in-as {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
}

.logged-in-as a {
    color: #8b0000;
    font-weight: bold;
}