/*
 * Blog Post & Archive Styles
 * Refactored to Canonical Tokens
 */

:root {
    /* Legacy variables removed/mapped to global tokens */
}

/* =========================================================
   1. General & Layout
   ========================================================= */
body {
    background-color: var(--gk-background);
}

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);
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: 15px;
    padding-right: 15px;
}

.gk-breadcrumb {
    font-size: 13px;
    color: var(--gk-neutral-600);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.gk-breadcrumb a { color: var(--gk-neutral-600); text-decoration: none; transition: .3s; }
.gk-breadcrumb a:hover { color: var(--gk-text); }
.gk-breadcrumb .dashicons { font-size: 14px; width: 14px; height: 14px; line-height: 14px; }
.gk-breadcrumb .current { color: var(--gk-text); font-weight: bold; }

.gk-blog-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
    align-items: start;
}

/* =========================================================
   2. Post Card
   ========================================================= */
.gk-post-card {
    background: var(--gk-surface);
    border-radius: var(--gk-radius-lg);
    box-shadow: var(--gk-shadow-sm);
    overflow: hidden;
    padding: 30px;
}

.gk-post-header { margin-bottom: 25px; }

.gk-badge {
    display: inline-block;
    background: var(--gk-primary-50);
    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);
    margin-bottom: 20px;
    font-weight: 800;
}

.gk-post-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    border-bottom: var(--gk-border-width) solid var(--gk-border-color);
    padding-bottom: 20px;
}

.meta-item {
    font-size: 13px;
    color: var(--gk-neutral-600);
    display: flex;
    align-items: center;
    gap: 6px;
}
.meta-item i { font-size: 16px; color: var(--gk-neutral-400); }

.gk-post-featured-img {
    margin: 0 -30px 30px -30px;
}
.gk-post-featured-img img {
    width: 100%;
    height: auto;
    display: block;
}

.gk-entry-content {
    font-size: 16px;
    line-height: 2;
    color: var(--gk-neutral-700);
    text-align: justify;
}
.gk-entry-content h2, .gk-entry-content h3 {
    color: var(--gk-text);
    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 var(--gk-border-color);
}
.gk-tags-list a {
    display: inline-block;
    background: var(--gk-neutral-100);
    color: var(--gk-neutral-600);
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 13px;
    text-decoration: none;
    margin-left: 8px;
    transition: .3s;
}
.gk-tags-list a:hover { background: var(--gk-neutral-200); color: var(--gk-text); }

/* =========================================================
   3. Sidebar
   ========================================================= */
.gk-sticky-sidebar-inner {
    position: sticky;
    top: 20px;
}

.gk-widget {
    background: var(--gk-surface);
    border-radius: var(--gk-radius-lg);
    padding: 25px;
    box-shadow: var(--gk-shadow-sm);
    margin-bottom: 20px;
    text-align: center;
}

.gk-author-avatar img {
    border-radius: 50%;
    margin-bottom: 10px;
    border: 3px solid var(--gk-neutral-100);
}
.gk-author-label {
    display: block;
    font-size: 12px;
    color: var(--gk-neutral-600);
    margin-bottom: 5px;
}
.gk-author-name {
    font-size: 16px;
    color: var(--gk-text);
    margin-bottom: 10px;
    font-weight: bold;
}
.gk-author-bio {
    font-size: 13px;
    color: var(--gk-neutral-600);
    line-height: 1.6;
    margin-bottom: 15px;
}
.gk-author-link {
    display: inline-block;
    border: var(--gk-border-width) solid var(--gk-neutral-200);
    padding: 6px 20px;
    border-radius: 20px;
    font-size: 12px;
    text-decoration: none;
    color: var(--gk-text);
    transition: .3s;
}
.gk-author-link:hover { border-color: var(--gk-text); }

.gk-share-icons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}
.share-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gk-neutral-50);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gk-neutral-600);
    text-decoration: none;
    transition: .3s;
}
.share-icon:hover { background: var(--gk-primary); color: var(--gk-surface); 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 var(--gk-neutral-100);
    color: var(--gk-text);
}

.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: var(--gk-neutral-300); border-radius: 4px; }

.gk-toc-item {
    margin-bottom: 0;
}

.gk-toc-item a {
    display: block;
    padding: 8px 0;
    font-size: 14px;
    color: var(--gk-neutral-600);
    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, var(--gk-surface), var(--gk-neutral-50));
}

.gk-toc-item.gk-toc-3 a {
    padding-right: 25px;
    font-size: 13px;
    color: var(--gk-neutral-500);
}

.gk-toc-item.active a {
    color: var(--gk-primary);
    border-right-color: var(--gk-primary);
    font-weight: bold;
}

/* =========================================================
   4. Comments Section
   ========================================================= */
.gk-comments-wrap {
    margin-top: 50px;
    border-top: var(--gk-border-width) solid var(--gk-border-color);
    padding-top: 40px;
}

.gk-comment-form-wrap {
    background: var(--gk-surface);
    border: var(--gk-border-width) solid var(--gk-border-color);
    border-radius: var(--gk-radius-lg);
    padding: 30px;
    margin-bottom: 50px;
    box-shadow: var(--gk-shadow);
}

.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-neutral-600);
    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: var(--gk-border-width) solid var(--gk-neutral-300);
    border-radius: 8px;
    background: var(--gk-neutral-50);
    font-family: inherit;
    font-size: 14px;
    transition: .3s;
}

.gk-comment-form-wrap input:focus,
.gk-comment-form-wrap textarea:focus {
    background: var(--gk-surface);
    border-color: var(--gk-primary);
    outline: none;
    box-shadow: 0 0 0 3px var(--gk-primary-100);
}

.gk-submit-btn {
    background: var(--gk-primary);
    color: var(--gk-surface);
    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: var(--gk-primary-700);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--gk-primary-200);
}

.gk-list-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--gk-neutral-100);
}

.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: var(--gk-surface);
    padding: 20px;
    border-radius: 12px;
    border: var(--gk-border-width) solid var(--gk-neutral-100);
}

.children {
    list-style: none;
    padding-right: 60px;
    margin-top: 20px;
    border-right: 2px solid var(--gk-neutral-100);
}
@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);
}

.gk-author-badge {
    background: var(--gk-neutral-100);
    color: var(--gk-secondary);
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    margin-right: 8px;
    vertical-align: middle;
}

.gk-comment-date {
    font-size: 12px;
    color: var(--gk-neutral-400);
}
.gk-comment-date a { color: inherit; text-decoration: none; }

.gk-comment-text {
    font-size: 14px;
    line-height: 1.8;
    color: var(--gk-neutral-700);
    margin-bottom: 15px;
}

.gk-comment-actions .reply-icon {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    color: var(--gk-neutral-600);
    border: var(--gk-border-width) solid var(--gk-neutral-200);
    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);
}

.gk-comment-awaiting-moderation {
    background: var(--gk-neutral-100);
    color: var(--gk-neutral-700);
    padding: 10px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 15px;
}

.gk-by-author {
    border-color: var(--gk-primary-100);
    background: var(--gk-surface);
}
