/*
Copyright 2020 Adobe. All rights reserved.
This file is licensed to you under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. You may obtain a copy
of the License at http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
OF ANY KIND, either express or implied. See the License for the specific language
governing permissions and limitations under the License.
*/

//== XF Header style, used on page template

header.experiencefragment {
    padding: .5em 1em;
    border-bottom: 1px solid $color-foreground;

    @media (prefers-color-scheme: dark) {
        border-bottom-color: $color-foreground-dark;
    }

    a {
        color: $color-foreground;
        text-decoration: none;

        @media (prefers-color-scheme: dark) {
            color: $color-foreground-dark;
        }

        &:hover,
        &:focus {
            color: $color-link;
            text-decoration: underline;

            @media (prefers-color-scheme: dark) {
                color: $color-link-dark;
            }
        }
    }

    //== Grid layout

    .cmp-container {
        display: grid;
        grid-template-columns: 4fr 1fr 1fr;
    }

    //== Navigation

    .cmp-navigation__group {
        margin: 0;
        padding: 0;
        list-style: none;
    }
    .cmp-navigation__item--level-0 {
        display: grid;
        grid-template-columns: 1fr 3fr;

        & > .cmp-navigation__group {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
        }
    }
    .cmp-navigation__item-link {
        display: block;
    }
    .cmp-navigation__item--active > .cmp-navigation__item-link {
        font-weight: bold;
    }

    //== Language Navigation

    .cmp-languagenavigation {
        position: relative;

        &::before {
            content: " ";
            display: block;
            height: 1.5em;
            $color-foreground-rgb: 'rgb('+red($color-foreground)+','+green($color-foreground)+','+blue($color-foreground)+')';
            background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="'+$color-foreground-rgb+'" d="M12.1,0.2h-0.1c-3.1,0-6.1,1.3-8.3,3.5C1.4,6,0.2,8.9,0.2,12.1c0,3.1,1.3,6.1,3.5,8.3c2.2,2.2,5.1,3.4,8.3,3.4 c0,0,0,0,0.1,0c6.5,0,11.7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.2c0.1-0.1,0.2-0.3,0.4-0.4C6.1,3.4,7.8,2.5,9.6,2z M5.7,11.5H1.8c0.1-2,0.8-3.9,1.9-5.5 C4.6,6.5,5.5,7,6.4,7.4C6,8.7,5.7,10.1,5.7,11.5z M6.4,16.6C5.5,17,4.6,17.5,3.7,18c-1.2-1.6-1.9-3.5-1.9-5.5h3.9 C5.7,13.9,5.9,15.3,6.4,16.6z M4.4,18.8c0.8-0.5,1.5-0.9,2.4-1.3c0.6,1.4,1.4,2.7,2.4,3.9c0.1,0.2,0.3,0.3,0.4,0.5 c-1.8-0.4-3.4-1.3-4.7-2.7C4.6,19.1,4.5,19,4.4,18.8z M14.5,21.9c1.2-1.3,2.1-2.8,2.8-4.4c0.8,0.3,1.6,0.8,2.4,1.2 C18.3,20.3,16.5,21.4,14.5,21.9z"/></svg>');
            background-repeat: no-repeat;

            @media (prefers-color-scheme: dark) {
                $color-background-rgb: 'rgb('+red($color-foreground-dark)+','+green($color-foreground-dark)+','+blue($color-foreground-dark)+')';
                background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="'+$color-background-rgb+'" d="M12.1,0.2h-0.1c-3.1,0-6.1,1.3-8.3,3.5C1.4,6,0.2,8.9,0.2,12.1c0,3.1,1.3,6.1,3.5,8.3c2.2,2.2,5.1,3.4,8.3,3.4 c0,0,0,0,0.1,0c6.5,0,11.7-5.3,11.7-11.8C23.7,5.5,18.5,0.3,12.1,0.2z M18.3,11.5c-0.1-1.4-0.3-2.8-0.7-4.1C18.5,7,19.4,6.5,20.3,6 c1.1,1.6,1.9,3.5,2,5.5H18.3z M22.2,12.5c-0.1,2.1-0.8,4-2,5.5c-0.8-0.6-1.7-1-2.6-1.4c0.3-1.1,0.6-2.2,0.7-3.3c0-0.3,0-0.5,0-0.8 H22.2z M19.6,5.2c-0.8,0.5-1.6,0.9-2.4,1.3c-0.6-1.4-1.4-2.7-2.3-3.8c-0.2-0.2-0.4-0.4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c-1.8-0.4-3.4-1.3-4.7-2.7C4.6,19.1,4.5,19,4.4,18.8z M14.5,21.9c1.2-1.3,2.1-2.8,2.8-4.4c0.8,0.3,1.6,0.8,2.4,1.2 C18.3,20.3,16.5,21.4,14.5,21.9z"/></svg>');
            }
        }
        & > .cmp-languagenavigation__group {
            visibility: hidden;
            transition-delay: .5s;
            position: absolute;
            top: 34px;
            width: 20em;
            padding: 0 8px;
            border: 1px solid $color-foreground;
            border-top: 0;
            background: $color-background;

            @media (prefers-color-scheme: dark) {
                border-color: $color-foreground-dark;
                background: $color-background-dark;
            }
        }
        &:hover > .cmp-languagenavigation__group {
            visibility: visible;
            transition-delay: 0s;
        }
    }
    .cmp-languagenavigation__group {
        margin: 0;
        padding: 0;
        list-style: none;
    }
    .cmp-languagenavigation__item-title {
        font-size: x-small;
        text-transform: uppercase;
    }
    .cmp-languagenavigation__item--level-0 {
        margin-bottom: .5em;
    }
    .cmp-languagenavigation__item--level-1 {
       display: inline;
    }
    .cmp-languagenavigation__item--level-1:not(:first-child)::before {
        content: " | ";
    }
    .cmp-languagenavigation__item--active > .cmp-languagenavigation__item-link {
        font-weight: bold;
    }

    //== Search

    .cmp-search__field {
        display: flex;
        margin: -3px 0;
    }
    .cmp-search__input {
        height: 26px;
    }
}
