/* ==========================================================================
   chinng-lab custom: homepage sidebar (recent posts + tag list)
   Loaded after built/screen.css so these rules win.
   ========================================================================== */

/* --- Two-column layout (desktop only; collapses below 992px) --- */
@media (min-width: 992px) {
    .gh-has-sidebar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 300px;
        gap: 4vmin;
        align-items: start;
    }

    .gh-has-sidebar .gh-main {
        min-width: 0; /* prevent grid blowout from wide cards */
    }

    .gh-sidebar {
        position: sticky;
        top: 88px;
    }
}

/* On narrow screens the sidebar drops below the feed automatically */
.gh-sidebar {
    margin-top: 4vmin;
}

/* --- Widget shell --- */
.gh-widget {
    margin-bottom: 3.2rem;
}

.gh-widget-title {
    margin: 0 0 1.2rem;
    padding-bottom: 0.6rem;
    font-size: 1.6rem;
    font-weight: 650;
    line-height: 1.2;
    border-bottom: 2px solid var(--ghost-accent-color, #FF1A75);
}

/* --- Recent posts --- */
.gh-recent {
    margin: 0;
    padding: 0;
    list-style: none;
}

.gh-recent-item + .gh-recent-item {
    margin-top: 1.2rem;
    padding-top: 1.2rem;
    border-top: 1px solid color-mix(in srgb, currentColor 12%, transparent);
}

.gh-recent-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.gh-recent-title {
    display: block;
    font-size: 1.5rem;
    font-weight: 550;
    line-height: 1.4;
}

.gh-recent-link:hover .gh-recent-title {
    color: var(--ghost-accent-color, #FF1A75);
}

.gh-recent-date {
    display: block;
    margin-top: 0.3rem;
    font-size: 1.25rem;
    opacity: 0.55;
}

/* --- Tag list (pills) --- */
.gh-taglist {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.gh-tag-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    background: color-mix(in srgb, currentColor 7%, transparent);
    font-size: 1.3rem;
    line-height: 1;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s ease, color 0.15s ease;
}

.gh-tag-link:hover {
    background: var(--ghost-accent-color, #FF1A75);
    color: #fff;
}

.gh-tag-count {
    font-size: 1.15rem;
    opacity: 0.6;
}

.gh-tag-link:hover .gh-tag-count {
    opacity: 0.85;
}

/* ==========================================================================
   chinng-lab custom: post table of contents (toc.js / tocbot)
   ========================================================================== */
.gh-toc-wrap {
    margin: 0 auto 3.2rem;
}

.gh-toc {
    border: 1px solid color-mix(in srgb, currentColor 14%, transparent);
    border-radius: 8px;
    background: color-mix(in srgb, currentColor 3%, transparent);
    padding: 1.4rem 1.8rem;
}

.gh-toc-title {
    font-size: 1.6rem;
    font-weight: 650;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.gh-toc-title::-webkit-details-marker { display: none; }

.gh-toc-title::before {
    content: "";
    width: 0; height: 0;
    border-left: 6px solid var(--ghost-accent-color, #FF1A75);
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    transition: transform 0.15s ease;
}

.gh-toc[open] .gh-toc-title::before { transform: rotate(90deg); }

.gh-toc-list { margin-top: 1.2rem; }

.gh-toc-list ol,
.gh-toc-list ul {
    list-style: none;
    margin: 0;
    padding-left: 1.2rem;
}

.gh-toc-list > .toc-list { padding-left: 0; }

.gh-toc-list .toc-list-item {
    margin: 0.4rem 0;
    line-height: 1.45;
}

.gh-toc-list a {
    color: inherit;
    text-decoration: none;
    opacity: 0.8;
    font-size: 1.45rem;
}

.gh-toc-list a:hover,
.gh-toc-list .is-active-link {
    color: var(--ghost-accent-color, #FF1A75);
    opacity: 1;
}

.gh-toc-list .is-active-link {
    font-weight: 600;
}
