@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Variable.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --primary: #235A82;
    --primary-dark: #194362;
    --primary-soft: #EDF4F8;
    --accent: #138A07;
    --accent-dark: #0E6B05;
    --accent-soft: #EAF6E9;
    --bg: #F8FAFC;
    --surface: #FFFFFF;
    --text: #1E293B;
    --text-muted: #64748B;
    --border: #E2E8F0;
    --radius: 12px;
    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 10px 25px rgba(15, 23, 42, 0.08);
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Vazirmatn', Tahoma, system-ui, -apple-system, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.8;
    font-size: 15.5px;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent);
}

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

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

/* Header */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 70px;
}

.site-logo img {
    height: 38px;
    width: auto;
}

.logo-text {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary);
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 24px;
    flex: 1;
    justify-content: space-between;
}

.nav-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 20px;
}

.nav-list a {
    color: var(--text);
    font-weight: 600;
    font-size: 0.95rem;
}

.nav-list a:hover {
    color: var(--accent);
}

.header-search {
    display: flex;
    align-items: center;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 99px;
    padding: 4px 12px;
    width: 230px;
    transition: border-color 0.2s;
}

.header-search:focus-within {
    border-color: var(--primary);
}

.header-search input {
    border: none;
    background: transparent;
    outline: none;
    font-family: inherit;
    font-size: 0.88rem;
    width: 100%;
    color: var(--text);
}

.header-search button {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    padding: 4px;
}

.header-search button:hover {
    color: var(--accent);
}

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
}

.menu-toggle span {
    width: 24px;
    height: 2.5px;
    background: var(--primary);
    border-radius: 2px;
}

/* Main */
.site-main {
    padding: 32px 0 60px;
}

.home-intro {
    text-align: center;
    margin-bottom: 32px;
    padding: 24px 20px;
    background: linear-gradient(135deg, var(--primary-soft) 0%, var(--accent-soft) 100%);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.home-intro h1 {
    margin: 0 0 6px;
    font-size: 1.75rem;
    color: var(--primary-dark);
}

.home-intro p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.98rem;
}

/* Featured Post on Home */
.featured-card {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 32px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.featured-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.featured-thumb {
    display: block;
    background: var(--primary-soft);
    min-height: 280px;
}

.featured-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.featured-content {
    padding: 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.featured-content h2 {
    margin: 12px 0;
    font-size: 1.55rem;
    line-height: 1.45;
}

.featured-content h2 a {
    color: var(--text);
}

.featured-content h2 a:hover {
    color: var(--primary);
}

/* Posts Grid */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.post-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.card-thumb {
    position: relative;
    aspect-ratio: 16 / 10;
    background: var(--primary-soft);
    overflow: hidden;
}

.card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.post-card:hover .card-thumb img {
    transform: scale(1.04);
}

.thumb-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-soft), var(--accent-soft));
}

.cat-badge {
    display: inline-block;
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 99px;
    width: fit-content;
}

.cat-badge-float {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.94);
    color: var(--accent-dark);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 99px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-body h2 {
    margin: 0 0 10px;
    font-size: 1.08rem;
    line-height: 1.55;
}

.card-body h2 a {
    color: var(--text);
}

.card-body h2 a:hover {
    color: var(--primary);
}

.card-excerpt {
    margin: 0 0 16px;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.7;
    flex: 1;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

/* Breadcrumbs & Archive */
.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.breadcrumbs .sep {
    opacity: 0.5;
}

.breadcrumbs .current {
    color: var(--text);
    font-weight: 600;
}

.archive-header {
    margin-bottom: 28px;
}

.archive-header h1 {
    margin: 0;
    font-size: 1.65rem;
    color: var(--primary-dark);
}

/* Two-Column Single Layout */
.content-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 310px;
    gap: 28px;
    align-items: start;
}

.single-article {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 36px;
    box-shadow: var(--shadow-sm);
}

.article-header {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.article-header h1 {
    margin: 12px 0 14px;
    font-size: 1.85rem;
    line-height: 1.45;
    color: var(--text);
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.86rem;
    color: var(--text-muted);
}

.article-featured-img {
    margin-bottom: 28px;
    border-radius: 10px;
    overflow: hidden;
}

.article-featured-img img {
    width: 100%;
}

.article-body {
    font-size: 1rem;
    line-height: 2;
    color: #273449;
}

.article-body h2 {
    margin: 32px 0 14px;
    font-size: 1.38rem;
    color: var(--primary-dark);
    border-right: 4px solid var(--accent);
    padding-right: 12px;
}

.article-body h3 {
    margin: 24px 0 10px;
    font-size: 1.15rem;
    color: var(--primary);
}

.article-body p {
    margin: 0 0 18px;
}

.article-body ul, .article-body ol {
    margin: 0 0 20px;
    padding-right: 22px;
}

.article-body li {
    margin-bottom: 8px;
}

.article-body blockquote {
    margin: 24px 0;
    padding: 16px 20px;
    background: var(--primary-soft);
    border-right: 4px solid var(--primary);
    border-radius: 8px;
    color: var(--primary-dark);
}

.article-body img {
    border-radius: 8px;
    margin: 20px auto;
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
}

.article-tags a {
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 3px 10px;
    border-radius: 6px;
    color: var(--text-muted);
}

.article-tags a:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Compact Sticky Sidebar (10 Latest Posts) */
.site-sidebar {
    position: sticky;
    top: 90px;
}

.sidebar-widget {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.widget-title {
    margin: 0 0 14px;
    font-size: 1.02rem;
    color: var(--primary-dark);
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent);
    display: flex;
    align-items: center;
}

.recent-posts-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.recent-posts-list li {
    border-bottom: 1px dashed var(--border);
}

.recent-posts-list li:last-child {
    border-bottom: none;
}

.recent-posts-list a {
    display: block;
    padding: 9px 0;
    font-size: 0.88rem;
    line-height: 1.55;
    color: var(--text);
    font-weight: 500;
}

.recent-posts-list a:hover {
    color: var(--accent);
    padding-right: 4px;
}

/* Comments */
.comments-box {
    margin-top: 28px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 36px;
    box-shadow: var(--shadow-sm);
}

.comments-box input[type="text"],
.comments-box input[type="email"],
.comments-box textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.92rem;
    margin-top: 6px;
}

.comments-box input[type="submit"],
.btn-primary {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 10px 22px;
    border-radius: 8px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.comments-box input[type="submit"]:hover,
.btn-primary:hover {
    background: var(--accent);
    color: #fff;
}

/* Pagination */
.pagination-wrap {
    margin-top: 40px;
    display: flex;
    justify-content: center;
}

.nav-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.page-numbers {
    padding: 8px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 600;
}

.page-numbers.current,
.page-numbers:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* Empty / 404 */
.empty-state {
    text-align: center;
    padding: 64px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.error-code {
    font-size: 4rem;
    font-weight: 900;
    color: var(--primary);
    line-height: 1;
}

/* Footer */
.site-footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 28px 0;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-brand strong {
    color: var(--primary-dark);
    font-size: 1.05rem;
}

.footer-brand p {
    margin: 4px 0 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.footer-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 18px;
    font-size: 0.88rem;
}

/* Responsive */
@media (max-width: 960px) {
    .featured-card {
        grid-template-columns: 1fr;
    }
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .content-with-sidebar {
        grid-template-columns: 1fr;
    }
    .site-sidebar {
        position: static;
    }
}

@media (max-width: 680px) {
    .menu-toggle {
        display: flex;
    }
    .main-nav {
        display: none;
        position: absolute;
        top: 70px;
        right: 0;
        left: 0;
        background: var(--surface);
        flex-direction: column;
        align-items: stretch;
        padding: 16px 20px;
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-md);
    }
    .main-nav.is-open {
        display: flex;
    }
    .nav-list {
        flex-direction: column;
        gap: 12px;
    }
    .header-search {
        width: 100%;
    }
    .posts-grid {
        grid-template-columns: 1fr;
    }
    .single-article, .comments-box {
        padding: 22px 18px;
    }
    .article-header h1 {
        font-size: 1.45rem;
    }
}
/* Blog Page */
.blog-intro-text {
    margin-top: 10px;
    color: var(--text-muted);
    font-size: 0.96rem;
    max-width: 780px;
}

.blog-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 28px;
}

.blog-cat-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 99px;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--text);
    transition: all 0.2s ease;
}

.blog-cat-pill span {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
}

.blog-cat-pill:hover,
.blog-cat-pill.is-active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.blog-cat-pill:hover span,
.blog-cat-pill.is-active span {
    color: rgba(255, 255, 255, 0.85);
}