/* Tema por defecto de Forgejo: el CSS "I Can't Believe It's Not GitHub" (abajo,
   CC0, gist qwertychouskie/0d34ac3a0677c6fe1d9b636b32e6c38b) sobre gitea-auto,
   que es el tema con el que se hizo. Se revisa después de cada actualización de
   Forgejo. */
@import "./theme-gitea-auto.css";

/*
==UserCSS==
@name             I Can't Believe It's Not GitHub™
@description      A CSS stylesheet for Forgejo that makes it look and feel a bit more like GitHub
@match            *://codeberg.org/*
@version          1.1
@author           QwertyChouskie
@license          CC0
@homepage         https://www.reddit.com/r/forgejo/comments/1x0efsw/i_cant_believe_its_not_github_css_theme/
==/UserCSS==
*/

:root {
  --color-green: #1f833d;
}
.primary.button {
  background-color: #238636 !important;
}
.button.primary:hover, .button.primary:focus {
  background-color: #29903b !important;
}
.ui.secondary.pointing.menu .active.item {
  border-color: #f78166 !important;
}
.issue-state-label {
  border-radius: 624.938rem !important;
}
.issue-content-right.ui.segment {
  border: none;
  position: sticky;
  top: 0;
  font-size: 0.85rem;
}
::selection, relative-time::part(relative-time)::selection, absolute-date::part(absolute-date)::selection {
  background-color: Highlight !important;
  color: HighlightText !important;
}
.page-content .ui.ui.ui.container:not(.fluid) {
  padding: 0 1.5em;
}
div:has(#navbar):not(:has(.dashboard)) > #navbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: transparent;
  height: 58px;
  border: none;
  pointer-events: none;
}
div:has(#navbar):not(:has(.dashboard)) > #navbar > div {
  pointer-events: all;
}
div:has(#navbar):not(:has(.dashboard)) > #navbar > .navbar-left > a:not(:first-child) {
  display: none;
}
.page-content:not(.dashboard) .secondary-nav .repo-header {
  padding-inline-start: max(0px, calc(76px  - (100vw - 100%) / 2));
  padding-inline-end:   max(0px, calc(186px - (100vw - 100%) / 2));
}
#issue-pins {
  margin-bottom: 1rem;
}
#issue-filters {
  background-color: #f6f8fa;
  border: 1px solid #d1d9e0b3;
  border-top-left-radius: 0.375rem;
  border-top-right-radius: 0.375rem;
}
#issue-filters .issue-list-toolbar-left .switch {
  border: none;
  margin-left: 3px;
}
#issue-list {
  border: 1px solid #d1d9e0b3;
  border-bottom-left-radius: 0.375rem;
  border-bottom-right-radius: 0.375rem;
  border-top: none;
}
#issue-list > div {
  padding: 10px;
}
#pull-desc-display > code > a {
  background-color: #388bfd1a;
  color: #4493f8;
  padding: 0.125rem 0.375rem;
  border-radius: 0.375rem;
}
#pull-desc-display > a, .issue-title-meta .time-desc > a {
  color: inherit;
  text-decoration: underline;
  font-weight: 600;
}
#pull-desc-display > a:hover, .issue-title-meta .time-desc > a:hover {
  color: #4493f8;
}
.issue-content-right .ui.button {
  padding: .5em 1.5em;
}

.diff-stats-bar {
  border-radius: 2px;
}
.diff-stats-add-bar {
  border-top-left-radius: 2px;
  border-bottom-left-radius: 2px;
}

#comment-form, #new-issue .content {
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}
#new-issue .content > .field:first-child {
  margin: 10px;
  flex: 1 0;
}
#comment-form > .field:first-child, #new-issue .content > .field:has(.combo-markdown-editor) {
  margin: 0;
  flex: 0 0 100%; /* editor field takes the whole first row */
}
.combo-markdown-editor markdown-toolbar {
  background-color: var(--color-box-header);
  height: 39px;
  padding: 0 7px 0 0;
  border: 1px solid var(--color-secondary);
  margin: -1px;
}
.field:first-child .combo-markdown-editor markdown-toolbar {
  border-top-left-radius: 4px;
  border-top-right-radius: 4px;
}
.combo-markdown-editor markdown-toolbar .switch {
  border: none;
  background: none;
  height: 39px;
  margin: -1px;
}
.combo-markdown-editor markdown-toolbar .switch .item {
  color: var(--color-text-light);
  height: 100%;
  outline: none;
  background-clip: padding-box;
  border: 1px solid transparent;
  border-bottom: 0 !important;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
.combo-markdown-editor markdown-toolbar .switch .item.active {
  color: var(--color-text);
  background: var(--color-body);
  border: 1px solid var(--color-input-border);
}
.combo-markdown-editor markdown-toolbar .markdown-toolbar-button {
  color: var(--color-text-light);
  padding: 6px 8px;
  border-radius: 0.375rem;
}
.combo-markdown-editor markdown-toolbar .markdown-toolbar-button:hover {
  background-color: var(--color-hover);
  color: inherit;
}
.combo-markdown-editor .markdown-toolbar-group:nth-child(2) {
  flex: 1;
  justify-content: flex-end;
}
.combo-markdown-editor .markdown-toolbar-group:nth-child(3)::after,
.combo-markdown-editor .markdown-toolbar-group:nth-child(4)::after {
  position: relative;
  content: "";
  width: 1px;
  height: 20px;
  margin: 6px 1px 6px 8px;
  background-color: var(--color-secondary);
}
.combo-markdown-editor .markdown-toolbar-group:last-child {
  flex: unset;
}
.combo-markdown-editor > div {
  margin: 10px;
}
.repository.view.issue .comment-list .comment .ui.form .field .tab.markup,
.repository.new.issue .ui.form .field .tab.markup {
  min-height: 132px;
  padding: 11px 15px;
}
.repository.view.issue .comment-list .comment .ui.form .field .tab.markup:empty::before,
.repository.new.issue .ui.form .field .tab.markup:empty::before {
  content: 'Nothing to preview';
}
#comment-form > .field:nth-last-child(2), #new-issue .content > .field:nth-last-child(2) {
  margin: 10px;
  margin-top: 0;
  flex: 1 1 0;
}
.ui .field .dropzone .dz-message {
  margin: 6px 0;
  line-height: 20px;
}
#comment-form .field.footer, #new-issue .content > div:last-child {
  margin: 10px;
  margin-top: 0;
  flex: 1 1 auto;
}
#new-issue .content > div:last-child button {
  min-height: var(--button-min-height);
  padding-block: 0;
  padding-inline: var(--button-padding-inline);
}
.repository .comment.form .content .form::before {
  z-index: 3;
}
.repository .comment.form .content .form::after {
  border-width: 7.5px;
  margin-top: -7.5px;
  z-index: 3;
}
.repository .comment.form .content .form:has(.markdown-toolbar-hidden)::after {
  border-inline-end-color: var(--color-box-header);
}

@media(prefers-color-scheme:dark) {
  :root {
/*    --color-primary: #238636; */
/*    --color-primary-light-1: #29903b; */
    --color-secondary: #3d444d;
    --color-green: #238636;
    --color-body: #0d1117;
    --color-box-header: #151b23;
    --color-box-body: #0d1117;
    --color-nav-bg: #010409;
    --color-secondary-nav-bg: #010409;
    --color-input-background: var(--color-body);
    --color-text: #f0f6fc;
    --color-text-light: #9198a1;
    --color-text-light-1: #9198a1;
    --color-text-light-2: #9198a1;
    --color-tooltip-bg: #3d444d;
    --color-hover: #656c7633;
  }
  a, a:hover {
    color: #4493f8;
  }
  .flex-item a:not(.label, .button):hover {
    color: #4493f8 !important;
  }
  #issue-filters {
    background-color: #151b23;
    border: 1px solid var(--color-secondary);
    border-bottom: none;
  }
  #issue-list {
    border: 1px solid var(--color-secondary);
  }
  .page-footer {
    color: var(--color-grey-light);
  }
}
