/*
Theme Name: بلوفا بلاگ
Theme URI: https://blog.bluefa.ir
Author: بلوفا
Description: قالب اختصاصی وبلاگ بلوفا، هماهنگ با هویت بصری سایت اصلی bluefa.ir — همان رنگ‌بندی، فونت، پس‌زمینه‌ی گرادیانت تیره و منوی همبرگری.
Version: 1.0
Requires PHP: 7.4
Text Domain: bluefa-blog
*/

:root {
    --bg-dark: #0f1224;
    --bg-darker: #0a0c1a;
    --card-bg: rgba(255, 255, 255, 0.06);
    --card-border: rgba(255, 255, 255, 0.12);
    --accent: #7c5cff;
    --accent-2: #22d3c9;
    --text-main: #eef0fb;
    --text-muted: #a3a8c3;
    --success: #2ecc71;
    --warning: #f5a623;
    --danger: #ff5d6c;
    --radius: 16px;
    --gold: #d9b25c;
    --gold2: #f0c869;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Vazirmatn', sans-serif;
    background: radial-gradient(circle at top right, #1c1f3f 0%, var(--bg-dark) 45%, var(--bg-darker) 100%);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.8;
}

a { color: inherit; }
img { max-width: 100%; height: auto; border-radius: 12px; }

/* ===== نوار ناوبری ===== */
.navbar {
    background: rgba(15, 18, 36, 0.8);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--card-border);
    position: sticky;
    top: 0;
    z-index: 50;
}
.nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}
.brand {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--accent-2);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}
.brand img { border-radius: 8px; }
.nav-start { display: flex; align-items: center; gap: 10px; }

/* دکمه‌ی همبرگری - فقط روی موبایل دیده می‌شود */
.nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--card-border);
    cursor: pointer;
    padding: 0;
}
.nav-toggle-bar {
    width: 18px;
    height: 2px;
    background: var(--text-main);
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease;
}
.nav-toggle-active .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle-active .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle-active .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* منوی کشویی روی موبایل */
.nav-links {
    position: absolute;
    top: calc(100% + 10px);
    left: 16px;
    right: 16px;
    background: rgba(15,18,36,0.98);
    backdrop-filter: blur(14px);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    box-shadow: 0 16px 32px rgba(0,0,0,0.4);
    z-index: 60;
    list-style: none;
    margin: 0;
}
.nav-links-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.nav-links li { list-style: none; }
.nav-links a {
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 10px 6px;
    border-bottom: 1px solid var(--card-border);
    display: block;
}
.nav-links li:last-child a { border-bottom: none; }
.nav-links a:hover { color: var(--accent-2); }
.btn-nav {
    background: linear-gradient(135deg, var(--accent), var(--accent-2)) !important;
    padding: 10px 14px !important;
    border-radius: 999px !important;
    color: #fff !important;
    text-align: center;
    border-bottom: none !important;
    margin-top: 6px;
}

/* روی صفحه‌های بزرگ‌تر: منو همیشه افقی و باز است، دکمه‌ی همبرگری مخفی می‌شود */
@media (min-width: 768px) {
    .nav-toggle { display: none; }
    .nav-links {
        position: static;
        flex-direction: row;
        align-items: center;
        background: transparent;
        border: none;
        padding: 0;
        gap: 18px;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        z-index: auto;
    }
    .nav-links a {
        padding: 0;
        border-bottom: none;
        white-space: nowrap;
    }
    .btn-nav { padding: 6px 14px !important; margin-top: 0; }
}

/* ===== محتوای اصلی ===== */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 16px 60px;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
}

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

.text-muted { color: var(--text-muted); }
h1, h2, h3, h4 { color: var(--text-main); line-height: 1.5; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.4rem; }

.btn {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
}
.btn-outline {
    background: transparent;
    border: 1px solid var(--card-border);
    color: var(--text-main);
}

/* ===== کارت پست وبلاگ ===== */
.blog-hero {
    text-align: center;
    padding: 40px 16px 20px;
}
.blog-hero h1 {
    font-size: 2rem;
    background: linear-gradient(135deg, var(--gold2), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 8px;
}

.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 22px;
    margin-top: 20px;
}
.post-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.post-card:hover {
    transform: translateY(-4px);
    border-color: rgba(124,92,255,0.4);
    box-shadow: 0 14px 30px rgba(0,0,0,0.35);
}
.post-card-thumb {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: 0;
    display: block;
    background: linear-gradient(135deg, rgba(124,92,255,0.25), rgba(34,211,201,0.15));
}
.post-card-thumb-placeholder {
    width: 100%;
    aspect-ratio: 16/9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.4rem;
    background: linear-gradient(135deg, rgba(124,92,255,0.25), rgba(34,211,201,0.15));
}
.post-card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.post-card-cat {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--gold2);
    margin-bottom: 6px;
}
.post-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 8px;
    line-height: 1.6;
}
.post-card-excerpt {
    font-size: 0.85rem;
    color: var(--text-muted);
    flex: 1;
    margin: 0 0 10px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.post-card-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    padding-top: 10px;
    border-top: 1px solid var(--card-border);
}

/* ===== صفحه‌ی تک‌پست ===== */
.single-post {
    max-width: 760px;
    margin: 0 auto;
}
.single-post-header { text-align: center; margin-bottom: 24px; }
.single-post-header h1 {
    font-size: 1.8rem;
    margin-bottom: 10px;
}
.single-post-meta {
    color: var(--text-muted);
    font-size: 0.85rem;
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
}
.single-post-thumb {
    width: 100%;
    border-radius: var(--radius);
    margin: 20px 0;
}
.single-post-content {
    font-size: 1rem;
    line-height: 2;
}
.single-post-content p { margin: 0 0 18px; }
.single-post-content h2, .single-post-content h3 {
    margin-top: 32px;
    margin-bottom: 12px;
}
.single-post-content a { color: var(--accent-2); text-decoration: underline; }
.single-post-content blockquote {
    border-right: 3px solid var(--accent);
    padding: 4px 16px;
    margin: 20px 0;
    color: var(--text-muted);
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
}
.single-post-content ul, .single-post-content ol { padding-right: 24px; }
.single-post-content img { margin: 16px 0; }
.single-post-content code {
    background: rgba(255,255,255,0.08);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}
.single-post-content pre {
    background: rgba(0,0,0,0.3);
    padding: 16px;
    border-radius: 12px;
    overflow-x: auto;
    direction: ltr;
    text-align: left;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--card-border);
}
.post-tags a {
    font-size: 0.75rem;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--card-border);
    padding: 5px 12px;
    border-radius: 999px;
    text-decoration: none;
    color: var(--text-muted);
}
.post-tags a:hover { color: var(--accent-2); border-color: var(--accent-2); }

/* ===== باکس بازگشت به اپلیکیشن اصلی (CTA) ===== */
.blog-cta {
    background: linear-gradient(135deg, rgba(124,92,255,0.15), rgba(34,211,201,0.08));
    border: 1px solid rgba(124,92,255,0.3);
    border-radius: var(--radius);
    padding: 22px;
    text-align: center;
    margin: 30px 0;
}
.blog-cta h3 { margin-top: 0; }

/* ===== صفحه‌بندی ===== */
.blog-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 30px;
    flex-wrap: wrap;
}
.blog-pagination a, .blog-pagination span {
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid var(--card-border);
    text-decoration: none;
    color: var(--text-main);
    font-size: 0.85rem;
}
.blog-pagination .current {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border-color: transparent;
}

/* ===== نوار کناری ===== */
.widget {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 20px;
}
.widget h3 { margin-top: 0; font-size: 1rem; }
.widget ul { list-style: none; padding: 0; margin: 0; }
.widget li { padding: 8px 0; border-bottom: 1px solid var(--card-border); font-size: 0.88rem; }
.widget li:last-child { border-bottom: none; }
.widget a { text-decoration: none; color: var(--text-main); }
.widget a:hover { color: var(--accent-2); }
.widget input[type="search"], .widget input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--card-border);
    background: rgba(255,255,255,0.04);
    color: var(--text-main);
    font-family: inherit;
}

.blog-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 26px;
    align-items: start;
}
@media (max-width: 860px) {
    .blog-layout { grid-template-columns: 1fr; }
}

/* ===== دیدگاه‌ها ===== */
.comment-list .comment { list-style: none; padding: 16px 0; border-bottom: 1px solid var(--card-border); }
.comment-list .comment:last-child { border-bottom: none; }
.comment-author .fn { font-weight: 700; font-style: normal; }
.comment-meta { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 6px; }
.comment-meta a { color: var(--text-muted); text-decoration: none; }
.comment-content p { margin: 6px 0; }
.comment-list .children { list-style: none; padding-right: 20px; margin-top: 12px; }
.comment-reply-link {
    font-size: 0.75rem;
    color: var(--accent-2);
    text-decoration: none;
    border: 1px solid var(--card-border);
    padding: 3px 10px;
    border-radius: 999px;
}
#respond { margin-top: 24px; }
#respond input[type="text"],
#respond input[type="email"],
#respond input[type="url"],
#respond textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--card-border);
    background: rgba(255,255,255,0.04);
    color: var(--text-main);
    font-family: inherit;
    margin-bottom: 12px;
}
#respond label { display: block; font-size: 0.85rem; margin-bottom: 4px; color: var(--text-muted); }
#respond .comment-form-cookies-consent { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--text-muted); }
#respond .comment-form-cookies-consent input { width: auto; margin-bottom: 0; }

/* ===== فوتر ===== */
.site-footer {
    border-top: 1px solid var(--card-border);
    padding: 30px 16px;
    text-align: center;
    margin-top: 40px;
}
.site-footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}
.site-footer-links {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
    font-size: 0.8rem;
}
.site-footer-links a { color: var(--text-muted); text-decoration: none; }
.site-footer-links a:hover { color: var(--accent-2); }
