@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');

body,
div.log_link,
td.link,
td.selflink,
a.rss_logo {
  font-family: "Inter", system-ui, sans-serif;
}

div.page_body,
div.title_text,
table.diff_tree,
td.sha1,
td.pre,
div.pre,
div.diff,
td.mode,
td.size,
div.readme code {
  font-family: ui-monospace, monospace;
}

body {
  font-size: 16px;
  min-inline-size: min(100% - 22px, 1440px);
  inline-size: fit-content;
  margin-inline: auto;
}

input {
  outline: 2px solid transparent;
  outline-offset: 1px;
  transition: outline-color 400ms;
}

input:focus-within {
  transition: outline-color 200ms;
  outline-color: hsl(216deg 50% 40%);
}

input[name="s"],
input[name="btnS"] {
  font-size: 16px;
  border: 1px solid hsl(216deg 20% 50%);
  border-radius: 4px;
}

input[name="s"] {
  padding: 4px;
}

input[name="btnS"] {
  padding: 4px 6px;
  cursor: pointer;
}

table.project_list,
table.shortlog,
table.tags,
table.heads,
table.tree,
table.history,
table.commit_search,
table.search {
  inline-size: 100%;
}

table.project_list {

  & th,
  td {
    line-height: 2;
    padding-block: 8px;
    padding-inline: 4px 16px;
  }
}

div.page_header {
  height: unset;
}

/* Gitweb replaces all spaces in commit descriptions (log) with &nbsp; which will not wrap by default. */
div.log,
div.log_body,
div.page_body,
div.readme,
div.patch {
  overflow: auto;
  overflow-wrap: break-word;
  /* Otherwise body will stretch to fit longest line. */
  max-inline-size: min(100dvi - 38px, 1440px);
}

div.readme {
  & p {
    line-height: 24px;
  }

  & :not(pre) code {
    border: 1px solid transparent;
    border-radius: 4px;
    background: hsl(0deg 0% 95%);
    padding: 1px 3px 2px;
    hyphens: none;
  }

  & li {
    margin-block: 4px;

    & code {
      font-size: 0.9rem;
    }
  }

  & pre {
    padding: 16px;
    overflow-x: auto;
  }

  & table {
    border-collapse: collapse;
  }

  & th,
  & td {
    padding: 8px;
    border: 1px solid hsl(216deg 50% 10% / 0.5);
    text-align: revert;
  }

  & tr:nth-child(even) {
    background-color: hsl(216deg 50% 97% / 0.45);
  }

  & blockquote {
    color: #59636e;
    margin: 0;
    padding-inline-start: 16px;
    border-inline-start: 4px solid #d1d9e0;
  }
}

div.title_text {
  display: flex;
  align-items: center;
}

div.log_link {
  width: unset;
}

div.log_body {
  padding: 8px;
}

td.link,
td.selflink {
  font-size: 80%;
}

td.selflink {
  width: 0;
}

td.pre,
div.pre,
div.diff {
  font-size: 14px;
}

div.diff:is(.header, .extended_header, .from_file, .to_file, .chunk_header) {
  inset-inline-start: 0;
  position: sticky;
}

.markdown-alert-note {
  --alert-color: #0969da;
}

.markdown-alert-tip {
  --alert-color: #1a7f37;
}

.markdown-alert-important {
  --alert-color: #8250df;
}

.markdown-alert-warning {
  --alert-color: #9a6700;
}

.markdown-alert-caution {
  --alert-color: #cf222e;
}

.markdown-alert {
  padding: 8px 16px;
  margin-block-end: 16px;
  border-inline-start: 4px solid var(--alert-color);

  & p {
    margin: 0;
  }

  & .markdown-alert-title {
    color: var(--alert-color);
    font-weight: 700;
    margin-block-end: 16px;
  }
}
