/* ===== CONFIGURATION & CONSTANTS (Dark Theme) ===== */
:root {
    --primary-color: #4A90E2; /* A modern, professional blue */
    --secondary-color: #BD10E0; /* A vibrant accent for categories/tags */
    --background-color: #121212; /* Main dark background */
    --surface-color: #1E1E1E; /* Card and surface background */
    --text-color: #E0E0E0; /* Primary text color */
    --text-secondary-color: #A0A0A0; /* Subtler text for metadata */
    --border-color: #2F2F2F;
    --font-family: 'Vazirmatn', sans-serif;
    --border-radius: 12px;
    --box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

/* ===== GENERAL STYLES ===== */
body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    line-height: 1.8;
    font-size: 16px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
}

/* ===== HEADER & FOOTER ===== */
header {
    text-align: center;
    padding: 3rem 0;
    border-bottom: 1px solid var(--border-color);
}

header h1 {
    margin: 0;
    font-size: 2.8rem;
    color: #fff;
}

header h1 a {
    color: #fff;
}

header p {
    margin: 0.5rem 0 0 0;
    color: var(--text-secondary-color);
    font-size: 1.1rem;
}

footer {
    text-align: center;
    margin-top: 4rem;
    padding: 2rem 0;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-secondary-color);
}

/* ===== MAIN CONTENT & LOADING STATE ===== */
main {
    padding: 2.5rem 0;
}

.loading {
    text-align: center;
    font-size: 1.2rem;
    color: var(--text-secondary-color);
    padding: 2rem;
}

/* ===== POSTS GRID (Homepage) ===== */
.posts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
}

.post-card {
    background-color: var(--surface-color);
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.post-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
}

.post-card-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 0; 
    border-top-left-radius: var(--border-radius);
    border-top-right-radius: var(--border-radius);
}

.post-card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.post-card-category {
    color: var(--secondary-color);
    font-weight: bold;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
}

.post-card-content h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.6rem;
}

.post-card-content h3 a {
    color: var(--text-color);
}

.post-card-meta {
    font-size: 0.85rem;
    color: var(--text-secondary-color);
    margin-bottom: 1rem;
}

.post-card-summary {
    font-size: 1rem;
    color: var(--text-secondary-color);
    flex-grow: 1;
    margin-bottom: 1.5rem;
}

.read-more {
    font-weight: bold;
    align-self: flex-start;
}

/* ===== SINGLE POST PAGE ===== */
.post-full {
    background-color: var(--surface-color);
    padding: 2.5rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.post-full-header {
    text-align: center;
    margin-bottom: 2rem;
}

.post-full-category {
    color: var(--secondary-color);
    font-weight: bold;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.post-full-title {
    font-size: 2.5rem;
    margin: 0 0 1rem 0;
    color: #fff;
    line-height: 1.3;
}

.post-full-meta {
    color: var(--text-secondary-color);
    font-size: 0.9rem;
}

.post-full-image {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: cover;
    margin-bottom: 2.5rem;
}

.post-full-content {
    font-size: 1.1rem;
}

.post-full-content h2, .post-full-content h3 {
    color: var(--text-color);
    margin-top: 3rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

.post-full-content p {
    margin-bottom: 1.5rem;
}

.post-tags {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.tag {
    display: inline-block;
    background-color: var(--background-color);
    color: var(--text-secondary-color);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    font-size: 0.85rem;
    margin-left: 0.5rem;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}
.tag:hover {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

/* ===== COMMENTS SECTION ===== */
.comments-section {
    /* 
     * افزایش فاصله از پست بالایی برای ایجاد فضای تنفس بیشتر.
     * مقدار قبلی 4rem بود، ما آن را به 6rem افزایش می‌دهیم.
     */
    margin-top: 6rem; 
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.comments-title {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-color);
}

/* ===== EMBEDDED BANNER STYLES ===== */
.daramet-embed-banner-container {
    /* ایجاد فاصله عمودی مناسب */
    margin: 2.5rem 0; 
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

/* 
 * این کلاس جدید برای بنری است که به صورت ثابت در صفحه پست قرار دارد.
 * فاصله آن را با مقاله و بخش نظرات تنظیم می‌کند.
*/
.post-banner-static {
    margin-top: 3rem;
    margin-bottom: 0; /* فاصله پایین با بخش نظرات توسط خود بخش نظرات کنترل می‌شود */
}
/* استایل مخصوص بنر در داخل پست برای فاصله بیشتر از محتوای اصلی */
.post-banner {
    margin-bottom: 2.5rem;
}

/* ===== CODE BLOCKS (Prism.js) ===== */
pre[class*="language-"] {
    padding: 1.5em;
    margin: 2rem 0;
    overflow: auto;
    border-radius: var(--border-radius);
    font-size: 0.95em;
    border: 1px solid var(--border-color);
}
