/* 
 * Gitbrowse: a simple web server for git.
 * Copyright (C) 2026 Vithushan
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
*/

/* I'm HORRIBLE at plain css, so you really should write your own */

@import url("/static/git-show.css");
@import url("/static/code.css");
@import url("/static/custom.css");

* {
  border-color: #504945;
}
a, a:visited {
  color: #689d6a;
  line-height: 1;
  text-decoration-line: underline;
  text-underline-offset: 2px;
  transition-property: all;
  transition-duration: 150ms;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}
a:hover {
  background-color: #689d6a;
  color: #282828 !important;
  text-decoration-color: #689d6a;
}
body {
  color: #ebdbb2;
  overflow-x: hidden;
  margin: 0;
  width: full;
  height: full;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
}
html {
  background-color: #1d2021;
  overflow-x: hidden;
}
input,
textarea {
  background-color: #282828;
  color: #ebdbb2;
}
blockquote,
pre {
  background-color: #282828;
  color: #ebdbb2;
}

main {
  max-width: 110ch;
  width: 100%;
  background-color: #1d2021;
  text-wrap: auto;
  overflow-x: hidden;
  padding: 1rem;
}

code {
  color: #ebdbb2;
  background-color: #282828;
  padding: 0.2rem;
}

img {
  max-width: 100%;
}

header {
  max-width: 110ch;
  width: 100%;
  background-color: #1d2021;
  padding: 1rem;
}

header img {
  max-height: 100px;
  height: auto;
}

header h1 {
  text-align: left;
  font-size: 1.5rem;
}

table {
  border-collapse: collapse;
}

table.breadcrumbs {
  width: fit-content;
  border-collapse: collapse;
  margin-bottom: 1rem;
}

table,
th,
td {
  border-width: 1px;
  border-style: solid;
  padding: 5px;
  text-align: left;
}

td:has(table) {
  padding: 0;
}

table.subtable {
  border: none;
}

table.subtable td {
  border-top: none;
  border-bottom: none;
}

table.subtable td:first-child {
  border-left: none;
}

table.subtable td:last-child {
  border-right: none;
}

pre {
  padding: 1rem;
  border-width: 1px;
  border-style: solid;
  font-family: monospace;
  word-wrap: break-word;
  text-wrap: auto;
}

.isbinary {
  font-family: monospace;
}

.isbinary#sub {
  color: #d8a657;
}

.isbinary#bin {
  color: #be5046;
}

.tree-dir {
  color: #8ec07c;
}

.tree-dir a {
  color: #8ec07c;
}

div.search {
  margin-bottom: 1rem;
}

.search-form {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 5px;
  margin-top: 0.5rem;
  width: 100%;
}

input,
button {
  background-color: #282828;
  border: 1px solid #504945;
  color: #ebdbb2;
  padding: 0.25rem 0.5rem;
}

button {
  cursor: pointer;
}

.search-form input[type="text"] {
  flex-grow: 1;
}

.search-results td {
  font-family: monospace;
}

td.search-content {
  word-break: break-all;
}

td.mintd {
  width: 1px;
}

::selection {
  background-color: #689d6a;
  color: #1d2021;
}

@media (min-width: 768px) {
  main {
    margin-top: 2rem;
    margin-bottom: 2rem;
    padding: 2rem;
  }
  body {
    padding: 2rem;
  }
  header {
    max-width: 110ch;
    width: 100%;
    background-color: #1d2021;
    padding: 2rem;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
  }
  table {
    width: 100%;
  }
  html {
    background-image: url("/static/background.jpg");
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
  }
}

@media (max-width: 768px) {
  table {
    display: block;
    width: 100%;
    overflow-x: scroll;
    border: none;
  }
  header img {
    max-height: 50px;
  }
  table.breadcrumbs tr {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
  }
  table.nav tr {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
  }
  header * {
    word-break: break-all;
  }
}
