/* styles.css */
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;700&display=swap');

body {
    font-family: 'Vazirmatn', Tahoma, sans-serif; /* فونت وزیرمتن برای ظاهر مدرن‌تر */
    margin: 0;
    padding: 0;
    background-color: #f0f2f5; /* رنگ پس‌زمینه روشن‌تر */
    direction: rtl; /* برای فارسی */
    text-align: right;
}

.container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 15px;
}

.header {
    background: url('26422_orig.png') no-repeat center;
    background-size: cover;
    color: white;
    position: relative;
    padding: 20px;
    min-height: 150px; /* حداقل ارتفاع برای هدر */
    display: flex;
    align-items: flex-end; /* متن در پایین هدر قرار گیرد */
    justify-content: flex-end;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

.header img {
    height: 90px;
    position: absolute;
    left: 10px;
    top: 10px;
    border-radius: 8px; /* گوشه‌های گرد برای لوگو */
}

.date-bar {
    background-color: #003e7e;
    color: #fff;
    padding: 10px 15px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    direction: rtl; /* برای حفظ ترتیب اعداد و متن فارسی */
}

.date-bar p {
    margin: 0;
}

.search-section {
    background: #ffffff;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.search-section input[type="text"] {
    flex-grow: 1; /* اینپوت جستجو فضای بیشتری بگیرد */
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 25px; /* گوشه‌های گرد */
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s ease;
}

.search-section input[type="text"]:focus {
    border-color: #1479db;
}

.search-section .login, .search-section .add-news-btn {
    font-size: 15px;
    color: #003e7e;
    text-decoration: none;
    display: flex;
    align-items: center;
    margin-right: 15px;
    padding: 8px 15px;
    background-color: #e0f2f7; /* رنگ پس‌زمینه برای دکمه ورود */
    border-radius: 25px;
    transition: background-color 0.3s ease;
    white-space: nowrap; /* جلوگیری از شکستن متن */
}

.search-section .login:hover, .search-section .add-news-btn:hover {
    background-color: #cceeff;
}
.search-section .add-news-btn {
    background-color: #d4edda; /* رنگ سبز روشن برای دکمه افزودن خبر */
    color: #155724;
    margin-left: 10px; /* برای فاصله از دکمه ورود */
}
.search-section .add-news-btn:hover {
    background-color: #c3e6cb;
}


.info-text {
    text-align: right;
    padding: 10px 15px;
    font-size: 14px;
    color: #555;
    background-color: #fdfdfd;
    border-bottom: 1px solid #eee;
}

.main-image {
    position: relative;
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.main-image img {
    width: 100%;
    height: auto;
    display: block;
}

.caption {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background-color: rgba(0,0,0,0.7);
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 16px;
    max-width: 70%; /* برای جلوگیری از پر شدن کامل عرض در موبایل */
}

.section-header {
    background-color: #1479db;
    color: white;
    padding: 12px 15px;
    font-weight: bold;
    margin-top: 20px;
    border-radius: 8px 8px 0 0; /* گوشه‌های گرد بالا */
}

.news-container {
    background-color: #ffffff;
    border-radius: 0 0 8px 8px; /* گوشه‌های گرد پایین */
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    padding: 15px;
    margin-bottom: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* گرید ریسپانسیو */
    gap: 20px;
}

.news-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* برای جلوگیری از سرریز شدن محتوا */
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.1);
}

.news-card img {
    max-width: 100%;
    height: 180px; /* ارتفاع ثابت برای عکس‌ها */
    object-fit: cover; /* پر کردن کادر بدون تغییر نسبت ابعاد */
    border-radius: 6px;
    margin-bottom: 10px;
}

.news-card h4 {
    margin: 10px 0 5px;
    font-size: 18px;
    color: #003e7e;
    line-height: 1.4;
}

.news-card p {
    font-size: 14px;
    color: #555;
    line-height: 1.6;
    flex-grow: 1; /* متن توضیحات فضای باقی‌مانده را پر کند */
    margin-bottom: 10px;
}

.news-card .category {
    font-size: 12px;
    color: #fff;
    background-color: #1479db;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
    margin-top: auto; /* برای چسبیدن به پایین کارت */
}

/* Form Styles (for add_news.php) */
.add-news-form-section {
    padding: 20px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    margin-top: 20px;
}

.news-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.news-form label {
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
    display: block; /* برای اینکه هر لیبل در خط جدید باشد */
}

.news-form input[type="text"],
.news-form textarea,
.news-form select {
    width: calc(100% - 22px); /* کمی فاصله از کناره‌ها */
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.3s ease;
    font-family: 'Vazirmatn', Tahoma, sans-serif; /* حفظ فونت */
}

.news-form input[type="file"] {
    padding: 8px 0;
}

.news-form input[type="text"]:focus,
.news-form textarea:focus,
.news-form select:focus {
    border-color: #1479db;
    box-shadow: 0 0 0 3px rgba(20, 121, 219, 0.2);
}

.news-form textarea {
    resize: vertical; /* اجازه تغییر اندازه عمودی */
    min-height: 100px;
}

.news-form button {
    background-color: #28a745; /* رنگ سبز برای دکمه ثبت */
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.news-form button:hover {
    background-color: #218838;
}
@media (max-width: 768px) {
    .search-section {
        flex-direction: column;
        align-items: stretch;
        padding: 10px;
    }

    .search-section input[type="text"] {
        width: 100%;
        margin-bottom: 10px;
        max-width: 100%; /* حداکثر عرض برای اینپوت */
    }

    .search-section .login, .search-section .add-news-btn {
        max-width: 90px; /* حداکثر عرض برای دکمه‌ها */
        flex-basis: 90px; /* عرض پایه برای دکمه‌ها */
        justify-content: center;
        margin-bottom: 10px; /* فاصله بین دکمه‌ها در حالت موبایل */
        /* white-space: nowrap; حذف این ویژگی */
        word-break: break-word; /* شکستن کلمات طولانی */
        padding: 5px; /* کاهش پدینگ */
        font-size: 12px; /* کاهش اندازه فونت */
        margin-right: 0; /* حذف margin-right */
        line-height: 1.2; /* کاهش ارتفاع خط */
    }

    .search-section .add-news-btn {
        margin-left: 0; /* حذف margin-left در حالت موبایل */
    }
}

.menu{
    text-decoration: none;
}

.search-section .menu {
    list-style: none;
    
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
}

.search-section .menu li {
    margin-left: 15px;
}

.search-section .menu li a {
    color: #003e7e;
    text-decoration: none;
    font-size: 15px;
    transition: color 0.3s ease;
}

.search-section .menu li a:hover {
    color: #1479db;
}


@media (max-width: 768px) {
    .search-section .menu {
        flex-direction: column;
        align-items: stretch;
    }

    .search-section .menu li {
        margin-left: 0;
        margin-bottom: 10px;
    }
}


/* Styles for specific categories */
.category.important {
    background-color: #dc3545; /* قرمز */
}

.category.controversial {
    background-color: #ffc107; /* زرد */
    color: #333; /* متن تیره برای زردی */
}

.category.breaking {
    background-color: #007bff; /* آبی */
}

.category.general {
    background-color: #6c757d; /* خاکستری */
}


