@charset "utf-8";

$computed-navbar-height: $navbar-height + $navbar-padding-vertical * 2;

@import "./adapters/_all.scss";
@import "./components/_all.scss";

$font-awesome-url: "https://use.fontawesome.com/releases/v5.15.4/css/all.css" !default;

@import url($font-awesome-url);

// Fix bug: On some browser the body is not placed at the right place
// This code should fix the issue
html {
    &.has-navbar-fixed-top {
        padding-top: 0;

        body {
            padding-top: 0;
            margin-top: $computed-navbar-height;
        }
    }
}

// If a footer is added via the footer partial
// We setup some specific rules allowing us to have
// the footer stick to the bottom when there are not a lot of content
// and otherwise it will be displayed under the page content as normal
// Adapted from: https://css-tricks.com/couple-takes-sticky-footer/#there-is-flexbox
body.has-footer {

    display: flex;
    flex-direction: column;

    @include tablet {
        height: calc(100vh - #{$computed-navbar-height});
    }

    @include mobile {
        height: calc(100vh - #{$computed-navbar-height + $navbar-height});
    }

    .page-content {
        flex: 1 0 auto;
    }

    .footer {
        flex-shrink: 0;
    }

}

// Remove bottom margin of the name of the project in the navbar otherwise a the navbar is distorted
.navbar-item.title.is-4 {
    margin-bottom: 0;
}

// Allow to add `is-active` class to navbar div item
.navbar-brand {
    div.navbar-item,
    a.navbar-item {
        &.is-active,
        &:hover {
            background-color: $navbar-item-hover-background-color;
            color: $navbar-item-hover-color;
        }
    }
}

// Add a space between an icon and the text
.icon + span {
    margin-left: 0.5rem;
}

span + .icon {
    margin-left: 0.5rem;
}

// Force the margin-left when using span+.icon in a button element
// otherwise the margin seems too small to me
.button span + .icon {
    margin-left: 0.5rem !important;
}

.visually-hidden {
    display: none !important;
}

// Disable Bulma .number class in code blocks
code .number {
    align-items: unset;
    background-color: unset;
    border-radius: unset;
    display: unset;
    font-size: unset;
    height: unset;
    justify-content: unset;
    margin-right: unset;
    min-width: unset;
    padding: unset;
    text-align: unset;
    vertical-align: unset;
}
