/* =========================
   استایل اصلی و لوکس - رنگ‌بندی سبز + آبی + سفید
   ========================= */

:root {
    --white: #fff;
    --blue: #007BFF;
    --green: #28a745;
    --dark: #222;
    --light: #f9f9f9;
}

/* =========================
   Header (هدر باریک، شیک، سه ستون: چپ لوگو، وسط دکمه‌ها، راست شماره)
   ========================= */

.site-header {
    background: linear-gradient(90deg, var(--blue), var(--green));
    color: #fff;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    position: fixed; /* باریک و شناور */
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 6px 0; /* باریک‌تر از قبل */
}

.header-inner {
    display: flex;
    align-items: center; /* جلوگیری از بالا رفتن آیتم‌ها */
    justify-content: space-between;
    gap: 12px;
}

/* لوگو سمت چپ */
.site-branding {
    flex: 1 1 auto;
    text-align: left;
}
.site-branding img { max-height: 50px; }
.site-title a {
    font-size: 1.6rem;
    font-weight: 900;
    color: #fff;
    text-decoration: none;
    font-family: 'Vazir', sans-serif;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* دکمه‌ها وسط */
.header-buttons {
    flex: 0 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
}
.header-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    border-radius: 4px;
    background: #fff;
    color: var(--blue);
    font-weight: 600;
    text-decoration: none;
    font-size: 14px;
    line-height: 1;
    transition: background 0.3s, color 0.3s;
}
.header-btn:hover {
    background: var(--green);
    color: #fff;
}

/* شماره تماس سمت راست */
.header-contact {
    flex: 1 1 auto;
    text-align: right;
}
.header-contact .phone-link {
    display: inline-block;
    background: var(--blue);
    color: #fff;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: background 0.3s, transform 0.3s;
    text-decoration: none;
}
.header-contact .phone-link:hover {
    background: var(--green);
    transform: translateY(-2px);
}

/* افکت چشمک‌زن */
.phone-link.blink {
    animation: blink 1.1s infinite;
}
@keyframes blink {
    0%, 60%, 100% { opacity: 1; }
    30% { opacity: 0.45; }
}

/* حذف هر منوی قدیمی زیر شماره (در صورت وجود کلاس) */
.header-right .main-navigation { display: none; }

/* =========================
   Navigation (اگر منو حذف شده، این بخش بدون اثر می‌ماند)
   ========================= */

.main-navigation { position: relative; }
.main-navigation .menu {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.main-navigation .menu li { position: relative; }
.main-navigation .menu a {
    color: var(--dark);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    padding: 8px 12px;
    line-height: 1.4;
    transition: color 0.2s;
    white-space: nowrap;
}
.main-navigation .menu a:hover { color: var(--green); }

/* زیرمنو در دسکتاپ */
.main-navigation .menu li:hover > ul.sub-menu { display: block; }
.main-navigation .menu li ul.sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--dark);
    min-width: 180px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 999;
}
.main-navigation .menu li ul.sub-menu li {
    margin: 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.main-navigation .menu li ul.sub-menu a {
    color: #fff;
    padding: 10px 14px;
    white-space: normal;
}
.main-navigation .menu li ul.sub-menu a:hover { background: var(--blue); }

/* =========================
   Hero
   ========================= */

.hero-section {
    background: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4)), url('../images/hero-bg.jpg') center/cover no-repeat;
    height: 90vh;
    display: flex;
    align-items: center;
    text-align: center;
    color: white;
    padding-top: 70px; /* فاصله از هدر ثابت */
}
.hero-title {
    font-size: 3.5rem;
    font-weight: 900;
    margin-bottom: 20px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}
.hero-desc {
    font-size: 1.4rem;
    max-width: 800px;
    margin: 0 auto 40px;
}

/* دکمه اصلی */
.btn-primary {
    background: var(--green);
    color: white;
    padding: 15px 40px;
    border-radius: 50px;
    font-weight: bold;
    font-size: 1.2rem;
    transition: 0.3s;
    display: inline-block;
    text-decoration: none;
}
.btn-primary:hover {
    background: var(--blue);
    transform: translateY(-3px);
}

/* =========================
   Posts section
   ========================= */

.posts-section { padding: 80px 0; background: var(--light); }
.posts-grid { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: 30px; 
    margin-top: 50px;
}
.post-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: 0.4s;
}
.post-card:hover { transform: translateY(-15px); }
.post-content { padding: 25px; }
.post-content h2 { font-size: 1.4rem; margin-bottom: 15px; }
.post-content h2 a { color: var(--dark); text-decoration: none; }
.post-content h2 a:hover { color: var(--green); }
.read-more { color: var(--blue); font-weight: bold; text-decoration: none; }

/* =========================
   Footer
   ========================= */

.site-footer {
    background: var(--dark);
    color: white;
    padding: 60px 0 20px;
}
.footer-widgets {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    margin-bottom: 50px;
}
.footer-col h4 {
    color: var(--green);
    margin-bottom: 20px;
    font-size: 1.3rem;
}
.social-links a {
    font-size: 1.8rem;
    margin: 0 10px;
    color: white;
    transition: 0.3s;
    text-decoration: none;
}
.social-links a:hover { color: var(--green); }
.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.95rem;
}

/* =========================
   Bottom Navigation (mobile)
   ========================= */

.bottom-nav {
    display: none; /* در دسکتاپ مخفی */
}
@media (max-width: 768px) {
    .bottom-nav {
        display: block;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: var(--dark);
        box-shadow: 0 -2px 10px rgba(0,0,0,0.15);
        z-index: 9999;
    }
    .bottom-nav ul {
        display: flex;
        justify-content: space-around;
        margin: 0;
        padding: 8px 0;
        list-style: none;
    }
    .bottom-nav ul li a {
        color: #fff;
        font-size: 0.9rem;
        text-decoration: none;
        font-weight: 600;
        transition: color 0.3s;
    }
    .bottom-nav ul li a:hover {
        color: var(--green);
    }
}

/* =========================
   Generic layout helpers
   ========================= */

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 16px;
    padding-right: 16px;
    box-sizing: border-box;
}

/* =========================
   Responsive
   ========================= */

/* بزرگ: تمام عرض کانتینر */
@media (max-width: 1200px) {
    .container { max-width: 100%; }
}

/* میانه: گرید پست‌ها و جلوگیری از ستون شدن هدر */
@media (max-width: 992px) {
    .posts-grid { grid-template-columns: repeat(2, 1fr); }
    .header-inner {
        flex-direction: row; /* جلوگیری از تبدیل به ستون */
        justify-content: space-between;
        align-items: center;
        text-align: initial;
    }
    .site-branding { margin-bottom: 0; }
}

/* موبایل: کامپکت، باریک، بدون به‌هم‌ریختگی */
@media (max-width: 768px) {
    .site-header { padding: 4px 0; }
    .site-title a { font-size: 1.2rem; }
    .header-btn { font-size: 12px; padding: 4px 10px; }
    .header-contact .phone-link { font-size: 12px; padding: 4px 8px; }
    .hero-section { height: auto; padding: 70px 16px 24px; }
    .hero-title { font-size: 2.2rem; }
    .hero-desc { font-size: 1rem; margin-bottom: 24px; }
    .posts-grid { grid-template-columns: 1fr; gap: 18px; }
    .footer-widgets { grid-template-columns: 1fr 1fr; gap: 20px; }
}

/* خیلی کوچک: بهینه‌سازی بیشتر */
@media (max-width: 480px) {
    .header-buttons { gap: 8px; }
    .header-btn { padding: 4px 8px; font-size: 11px; }
    .site-branding img { max-height: 42px; }
    .site-title a { font-size: 1.05rem; }
}

/* =========================
   Accessibility & misc
   ========================= */

a:focus, button:focus {
    outline: 2px dashed rgba(0, 123, 255, 0.6);
    outline-offset: 2px;
}

img { max-width: 100%; height: auto; display: block; }

ul { margin: 0; padding: 0; }
/* فاصله محتوای اصلی از هدر در دسکتاپ */
body {
    padding-top: 70px; /* ارتفاع هدر دسکتاپ */
}
/* صفحه جستجو */
.search-page {
    max-width: 800px;
    margin: 50px auto;
    text-align: center;
}

.search-title {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 25px;
    color: #333;
}

/* فرم جستجو */
.search-form {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 40px;
}

.search-field {
    width: 70%;
    padding: 15px 20px;
    font-size: 18px;
    border: 2px solid #007BFF;
    border-radius: 50px 0 0 50px;
    outline: none;
    transition: all 0.3s ease;
}

.search-field:focus {
    border-color: #0056b3;
    box-shadow: 0 0 8px rgba(0,123,255,0.4);
}

.search-submit {
    padding: 15px 25px;
    font-size: 18px;
    border: none;
    background: linear-gradient(135deg, #007BFF, #0056b3);
    color: #fff;
    border-radius: 0 50px 50px 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-submit i {
    margin-left: 8px;
}

.search-submit:hover {
    background: linear-gradient(135deg, #0056b3, #003f7f);
    transform: scale(1.05);
}

/* نتایج جستجو */
.search-results {
    text-align: left;
}

.search-item {
    background: #f9f9f9;
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.search-item:hover {
    background: #eef6ff;
    transform: translateY(-3px);
}

.search-item h3 {
    margin: 0 0 10px;
    font-size: 20px;
    color: #007BFF;
}

.search-item h3 a {
    text-decoration: none;
    color: inherit;
}

.search-item p {
    font-size: 16px;
    color: #555;
}
.search-results {
    display: flex;
    flex-direction: column;
    gap: 20px;
    direction: rtl; /* راست‌چین */
}

.search-item {
    display: flex;
    align-items: flex-start;
    background: #f9f9f9;
    border-radius: 12px;
    padding: 15px;
    transition: all 0.3s ease;
}

.search-item:hover {
    background: #eef6ff;
    transform: translateY(-3px);
}

.search-thumb {
    flex: 0 0 150px;
    margin-left: 15px;
}

.search-thumb img {
    width: 100%;
    border-radius: 10px;
}

.search-content {
    flex: 1;
    text-align: right;
}

.search-content h3 {
    margin: 0 0 10px;
    font-size: 20px;
    color: #007BFF;
}

.search-content h3 a {
    text-decoration: none;
    color: inherit;
}

.search-content p {
    font-size: 16px;
    color: #555;
    line-height: 1.6;
}
/* استایل محتوای نوشته و برگه */
.entry-content, .post-content {
    background: #fff; /* پس‌زمینه سفید داخل کادر */
    border-radius: 12px; /* گوشه‌های گرد */
    box-shadow: 0 4px 15px rgba(0,0,0,0.08); /* سایه نرم */
    padding: 40px; /* فاصله داخلی */
    margin: 40px auto; /* فاصله از اطراف */
    max-width: 900px; /* عرض محدود برای خوانایی */
    direction: rtl; /* راست‌چین */
}

/* تیترها داخل محتوا */
.entry-content h2, .post-content h2 {
    font-size: 26px;
    color: #007BFF;
    margin-bottom: 20px;
    border-bottom: 2px solid #eef6ff;
    padding-bottom: 8px;
}

/* پاراگراف‌ها */
.entry-content p, .post-content p {
    font-size: 18px;
    line-height: 1.8;
    color: #444;
    margin-bottom: 20px;
}
.post-header-box {
    background: linear-gradient(135deg, #f9f9f9, #eef6ff);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    padding: 25px 30px;
    margin-bottom: 30px;
    text-align: right;
    direction: rtl;
}

.post-header-box .entry-title {
    font-size: 28px;
    font-weight: bold;
    color: #007BFF;
    margin-bottom: 15px;
}

.post-header-box .entry-title a {
    text-decoration: none;
    color: inherit;
}

.post-header-box .entry-meta {
    font-size: 14px;
    color: #555;
}
.page-header-box {
    background: linear-gradient(135deg, #f9f9f9, #eef6ff);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    padding: 25px 30px;
    margin-bottom: 30px;
    text-align: right;
    direction: rtl;
}

.page-header-box .page-title {
    font-size: 28px;
    font-weight: bold;
    color: #007BFF;
    margin-top: 15px;
}

.page-thumb img {
    width: 100%;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.page-body {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    padding: 40px;
    margin-bottom: 40px;
    font-size: 18px;
    line-height: 1.8;
    color: #444;
}
/* تصویر شاخص وسط‌چین */
.post-thumb {
    text-align: center;
    margin-bottom: 15px;
}
.post-thumb img {
    display: inline-block;
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* دکمه وسط‌چین */
.read-more-wrapper {
    text-align: center;
    margin-top: 15px;
}

.read-more-btn {
    display: inline-block;
    padding: 10px 20px;
    background: linear-gradient(135deg, #28a745, #218838);
    color: #fff;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
}

.read-more-btn:hover {
    background: linear-gradient(135deg, #218838, #1e7e34);
    transform: translateY(-2px);
}
/* بخش کلی دیدگاه‌ها */
.comments-area {
    background: #f9f9f9;
    padding: 20px;
    margin-top: 30px;
    border-radius: 8px;
}

/* عنوان دیدگاه‌ها */
.comments-title {
    font-size: 20px;
    margin-bottom: 15px;
    border-bottom: 2px solid #ddd;
    padding-bottom: 10px;
}

/* لیست دیدگاه‌ها */
.comment-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.comment-list li {
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}
.comment-author {
    font-weight: bold;
    margin-bottom: 5px;
}
.comment-meta {
    font-size: 12px;
    color: #777;
    margin-bottom: 10px;
}

/* فرم دیدگاه */
.comment-form input,
.comment-form textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
}
.comment-form textarea {
    min-height: 120px;
}
.comment-form input[type="submit"],
.comment-form .btn {
    background: #0073aa;
    color: #fff;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 4px;
}
.comment-form input[type="submit"]:hover {
    background: #005f8d;
}

/* کپچا */
.comment-form-captcha {
    margin-top: 10px;
}
.comment-form-captcha label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}
/* لیست دیدگاه‌ها */
.comment-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* هر کامنت */
.comment-list li {
    margin-bottom: 20px;
    border: 1px solid #ddd;
    padding: 15px;
    border-radius: 6px;
    background: #fafafa;
}

/* پاسخ‌های تو در تو */
.comment-list .children {
    margin-left: 30px; /* تو رفتن پاسخ‌ها */
    margin-top: 15px;
    list-style: none;
    padding-left: 0;
    border-left: 3px solid #ccc; /* خط راهنما */
}

.comment-list .children li {
    background: #fff;
    border: 1px solid #eee;
    margin-bottom: 15px;
    padding: 12px;
    border-radius: 6px;
}
