@import "base";
@import "compontents/carousel";
@import "compontents/feature";
@import "../../node_modules/animate-scss/_fading-entrances/fadeIn";


@mixin section-variant($bg-color, $fg-color) {
    background: $bg-color;
    color: $fg-color;

    > .container > header hr,
    .section-title-divider {
        border-color: $fg-color;
    }
    .section-title { color: $fg-color; }
    .section-divider {
        border-top: inset $fg-color;
    }
}

@mixin carousel-slide($slideName, $slideExt) {
    $prefix: '/assets/img/slides/slide-';
    background-image: url($prefix + $slideName + '-576.' + $slideExt);
    @include media-breakpoint-up(sm) {
        background-image: url($prefix + $slideName + '-768.' + $slideExt);
    }
    @include media-breakpoint-up(md) {
        background-image: url($prefix + $slideName + '-922.' + $slideExt);
    }
    @include media-breakpoint-up(lg) {
        background-image: url($prefix + $slideName + '-1200.' + $slideExt);
    }
    @include media-breakpoint-up(xl) {
        background-image: url($prefix + $slideName + '-2000.' + $slideExt);
    }
}

%section-title {
    > .container > header hr,
    .section-title-divider {
        width: 120px;
        border: 1px dashed #000000;
    }

    .section-title {
        text-align: center;
        margin-top: 0;
        &:after {
            content: '.';
            font-weight: bold;
            color: $color-codex;
            margin-left: 2px;
        }
    }
}

.page-welcome {

    .c-header {
        position: fixed;
        z-index: 99;
        top: 0;
        left: 0;
        background-color: rgba($header-bg-color, 0.7);
    }

    .c-page {
        padding: 0;
        h2:not(.featurette-heading) {
            font-weight: normal;
            margin-top: 1.5rem;
        }
        .col-lg-4 {
            margin-bottom: 1.5rem;
            text-align: center;
        }
        .col-lg-4 p {
            margin-right: .75rem;
            margin-left: .75rem;
        }
    }

    .c-section {
        > .container {
            padding-top: 4rem;
            padding-bottom: 4rem;
        }
        > header,
        > .container > header {
            margin-bottom: 5rem;
        }

        @extend %section-title;

        .section-divider {
            margin: 5rem 0; /* Space out the Bootstrap <hr> more */
        }

        &.c-section-light {
            @include section-variant($section-variant-light-bg, $section-variant-light-fg);
        }
        &.c-section-dark {
            @include section-variant($section-variant-dark-bg, $section-variant-dark-fg);
        }
    }

    .c-footer {
        height: auto;
        padding-top: 30px;
        @extend %section-title;
        @include section-variant($footer-bg-color, $footer-font-color);

        .section-title { text-align: left; }
        .section-title-divider {
            width: 100%;
            border-top: none;
        }

        p { font-size: 1rem; }

        .copyright {
            margin-top: 20px;
            background-color: $footer-copyright-bg-color;
            p {
                margin: 0;
                padding: 3px 20px;
                font-size: 0.8rem;
            }
        }
    }

    .feature-column {
        .feature {
            &-heading {
                margin-top: 10px;
            }
            &-image {
                height: 140px;
                width: 140px;
            }
        }
    }

    .feature-row {
        .feature {
            &-heading {
                font-weight: 300;
                line-height: 1;
                letter-spacing: -.05rem;
                //font-size: 2rem;
            }
            &-image {
                //max-height: 240px;
                border: 1px dashed material-color(blue-grey, '200');
            }

        }
        .carousel-codex {
            .carousel-item {
                background-position: top left;
            }

            .carousel-caption {
                left: 0;
                right: 0;
                width: 100%;
                bottom: 0;
                background: rgba(0, 0, 0, 0.7);
                font-size: 1rem;
                padding: 5px;
                text-align: left;
                p {
                    font-size: 1rem;
                    margin: 0;
                }
            }
            .carousel-indicators {
                bottom: -45px;
                li {
                    border-color: material-color(blue-grey, '500');
                    background-color: material-color(blue-grey, '900');
                }
                li.active {
                    //border-color: material-color(blue-grey, '200');
                    background-color: $color-codex;
                }
                li, li.active {
                    border-radius: 20%;
                    width: 20px;
                    height: 20px;
                    margin: 1px 5px;
                }
            }
        }
    }

    .nav-header {

        .nav-item {
            display: inline-block;
        }

        .nav-item + .nav-item,
        .nav-link + .nav-link {
            margin-left: $nav-item-inline-spacer;
        }

        .nav-link {
            display: inline-block;
            text-align: center;
            white-space: nowrap;
            vertical-align: middle;
            cursor: pointer;
            user-select: none;
            @include button-size($btn-padding-y, $btn-padding-x, 0.9rem, $btn-border-radius);
            @include transition(all .2s ease-in-out);

            &,
            &:active,
            &.active {
                &:focus,
                &.focus {
                    @include tab-focus();
                }
            }

            @include hover-focus {
                text-decoration: none;
            }
            &.focus {
                text-decoration: none;
            }

            &:active,
            &.active {
                background-image: none;
                outline: 0;
                @include box-shadow($btn-active-box-shadow);
            }

            &.disabled,
            &:disabled {
                cursor: $cursor-disabled;
                opacity: .65;
                @include box-shadow(none);
            }
            background: none;
            border: none;
            box-shadow: none;
            text-transform: uppercase;
            font-size: 0.9rem;
            height: $header-height;
            font-weight: 300;
            margin-left: 0 !important;
            background: rgba(120, 144, 156, 0.28);
            color: #eceff1;
            line-height: 35px;

            &:hover, &:focus {
                box-shadow: none;
            }

            &.active {
                color: $color-codex;
                //border-bottom: 2px solid $color-codex;
            }
        }

        .nav-link-highlight {
            color: $color-codex-alt;
            font-size: 0.7rem;
            text-transform: uppercase;
            display: block;
            float: right;
            padding: 1px;
            font-family: $headings-font-family;
        }
    }

    .awesome {
        text-align: center;

        &-title {
            @include fadeIn();
            font-size: 3rem;
            font-family: $headings-font-family;
        }
        &-divider {
            @include fadeIn(1, 2s);
            height: 1px;
            width: 200px;
            margin: 10px auto;
            background-color: material-color(blue-grey, '200');
        }
        &-text {
            @include fadeIn(1, 2s);
            /*font-size: 1rem;*/
        }

    }

    .btn-big {
        display: block;
        height: 100px;
        width: 100%;
        padding-top: 30px;
        font-size: 30px;
    }

    .nav-footer {
        padding: 0 0 0 20px;
        .nav-item {
            padding: 3px 25px 3px 5px;
            &:before {
                content: '\25A0';
                line-height: 19px;
                position: absolute;
                left: 20px;
                font-size: 14px;
                color: #56565f;
            }
            &:hover:before {
                color: $color-codex;
            }
        }
        .nav-link {
            display: block;
            //font-size: 0.9rem;
            //font-family: $font-family-monospace;
            color: $footer-font-color;

            &:hover { }
        }

        &.nav-footer-right {
            .nav-item {
                &:before {
                    right: 20px;
                    left: auto;
                }
            }
            .nav-link {
                text-align: right;
            }
        }
    }

    .nav-footer-social {
        .nav-item {
            display: block;
            width: 4rem;
            margin: 6px;
            float: left;
        }
        .nav-link {
            display: block;
            text-align: center;
            padding: 1rem 0;
            background-color: $color-codex-grey;
            &:hover {
                background-color: darken($color-codex-grey, 10);
            }
        }
        i {
            font-size: 2rem;
            text-shadow: 1px 0 1px rgba(0, 0, 0, 0.45);
        }
        //@include clearfix;
        &:after {
            clear: left;
        }
    }

    .carousel.carousel-codex .carousel-item {
        &.slide-html {
        }
        &.slide {
            &-html { @include carousel-slide('html', 'png') }
            &-typewriter { @include carousel-slide('typewriter', 'jpg') }
        }
    }
}

