/**
 * Copyright (C) 2018-2026  The Software Heritage developers
 * See the AUTHORS file at the top-level directory of this distribution
 * License: GNU Affero General Public License version 3, or any later version
 * See top-level LICENSE file for more information
 */

html {
    height: 100%;
    overflow-x: hidden;
    scroll-behavior: auto !important;
}

body {
    min-height: 100%;
    margin: 0;
    position: relative;
    overflow-y: clip;
}

/* Prevent scrolling of background when modal is opened */
body.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}


/* The Alegreya font used in swh-web ships some ligatures producing
confusing text rendering, for instance the ligatures for `~` and some
characters like e, y, u, ... so disable font common ligatures */
* {
    font-variant-ligatures: no-common-ligatures;
}

a:active,
a.active {
    outline: none;
}

a:focus-visible,
.page-item:focus-visible,
.page-link:focus-visible {
    outline:rgb(226 0 38 / 25%) 4px solid !important;
    z-index: 100;
}

.swh-top-bar a:focus-visible,
footer a:focus-visible {
    outline:rgb(226 0 38 / 75%) 3px solid !important;
}

code {
    background-color: #f9f2f4;
}

pre code {
    background-color: transparent;
}

footer {
    background-color: #262626 !important;
    color: #fff !important;
    font-size: 0.8rem;
    width: 100%;
    padding-top: 10px;
    padding-bottom: 10px;
}

footer a,
footer a:visited,
footer a:hover {
    color: #fecd1b;
}


pre {
    background-color: #f5f5f5;
    color: #212529;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 9.5px;
    font-size: 0.8rem;
}

.app-content {
    padding-top: 10px;
}

.app-main {
    overflow: hidden !important;
}

.btn.active {
    background-color: #e7e7e7;
}

.card {
    margin-bottom: 5px !important;
    overflow-x: auto;
}


.navbar-brand {
    padding: 5px;
    margin-right: 0;
}

.table {
    margin-bottom: 0;
}

.swh-table thead {
    background-color: #f2f4f5;
    border-top: 1px solid rgb(0 0 0 / 20%);
    font-weight: normal;
}

.swh-table-striped th {
    border-top: none;
}

.swh-table-striped tbody tr:nth-child(even) {
    background-color: #f2f4f5 !important;
}

.swh-table-striped tbody tr:nth-child(odd) {
    background-color: #fff !important;
}

.table > thead > tr > th {
    border-top: none;
    border-bottom: 1px solid #e20026;
}

.table > tbody > tr > td {
    border-style: none;
}

.sitename .first-word,
.sitename .second-word {
    color: rgb(0 0 0 / 75%);
    font-weight: normal;
    font-size: 1.2rem;
}

.sitename .first-word {
    font-family: "Alegreya Sans", sans-serif;
}

.sitename .second-word {
    font-family: Alegreya, serif;
}

.swh-counter {
    font-size: 150%;
}

@media (max-width: 600px) {
    .swh-counter-container {
        margin-top: 1rem;
    }
}

.swh-http-error {
    margin: 0 auto;
    text-align: center;
}

.swh-http-error-head {
    color: #2d353c;
    font-size: 30px;
}

.swh-http-error-code {
    bottom: 60%;
    color: #2d353c;
    font-size: 96px;
    line-height: 80px;
    margin-bottom: 10px !important;
}

.swh-http-error-desc {
    font-size: 12px;
    color: #647788;
    text-align: center;
}

.swh-http-error-desc pre {
    display: inline-block;
    text-align: left;
    max-width: 800px;
    white-space: pre-wrap;
}

.swh-list-unstyled {
    list-style: none;
}

.popover {
    max-width: 97%;
    z-index: 40000;
}

.modal {
    text-align: center;
    padding: 0 !important;
    z-index: 50000;
}

.modal::before {
    content: "";
    display: inline-block;
    height: 100%;
    vertical-align: middle;
    margin-right: -4px;
}

.modal-dialog {
    display: inline-block;
    text-align: left;
    vertical-align: middle;
}

.dropdown-submenu {
    position: relative;
}

.dropdown-submenu .dropdown-menu {
    top: 0;
    left: -100%;
    margin-top: -5px;
    margin-left: -2px;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: rgb(0 0 0 / 10%);
}

a.dropdown-left::before {
    content: "\f035e";
    font-family: "Material Design Icons";
    display: block;
    width: 20px;
    height: 20px;
    float: left;
    margin-left: 0;
}

.swh-navbar {
    border-style: solid;
    border-top-style: none;
    border-left-style: none;
    border-right-style: none;
    border-bottom-width: 5px;
    border-image:
        linear-gradient(
            to right,
            rgb(226 0 38) 0%,
            rgb(254 205 27) 100%
        )
        1 1 1 1;
    width: 100%;
    padding: 5px;
    margin-top: 30px;
    justify-content: normal;
    flex-wrap: nowrap;
    height: 72px;
    overflow: hidden;
}

.swh-navbar-banner {
    margin-top: 60px !important;
}

#back-to-top {
    display: none;
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 10;
}

#back-to-top a img {
    display: block;
    width: 32px;
    height: 32px;
    background-size: 32px 32px;
    text-indent: -999px;
    overflow: hidden;
}

.swh-top-bar {
    direction: ltr;
    height: 30px;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 99999;
    background-color: #262626;
    color: #fff;
    text-align: center;
    font-size: 14px;
}

.swh-top-bar ul {
    margin-top: 4px;
    padding-left: 0;
    white-space: nowrap;
}

.swh-top-bar li {
    display: inline-block;
    margin-left: 10px;
    margin-right: 10px;
}

.swh-top-bar a,
.swh-top-bar a:visited {
    color: white;
}

.swh-top-bar a.swh-current-site,
.swh-top-bar a.swh-current-site:visited {
    color: #fecd1b;
}

.swh-banner {
    height: 30px;
    position: fixed;
    top: 30px;
    left: 0;
    width: 100%;
    z-index: 99999;
    border: none;
}

.swh-banner .row {
    height: 30px;
    background-color: #fecd1b;
    color: #e20026;
    font-size: larger;
}

.swh-position-left {
    position: absolute;
    left: 0;
}

.swh-position-right {
    position: absolute;
    right: 0;
}

.swh-background-gray {
    background: #f6f5f4;
}

.swh-donate-link {
    border: 1px solid #fecd1b;
    background-color: #e20026;
    color: white !important;
    padding: 3px;
    border-radius: 3px;
}

.swh-navbar-content h4 {
    padding-top: 11px;
    padding-left: 15px;
}

.swh-navbar-content .bread-crumbs {
    display: block;
    margin-left: -40px;
}

.swh-navbar-content .bread-crumbs li.bc-no-root {
    padding-top: 0.7rem;
}

.app-sidebar {
    background: white;
    top: 30px !important;
    max-height: calc(100vh - 30px) !important;
}

.app-sidebar-banner {
    margin-top: 60px;
}

.content-wrapper {
    background: none;
}

.swh-push-menu {
    padding-top: 5px;
}

.sidebar-brand {
    padding-top: 18.5px;
    padding-bottom: 18px;
    padding-left: 4px;
    border-bottom: 5px solid #e20026 !important;
    height: 4.5rem;
    font-weight: 500;
}

.brand-image {
    max-height: 40px;
}

.sidebar-brand:hover,
.sidebar-brand:focus {
    color: #323232 !important;
    background-color: #e7e7e7 !important;
}

.sidebar-menu .nav-link p {
    padding-top: 5px;
}

.navbar-header a,
ul.dropdown-menu a,
ul.navbar-nav a,
ul.nav.sidebar-menu a {
    border-bottom-style: none;
    color: #323232;
}

.nav.sidebar-menu .nav-icon

.nav-tabs .nav-link.active {
    border-top: 3px solid #e20026;
}

.swh-menu-item .nav-icon {
    color: #e20026 !important;
}

.swh-admin-menu-item .nav-icon {
    color: #fecd1b ! important;
}

.swh-notification-icon {
    color: #e20026 !important;
    transform: translate(8px, -6px);
}

.swh-sidebar .nav-link.active,
.swh-sidebar .nav-link:focus {
    color: #323232 !important;
    background-color: #e7e7e7 !important;
}

.swh-image-error {
    width: 80px;
    height: auto;
}

@media (max-width: 600px) {
    .card {
        min-width: 80%;
    }

    .swh-image-error {
        width: 40px;
        height: auto;
    }

    .swh-donate-link {
        display: none;
    }
}

.swhid {
    white-space: pre-wrap;
}

.swhid .swhid-option {
    display: inline-block;
    margin-right: 5px;
    line-height: 1rem;
}

.nav-pills .nav-link:not(.active):hover {
    color: rgb(0 0 0 / 55%);
}

.swh-heading-color {
    color: #e20026 !important;
}

.sidebar-mini.sidebar-collapse .app-sidebar:hover {
    width: 4.6rem;

    /* ensure collapsed sidebar is not automatically expanded when hovering it */
    min-width: 4.6rem;
    max-width: 4.6rem;
}

.sidebar-mini.sidebar-collapse .brand-text {
    display: none !important;
}

.sidebar-mini.sidebar-collapse .app-sidebar:hover .user-panel > .info,
.sidebar-mini.sidebar-collapse .app-sidebar:hover .nav.sidebar-menu .nav-link p,
.sidebar-mini.sidebar-collapse .app-sidebar:hover .brand-text {
    visibility: hidden !important;
}

.sidebar-mini.sidebar-collapse .app-sidebar .nav-header {
    display: none;
}

.swh-words-logo {
    position: absolute;
    top: 0;
    left: 0;
    width: 73px;
    height: 73px;
    text-align: center;
    font-size: 10pt;
    color: rgb(0 0 0 / 75%);
    pointer-events: none;
}

.swh-words-logo:hover {
    text-decoration: none;
}

.swh-words-logo-swh {
    line-height: 1;
    padding-top: 13px;
    visibility: hidden;
}

.sidebar-collapse .swh-words-logo-swh {
    visibility: visible;
}

.sidebar-open .swh-words-logo-swh {
    visibility: hidden;
}

.sidebar-open .sidebar-wrapper {
    padding-left: 1.5rem;
}

hr.swh-faded-line {
    border: 0;
    height: 1px;
    background-image: linear-gradient(to left, #f0f0f0, #8c8b8b, #f0f0f0);
}

/* Ensure that section title with link is colored like standard section title */
.swh-readme h1 a,
.swh-readme h2 a,
.swh-readme h3 a,
.swh-readme h4 a,
.swh-readme h5 a,
.swh-readme h6 a {
    color: #e20026;
}

/* Make list compact in reStructuredText rendering */
.swh-rst li p {
    margin-bottom: 0;
}

.swh-readme-txt pre {
    background: none;
    border: none;
    white-space: pre-wrap;
}

.swh-coverage {
    padding-top: 0.3rem;
    border: none;
    overflow: visible;
}

.swh-coverage a {
    text-decoration: none;
}

.swh-coverage-col {
    padding-left: 10px;
    padding-right: 10px;
}

.swh-coverage-header {
    padding-top: 0;
    padding-bottom: 0;
}

.swh-coverage-logo {
    display: block;
    width: 100%;
    height: 50px;
    margin-left: auto;
    margin-right: auto;
    object-fit: contain;

    /* polyfill for old browsers, see https://github.com/bfred-it/object-fit-images */
    font-family: "object-fit: contain;";
}

.swh-coverage-iframe {
    width: 100%;
    height: 640px;
    border: none;
}

.swh-coverage-chevron {
    position: absolute;
    right: 0;
}

.swh-coverage .card-header .mdi {
    transition: 0.3s transform ease-in-out;
}

.swh-coverage .card-header .collapsed .mdi {
    transform: rotate(90deg);
}

.swh-coverage-info-body {
    max-height: 150px;
    overflow: auto hidden;
    scrollbar-width: thin; /* Firefox only */
    padding: 0;
}

/* Thin scrollbar for chromium based browsers */

.swh-coverage-info-body::-webkit-scrollbar {
    width: 4px;
}

.swh-coverage-info-body::-webkit-scrollbar-track {
    background: #eff0f1;
}

.swh-coverage-info-body::-webkit-scrollbar-thumb {
    background: #909396;
}

tr.swh-tr-hover-highlight:hover td {
    background: #ededed;
}

tr.swh-api-doc-route a {
    text-decoration: none;
}

.swh-apidoc .col {
    margin: 10px;
}

.swh-apidoc .swh-rst blockquote {
    border: 0;
    margin: 0;
    padding: 0;
}

a.toggle-col {
    text-decoration: none;
}

a.toggle-col.col-hidden {
    text-decoration: line-through;
}

.admonition.warning {
    background: #fcf8e3;
    border: 1px solid #faebcc;
}

.admonition.note {
    background: #dce7fc;
    border: 1px solid #c3d6fa;
}

.admonition.important {
    background: hsl(28.5deg 74% 90%);
    border: 1px solid hsl(28.5deg 74% 50%);
}

.admonition.warning,
.admonition.note,
.admonition.important {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.admonition.warning p,
.admonition.note p,
.admonition.important p {
    margin-bottom: 0;
}

.admonition-title {
    font-weight: bold;
}

.admonition-title::before {
    display: block;
    width: 20px;
    height: 20px;
    float: left;
    margin-left: 0;
}

.admonition.warning .admonition-title::before {
    content: "\f0026";
    font-family: "Material Design Icons";
}

.admonition.note .admonition-title::before {
    content: "\f02fc";
    font-family: "Material Design Icons";
}

.admonition.important .admonition-title::before {
    content: "\f0238";
    font-family: "Material Design Icons";
}

.swh-popover {
    max-height: 50vh;
    overflow: auto;
    padding: 0;
}

@media screen and (min-width: 768px) {
    .swh-popover {
        max-width: 50vw;
    }
}

.swh-popover pre {
    white-space: pre-wrap;
    margin-bottom: 0;
}

.d3-wrapper {
    position: relative;
    height: 0;
    width: 100%;
    padding: 0;

    /* padding-bottom will be overwritten by JavaScript later */
    padding-bottom: 100%;
}

.d3-wrapper > svg {
    position: absolute;
    height: 100%;
    width: 100%;
    left: 0;
    top: 0;
}

div.d3-tooltip {
    position: absolute;
    text-align: center;
    width: auto;
    height: auto;
    padding: 2px;
    font: 12px sans-serif;
    background: white;
    border: 1px solid black;
    border-radius: 4px;
    pointer-events: none;
}

.page-link {
    cursor: pointer;
}

.wrapper {
    overflow: hidden;
}

/* Material Design icons alignment tweaks */

.mdi {
    display: inline-block;
}

.mdi-camera {
    transform: translateY(1px);
}

.mdi-source-commit {
    transform: translateY(2px);
}

/* To set icons at a fixed width. Great to use when different
   icon widths throw off alignment. Courtesy of Font Awesome. */
.mdi-fw {
    text-align: center;
    width: 1.25em;
}

.mdi-stack {
    position: relative;
    display: inline-block;
    width: 1em;
    height: 1em;
    line-height: 1em;
    vertical-align: middle;
}

.mdi-stack .mdi {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    text-align: center;
}

.main-header .nav-link {
    height: inherit;
}

.nav.sidebar-menu .nav-header:not(:first-of-type) {
    padding-top: 1rem;
}

.nav.sidebar-menu .nav-link {
    padding-top: 0;
    padding-bottom: 0;
}

.nav.sidebar-menu > .nav-item .nav-icon {
    vertical-align: sub;
}

.swh-search-icon {
    line-height: 1rem;
    vertical-align: middle;
}

.swh-search-navbar {
    position: absolute;
    top: 1rem;
    right: 4rem;
    z-index: 50000;
    width: 500px;
}

.swh-corner-ribbon {
    width: 200px;
    background: #f6f5f4;
    color: #e20026;
    position: absolute;
    text-align: center;
    letter-spacing: 1px;
    box-shadow: 0 0 3px rgb(0 0 0 / 30%);
    top: 28px;
    right: -50px;
    left: auto;
    transform: rotate(45deg);
    z-index: 1000;
}

.swh-corner-ribbon-banner {
    top: 85px;
}

@media screen and (max-width: 600px) {
    .swh-corner-ribbon {
        top: 24px;
        right: -55px;
    }
}

.invalid-feedback {
    font-size: 100%;
}

.swh-required-label::after {
    content: "*";
    color: #f00;
}

.docutils.literal {
    background-color: #f9f2f4;
    color: #c7254e;
    font-family: monospace;
}

.swh-text-under-logo, .swh-mirror-text-under-logo {
    position: absolute;
    top: 45px;
}

.swh-text-under-logo {
    left: 30px;
}

.swh-mirror-text-under-logo {
    left: 33px;
}

.sidebar-collapse .swh-text-under-logo {
    left: 15px;
}

.sidebar-collapse .swh-mirror-text-under-logo {
    left: 17px;
}

.swh-mirror-partner-logo {
    position: absolute;
    top: 0;
    right: 47rem;
    z-index: 50000;
    height: 100%;
}

.sidebar-collapse .swh-mirror-partner-logo {
    right: 36rem;
}

.swh-mirror-partner-logo-no-search {
    right: 15rem;
}

.sidebar-collapse .swh-mirror-partner-logo-no-search {
    right: 5rem;
}

.sidebar-collapse .swh-origin-save-link .mdi-open-in-new,
.sidebar-collapse .swh-add-forge-now-link .mdi-open-in-new {
    position: absolute;
    left: 35px;
    top: 5px;
}

#swh-web-api-link {
    color: #e20026;
}

p a {
    text-decoration: underline;
}

.skipnav {
    text-align: left;
}

.skipnav a {
    position: absolute;
    left: -10000px;
    top: 5px;
    width: auto;
    height: auto;
    text-decoration: underline;
    background: black;
    color: white;
    z-index: 100000;
}

.skipnav a:focus,
.skipnav a:active {
    left: 5px;
}

#swh-login,
#swh-logout {
    text-decoration: underline;
}

#swh-logout-form {
    display: inline;;
}

#swh-logout-form button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    color: white !important;
}

.select-no-arrows {
    background: none !important;
}



