/*
 * Writer Theme CSS
 * A clean, content-focused, and minimalist theme.
 */

:root {
    --font-family-sans: 'Vazirmatn', sans-serif;
    --text-color: #333;
    --background-color: #fdfdfd;
    --primary-color: #007bff;
    --border-color: #eee;
    --container-width: 960px; /* Increased width for sidebar */
}

body {
    font-family: var(--font-family-sans);
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--background-color);
    margin: 0;
    padding: 0;
    font-size: 16px;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

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

a:hover {
    color: #0056b3;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
}

img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

/* --- Layout --- */
.writer-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-header {
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-logo h1 {
    margin: 0;
    font-size: 1.5rem;
}
.site-logo img {
    max-height: 40px;
}

.main-nav a {
    margin-right: 30px;
    font-size: 1rem;
    color: var(--text-color);
}
.main-nav a:last-child {
    margin-right: 0;
}

.main-content {
    flex-grow: 1;
    padding: 40px 0;
}

.main-footer {
    padding: 20px 0;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 0.9rem;
    color: #777;
}

/* --- Home Page Layout --- */
.home-layout {
    display: flex;
    gap: 40px;
}
.main-column {
    flex: 1;
    min-width: 0;
}
.sidebar-column {
    width: 280px;
    flex-shrink: 0;
}

/* --- Sidebar Widget --- */
.widget {
    margin-bottom: 30px;
}
.widget-title {
    font-size: 1.2rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}
.widget .posts-list .post-item {
    border: none;
    padding: 0;
    margin-bottom: 15px;
}
.widget .posts-list .post-item h3 {
    font-size: 1rem;
    margin: 0 0 5px;
    font-weight: 400;
}
.widget .posts-list .post-item h3 a {
    color: var(--text-color);
}


/* --- Posts List --- */
.posts-list .post-item {
    margin-bottom: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--border-color);
}
.posts-list .post-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.post-item h2 {
    margin: 0 0 10px;
    font-size: 1.5rem;
}
.post-item h2 a {
    color: var(--text-color);
}
.post-item p {
    margin: 0 0 15px;
    color: #555;
}
.post-meta {
    font-size: 0.9rem;
    color: #777;
    display: flex;
    align-items: center;
    gap: 15px;
}
.views-count {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.views-count svg {
    vertical-align: middle;
}


/* --- Single Post & Page --- */
.single-post .post-header,
.single-page .page-header {
    text-align: center;
    margin-bottom: 30px;
}
.single-post .post-header h1,
.single-page .page-header h1 {
    margin: 0 0 10px;
    font-size: 2.5rem;
}
.single-post .post-header .post-meta {
    justify-content: center;
}

.post-featured-image {
    margin-bottom: 30px;
}

.post-content,
.page-content {
    font-size: 1.1rem;
}
.post-content p, .page-content p {
    margin-bottom: 1.5em;
}
.post-content a {
    text-decoration: underline;
}
.post-content h2, .post-content h3 {
    margin-top: 2em;
    margin-bottom: 1em;
}

.post-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}
.post-tags a {
    display: inline-block;
    background-color: #f0f0f0;
    padding: 5px 10px;
    border-radius: 4px;
    margin-left: 8px;
    font-size: 0.9rem;
}

/* --- Pagination --- */
.pagination {
    display: flex;
    justify-content: center;
    list-style: none;
    padding: 0;
    margin-top: 4rem;
}

.pagination li a {
    display: block;
    padding: 0.7rem 1.1rem;
    margin: 0 0.3rem;
    border-radius: 8px;
    text-decoration: none;
    color: #555;
    background-color: #fff;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
    font-weight: 500;
}

.pagination li.active a {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 2px 5px rgba(0, 123, 255, 0.2);
}

.pagination li a:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.pagination li.disabled span {
    /* You can style disabled links if you add them back */
    display: block;
    padding: 0.7rem 1.1rem;
    margin: 0 0.3rem;
    border-radius: 8px;
    color: #ccc;
    background-color: #f9f9f9;
    border: 1px solid var(--border-color);
}


/* --- Error Page --- */
.error-page {
    text-align: center;
    padding: 50px 0;
}
.error-page h1 {
    font-size: 2rem;
}

/* --- Responsive --- */
@media (max-width: 992px) { /* Adjusted breakpoint for sidebar */
    .home-layout {
        flex-direction: column;
    }
    .sidebar-column {
        width: 100%;
    }
    .widget {
        border-top: 1px solid var(--border-color);
        padding-top: 30px;
    }
}

@media (max-width: 768px) {
    body {
        font-size: 15px;
    }
    .main-header .container {
        flex-direction: column;
        align-items: center;
    }
    .site-logo {
        margin-bottom: 15px;
    }
    .main-nav {
        text-align: center;
    }
    .main-nav a {
        margin: 0 15px;
    }
    .single-post .post-header h1,
    .single-page .page-header h1 {
        font-size: 2rem;
    }
    /* On smaller screens, use the original container width for single posts */
    .single-post .container, .single-page .container {
        max-width: 720px;
    }
    .hide-on-mobile {
        display: none;
    }
}
