/**
 * GitHub Like Theme: layout and components.
 *
 * Tokens are defined in style.css. Article typography is in content.css.
 *
 * Breakpoints
 *   <= 1024px  the sidebar becomes a drawer and carries the primary menu
 *   <= 1279px  the article's right rail is replaced by an inline contents block
 *   <=  640px  compact header and single-column cards
 */

/* ==========================================================================
   Primitives
   ========================================================================== */

.icon {
    flex-shrink: 0;
    vertical-align: text-bottom;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 5px 12px;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    color: var(--gh-color-btn-text);
    white-space: nowrap;
    text-decoration: none;
    background-color: var(--gh-color-btn-bg);
    border: 1px solid var(--gh-color-border-default);
    border-radius: var(--gh-radius-md);
    box-shadow: var(--gh-shadow-sm);
    cursor: pointer;
    user-select: none;
    appearance: none;
    transition: background-color var(--gh-transition-fast), border-color var(--gh-transition-fast);
}

.btn:hover {
    text-decoration: none;
    background-color: var(--gh-color-btn-hover-bg);
}

.btn-sm {
    padding: 3px 10px;
    font-size: 12px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    color: var(--gh-color-fg-muted);
}

.btn-sm.btn-icon {
    width: 28px;
    height: 28px;
}

.btn-primary,
.btn-primary:visited {
    color: #ffffff;
    background-color: var(--gh-color-success-emphasis);
    border-color: rgba(31, 35, 40, 0.15);
}

.btn-primary:hover {
    background-color: var(--gh-color-success-emphasis);
    filter: brightness(0.94);
}

.btn-link {
    padding: 0;
    font-size: inherit;
    color: var(--gh-color-accent-fg);
    background: none;
    border: 0;
    cursor: pointer;
}

.btn-link:hover {
    text-decoration: underline;
}

.box {
    background-color: var(--gh-color-canvas-default);
    border: 1px solid var(--gh-color-border-default);
    border-radius: var(--gh-radius-md);
}

.counter {
    display: inline-block;
    min-width: 20px;
    padding: 0 6px;
    font-size: 12px;
    font-weight: 500;
    line-height: 18px;
    color: var(--gh-color-fg-default);
    text-align: center;
    background-color: var(--gh-color-neutral-muted);
    border-radius: 2em;
}

.label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0 7px;
    font-size: 12px;
    font-weight: 500;
    line-height: 18px;
    color: var(--gh-color-fg-muted);
    white-space: nowrap;
    border: 1px solid var(--gh-color-border-default);
    border-radius: 2em;
}

.label-pinned {
    margin-right: 6px;
    vertical-align: 2px;
}

.label-author {
    color: var(--gh-color-accent-fg);
    border-color: var(--gh-color-accent-muted);
}

.lang-dot {
    display: inline-block;
    flex-shrink: 0;
    width: 12px;
    height: 12px;
    background-color: var(--gh-color-fg-subtle);
    border: 1px solid rgba(128, 128, 128, 0.2);
    border-radius: 50%;
}

.topics {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.topic {
    display: inline-block;
    padding: 0 10px;
    font-size: 12px;
    font-weight: 500;
    line-height: 22px;
    color: var(--gh-color-accent-fg);
    white-space: nowrap;
    background-color: var(--gh-color-accent-subtle);
    border: 1px solid transparent;
    border-radius: 2em;
}

a.topic:hover {
    color: var(--gh-color-fg-on-emphasis);
    text-decoration: none;
    background-color: var(--gh-color-accent-emphasis);
}

.topic-more {
    color: var(--gh-color-fg-muted);
    background-color: var(--gh-color-neutral-muted);
}

.entry-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 16px;
    font-size: 12px;
    color: var(--gh-color-fg-muted);
}

.meta-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--gh-color-fg-muted);
}

.meta-item a {
    color: inherit;
}

a.meta-item:hover,
.meta-item a:hover {
    color: var(--gh-color-accent-fg);
    text-decoration: none;
}

.avatar {
    border-radius: 50%;
    box-shadow: 0 0 0 1px var(--gh-color-border-muted);
}

.avatar-inline {
    margin-right: 6px;
    vertical-align: middle;
}

.byline .author {
    display: inline-flex;
    align-items: center;
    font-weight: 600;
    color: var(--gh-color-fg-default);
}

/* Dropdown menus built on <details> */

.dropdown {
    position: relative;
}

.dropdown > summary {
    list-style: none;
}

.dropdown > summary::-webkit-details-marker {
    display: none;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 300;
    width: 220px;
    padding: 8px;
    font-size: 14px;
    background-color: var(--gh-color-canvas-overlay);
    border: 1px solid var(--gh-color-border-default);
    border-radius: var(--gh-radius-lg);
    box-shadow: var(--gh-shadow-lg);
}

.dropdown-menu-right {
    right: 0;
    left: auto;
}

.dropdown-header {
    padding: 6px 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--gh-color-fg-muted);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 6px 8px;
    color: var(--gh-color-fg-default);
    text-align: left;
    background: none;
    border: 0;
    border-radius: var(--gh-radius-md);
}

.dropdown-item:hover {
    background-color: var(--gh-color-neutral-muted);
}

.dropdown-item-check {
    display: inline-flex;
    width: 16px;
    visibility: hidden;
}

.dropdown-item[aria-checked="true"] .dropdown-item-check {
    visibility: visible;
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--gh-header-height);
    background-color: var(--gh-color-header-bg);
    border-bottom: 1px solid var(--gh-color-border-default);
}

.admin-bar .site-header {
    top: 32px;
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 100%;
    padding: 0 16px;
}

.site-branding {
    display: flex;
    flex-shrink: 1;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.site-logo,
.custom-logo-link {
    display: flex;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
}

.site-logo svg,
.custom-logo {
    display: block;
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.site-identity {
    min-width: 0;
}

.site-title {
    margin: 0;
    overflow: hidden;
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.site-title a {
    padding: 4px 6px;
    margin-left: -6px;
    color: var(--gh-color-fg-default);
    border-radius: var(--gh-radius-md);
}

.site-title a:hover {
    text-decoration: none;
    background-color: var(--gh-color-neutral-muted);
}

/* Primary menu */

.main-navigation {
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    margin-left: 8px;
}

.nav-menu,
.nav-menu ul {
    padding: 0;
    margin: 0;
    list-style: none;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 100%;
}

.nav-menu > li {
    position: relative;
    display: flex;
    align-items: center;
    height: 100%;
}

.nav-menu a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    font-size: 14px;
    line-height: 20px;
    color: var(--gh-color-fg-default);
    white-space: nowrap;
    border-radius: var(--gh-radius-md);
}

.nav-menu a:hover {
    text-decoration: none;
    background-color: var(--gh-color-neutral-muted);
}

/* The underline that marks the current section, as on GitHub's tab bars. */
.nav-menu > .current-menu-item > a,
.nav-menu > .current-menu-ancestor > a,
.nav-menu > .current_page_item > a {
    font-weight: 600;
}

.nav-menu > .current-menu-item::after,
.nav-menu > .current-menu-ancestor::after,
.nav-menu > .current_page_item::after {
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 2px;
    content: "";
    background-color: #fd8c73;
    border-radius: 2px;
}

.nav-menu .menu-item-has-children > a::after {
    width: 6px;
    height: 6px;
    margin: -3px 2px 0 0;
    content: "";
    border: solid currentColor;
    border-width: 0 1.5px 1.5px 0;
    opacity: 0.7;
    transform: rotate(45deg);
}

.nav-menu .sub-menu {
    position: absolute;
    top: calc(100% - 8px);
    left: 0;
    z-index: 300;
    display: none;
    min-width: 220px;
    padding: 8px;
    background-color: var(--gh-color-canvas-overlay);
    border: 1px solid var(--gh-color-border-default);
    border-radius: var(--gh-radius-lg);
    box-shadow: var(--gh-shadow-lg);
}

.nav-menu li:hover > .sub-menu,
.nav-menu li:focus-within > .sub-menu {
    display: block;
}

.nav-menu .sub-menu li {
    position: relative;
}

.nav-menu .sub-menu a {
    justify-content: space-between;
    padding: 6px 8px;
    white-space: normal;
}

.nav-menu .sub-menu .sub-menu {
    top: -9px;
    left: calc(100% + 4px);
}

.nav-menu .sub-menu .menu-item-has-children > a::after {
    margin: 0 2px 0 8px;
    transform: rotate(-45deg);
}

.nav-menu .sub-menu .current-menu-item > a {
    font-weight: 600;
    background-color: var(--gh-color-neutral-muted);
}

/* Search and colour scheme */

.header-actions {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.search-form {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 9px;
    display: flex;
    color: var(--gh-color-fg-muted);
    pointer-events: none;
}

.search-field {
    width: 240px;
    height: 32px;
    padding: 0 34px 0 32px;
    font-size: 14px;
    color: var(--gh-color-fg-default);
    background-color: var(--gh-color-canvas-default);
    border: 1px solid var(--gh-color-border-default);
    border-radius: var(--gh-radius-md);
    transition: width 120ms ease, border-color var(--gh-transition-fast);
    appearance: none;
}

.search-field::placeholder {
    color: var(--gh-color-fg-muted);
}

.search-field::-webkit-search-cancel-button {
    appearance: none;
}

.search-field:focus {
    width: 320px;
    max-width: 50vw;
    border-color: var(--gh-color-accent-emphasis);
    outline: 2px solid var(--gh-color-accent-emphasis);
    outline-offset: -1px;
}

.search-hint {
    position: absolute;
    right: 7px;
    pointer-events: none;
}

.search-field:focus ~ .search-hint {
    display: none;
}

.scheme-icon {
    display: none;
}

[data-color-mode="light"] .scheme-icon-light,
[data-color-mode="dark"] .scheme-icon-dark {
    display: flex;
}

/* Reading progress */

.reading-progress {
    position: absolute;
    right: 0;
    bottom: -3px;
    left: 0;
    height: 2px;
    pointer-events: none;
}

.reading-progress-bar {
    display: block;
    height: 100%;
    background-color: var(--gh-color-accent-emphasis);
    transform: scaleX(0);
    transform-origin: 0 50%;
    will-change: transform;
}

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

.developer-sidebar {
    position: fixed;
    top: var(--gh-header-height);
    bottom: 0;
    left: 0;
    z-index: 90;
    width: var(--gh-sidebar-width);
    overflow-x: hidden;
    overflow-y: auto;
    font-size: 14px;
    background-color: var(--gh-color-canvas-default);
    border-right: 1px solid var(--gh-color-border-default);
    overscroll-behavior: contain;
    scrollbar-width: thin;
}

.admin-bar .developer-sidebar {
    top: calc(var(--gh-header-height) + 32px);
}

.sidebar-drawer-header,
.sidebar-nav {
    display: none;
}

.sidebar-section {
    padding: 16px;
    border-bottom: 1px solid var(--gh-color-border-muted);
}

.sidebar-section:last-child {
    border-bottom: 0;
}

.sidebar-section-title {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
}

.sidebar-empty {
    margin: 0;
    font-size: 12px;
    color: var(--gh-color-fg-muted);
}

/* Author card */

.author-avatar {
    display: inline-block;
    margin-bottom: 12px;
}

.author-avatar .avatar {
    display: block;
    width: 96px;
    height: 96px;
}

.author-name {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.25;
}

.author-name a {
    color: var(--gh-color-fg-default);
}

.author-tagline {
    margin: 2px 0 0;
    font-size: 14px;
    color: var(--gh-color-fg-muted);
}

.author-bio {
    margin: 12px 0 0;
    font-size: 13px;
    line-height: 1.5;
}

.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0;
    margin: 12px 0 0;
    list-style: none;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: var(--gh-color-fg-muted);
    border-radius: var(--gh-radius-md);
    transition: background-color var(--gh-transition-fast), color var(--gh-transition-fast);
}

.social-link:hover {
    color: var(--gh-color-fg-default);
    background-color: var(--gh-color-neutral-muted);
}

/* Categories, drawn like a repository's language breakdown */

.language-bar {
    display: flex;
    gap: 2px;
    height: 8px;
    margin-bottom: 12px;
    overflow: hidden;
    border-radius: 6px;
}

.language-bar span {
    min-width: 2px;
}

.language-list {
    padding: 0;
    margin: 0;
    list-style: none;
}

.language-list a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    margin: 0 -8px;
    font-size: 13px;
    color: var(--gh-color-fg-default);
    border-radius: var(--gh-radius-md);
}

.language-list a:hover {
    text-decoration: none;
    background-color: var(--gh-color-neutral-muted);
}

.language-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.language-count {
    font-size: 12px;
    color: var(--gh-color-fg-muted);
}

/* Posting activity: one row per year, one square per month */

.activity-months,
.activity-row {
    display: grid;
    grid-template-columns: 34px repeat(12, minmax(0, 1fr));
    gap: 3px;
    align-items: center;
}

.activity-months {
    margin-bottom: 4px;
    font-size: 10px;
    color: var(--gh-color-fg-muted);
    text-align: center;
}

.activity-row {
    margin-bottom: 3px;
}

.activity-row-extra {
    display: none;
}

.activity-expanded .activity-row-extra {
    display: grid;
}

.activity-year {
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    color: var(--gh-color-fg-muted);
}

.activity-cell {
    display: block;
    aspect-ratio: 1;
    background-color: var(--gh-activity-0);
    border-radius: 2px;
    outline: 1px solid rgba(27, 31, 35, 0.06);
    outline-offset: -1px;
}

.activity-cell[data-level="1"] { background-color: var(--gh-activity-1); }
.activity-cell[data-level="2"] { background-color: var(--gh-activity-2); }
.activity-cell[data-level="3"] { background-color: var(--gh-activity-3); }
.activity-cell[data-level="4"] { background-color: var(--gh-activity-4); }

a.activity-cell:hover,
a.activity-cell:focus-visible {
    outline: 2px solid var(--gh-color-fg-default);
    outline-offset: 0;
}

.activity-toggle {
    margin-top: 6px;
    font-size: 12px;
}

.activity-legend {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 3px;
    margin-top: 10px;
    font-size: 11px;
    color: var(--gh-color-fg-muted);
}

.activity-legend .activity-cell {
    width: 10px;
}

.activity-legend span:first-child {
    margin-right: 3px;
}

.activity-legend span:last-child {
    margin-left: 3px;
}

/* Widgets placed in the sidebar */

.developer-sidebar .widget ul {
    padding: 0;
    margin: 0;
    list-style: none;
}

.developer-sidebar .widget li {
    padding: 3px 0;
    font-size: 13px;
}

.developer-sidebar .widget select,
.developer-sidebar .widget input[type="text"],
.developer-sidebar .widget input[type="email"] {
    width: 100%;
    height: 32px;
    padding: 0 8px;
    background-color: var(--gh-color-canvas-default);
    border: 1px solid var(--gh-color-border-default);
    border-radius: var(--gh-radius-md);
}

/* ==========================================================================
   Page frame
   ========================================================================== */

.site-container {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - var(--gh-header-height));
}

.site-main {
    flex: 1;
    width: 100%;
    min-width: 0;
    padding: 24px 32px 48px;
}

.content-wrapper {
    max-width: var(--gh-list-max);
    margin: 0 auto;
}

.content-narrow {
    max-width: var(--gh-content-max);
}

@media (min-width: 1025px) {
    .has-sidebar .site-container {
        margin-left: var(--gh-sidebar-width);
    }

    [data-sidebar="closed"] .has-sidebar .site-container {
        margin-left: 0;
    }

    [data-sidebar="closed"] .developer-sidebar,
    .no-sidebar .developer-sidebar {
        display: none;
    }

    .no-sidebar .sidebar-toggle {
        display: none;
    }
}

/* ==========================================================================
   Lists of posts
   ========================================================================== */

.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding-bottom: 12px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--gh-color-border-muted);
}

.page-title {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    line-height: 1.25;
}

.page-title-small {
    font-size: 16px;
}

.page-kind {
    display: inline-flex;
    flex-basis: 100%;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--gh-color-fg-muted);
}

.archive-description {
    flex-basis: 100%;
    font-size: 14px;
    color: var(--gh-color-fg-muted);
}

.archive-description p:last-child {
    margin-bottom: 0;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.post-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    padding: 16px;
    overflow: hidden;
    transition: border-color var(--gh-transition-fast), box-shadow var(--gh-transition-fast);
}

.post-card:hover {
    border-color: var(--gh-color-fg-subtle);
    box-shadow: var(--gh-shadow-md);
}

.post-card .post-thumbnail {
    display: block;
    margin: -16px -16px 8px;
    overflow: hidden;
    background-color: var(--gh-color-canvas-subtle);
    border-bottom: 1px solid var(--gh-color-border-muted);
    aspect-ratio: 16 / 9;
}

.post-card .post-thumbnail img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-card .entry-title,
.post-row .entry-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
}

.post-card .entry-title a,
.post-row .entry-title a {
    color: var(--gh-color-accent-fg);
}

.entry-summary {
    font-size: 13px;
    line-height: 1.55;
    color: var(--gh-color-fg-muted);
}

.entry-summary p {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
}

.post-card .entry-meta {
    padding-top: 8px;
    margin-top: auto;
}

.post-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 16px 0;
    border-bottom: 1px solid var(--gh-color-border-muted);
}

.post-row:first-child {
    padding-top: 0;
}

/* Pagination */

.gh-pagination {
    margin-top: 32px;
}

.gh-pagination .nav-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.gh-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    font-size: 14px;
    color: var(--gh-color-fg-default);
    border: 1px solid transparent;
    border-radius: var(--gh-radius-md);
}

.gh-pagination a.page-numbers:hover {
    text-decoration: none;
    border-color: var(--gh-color-border-default);
}

.gh-pagination .page-numbers.current {
    color: var(--gh-color-fg-on-emphasis);
    background-color: var(--gh-color-accent-emphasis);
}

.gh-pagination .prev,
.gh-pagination .next {
    color: var(--gh-color-accent-fg);
}

/* Empty states and simple list boxes */

.blankslate {
    padding: 48px 24px;
    text-align: center;
}

.blankslate p {
    max-width: 480px;
    margin: 8px auto 16px;
    color: var(--gh-color-fg-muted);
}

.blankslate .search-form {
    display: inline-flex;
}

.blankslate-code {
    margin: 0;
    font-family: var(--gh-font-mono);
    font-size: 64px;
    font-weight: 600;
    line-height: 1;
    color: var(--gh-color-border-default);
}

.box-header {
    padding: 12px 16px;
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    background-color: var(--gh-color-canvas-subtle);
    border-bottom: 1px solid var(--gh-color-border-default);
    border-radius: var(--gh-radius-md) var(--gh-radius-md) 0 0;
}

.box-list ul {
    padding: 0;
    margin: 0;
    list-style: none;
}

.box-list li {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px 16px;
    padding: 10px 16px;
    border-top: 1px solid var(--gh-color-border-muted);
}

.box-list li:first-child {
    border-top: 0;
}

.box-list a {
    font-weight: 600;
}

.box-list time {
    font-size: 12px;
    color: var(--gh-color-fg-muted);
    white-space: nowrap;
}

/* ==========================================================================
   Single post and page
   ========================================================================== */

.post-layout {
    display: grid;
    grid-template-columns: minmax(0, var(--gh-content-max)) var(--gh-rail-width);
    gap: 32px;
    justify-content: center;
}

.post-column {
    min-width: 0;
}

.article-box {
    padding: 24px 32px 32px;
    background-color: var(--gh-color-canvas-default);
    border: 1px solid var(--gh-color-border-default);
    border-radius: var(--gh-radius-md);
}

.article-box .entry-header {
    padding-bottom: 16px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--gh-color-border-muted);
}

.article-box .entry-title {
    margin: 0 0 12px;
    font-size: 32px;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.01em;
    text-wrap: balance;
}

.article-box .entry-meta {
    font-size: 14px;
}

.article-box .post-thumbnail {
    margin: 0 0 24px;
}

.article-box .post-thumbnail img {
    display: block;
    width: 100%;
    border: 1px solid var(--gh-color-border-muted);
    border-radius: var(--gh-radius-md);
}

.article-box .entry-footer {
    padding-top: 16px;
    margin-top: 32px;
    border-top: 1px solid var(--gh-color-border-muted);
}

/* Breadcrumb, written like a repository path */

.breadcrumb ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 0;
    margin: 0 0 12px;
    font-size: 14px;
    list-style: none;
}

.breadcrumb li {
    display: inline-flex;
    align-items: center;
    min-width: 0;
}

.breadcrumb li + li::before {
    margin: 0 6px;
    color: var(--gh-color-fg-muted);
    content: "/";
}

.breadcrumb a {
    display: inline-flex;
    align-items: center;
}

.breadcrumb [aria-current] span {
    max-width: 46ch;
    overflow: hidden;
    font-weight: 600;
    color: var(--gh-color-fg-default);
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Right rail */

.post-rail-inner {
    position: sticky;
    top: calc(var(--gh-header-height) + 24px);
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-height: calc(100vh - var(--gh-header-height) - 48px);
}

.admin-bar .post-rail-inner {
    top: calc(var(--gh-header-height) + 56px);
}

.rail-title {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
}

.toc-rail {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: thin;
}

.toc-list {
    padding: 0;
    margin: 0;
    font-size: 13px;
    list-style: none;
    border-left: 1px solid var(--gh-color-border-default);
}

.toc-list a {
    display: block;
    padding: 4px 8px 4px 12px;
    margin-left: -1px;
    line-height: 1.4;
    color: var(--gh-color-fg-muted);
    border-left: 2px solid transparent;
}

.toc-level-3 a {
    padding-left: 24px;
}

.toc-list a:hover {
    color: var(--gh-color-fg-default);
    text-decoration: none;
}

.toc-list a[aria-current] {
    font-weight: 600;
    color: var(--gh-color-fg-default);
    border-left-color: var(--gh-color-accent-emphasis);
}

.rail-section {
    flex-shrink: 0;
}

.share-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* Sections after the article */

.post-metadata-section {
    padding: 4px 16px;
    margin-top: 16px;
}

.post-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    padding: 12px 0;
    border-top: 1px solid var(--gh-color-border-muted);
}

.post-meta-row:first-child {
    border-top: 0;
}

.metadata-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 108px;
    font-size: 12px;
    font-weight: 600;
    color: var(--gh-color-fg-muted);
}

.author-box {
    display: flex;
    gap: 16px;
    padding: 16px;
    margin-top: 16px;
}

.author-box-avatar .avatar {
    display: block;
    width: 64px;
    height: 64px;
}

.author-box-label {
    margin: 0;
    font-size: 12px;
    color: var(--gh-color-fg-muted);
}

.author-box-name {
    margin: 0;
    font-size: 16px;
}

.author-box-name a {
    color: var(--gh-color-fg-default);
}

.author-box-bio {
    margin: 6px 0 0;
    font-size: 14px;
    color: var(--gh-color-fg-muted);
}

.author-box .social-links {
    margin-top: 8px;
    margin-left: -7px;
}

.section-title {
    margin: 32px 0 12px;
    font-size: 16px;
    font-weight: 600;
}

.related-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.related-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 16px;
}

.related-link {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
}

.related-item .entry-meta {
    margin-top: auto;
}

.post-navigation {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.post-navigation .nav-link {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 16px;
    transition: border-color var(--gh-transition-fast);
}

.post-navigation .nav-link:hover {
    text-decoration: none;
    border-color: var(--gh-color-accent-fg);
}

.post-navigation .nav-next {
    text-align: right;
}

.nav-direction {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--gh-color-fg-muted);
}

.nav-next .nav-direction {
    justify-content: flex-end;
}

.nav-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
}

/* ==========================================================================
   Comments, drawn like an issue thread
   ========================================================================== */

.comments-area {
    margin-top: 40px;
}

.comments-title,
.comment-reply-title {
    padding-bottom: 8px;
    margin: 0 0 16px;
    font-size: 20px;
    font-weight: 600;
    border-bottom: 1px solid var(--gh-color-border-muted);
}

.comment-list,
.comment-list .children {
    padding: 0;
    margin: 0;
    list-style: none;
}

.comment-list .children {
    margin-left: 56px;
}

.github-comment .comment-body {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.comment-avatar {
    flex-shrink: 0;
}

.comment-avatar .avatar {
    display: block;
    width: 40px;
    height: 40px;
}

.github-comment .comment-content {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--gh-color-border-default);
    border-radius: var(--gh-radius-md);
}

.comment-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
    padding: 8px 16px;
    font-size: 14px;
    color: var(--gh-color-fg-muted);
    background-color: var(--gh-color-canvas-subtle);
    border-bottom: 1px solid var(--gh-color-border-default);
    border-radius: var(--gh-radius-md) var(--gh-radius-md) 0 0;
}

.bypostauthor > .comment-body .comment-header {
    background-color: var(--gh-color-accent-subtle);
}

.comment-author-name,
.comment-author-name a {
    color: var(--gh-color-fg-default);
}

.comment-time {
    color: var(--gh-color-fg-muted);
}

.comment-header .label {
    margin-left: auto;
}

.comment-text {
    padding: 16px;
    font-size: 14px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.comment-text > :last-child {
    margin-bottom: 0;
}

.comment-awaiting-moderation {
    padding: 8px 12px;
    font-size: 13px;
    color: var(--gh-color-attention-fg);
    background-color: var(--gh-color-attention-subtle);
    border-radius: var(--gh-radius-md);
}

.comment-actions {
    display: flex;
    gap: 16px;
    padding: 0 16px 12px;
    font-size: 12px;
}

.comment-actions:empty {
    display: none;
}

.comment-actions a {
    color: var(--gh-color-fg-muted);
}

.comment-actions a:hover {
    color: var(--gh-color-accent-fg);
}

.comment-nav-links {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin: 16px 0;
}

.comment-nav-links .page-numbers {
    padding: 5px 10px;
    border-radius: var(--gh-radius-md);
}

.comment-nav-links .current {
    color: var(--gh-color-fg-on-emphasis);
    background-color: var(--gh-color-accent-emphasis);
}

.no-comments {
    padding: 12px 16px;
    color: var(--gh-color-fg-muted);
    background-color: var(--gh-color-canvas-subtle);
    border: 1px solid var(--gh-color-border-default);
    border-radius: var(--gh-radius-md);
}

.comment-respond {
    margin-top: 24px;
}

.comment-list .comment-respond {
    margin: 0 0 16px 56px;
}

.comment-reply-title small {
    margin-left: 12px;
    font-size: 12px;
    font-weight: 400;
}

.comment-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.comment-form > * {
    grid-column: 1 / -1;
    margin: 0;
}

.comment-form > .comment-form-author,
.comment-form > .comment-form-email,
.comment-form > .comment-form-url {
    grid-column: span 1;
}

.comment-notes,
.logged-in-as,
.comment-form-cookies-consent {
    font-size: 12px;
    color: var(--gh-color-fg-muted);
}

.comment-form-cookies-consent {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.comment-form .required {
    color: var(--gh-color-danger-fg);
}

.comment-form textarea,
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"] {
    display: block;
    width: 100%;
    padding: 5px 12px;
    font-size: 14px;
    line-height: 20px;
    color: var(--gh-color-fg-default);
    background-color: var(--gh-color-canvas-default);
    border: 1px solid var(--gh-color-border-default);
    border-radius: var(--gh-radius-md);
}

.comment-form textarea {
    min-height: 120px;
    padding: 8px 12px;
    resize: vertical;
}

.comment-form textarea:focus,
.comment-form input:focus {
    border-color: var(--gh-color-accent-emphasis);
    outline: 2px solid var(--gh-color-accent-emphasis);
    outline-offset: -1px;
}

.comment-form .form-submit {
    display: flex;
    justify-content: flex-end;
}

/* ==========================================================================
   Footer and floating controls
   ========================================================================== */

.site-footer {
    font-size: 12px;
    color: var(--gh-color-fg-muted);
    border-top: 1px solid var(--gh-color-border-muted);
}

.footer-inner {
    max-width: calc(var(--gh-list-max) + 64px);
    padding: 32px;
    margin: 0 auto;
}

.footer-widgets {
    margin-bottom: 24px;
}

.footer-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 32px;
}

.footer-column-title {
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--gh-color-fg-default);
}

.footer-text,
.footer-text p {
    margin: 0 0 8px;
    line-height: 1.6;
}

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    padding-top: 24px;
    margin-top: 24px;
    border-top: 1px solid var(--gh-color-border-muted);
}

.footer-logo {
    display: flex;
    color: var(--gh-color-fg-subtle);
}

.footer-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.footer-meta {
    margin-left: auto;
}

.site-footer a {
    color: var(--gh-color-fg-muted);
}

.site-footer a:hover {
    color: var(--gh-color-accent-fg);
}

.site-footer strong {
    color: var(--gh-color-fg-default);
}

.rss-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.back-to-top {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 80;
    background-color: var(--gh-color-canvas-overlay);
    box-shadow: var(--gh-shadow-md);
}

.back-to-top[hidden],
.sidebar-backdrop[hidden] {
    display: none;
}

/* ==========================================================================
   Narrow screens
   ========================================================================== */

@media (max-width: 1279px) {
    .post-layout {
        grid-template-columns: minmax(0, var(--gh-content-max));
    }

    .post-rail {
        display: none;
    }
}

@media (min-width: 1280px) {
    .markdown-body .toc-inline {
        display: none;
    }

    .post-meta-share {
        display: none;
    }
}

@media (max-width: 1024px) {
    .main-navigation {
        display: none;
    }

    .developer-sidebar {
        top: 0;
        z-index: 210;
        width: min(320px, 86vw);
        box-shadow: var(--gh-shadow-lg);
        visibility: hidden;
        transform: translateX(-100%);
        transition: transform 180ms ease, visibility 0s linear 180ms;
    }

    .admin-bar .developer-sidebar {
        top: 46px;
    }

    .sidebar-open .developer-sidebar {
        visibility: visible;
        transform: translateX(0);
        transition: transform 180ms ease;
    }

    .sidebar-open {
        overflow: hidden;
    }

    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 200;
        background-color: var(--gh-color-backdrop);
    }

    .sidebar-drawer-header {
        position: sticky;
        top: 0;
        z-index: 1;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        padding: 12px 16px;
        background-color: var(--gh-color-canvas-default);
        border-bottom: 1px solid var(--gh-color-border-muted);
    }

    .sidebar-drawer-title {
        overflow: hidden;
        font-weight: 600;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .sidebar-nav {
        display: block;
    }

    .sidebar-menu,
    .sidebar-menu ul {
        padding: 0;
        margin: 0;
        list-style: none;
    }

    .sidebar-menu a {
        display: block;
        padding: 6px 8px;
        margin: 0 -8px;
        color: var(--gh-color-fg-default);
        border-radius: var(--gh-radius-md);
    }

    .sidebar-menu a:hover {
        text-decoration: none;
        background-color: var(--gh-color-neutral-muted);
    }

    .sidebar-menu .current-menu-item > a {
        font-weight: 600;
    }

    .sidebar-menu .sub-menu {
        padding-left: 12px;
        margin: 2px 0 2px 8px;
        border-left: 1px solid var(--gh-color-border-muted);
    }

    .site-main {
        padding: 16px 16px 40px;
    }

    .search-field,
    .search-field:focus {
        width: 200px;
    }
}

@media (max-width: 782px) {
    .admin-bar .site-header {
        top: 46px;
    }
}

@media (max-width: 640px) {
    .article-box {
        padding: 16px;
        margin: 0 -16px;
        border-right: 0;
        border-left: 0;
        border-radius: 0;
    }

    .article-box .entry-title {
        font-size: 24px;
    }

    .posts-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .header-actions {
        flex: 1;
        justify-content: flex-end;
        min-width: 0;
    }

    .header-search {
        flex: 0 0 132px;
        min-width: 0;
    }

    .site-branding {
        flex: 1 1 auto;
    }

    .site-title {
        max-width: none;
    }

    .breadcrumb [aria-current] {
        display: none;
    }

    .search-field,
    .search-field:focus {
        width: 100%;
        max-width: none;
        padding-right: 8px;
    }

    .search-hint {
        display: none;
    }

    .post-navigation,
    .footer-columns {
        grid-template-columns: minmax(0, 1fr);
    }

    .post-navigation .nav-next {
        text-align: left;
    }

    .nav-next .nav-direction {
        justify-content: flex-start;
    }

    .comment-list .children,
    .comment-list .comment-respond {
        margin-left: 16px;
    }

    .comment-avatar {
        display: none;
    }

    .comment-form > .comment-form-author,
    .comment-form > .comment-form-email,
    .comment-form > .comment-form-url {
        grid-column: 1 / -1;
    }

    .footer-inner {
        padding: 24px 16px;
    }

    .footer-meta {
        margin-left: 0;
    }

    .back-to-top {
        right: 16px;
        bottom: 16px;
    }
}

/* ==========================================================================
   Image zoom overlay (js/image-zoom.js). Carried over from version 1.
   ========================================================================== */

/* ============================================
   IMAGE ZOOM FUNCTIONALITY - GitHub Style
   ============================================ */

.image-zoom-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.image-zoom-container.active {
    display: flex;
}

.image-zoom-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
}

.image-zoom-content {
    position: relative;
    z-index: 1;
    max-width: 95vw;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.image-zoom-img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: var(--gh-radius-md);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s ease;
    cursor: grab;
}

.image-zoom-img:active {
    cursor: grabbing;
}

.image-zoom-pdf {
    max-width: 90vw;
    max-height: 90vh;
    width: 90vw;
    height: 90vh;
    border: none;
    border-radius: var(--gh-radius-md);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    background-color: var(--gh-color-canvas-default);
    display: none;
}

.image-zoom-close {
    position: absolute;
    top: -40px;
    right: 0;
    width: 32px;
    height: 32px;
    background-color: var(--gh-color-canvas-default);
    border: 1px solid var(--gh-color-border-default);
    border-radius: 50%;
    color: var(--gh-color-fg-default);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--gh-transition-fast);
    z-index: 2;
}

.image-zoom-close:hover {
    background-color: var(--gh-color-canvas-subtle);
    border-color: var(--gh-color-accent-emphasis);
    color: var(--gh-color-accent-fg);
}

.image-zoom-controls {
    position: absolute;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    background-color: var(--gh-color-canvas-default);
    border: 1px solid var(--gh-color-border-default);
    border-radius: var(--gh-radius-md);
    padding: 8px;
    box-shadow: var(--gh-shadow-lg);
}

.image-zoom-btn {
    width: 32px;
    height: 32px;
    background-color: var(--gh-color-canvas-subtle);
    border: 1px solid var(--gh-color-border-default);
    border-radius: var(--gh-radius-sm);
    color: var(--gh-color-fg-default);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--gh-transition-fast);
}

.image-zoom-btn:hover {
    background-color: var(--gh-color-canvas-overlay);
    border-color: var(--gh-color-accent-emphasis);
    color: var(--gh-color-accent-fg);
}

.image-zoom-btn:active {
    transform: scale(0.95);
}

/* Responsive image zoom */
@media (max-width: 768px) {
    .image-zoom-content {
        max-width: 100vw;
        max-height: 100vh;
        padding: 20px;
    }
    
    .image-zoom-img {
        max-height: 75vh;
    }
    
    .image-zoom-close {
        top: 10px;
        right: 10px;
    }
    
    .image-zoom-controls {
        bottom: 10px;
        left: 50%;
        transform: translateX(-50%);
    }
}

/* ============================================

/* ==========================================================================
   HTML sitemap page template. Carried over from version 1.
   ========================================================================== */

/* ============================================
   HTML SITEMAP STYLING
   ============================================ */

.html-sitemap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px;
}

.sitemap-section {
    margin-bottom: 48px;
}

.sitemap-section h2 {
    font-size: 1.5em;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--gh-color-border-default);
    color: var(--gh-color-fg-default);
}

.sitemap-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sitemap-section ul li {
    padding: 8px 0;
    border-bottom: 1px solid var(--gh-color-border-muted);
}

.sitemap-section ul li:last-child {
    border-bottom: none;
}

.sitemap-section a {
    color: var(--gh-color-accent-fg);
    text-decoration: none;
    transition: color var(--gh-transition-fast);
}

.sitemap-section a:hover {
    color: var(--gh-color-accent-emphasis);
    text-decoration: underline;
}

.sitemap-date,
.sitemap-count {
    color: var(--gh-color-fg-muted);
    font-size: 0.875em;
    margin-left: 8px;
}

.sitemap-tags .tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sitemap-tags .tag-link {
    display: inline-block;
    padding: 4px 12px;
    background-color: var(--gh-color-canvas-subtle);
    border: 1px solid var(--gh-color-border-default);
    border-radius: var(--gh-radius-sm);
    color: var(--gh-color-fg-default);
    text-decoration: none;
    font-size: 0.875em;
    transition: all var(--gh-transition-fast);
}

.sitemap-tags .tag-link:hover {
    background-color: var(--gh-color-accent-subtle);
    border-color: var(--gh-color-accent-emphasis);
    color: var(--gh-color-accent-fg);
    text-decoration: none;
}

/* ============================================

/* Block widgets in the sidebar: keep their headings at sidebar size. */

.developer-sidebar .widget :is(h1, h2, h3, h4),
.developer-sidebar .widget .wp-block-heading,
.developer-sidebar .widget .wp-block-search__label {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
}

.developer-sidebar .widget .wp-block-search__inside-wrapper {
    gap: 6px;
}

.developer-sidebar .widget .wp-block-search__input {
    min-width: 0;
    height: 32px;
    padding: 0 8px;
    background-color: var(--gh-color-canvas-default);
    border: 1px solid var(--gh-color-border-default);
    border-radius: var(--gh-radius-md);
}

.developer-sidebar .widget .wp-block-search__button {
    height: 32px;
    padding: 0 12px;
    margin: 0;
    font-size: 14px;
    color: var(--gh-color-btn-text);
    background-color: var(--gh-color-btn-bg);
    border: 1px solid var(--gh-color-border-default);
    border-radius: var(--gh-radius-md);
}
