/* cgit.css - Modern Light Theme */

:root {
    color-scheme: light;
    --bg: #fff;
    --surface: #f6f8fa;
    --text: #24292f;
    --muted: #57606a;
    --border: #d0d7de;
    --link: #0969da;
    --link-hover: #0550ae;
    --green: #1a7f37;
    --red: #cf222e;
}

* {
    box-sizing: border-box;
}

html {
    font-size: 14px;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    padding: 24px;
    background: var(--bg);
    color: var(--text);
    font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

a {
    color: var(--link);
    text-decoration: none;
}

a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

/* Main layout */

#cgit {
    width: 100%;
    max-width: 1280px;
    min-width: 0;
    margin: 0 auto;
}

#cgit table {
    width: 100%;
    border-collapse: collapse;
}

#cgit td,
#cgit th {
    padding: 9px 12px;
    vertical-align: top;
}

#cgit a+a {
    margin-left: .5rem;
}

#cgit img {
    max-width: 100%;
    height: auto;
}

/* Header and navigation */

#cgit table#header {
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

#cgit #header td.logo {
    width: 64px;
}

#cgit #header td.logo img {
    max-width: 64px;
}

#cgit #header td.main {
    font-size: 20px;
    font-weight: 600;
}

#cgit #header td.sub {
    color: var(--muted);
    font-size: 13px;
}

#cgit table.tabs {
    margin: 16px 0;
    border-bottom: 1px solid var(--border);
}

#cgit .tabs td {
    padding: 10px 14px;
}

#cgit .tabs a {
    display: inline-block;
    padding: 4px;
    color: var(--muted);
    font-weight: 500;
}

#cgit .tabs a.active {
    border-bottom: 2px solid var(--link);
    color: var(--text);
    font-weight: 600;
}

/* Repository list */

#cgit table.list {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 6px;
}

#cgit .list th {
    background: var(--surface);
    color: var(--muted);
    font-weight: 600;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

#cgit .list td {
    border-bottom: 1px solid var(--border);
}

#cgit .list tr:last-child td {
    border-bottom: 0;
}

#cgit .list tr:hover td {
    background: var(--surface);
}

#cgit .list td a {
    font-weight: 500;
}

/* Forms */

#cgit form {
    text-align: right;
}

#cgit input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]),
#cgit select,
#cgit button {
    max-width: 100%;
    min-height: 32px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: var(--bg);
    color: var(--text);
    font: inherit;
    line-height: 1.2;
    vertical-align: middle;
    font-size: 13px;
}

#cgit select {
    -webkit-appearance: none;
    appearance: none;
    padding-right: 32px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%2357606a' stroke-width='2'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

#cgit input:focus,
#cgit select:focus,
#cgit button:focus {
    outline: 2px solid var(--link);
    outline-offset: 1px;
}

#cgit input[type="submit"],
#cgit input[type="button"],
#cgit input[type="reset"],
#cgit button {
    background: var(--surface);
    cursor: pointer;
    font-weight: 600;
}

#cgit input[type="submit"]:hover,
#cgit input[type="button"]:hover,
#cgit input[type="reset"]:hover,
#cgit button:hover {
    background: #eef1f4;
}

#cgit form select+input[type="submit"],
#cgit form select+button {
    margin-left: 6px;
}

/* Commit information */

#cgit table.commit-info {
    margin: 16px 0;
    border: 1px solid var(--border);
}

#cgit .commit-info th {
    width: 120px;
    background: var(--surface);
    color: var(--muted);
    text-align: left;
}

#cgit .commit-info td {
    overflow-wrap: anywhere;
}

/* Source and diff tables */

#cgit .content {
    margin-top: 16px;
}

#cgit .decoration a {
    padding: 0 4px;
}

#cgit table.blob,
#cgit table.ssdiff {
    border: 1px solid var(--border);
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    font-size: 13px;
}

#cgit .blob td,
#cgit .ssdiff td {
    padding: 0 8px;
    white-space: pre;
}

#cgit .blob td.linenumbers {
    width: 1%;
    border-right: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    text-align: right;
    user-select: none;
}

#cgit .blob td.lines {
    overflow-x: auto;
}

#cgit div.add,
#cgit span.add {
    background: #dafbe1;
    color: var(--green);
}

#cgit div.del,
#cgit span.del {
    background: #ffebe9;
    color: var(--red);
}

#cgit div.hunk {
    background: #ddf4ff;
    color: #0550ae;
}

/* Readme and footer */

#cgit .readme {
    overflow-x: auto;
    margin-top: 20px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 6px;
}

#cgit .readme h1,
#cgit .readme h2 {
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

#cgit .footer {
    margin-top: 32px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 12px;
}

/* Responsive layout */

@media (max-width: 768px) {
    body {
        padding: 8px;
    }

    #cgit table#header,
    #cgit table.tabs {
        display: block;
        width: 100%;
    }

    #cgit #header tbody,
    #cgit #header tr,
    #cgit .tabs tbody {
        display: block;
    }

    #cgit #header tr {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
    }

    #cgit #header td {
        display: block;
        width: auto;
    }

    #cgit #header td.main {
        flex: 1 1 0;
        min-width: 0;
        padding: 4px 8px;
        font-size: 18px;
        overflow-wrap: anywhere;
    }

    #cgit #header td.logo {
        flex: 0 0 40px;
        width: 40px;
        padding: 4px;
    }

    #cgit #header td.logo img {
        display: block;
        width: 32px;
        max-width: 32px;
    }

    #cgit #header td.sub {
        flex: 0 0 100%;
        padding: 0 4px 6px 44px;
        font-size: 12px;
        overflow-wrap: anywhere;
    }

    #cgit table#header {
        margin-bottom: 10px;
    }

    #cgit .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    #cgit .tabs tr {
        display: flex;
        flex-wrap: nowrap;
        width: max-content;
        min-width: 100%;
    }

    #cgit .tabs td {
        padding: 8px 10px;
        white-space: nowrap;
    }

    #cgit table.list,
    #cgit table.blob,
    #cgit table.ssdiff {
        display: block;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    #cgit table.list {
        white-space: nowrap;
    }

    #cgit table.list > tbody,
    #cgit table.blob > tbody,
    #cgit table.ssdiff > tbody {
        display: table;
        width: 100%;
    }

    #cgit table.blob {
        font-size: 12px;
    }

    #cgit .footer {
        text-align: center;
    }
}
