/*
Theme Name: Hello Elementor Child
Theme URI: https://rivena.ir
Description: Child Theme with modern blog templates (single, archive, sidebar, comments)
Author: Mohammad Baneshi
Author URI: https://baneshi.ir
Template: hello-elementor
Version: 1.0.0
Text Domain: hello-elementor-child
*/

/* ===== بارگذاری فونت ایران‌سنس (IranSans) ===== */
@font-face {
    font-family: 'IRANSans';
    src: url('assets/fonts/iransans/IRANSans_regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'IRANSans';
    src: url('assets/fonts/iransans/IRANSans_Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'IRANSans';
    src: url('assets/fonts/iransans/IRANSans_Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'IRANSans';
    src: url('assets/fonts/iransans/IRANSans_Black.woff2') format('woff2');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

/* در صورت تمایل به استفاده از فونت دانا، می‌توانید مسیرها را جایگزین کنید */
/*
@font-face {
    font-family: 'Dana';
    src: url('assets/fonts/dana/dana-regular.woff2') format('woff2');
    font-weight: 400;
}
...
*/

/* ===== متغیرهای طراحی (برگرفته از سایت ۷لرن) ===== */
:root {
    /* تایپوگرافی اصلی */
    --base-font-family: 'IRANSans', Tahoma, sans-serif;
    --base-font-size: 16px;
    --base-line-height: 2; /* افزایش فاصله خطوط برای خوانایی بهتر */

    /* رنگ‌های اصلی (طبق نمونه ۷لرن) */
    --primary: #428DED;
    --primary-10: #EAF2F6;
    --secondary: #2A3554;
    --secondary-70: #6C7A8E;
    --secondary-10: #E9EAEA;
    --success: #1ECE9A;
    --warning: #ffbf38;
    --danger: #FB5252;

    /* رنگ‌های پایه */
    --color-dark: #1e293b; /* رنگ تیره‌تر و شیک‌تر */
    --color-light: #f8fafc;
    --color-border: #e2e8f0;
    --color-white: #ffffff;
    --color-body-bg: #f5f7fa;

    /* فاصله‌ها و ابعاد */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2.5rem;
    --container-max-width: 1200px;
    --border-radius: 10px;

    /* سایه و انتقال */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.06);
    --transition-base: all 0.25s ease;
}

/* ===== ریست و پایه ===== */
body {
    font-family: var(--base-font-family);
    font-size: var(--base-font-size);
    line-height: var(--base-line-height);
    color: var(--color-dark);
    background-color: var(--color-body-bg);
    direction: rtl;
    text-align: right;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* تنظیم فاصله حروف برای زیبایی بیشتر فارسی */
p, li, .article-content, .widget, .comment-content {
    letter-spacing: 0.02em;
}

/* تیترها با وزن‌های سنگین‌تر و فاصله مناسب */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--base-font-family);
    font-weight: 700; /* Bold */
    line-height: 1.5;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    color: var(--secondary);
}

h1 { font-weight: 900; font-size: 2.2rem; } /* Black */
h2 { font-weight: 700; font-size: 1.8rem; }
h3 { font-weight: 700; font-size: 1.4rem; }

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition-base);
}
a:hover {
    color: #1a5ea8;
}

img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
}

/* ===== ساختار دو ستونه اصلی ===== */
.site-main-layout {
    max-width: var(--container-max-width);
    margin: var(--spacing-lg) auto;
    padding: 0 var(--spacing-sm);
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
}

@media (min-width: 992px) {
    .site-main-layout {
        grid-template-columns: 8fr 4fr;
    }
}

/* ===== بخش محتوای اصلی ===== */
.main-content-area {
    background: var(--color-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    padding: var(--spacing-lg);
}

/* ===== صفحه تک‌نوشته (single) ===== */
.article-header {
    margin-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--color-border);
    padding-bottom: var(--spacing-sm);
}

.article-title {
    font-size: 2rem;
    font-weight: 900; /* Black */
    margin: 0 0 var(--spacing-xs);
    line-height: 1.4;
    color: var(--secondary);
}

.article-meta {
    font-size: 0.9rem;
    color: var(--secondary-70);
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
}
.article-meta span {
    display: inline-flex;
    align-items: center;
}
.article-meta .sep {
    color: var(--color-border);
    margin: 0 0.25rem;
}

.article-content {
    font-size: 1.05rem;
    line-height: 2; /* فاصله خطوط عالی برای متن فارسی */
    color: #2d3748;
}
.article-content p {
    margin-bottom: var(--spacing-md);
}
.article-content h2,
.article-content h3,
.article-content h4 {
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-sm);
    color: var(--secondary);
}
.article-content img {
    margin: var(--spacing-sm) 0;
    border-radius: var(--border-radius);
}
.article-content figure {
    margin: var(--spacing-md) 0;
}
.article-content ul,
.article-content ol {
    padding-right: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
}
.article-content ul li,
.article-content ol li {
    margin-bottom: 0.3rem;
}

/* ===== جعبه سرفصل‌های مقاله (مشابه نمونه) ===== */
.post-headings-box {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    padding: var(--spacing-md) var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}
.post-headings-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 40%, rgba(255,255,255,0.7) 80%, transparent 100%);
    z-index: 0;
    pointer-events: none;
}
.post-headings-box .headings-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: var(--spacing-sm);
    position: relative;
    z-index: 1;
}
.post-headings-box ul {
    list-style: none;
    padding: 0;
    margin: 0;
    position: relative;
    z-index: 1;
}
.post-headings-box ul li {
    padding: 0.4rem 0;
    border-bottom: 1px dashed var(--color-border);
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition-base);
    line-height: 1.8;
}
.post-headings-box ul li:last-child {
    border-bottom: none;
}
.post-headings-box ul li:hover {
    color: var(--primary);
    padding-right: 5px;
}
.post-headings-box ul li::before {
    content: "•";
    color: var(--primary);
    margin-left: 0.5rem;
    font-weight: 900;
}

/* ===== مقالات مرتبط ===== */
.related-posts {
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--color-border);
}
.related-posts-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    color: var(--secondary);
}
.related-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
}
@media (min-width: 576px) {
    .related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (min-width: 992px) {
    .related-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
.related-card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: var(--transition-base);
}
.related-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}
.related-card-image {
    height: 150px;
    overflow: hidden;
}
.related-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
}
.related-card-text {
    padding: var(--spacing-sm);
}
.related-card-text .cat {
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 700;
    text-transform: uppercase;
}
.related-card-text h3 {
    font-size: 1rem;
    margin: 0.25rem 0 0;
    line-height: 1.6;
}
.related-card-text h3 a {
    color: var(--secondary);
}
.related-card-text h3 a:hover {
    color: var(--primary);
}

/* ===== صفحه آرشیو (گرید کارتی) ===== */
.archive-header {
    margin-bottom: var(--spacing-lg);
}
.archive-title {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--secondary);
    margin: 0;
}

.archive-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
}
@media (min-width: 576px) {
    .archive-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (min-width: 992px) {
    .archive-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.archive-card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: var(--transition-base);
    display: flex;
    flex-direction: column;
}
.archive-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}
.archive-card-image {
    height: 200px;
    overflow: hidden;
}
.archive-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
}
.archive-card-content {
    padding: var(--spacing-md);
    flex: 1;
    display: flex;
    flex-direction: column;
}
.archive-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 var(--spacing-xs);
}
.archive-card-title a {
    color: var(--secondary);
}
.archive-card-title a:hover {
    color: var(--primary);
}
.archive-card-excerpt {
    font-size: 0.95rem;
    color: var(--secondary-70);
    margin-bottom: var(--spacing-sm);
    flex: 1;
    line-height: 1.9;
}
.archive-card-meta {
    font-size: 0.8rem;
    color: var(--secondary-70);
    margin-bottom: var(--spacing-xs);
}
.read-more-link {
    align-self: flex-start;
    background: var(--primary);
    color: var(--color-white) !important;
    padding: 0.4rem 1.2rem;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition-base);
}
.read-more-link:hover {
    background: #1a5ea8;
}

.pagination {
    margin-top: var(--spacing-lg);
    text-align: center;
}
.pagination .page-numbers {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    margin: 0 0.2rem;
    border-radius: 4px;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    color: var(--secondary);
    font-weight: 500;
}
.pagination .page-numbers.current {
    background: var(--primary);
    color: var(--color-white);
    border-color: var(--primary);
}
.pagination .page-numbers:hover:not(.current) {
    background: var(--color-light);
}

/* ===== سایدبار ===== */
.sidebar-area {
    background: var(--color-white);
    border-radius: var(--border-radius);
    padding: var(--spacing-md);
    box-shadow: var(--shadow-sm);
    align-self: start;
}
.widget {
    margin-bottom: var(--spacing-lg);
}
.widget:last-child {
    margin-bottom: 0;
}
.widget-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--secondary);
    border-bottom: 2px solid var(--primary);
    padding-bottom: 0.4rem;
    margin-bottom: var(--spacing-sm);
}
.widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.widget ul li {
    padding: 0.4rem 0;
    border-bottom: 1px dashed var(--color-border);
    line-height: 1.8;
}
.widget ul li:last-child {
    border-bottom: none;
}
.widget ul li a {
    color: var(--color-dark);
    transition: var(--transition-base);
}
.widget ul li a:hover {
    color: var(--primary);
    padding-right: 5px;
}
.widget select,
.widget input[type="search"] {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-family: inherit;
}
.widget .search-submit {
    background: var(--primary);
    color: var(--color-white);
    border: none;
    padding: 0.4rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
}

/* ===== نظرات (comments) ===== */
.comments-area {
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--color-border);
}
.comments-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: var(--spacing-md);
}
.comment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.comment-list .comment {
    margin-bottom: var(--spacing-sm);
}
.comment-body {
    background: var(--color-light);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    padding: var(--spacing-md);
}
.comment-meta {
    font-size: 0.85rem;
    color: var(--secondary-70);
    margin-bottom: 0.4rem;
}
.comment-meta .comment-author {
    font-weight: 700;
    color: var(--secondary);
}
.comment-meta .comment-author .avatar {
    border-radius: 50%;
    margin-left: 0.5rem;
}
.comment-content {
    font-size: 0.95rem;
    line-height: 2;
}
.comment-reply-link {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    display: inline-block;
    margin-top: 0.4rem;
}
.comment-reply-link:hover {
    text-decoration: underline;
}
.children {
    list-style: none;
    padding-right: var(--spacing-md);
    border-right: 2px solid var(--color-border);
    margin-top: var(--spacing-sm);
}

/* فرم نظر */
.comment-respond {
    margin-top: var(--spacing-lg);
    background: var(--color-white);
    padding: var(--spacing-md);
    border-radius: var(--border-radius);
    border: 1px solid var(--color-border);
}
.comment-respond .comment-reply-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--secondary);
}
.comment-respond .comment-notes {
    font-size: 0.9rem;
    color: var(--secondary-70);
}
.comment-respond label {
    display: block;
    margin-bottom: 0.2rem;
    font-weight: 500;
}
.comment-respond input[type="text"],
.comment-respond input[type="email"],
.comment-respond input[type="url"],
.comment-respond textarea {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition-base);
}
.comment-respond input:focus,
.comment-respond textarea:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(66, 141, 237, 0.15);
}
.comment-respond .form-submit {
    margin-top: var(--spacing-sm);
}
.comment-respond .submit {
    background: var(--primary);
    color: var(--color-white);
    border: none;
    padding: 0.6rem 2rem;
    border-radius: 30px;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    transition: var(--transition-base);
}
.comment-respond .submit:hover {
    background: #1a5ea8;
}

/* ===== ریسپانسیو ===== */
@media (max-width: 768px) {
    .main-content-area {
        padding: var(--spacing-sm);
    }
    .article-title {
        font-size: 1.6rem;
    }
    .post-headings-box {
        padding: var(--spacing-sm);
    }
    .archive-card-image {
        height: 160px;
    }
}