@font-face { font-family: "Kawkab Mono"; src: url(/fonts/KawkabMono-Regular.woff2); font-weight: normal; }
@font-face { font-family: "Kawkab Mono"; src: url(/fonts/KawkabMono-Bold.woff2); font-weight: bold; }

* { unicode-bidi: plaintext; box-sizing: border-box; }
html { color: black; background: white; }
body {
    font-family: "Kawkab Mono";
    font-size: 16px;
    line-height: 1.4;
    margin: 0;
    padding: 4rem 0;
    min-height: 100%;
    overflow-wrap: break-word;
}
p { margin: 1em 0 0 0; }
hr { border: none; border-top: thin solid; margin: 1.25rem 0; }

/* form elements — match site font */
select, input, button, textarea {
    font-family: inherit;
    font-size: 0.85em;
    color: inherit;
    background: transparent;
    border: thin solid;
    padding: 0.2em 0.4em;
}
select { cursor: pointer; }
input[type="submit"], button { cursor: pointer; }
input[type="checkbox"] { background: revert; width: auto; padding: 0; }

/* full-width layout — cgit code viewer needs the space */
header, #cgit {
    padding: 0 1rem;
}

/* injected nav header (from header=/usr/share/webapps/cgit/header.html) */
header { margin-bottom: 0.75em; }
nav a { text-decoration: none; }

/* cgit's built-in header table — show only td.main as h1 */
table#header { display: block; width: 100%; margin-bottom: 1em; }
table#header tbody { display: block; }
table#header tr { display: block; }
table#header td { display: none; }
table#header td.main {
    display: block;
    font-size: 2em;
    font-weight: bold;
    text-align: center;
    padding: 0;
}
table#header td.main a { text-decoration: none; }

/* tab bar */
table.tabs {
    width: 100%;
    border-collapse: collapse;
    border-bottom: thin solid;
    margin-bottom: 1.5em;
}
table.tabs a { text-decoration: none; padding: 0.3em 1em; display: inline-block; }
// table.tabs td:first-child a + a::before { content: " - "; opacity: 0.4; }
table.tabs a.active { font-weight: bold; text-decoration: underline; }
table.tabs td.form { text-align: right; padding: 0 0.5em; }

/* commit decoration badges (HEAD, branch, tag labels) */
span.decoration { margin-left: 0.5em; }
span.decoration a {
    padding: 0.05em 0.3em;
    border: thin solid;
    font-size: 0.8em;
    opacity: 0.8;
    text-decoration: none;
}
span.decoration a + a { margin-left: 0.25em; }

/* repo index — <table class='list'> */
table.list {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1em;
}
table.list th {
    text-align: left;
    border-bottom: thin solid;
    padding: 0.3em 0.6em;
}
table.list td {
    padding: 0.3em 0.6em;
    vertical-align: top;
}
table.list tr:hover td { background: rgba(128,128,128,0.08); }
table.list tr.nohover:hover td { background: none; }

/* repo summary */
table#summary {
    border: thin solid;
    padding: 1em;
    margin-bottom: 1.5em;
    border-collapse: collapse;
    width: 100%;
}
table#summary td {
    padding: 0.2em 0.8em 0.2em 0;
    vertical-align: top;
}
table#summary td:first-child {
    opacity: 0.6;
    white-space: nowrap;
}

/* tree listing — space out the log/stats/plain/blame nav links */
table#files td a + a::before { content: " · "; opacity: 0.4; }

/* log, files, refs, blame */
table#log, table#files, table#refs, table#blame {
    width: 100%;
    border-collapse: collapse;
}
table#log th, table#files th, table#refs th, table#blame th {
    text-align: left;
    border-bottom: thin solid;
    padding: 0.3em 0.6em;
}
table#log td, table#files td, table#refs td, table#blame td {
    padding: 0.3em 0.6em;
    vertical-align: top;
}
table#log tr:hover td,
table#files tr:hover td { background: rgba(128,128,128,0.08); }

.num { text-align: right; opacity: 0.6; }
.id { font-size: 0.85em; opacity: 0.5; }
.age-label, .age-date { font-size: 0.85em; }

/* diff / blob */
pre { margin: 1em 0; overflow-x: auto; }
#blob { border: thin solid; padding: 1em; }
.diff-add { color: #007700; }
.diff-del { color: #cc0000; }
.diff-head { font-weight: bold; }

/* cgit's own footer line */
div.footer {
    margin-top: 3em;
    text-align: center;
    font-size: 0.75em;
    opacity: 0.5;
}

/* network footer — injected via footer= outside #cgit */
div.network-footer {
    padding: 0 1rem;
    margin: 0 0 2em;
    text-align: center;
}
div.network-footer hr {
    border: none;
    border-top: thin solid;
    margin-bottom: 0.75em;
}

@media (max-width: 600px) { body { font-size: 0.9em; } }
@media (max-width: 400px) { body { font-size: 0.8em; } }

@media (prefers-color-scheme: dark) {
    html { filter: invert(1); }
    img { filter: invert(1); }
}
