:root {
    --gk-bg-body: #f5f7fa;
    --gk-card-bg: #ffffff;
    --gk-primary: #ef394e;
    --gk-text-dark: #3f4064;
    --gk-text-light: #81858b;
    --gk-border-radius: 16px;

    /* اگر این متغیر در تنظیمات اصلی قالب ست نشده باشد، از 1280px استفاده می‌کند */
    --gk-site-width-default: 1280px;
}

/* عمومی */
body {
    background-color: var(--gk-bg-body);
}
/* اسکرول نرم برای کل صفحه */
html {
    scroll-behavior: smooth;
}

/* فاصله گرفتن تیترها از بالای صفحه هنگام اسکرول (بسیار مهم) */
.gk-entry-content h2,
.gk-entry-content h3 {
    scroll-margin-top: 100px; /* این عدد را بسته به ارتفاع هدر سایت تنظیم کنید */
    position: relative; /* برای اطمینان */
}


.gk-blog-wrapper .container {
    max-width: var(--gk-site-width, var(--gk-site-width-default));
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: 15px;  /* فاصله ایمن از لبه‌ها در موبایل */
    padding-right: 15px;
}

/* Breadcrumb */
.gk-breadcrumb {
    font-size: 13px;
    color: var(--gk-text-light);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.gk-breadcrumb a { color: var(--gk-text-light); text-decoration: none; transition: .3s; }
.gk-breadcrumb a:hover { color: var(--gk-text-dark); }
.gk-breadcrumb .dashicons { font-size: 14px; width: 14px; height: 14px; line-height: 14px; }
.gk-breadcrumb .current { color: var(--gk-text-dark); font-weight: bold; }

/* لی‌اوت اصلی */
.gk-blog-layout {
    display: grid;
    grid-template-columns: 1fr 300px; /* ستون اصلی + سایدبار */
    gap: 30px;
    align-items: start; /* برای استیکی شدن سایدبار مهم است */
}

/* کارت پست */
.gk-post-card {
    background: var(--gk-card-bg);
    border-radius: var(--gk-border-radius);
    box-shadow: 0 2px 12px rgba(0,0,0,0.03);
    overflow: hidden;
    padding: 30px;
}

/* هدر پست */
.gk-post-header { margin-bottom: 25px; }

.gk-badge {
    display: inline-block;
    background: rgba(239, 57, 78, 0.1);
    color: var(--gk-primary);
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 15px;
    text-decoration: none;
}

.gk-post-title {
    font-size: 26px;
    line-height: 1.5;
    color: var(--gk-text-dark);
    margin-bottom: 20px;
    font-weight: 800;
}

.gk-post-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    border-bottom: 1px solid #f0f0f1;
    padding-bottom: 20px;
}

.meta-item {
    font-size: 13px;
    color: var(--gk-text-light);
    display: flex;
    align-items: center;
    gap: 6px;
}
.meta-item i { font-size: 16px; color: #a1a3a8; }

/* تصویر شاخص */
.gk-post-featured-img {
    margin: 0 -30px 30px -30px; /* تصویر را به لبه‌ها می‌چسباند (Bleed) */
}
.gk-post-featured-img img {
    width: 100%;
    height: auto;
    display: block;
}

/* محتوا */
.gk-entry-content {
    font-size: 16px;
    line-height: 2;
    color: #4d4d4d;
    text-align: justify;
}
.gk-entry-content h2, .gk-entry-content h3 {
    color: var(--gk-text-dark);
    font-weight: 800;
    margin-top: 40px;
    margin-bottom: 20px;
}
.gk-entry-content p { margin-bottom: 20px; }
.gk-entry-content img { border-radius: 12px; max-width: 100%; height: auto; }

/* فوتر پست */
.gk-post-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px dashed #e0e0e2;
}
.gk-tags-list a {
    display: inline-block;
    background: #f0f0f1;
    color: #666;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 13px;
    text-decoration: none;
    margin-left: 8px;
    transition: .3s;
}
.gk-tags-list a:hover { background: #e0e0e2; color: #333; }

/* سایدبار */
.gk-sticky-sidebar-inner {
    position: sticky;
    top: 20px; /* فاصله از بالای مرورگر هنگام اسکرول */
}

.gk-widget {
    background: var(--gk-card-bg);
    border-radius: var(--gk-border-radius);
    padding: 25px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.03);
    margin-bottom: 20px;
    text-align: center;
}

/* ویجت نویسنده */
.gk-author-avatar img {
    border-radius: 50%;
    margin-bottom: 10px;
    border: 3px solid #f0f0f1;
}
.gk-author-label {
    display: block;
    font-size: 12px;
    color: var(--gk-text-light);
    margin-bottom: 5px;
}
.gk-author-name {
    font-size: 16px;
    color: var(--gk-text-dark);
    margin-bottom: 10px;
    font-weight: bold;
}
.gk-author-bio {
    font-size: 13px;
    color: var(--gk-text-light);
    line-height: 1.6;
    margin-bottom: 15px;
}
.gk-author-link {
    display: inline-block;
    border: 1px solid #eee;
    padding: 6px 20px;
    border-radius: 20px;
    font-size: 12px;
    text-decoration: none;
    color: var(--gk-text-dark);
    transition: .3s;
}
.gk-author-link:hover { border-color: var(--gk-text-dark); }

/* اشتراک گذاری */
.gk-share-icons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}
.share-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f5f7fa;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    text-decoration: none;
    transition: .3s;
}
.share-icon:hover { background: var(--gk-primary); color: #fff; transform: translateY(-3px); }

/* ریسپانسیو */
@media (max-width: 992px) {
    .gk-blog-layout {
        grid-template-columns: 1fr; /* تک ستونه در تبلت و موبایل */
    }
    .gk-sticky-sidebar-inner { position: static; }
    .gk-blog-sidebar { order: 2; /* سایدبار برود پایین */ }
    .gk-post-card { padding: 20px; }
    .gk-post-featured-img { margin: 0 -20px 20px -20px; }
}
/* استایل فهرست محتوا در سایدبار */
.gk-toc-widget .gk-widget-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f1;
    color: var(--gk-text-dark);
}

.gk-toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 300px; /* اگر خیلی طولانی شد اسکرول بخورد */
    overflow-y: auto;
}

/* اسکرول‌بار نازک برای لیست */
.gk-toc-list::-webkit-scrollbar { width: 4px; }
.gk-toc-list::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }

.gk-toc-item {
    margin-bottom: 0;
}

.gk-toc-item a {
    display: block;
    padding: 8px 0;
    font-size: 14px;
    color: #666;
    text-decoration: none;
    border-right: 2px solid transparent; /* خط راهنما سمت راست */
    padding-right: 10px;
    transition: all .2s;
}

.gk-toc-item a:hover {
    color: var(--gk-primary);
    border-right-color: var(--gk-primary);
    background: linear-gradient(to left, #fff, #f9f9f9);
}

/* تورفتگی برای H3 */
.gk-toc-item.gk-toc-3 a {
    padding-right: 25px;
    font-size: 13px;
    color: #888;
}

/* حالت فعال (Active State) - نیازمند کمی JS است که پایین‌تر میگویم */
.gk-toc-item.active a {
    color: var(--gk-primary);
    border-right-color: var(--gk-primary);
    font-weight: bold;
}





/* ================= Comments Section ================= */
.gk-comments-wrap {
    margin-top: 50px;
    border-top: 1px solid #e5e5e5;
    padding-top: 40px;
}

/* --- Form --- */
.gk-comment-form-wrap {
    background: #fff;
    border: 1px solid #e0e0e2;
    border-radius: var(--gk-border-radius);
    padding: 30px;
    margin-bottom: 50px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.02);
}

.gk-comments-title {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.gk-comments-title i { color: var(--gk-primary); }

.gk-comments-subtitle {
    font-size: 14px;
    color: var(--gk-text-light);
    margin-bottom: 25px;
}

.gk-form-row {
    margin-bottom: 20px;
    display: flex;
    gap: 20px;
}
.gk-form-col { flex: 1; }

.gk-comment-form-wrap input[type="text"],
.gk-comment-form-wrap input[type="email"],
.gk-comment-form-wrap textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #f9f9f9;
    font-family: inherit;
    font-size: 14px;
    transition: .3s;
}

.gk-comment-form-wrap input:focus,
.gk-comment-form-wrap textarea:focus {
    background: #fff;
    border-color: var(--gk-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(239, 57, 78, 0.1);
}

.gk-submit-btn {
    background: var(--gk-primary);
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: .3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.gk-submit-btn:hover {
    background: #d62f42; /* کمی تیره‌تر */
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(239, 57, 78, 0.3);
}

/* --- List --- */
.gk-list-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f1;
}

.gk-comment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.gk-comment-list > li {
    margin-bottom: 30px;
}

.gk-comment-body {
    display: flex;
    gap: 20px;
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #f0f0f1;
}

/* حالت پاسخ (Nested) */
.children {
    list-style: none;
    padding-right: 60px; /* تورفتگی برای فرزندان در RTL */
    margin-top: 20px;
    border-right: 2px solid #f0f0f1; /* خط راهنما */
}
@media(max-width: 768px) {
    .children { padding-right: 20px; }
}

.gk-comment-avatar img {
    border-radius: 50%;
    width: 60px;
    height: 60px;
    object-fit: cover;
}

.gk-comment-content { width: 100%; }

.gk-comment-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.gk-comment-author .fn {
    font-size: 16px;
    color: var(--gk-text-dark);
}

.gk-author-badge {
    background: #eef4ff;
    color: #3d7eff;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    margin-right: 8px;
    vertical-align: middle;
}

.gk-comment-date {
    font-size: 12px;
    color: #999;
}
.gk-comment-date a { color: inherit; text-decoration: none; }

.gk-comment-text {
    font-size: 14px;
    line-height: 1.8;
    color: #555;
    margin-bottom: 15px;
}

/* Reply Button */
.gk-comment-actions .reply-icon {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    color: var(--gk-text-light);
    border: 1px solid #eee;
    padding: 4px 12px;
    border-radius: 20px;
    transition: .3s;
}
.gk-comment-actions a { text-decoration: none; color: inherit; }
.gk-comment-actions .reply-icon:hover {
    border-color: var(--gk-primary);
    color: var(--gk-primary);
}

/* Awaiting Moderation */
.gk-comment-awaiting-moderation {
    background: #fff3cd;
    color: #856404;
    padding: 10px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 15px;
}

/* استایل مخصوص کامنت نویسنده */
.gk-by-author {
    border-color: #e3eaff;
    background: #fbfdff;
}
