@import "bootstrap/scss/mixins";
@import "bootstrap/scss/functions";
@import "bootstrap/scss/variables";
@import "../../pdh_variables.scss";

.pdh-header {
    background: linear-gradient(to bottom, #0d3f91 0%, #1b7bbc 100%);
    background: -webkit-linear-gradient(to bottom, #0d3f91 0%, #1b7bbc 100%);
    background: -moz-linear-gradient(to bottom, #0d3f91 0%, #1b7bbc 100%);
    background: -o-linear-gradient(to bottom, #0d3f91 0%, #1b7bbc 100%);
    background: -ms-linear-gradient(to bottom, #0d3f91 0%, #1b7bbc 100%);

    &.pdh-header-large {
        background: linear-gradient(to bottom, #0d3f91 0%, #02b8d0 100%);
        background: -webkit-linear-gradient(to bottom, #0d3f91 0%, #02b8d0 100%);
        background: -moz-linear-gradient(to bottom, #0d3f91 0%, #02b8d0 100%);
        background: -o-linear-gradient(to bottom, #0d3f91 0%, #02b8d0 100%);
        background: -ms-linear-gradient(to bottom, #0d3f91 0%, #02b8d0 100%);
        .navbar-brand {
            img {
                height: 2.25em;
            }
        }
    }

    .navbar-brand {
        img {
            width: auto;
            height: 2em;
        }
    }

    .navbar-toggler {
        background-color: transparent;
        border: none;
        box-shadow: none;
        padding: 0.5rem;
        border-radius: 0.25rem;
        &:focus {
            box-shadow: none;
            outline: none;
        }
        .navbar-toggler-icon {
            background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255,255,255,.8)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
        }
    }

    &:not(.pdh-header-large) {
        .search {
            max-width: 16em;
            height: 2.5em;
            align-self: center;
        }
    }

    .header-banner-container {
        .search-box {
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            width: 80%;
            max-width: 800px;
            .search {
                max-width: 100%;
            }
        }
    }
}

.pdh-header-background {
    background-image: url("../../images/pdh_pattern.svg");
    background-size: 35%;
    background-repeat: repeat-y;
    background-position: top 0 right 5rem;
    .nav-item {
        .bi {
            font-size: 1.5em;
        }
    }
    @include media-breakpoint-up(xl) {
        background-size: 420px;
        .navbar-nav {
            font-size: 105%;
        }
    }
    @include media-breakpoint-up(xxl) {
        .navbar-nav {
            font-size: 115%;
            & > .nav-item {
                padding-left: 0.5em;
            }
        }
    }
    .top-navbar {
        background-color: rgba($black, 0.2);
        div.nav-item {
            padding: 0.25em 0.75em;
        }
    }
    .header-banner-container {
        --bs-bg-opacity: 0.97;
    }
    .footer-container {
        --bs-bg-opacity: 0.96;
    }
}

/* OFFCANCAS */
.pdh-offcanvas {
    .offcanvas-header {
        img {
            width: auto;
            max-width: 80%;
            max-height: 56px;
        }
    }

    &.text-bg-dark {
        .btn-close {
            filter: var(--#{$prefix}btn-close-white-filter);
        }
    }
    &.show {
        .search {
            max-width: 100%;
            margin-bottom: 1em;
        }
        .navbar-nav {
            & > .nav-item {
                padding: 0.2em 0.5em;
                &:not(:first-child) {
                    border-top: 1px solid rgba(255, 255, 255, 0.2);
                }
                .nav-link.active {
                    color: $secondary;
                }
                .bi {
                    font-size: 1em;
                    margin-right: 0.5em;
                }
            }
        }
        .dropdown-menu {
            --bs-dropdown-border-width: 0;
            --bs-dropdown-bg: transparent;
            --bs-dropdown-link-color: white;
            --bs-dropdown-link-hover-color: white;
            --bs-dropdown-link-hover-bg: transparent;
            --bs-dropdown-link-active-bg: transparent;
        }

        /* Duplicated code to fix conflicts in Drupal - shall be removed later */
        // .nav-link {
        //     color: white;
        //     padding: var(--bs-nav-link-padding-y) var(--bs-nav-link-padding-x) !important;
        //     &:hover {
        //         color: white;
        //         background-color: transparent;
        //     }
        //     &.active {
        //         color: $secondary;
        //         background-color: transparent;
        //     }
        //     .dropdown-menu {
        //         .dropdown-item {
        //             padding: var(--bs-dropdown-item-padding-y) var(--bs-dropdown-item-padding-x);
        //         }
        //     }
        // }
    }
}

/* PDH TALL BANNER */
.header-banner-container {
    color: var(--bs-gray-100);
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    align-items: center;
    padding-top: 2rem;
    padding-bottom: 2rem;
    @include media-breakpoint-up(lg) {
        padding-top: 4rem;
        padding-bottom: 4rem;
    }

    // below classes are unused in storybook
    // and probably won't be used in the future
    // if we decide to remove the big title and highlight
    // from the header banner
    // but we keep them here for now

    .header-banner {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .header-banner-text {
        color: var(--bs-gray-100);
        text-align: center;
    }

    .header-banner-title {
        font-weight: 800;
        font-size: 72px;
        text-align: center;
    }

    .header-banner-highlight {
        color: var(--bs-yellow);
    }
}

// Dark mode (overrides)
// @include color-mode(dark) {
//     .pdh-header-background .navbar {
//         background-color: rgba($primary-dark, var(--bs-bg-opacity));
//     }
//     .pdh-header-background .top-navbar {
//         --bs-bg-opacity: 0.93;
//     }
// }
