/* ---------- design tokens ---------- */

:root {
    --link: #069;
    --link-hover: #046;
    --muted: #61778b;
    --edge: #c6d5de;
}

/* ---------- header brand / logo ---------- */

.wrapper > header {
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
}

.wrapper > header .brand {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
}

.wrapper > header .logo-link {
    flex: 0 0 auto;
}

.site-logo {
    display: block;
    width: 64px;
    height: 64px;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .2));
}

.wrapper > header .brand-text {
    min-width: 0;
}

.wrapper > header .brand-text p {
    width: auto;
    max-width: 460px;
    font-size: 16px;
}

.wrapper > header .about-link {
    margin-left: auto;
    flex: 0 0 auto;
    padding: .4rem .9rem;
    border: 1px solid var(--edge);
    border-radius: 999px;
    background: rgba(255, 255, 255, .55);
    font-size: .85rem;
    font-weight: 600;
    color: var(--link);
    text-decoration: none;
}

.wrapper > header .about-link:hover {
    border-color: var(--link);
    background: #fff;
}

.wrapper > section {
    font-size: 18px;
}

/* ---------- table of contents ---------- */

.toc ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    padding: 0;
    margin: 0 0 1.5rem;
}

.toc a {
    display: inline-block;
    padding: .35rem .75rem;
    border: 1px solid var(--edge);
    border-radius: 999px;
    background: #fff;
    font-size: .85em;
    color: var(--link);
}

.toc a:hover {
    border-color: var(--link);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .15);
}

.toc .count {
    color: #66707a;
    font-size: .8em;
}

/* wide screens: minimal fixed sidebar */
@media (min-width: 1140px) {

    .toc {
        position: fixed;
        top: 118px;
        left: max(14px, calc(50vw - 370px - 200px));
        width: 176px;
        max-height: 80vh;
        overflow-y: auto;
        z-index: 10;
        background: rgba(250, 250, 250, .95);
        border: 1px solid rgba(0, 0, 0, .1);
        border-radius: 8px;
        padding: .7rem .9rem;
        box-shadow: 0 2px 8px rgba(0, 0, 0, .3);
    }

    .toc h2 {
        margin: 0 0 .6rem;
        font-size: .72rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: .08em;
        color: var(--muted);
    }

    .toc ul {
        display: block;
        margin: 0;
    }

    .toc li {
        margin: 0;
    }

    .toc a {
        display: block;
        padding: .35rem .5rem;
        border: none;
        border-left: 2px solid var(--edge);
        border-radius: 0;
        background: transparent;
        font-size: .95rem;
        line-height: 1.35;
        color: #444;
    }

    .toc a:hover {
        border-left-color: var(--link);
        color: var(--link-hover);
        background: rgba(0, 102, 153, .1);
        box-shadow: none;
    }
}

/* ---------- categories ---------- */

@media (prefers-reduced-motion: no-preference) {

    html {
        scroll-behavior: smooth;
    }
}

.repo-category {
    margin-bottom: 3rem;
}

.repo-category h2 {
    scroll-margin-top: 7.5rem;
}

.category-description {
    color: #666;
    margin-bottom: 1rem;
}

.repo-table {
    width: 100%;
    border-collapse: collapse;
}

.repo-table th {
    text-align: left;
    padding: 0.75rem;
    border-bottom: 2px solid #ddd;
    font-size: .8em;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
}

.repo-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.repo-table td:first-child,
.repo-table td:last-child {
    white-space: nowrap;
    width: 1%;
}

.repo-table td:last-child {
    text-align: right;
}

.repo-table td:last-child img {
    display: block;
    height: 20px;
    max-width: none;
    margin: 0 0 .3rem auto;
}

.repo-table td:last-child img:last-child {
    margin-bottom: 0;
}

.repo-table th:last-child {
    text-align: right;
}

.repo-table tr:hover {
    background: #fafafa;
}

.repo-table a {
    font-weight: 600;
    text-decoration: none;
}

.repo-table a:hover {
    text-decoration: underline;
}

@media (max-width: 900px) {

    .repo-table {
        display: block;
        overflow-x: auto;
    }
}
