//
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
//
//
// Adaptable Blocks styles style sheet
//
// @package    theme_adaptable
// @copyright  2021 G J Barnard - {@link http://moodle.org/user/profile.php?id=442195}
// @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
//

.adaptable-block-area {
    background: #EEE;
    border: 2px dashed #BFBDBD;
    display: block;
    min-height: 50px;
}

.block {
    .block-action {
        //@include fa-icon();
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        //display: inline-block;
        font-style: normal;
        font-variant: normal;
        font-weight: normal;
        line-height: 1;

        cursor: pointer;
        float: right;

        margin-top: 4px;

        &:before {
            content: "\f066";
            font: normal normal 900 16px/1 'Font Awesome 6 Free';
        }
    }

    &.hidden {
        .block-action:before {
            content: "\f065";
        }
    }

    .block-controls .action-menu .menubar {
        justify-content: space-between;
        width: 100%;
    }

    .list ul {
        padding-left: 20px;
    }
}

.block-region-front .block {
    border: none;

    .content {
        padding: 10px 5px;
    }

    .header {
        border: none;
    }
}

.block .content a.dimmed {
    font-style: italic;
}

.block_timeline .col-sm {
    flex-basis: 0%;
    flex-grow: 1;
    max-width: 100%;
}

#block-region-information {
    .block {
        .header {
            .block-action {
                display: none;
            }
        }
    }
}

.block .block-hider-show,
.block .block-hider-hide {
    width: 18px;
}

// Block action classes lifted from previously used bootstrapbase parent theme.
.block.hidden .header .block_action {
    .block-hider-hide {
        display: none;
    }
    .block-hider-show {
        display: inline;
    }
}

.block .header .block_action {
    float: right;
    margin-left: 5px;
    padding: 1px 2px;
}

.block .header .block_action {
    .block-hider-show,
    .block-hider-hide {
        cursor: pointer;
    }
}

.block .header .block_action .block-hider-show,
.jsenabled .block-region:not(#block-region-information) .block.hidden .content {
    display: none;
}

.jsenabled .block-region:not(#block-region-information) .block.hidden .content {
    opacity: 0;
}

// Overriden from Boost..
.block_tree .tree_item.branch {
    margin-left: 0;
}

.block_navigation,
.block_settings {
    .block_tree .afaicon[aria-hidden="true"] {
        display: inline-block;
    }
}

// Recently accessed courses block.
.block_recentlyaccessedcourses .paging-bar-container {
    margin-top: -3rem;
}

// Login block.
.block_login label {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
    margin-top: 5px;
    font-weight: 400;
}

.block_login .username label:before {
    content: "\f007"; // user <- user.
    font-family: "Font Awesome 6 Free";
    margin-right: 5px;
    color: #999;
}

.block_login .password label:before {
    content: "\f084"; // key <- key.
    font-family: "Font Awesome 6 Free";
    margin-right: 5px;
    color: #999;
}

.loginbox .loginpanel .desc {
    clear: both;
}

.block_login .content {
    margin-left: auto;
    margin-right: auto;
    max-width: 100%;
}

.block_login .c1.btn input {
    display: block;
    text-align: center;
    width: 96%;
}

.loginbox .loginform {
    .form-input {
        float: right;
        width: 66%;

        input {
            width: 50%;
        }
    }

    .form-label {
        width: 33%;
    }
}

.block_navigation,
.block_settings {
    .block_tree {
        .tree_item.branch,
        p.hasicon {
            padding-left: 0;
        }

        p.hasicon {
            text-indent: 0;

            .afaicon,
            .icon { // As the JS templates.js instantiates Render() without the current theme name that renderIcon() needs.
                margin-right: 0.25rem;
                text-align: center;

                &.anavigationitem {
                    margin: 0 0.25rem;
                }
            }

            .icon {
                height: auto;
            }
        }

        [aria-expanded="true"],
        [aria-expanded="false"] {
            > p::before {
                margin-right: 0.25rem;
            }
        }
    }
}

// Block Icons.
.showblockicons {
    .block .header .title h2:before {
        content: "\f0c9"; // navicon <- navicon.
        display: inline-block;
        font-family: "Font Awesome 6 Free";
        font-style: normal;
        font-variant: normal;
        font-weight: 900; // fa-solid.
        padding-right: 8px;
        text-rendering: auto;
    }

    .block_news_items.block .header .title h2:before {
        content: "\f0a1"; // bullhorn <- bullhorn.
        font-family: "Font Awesome 6 Free";
    }

    .block_navigation.block .header .title h2:before {
        content: "\f0e8"; // sitemap <- sitemap.
    }

    .block_calendar_upcoming.block .header .title h2:before,
    .block_calendar_month.block .header .title h2:before {
        content: "\f133"; // far calendar <- calendar-o.
        font-weight: 400; // fa-regular.
    }

    .block_course_list.block .header .title h2:before {
        content: "\f390"; // desktop <- desktop.
    }

    .block_completionstatus.block .header .title h2:before,
    .block_selfcompletion.block .header .title h2:before {
        content: "\f625"; // gauge-high <- tachometer.
    }

    .block_blog_menu.block .header .title h2:before,
    .block_book_toc.block .header .title h2:before {
        content: "\f02d"; // book <- book.
    }

    .block_quiz_results.block .header .title h2:before {
        content: "\e0e3"; // chart-column <- bar-chart.
    }

    .block_quiz_navblock.block .header .title h2:before {
        content: "\f126"; // code-branch <- code-fork.
    }

    .block_glossary_random.block .header .title h2:before {
        content: "\f0eb"; // far lightbulb <- lightbulb-o.
        font-weight: 400; // fa-regular.
    }

    .block_participants.block .header .title h2:before,
    .block_online_users.block .header .title h2:before,
    .block_block_mentees.block .header .title h2:before {
        content: "\f0c0"; // users <- group.
    }

    .block_html.block .header .title h2:before {
        content: "\f022"; // far rectangle-list <- list-alt.
        font-weight: 400; // fa-regular.
    }

    .block_section_links.block .header .title h2:before,
    .block_admin_bookmarks.block .header .title h2:before {
        content: "\f02e"; // bookmark <- bookmark.
    }

    .block_activity_modules.block .header .title h2:before {
        content: "\f12e"; // puzzle-piece <- puzzle-piece.
    }

    .block_comments.block .header .title h2:before {
        content: "\f075"; // comment <- comment.
    }

    .block_settings.block .header .title h2:before {
        content: "\f085"; // gears <- cogs.
    }

    .block_blog_tags.block .header .title h2:before,
    .block_tags.block .header .title h2:before {
        content: "\f02c"; // tags <- tags.
    }

    .block_private_files.block .header .title h2:before {
        content: "\f07b"; // folder <- folder.
    }

    .block_messages.block .header .title h2:before {
        content: "\f0e0"; // envelope <- envelope.
    }

    .block_community.block .header .title h2:before {
        content: "\f0ac"; // globe <- globe.
    }

    .block_recent_activity.block .header .title h2:before {
        content: "\f017"; // far clock <- clock-o.
        font-weight: 400; // fa-regular.
    }

    .block_rss_client.block .header .title h2:before {
        content: "\f09e"; // rss <- feed.
    }

    .block_search_forums.block .header .title h2:before,
    .block_globalsearch.block .header .title h2:before {
        content: "\f002"; // magnifying-glass <- search.
    }

    .block_myprofile.block .header .title h2:before {
        content: "\f007"; // user <- user.
    }

    .block_adminblock.block .header .title h2:before {
        content: "\f009"; // table-cells-large <- th-large.
    }

    .block_feedback.block .header .title h2:before {
        content: "\f164"; // far thumbs-up <- thumbs-o-up.
        font-weight: 400; // fa-regular.
    }

    .block_flickr.block .header .title h2:before {
        content: "\f03e"; // far image <- picture-o.
        font-weight: 400; // fa-regular.
    }

    .block_youtube.block .header .title h2:before {
        content: "\f145"; // ticket <- ticket.
    }

    .block_course_badges.block .header .title h2:before,
    .block_badges.block .header .title h2:before {
        content: "\f0a3"; // certificate <- certificate.
    }

    .block_twitter_search.block .header .title h2:before {
        content: "\e61b"; // x-twitter <- twitter.
    }

    .block_overview.block .header .title h2:before {
        content: "\f03a"; // list <- list.
    }

    .block_timeline.block .header .title h2:before {
        content: "\f062"; // arrow-up <- arrow-up.
    }

    .block_starredcourses.block .header .title h2:before {
        content: "\f005"; // star <- star.
    }

    .block_lp.block .header .title h2:before {
        content: "\f277"; // signs-post <- map-signs.
    }
    
    .block_sitenews.block .header .title h2:before {
        content: "\f1ea"; // far newspaper <- newspaper-o.
        font-weight: 400; // fa-regular.
    }
}

.skip-block-to {
    padding: 0;
    width: auto;
}
