/* =============================================
   Sidebar Layout
   ============================================= */

.site-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 0;
    min-height: 100vh;
}

/* =============================================
   Sidebar
   ============================================= */

.site-sidebar {
    position: sticky;
    top: 0;
    max-height: 100vh;
    align-self: start;
    padding: 2.4rem 1.6rem;
    border-right: 1px solid var(--color-border, #e6e8eb);
    overflow-y: auto;
    background: var(--color-bg, #ffffff);
}

.sidebar-section {
    margin-bottom: 2.4rem;
}

.sidebar-heading {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-secondary-text, #738a94);
    margin: 0 0 0.8rem 0;
}

/* Navigation links */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.sidebar-nav .nav {
    display: flex;
    flex-direction: column;
}

.sidebar-nav .nav li {
    list-style: none;
    margin: 0;
}

.sidebar-nav .nav li a {
    display: block;
    padding: 0.4rem 0;
    color: var(--color-base, #15171a);
    text-decoration: none;
    font-size: 1.5rem;
}

.sidebar-nav .nav li a:hover {
    color: var(--ghost-accent-color, #ff0095);
}

/* Tag pills */
.sidebar-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.sidebar-tag {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border: 1px solid var(--color-border, #e6e8eb);
    border-radius: 999px;
    font-size: 1.3rem;
    color: var(--color-base, #15171a);
    text-decoration: none;
    transition: border-color 0.2s, color 0.2s;
}

.sidebar-tag:hover {
    border-color: var(--ghost-accent-color, #ff0095);
    color: var(--ghost-accent-color, #ff0095);
}

/* =============================================
   Main content area
   ============================================= */

.site-main {
    min-width: 0;
    /* prevents grid blowout */
    padding: 0;
    margin-bottom: 40px;
}

/* =============================================
   Responsive — sidebar collapses on mobile
   ============================================= */

@media (max-width: 900px) {
    .site-layout {
        grid-template-columns: 1fr;
    }

    .site-sidebar {
        display: none;
    }
}

/* Hide header nav and search on desktop — sidebar handles navigation */
@media (min-width: 901px) {
    .gh-head-menu {
        display: none;
    }

}

.gh-head .gh-search {
    display: none;
}

:is(.home-template, .paged:not(.tag-template):not(.author-template)).has-cover .gh-head {
    position: relative;
    background-color: var(--ghost-accent-color);
    color: #fff;
}

/* =============================================
   Compact footer
   ============================================= */

.site-footer {
    margin-top: 0;
    padding-top: 16px;
    padding-bottom: 16px;
}

/* =============================================
   Dark mode — Auto (follows OS)
   ============================================= */

@media (prefers-color-scheme: dark) {
    html.auto-color .site-sidebar {
        background: var(--color-darkmode);
        border-right-color: hsla(0, 0%, 100%, .1);
    }

    html.auto-color .sidebar-heading {
        color: hsla(0, 0%, 100%, .4);
    }

    html.auto-color .sidebar-nav .nav li a {
        color: hsla(0, 0%, 100%, .75);
    }

    html.auto-color .sidebar-tag {
        color: hsla(0, 0%, 100%, .75);
        border-color: hsla(0, 0%, 100%, .1);
    }

    html.auto-color ::selection {
        background: #1a3a5c;
    }
}

/* =============================================
   Dark mode — Explicit
   ============================================= */

html.dark-mode .site-sidebar {
    background: var(--color-darkmode);
    border-right-color: hsla(0, 0%, 100%, .1);
}

html.dark-mode .sidebar-heading {
    color: hsla(0, 0%, 100%, .4);
}

html.dark-mode .sidebar-nav .nav li a {
    color: hsla(0, 0%, 100%, .75);
}

html.dark-mode .sidebar-tag {
    color: hsla(0, 0%, 100%, .75);
    border-color: hsla(0, 0%, 100%, .1);
}

html.dark-mode ::selection {
    background: #1a3a5c;
}
