@import 'sphinx-book-theme.css';

html[data-theme="light"] {
    --pst-color-univention: rgb(208, 0, 2);
    --pst-color-primary: var(--pst-color-univention);
    --pst-color-inline-code: #e83e8c;
    --pst-color-link: var(--pst-color-univention);
    --pst-color-link-hover: var(--pst-color-univention);
    --pst-color-inline-code-links: var(--pst-color-univention);
    --pst-color-footer: #868686;
    --pst-color-text-base-footer: var(--pst-color-surface);
    --tabs--label-text--active: var(--pst-color-univention);
    --tabs--label-text--active--hover: var(--tabs--label-text--active);
    --tabs--label-border--active: var(--tabs--label-text--active);
    --tabs--label-border--active--hover: var(--tabs--label-text--active);
    --docsearch-searchbox-background: var(--pst-color-white);
}

html[data-theme="dark"] {
    --pst-color-univention: rgb(232,82,129);
    --pst-color-primary: var(--pst-color-univention);
    --pst-color-inline-code: #dd9ec2;
    --pst-color-link: var(--pst-color-univention);
    --pst-color-link-hover: var(--pst-color-univention);
    --pst-color-inline-code-links: var(--pst-color-univention);
    --pst-color-footer: #868686;
    --pst-color-text-base-footer: var(--pst-color-surface);
    --tabs--label-text--active: var(--pst-color-univention);
    --tabs--label-text--active--hover: var(--tabs--label-text--active);
    --tabs--label-border--active: var(--tabs--label-text--active);
    --tabs--label-border--active--hover: var(--tabs--label-text--active);
    --docsearch-searchbox-background: var(--pst-color-light);
}

a {
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

a:visited {
    color: var(--pst-color-secondary);
}

/* Fix scrollbar in Chrome
 * https://github.com/pydata/pydata-sphinx-theme/issues/1238
 *
 */
.sidebar-primary-items__end {
    margin-bottom: 0 !important;
    margin-top: 0 !important;
}

.navbar_extra_footer {
    text-align: center;
}

.site-title {
  font-size: var(--pst-font-size-h4);
  margin: 0.5em 0 0 0;
  text-align: center;
}

.bd-header .navbar-nav > p.sidebar-header-items__title {
  margin-bottom: 0;
  padding-right: 1em;
  font-weight:bold;
}

.navbar-nav > p.sidebar-header-items__title > a.nav-link {
    color: var(--pst-color-text-muted);
}

.navbar-nav > p.sidebar-header-items__title > a.nav-link:hover {
    color: var(--pst-color-link-hover);
    text-decoration: none;
}

.bd-header .navbar-nav > .active > .nav-link,
.bd-header .navbar-nav li a.nav-link:focus,
.bd-header .navbar-nav li a.nav-link:hover,
.navbar-nav li a:focus,
nav.bd-links .active > a {
  text-decoration: none;
}

.prev-next-area a {
    text-decoration: none;
}

.prev-next-area a p.prev-next-title {
    text-decoration: none;
}

.prev-next-area a:hover p.prev-next-title:hover {
    text-decoration-thickness: auto;
}

.bd-header .navbar-header-items__center {
    margin: 0 auto;
}

nav.bd-links .active:hover > a,
.navbar-nav li a:hover,
nav.bd-links li > a:hover,
.toc-entry a.nav-link:hover {
    text-decoration: none;
}

footer {
    font-size: 0.8em;
}

footer p,
footer > div.extra_footer {
    color: #868681;
}

a.reference.external:after {
    font-family: "Font Awesome 6 Free";
    font-weight: 600;
    content: "\f35d";
    font-size: 0.67em;
    padding-left: 0.33em;
}

a.image-reference:after {
    content: unset !important;
}

span.menuselection {
    font-style: italic;
}

span.guilabel {
    background-color: var(--pst-color-dark);
    border-color: var(--pst-color-dark-text);
    color: var(--pst-color-dark-text);
}

.tab-set > input:checked + label + .tab-content {
    width: 100%;
}

a.feedbacklink {
    font-size: 0.8em;
    float: right;
    clear: right;
    opacity: 0;
    transition: all .3s ease-out;
    vertical-align: bottom;
    padding: 5px 0;
}

h1:hover > a.feedbacklink,
h2:hover > a.feedbacklink,
h3:hover > a.feedbacklink,
h4:hover > a.feedbacklink,
h5:hover > a.feedbacklink,
h6:hover > a.feedbacklink {
    visibility: visible;
}

a.feedbacklink:hover {
    opacity: 1 !important;
}

a.feedbacklink > svg {
    color: rgba(var(--pst-color-link),1);
}

.tab-content {
    padding-bottom: .8em;
    border-bottom: 1px solid #e6e6e6;
}

blockquote.epigraph,
blockquote.pull-quote {
    border-left: .25em solid var(--pst-color-border);
}

/* Styles for the extra Univention footer */

.bd-footer {
  background-color: var(--pst-color-footer);
}

.bd-footer p,
.bd-footer div {
  color: var(--pst-color-text-base-footer);
  font-size: 0.9rem;
}

.univention-footer {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    column-gap: 11rem;
}

.univention-footer div {
    display: flex;
}

.univention-footer div:first-child {
    display: flex;
}

.univention-footer div:last-child {
    display: flex;
}

.univention-footer div a {
    color: var(--pst-color-text-base-footer);
}

.univention-footer div ul {
    list-style-type: none;
    padding-inline-start: 0;
    white-space: nowrap;
}

.bd-footer .footer-items__start {
    margin: 0 auto;
    flex-grow: unset;
}

div.versionadded p::before {
    opacity: 0.05;
}

.search-button-field {
    border: unset;
    box-shadow: inset 0 0 0 1px var(--pst-color-border);
}

.search-button-field:hover {
    border: unset;
    box-shadow: inset 0 0 0 2px var(--pst-color-link-hover);
}

/*
* CSS controlling the modal of typesense-docsearch
*/

@media screen, print {
  .DocSearch-Button-Keys,
  .DocSearch-Button-Placeholder {
    display: none;
  }
}

.DocSearch-Hit-source {
  color: var(--pst-color-univention);
}

.DocSearch-Hits mark {
  color: var(--pst-color-univention);
}

.DocSearch-Form {
  box-shadow: var(--pst-color-univention) 0px 0px 0px 2px inset;
}

.DocSearch-Hit[aria-selected="true"] a {
  background-color: var(--pst-color-univention);
}

.DocSearch-MagnifierLabel {
  color: var(--pst-color-univention);
}

.DocSearch-Reset:hover {
  color: var(--pst-color-univention);
}


.DocSearch-Button {
  margin: 0;
  background-color: unset;
}

.DocSearch-Button:hover,
.DocSearch-Button:active,
.DocSearch-Button:focus {
  box-shadow: var(--pst-color-univention) 0px 0px 0px 2px inset;
}

.DocSearch-Button .DocSearch-Search-Icon {
    color: var(--pst-color-text-base);
}

.DocSearch-Commands-Key {
    padding: 0 0 1px !important;
    margin-right: .4em !important;
    box-shadow: var(--docsearch-key-shadow) !important;
    border: 0 !important;
}

.DocSearch-Cancel {
  color: var(--bs-univention-red);
}

.DocSearch-Hit-content-wrapper {
  line-height: unset;
}

@media (min-width: 960px) {
    :root {
      --univention-header-height: 8rem;
      --docsearch-modal-height: calc(100vh - var(--univention-header-height) - var(--docsearch-footer-height));
    }

  .DocSearch-Modal {
    margin-top: var(--univention-header-height) !important;
  }
}

@media (min-width: 769px) and (max-width: 959px) {
    :root {
      --univention-header-height: 3.5rem;
      --docsearch-modal-height: calc(100vh - var(--univention-header-height) - var(--docsearch-footer-height));
    }

    .DocSearch-Dropdown {
    height: calc(
      var(--docsearch-vh, 1vh) * 100 -
      var(--univention-header-height) -
      var(--docsearch-searchbox-height) -
      var(--docsearch-spacing) -
      var(--docsearch-footer-height));
  }

  .DocSearch-Modal {
    margin-top: var(--univention-header-height) !important;
  }
}

@media (max-width: 768px) {
  :root {
    --univention-header-height: 3.5rem;
  }
  .DocSearch-Dropdown {
    height: calc(
      var(--docsearch-vh, 1vh) * 100 -
      var(--univention-header-height) -
      var(--docsearch-searchbox-height) -
      var(--docsearch-spacing) -
      var(--docsearch-footer-height));
  }

  .DocSearch-Modal {
    margin-top: var(--univention-header-height) !important;
    height: calc(100% - var(--univention-header-height));
  }

  .univention-footer {
    flex-direction: column;
  }

  .univention-footer div {
    justify-content: flex-start;
  }

  .univention-footer div:last-child {
    justify-content: flex-start;
  }

}
