//
// Footer
// --------------------------------------------------
$footer-sections: () !default;
$footer-sections: map-merge(
    (
        'content': (
            'background':   $dark,
            'color':        color-contrast($dark),
            'link-color':   a11y-color($dark, $link-color)
        ),
        'meta': (
            'background':   $darker,
            'color':        color-contrast($darker),
            'link-color':   a11y-color($darker, $link-color)
        )
    ),
    $footer-sections
);

//
// Footer Columns
// --------------------------------------------------
.footer-section-content-column-left,
.footer-section-content-column-middle,
.footer-section-content-column-right {
    --section-colspan: 12;
    @include media-breakpoint-up('md') {
        --section-gaps: 2;
        --section-colspan: 4;
    }
}

//
// Footer Sections
// --------------------------------------------------
@each $name, $settings in $footer-sections {
    .footer-section-#{$name} {
        $background: map-get($settings, 'background');
        $color: map-get($settings, 'color');
        $link-color: map-get($settings, 'link-color');
        $link-hover-color: $link-color;
        background: $background;
        --frame-color: #{$color};
        --frame-background: #{$background};
        --frame-link-color: #{$link-color};
        --frame-link-hover-color: #{$link-hover-color};
    }
}

//
// Footer Section Meta
// --------------------------------------------------
.footer-info-section {
    @include media-breakpoint-up('sm') {
        text-align: center;
    }
    > *:not(:first-child) {
        margin-top: 1rem;
    }
}

//
// Footer Navigation Section
// --------------------------------------------------
.footer-menu-section {
    text-align: start;
    & + .footer-info-section {
        margin-top: $grid-gutter-width;
    }
}
.footer-menu-section-has-navigation.footer-menu-section-has-contact {
    display: grid;
    gap: $grid-gutter-width;
    grid-template-columns: 1fr;
    @include media-breakpoint-up('md') {
        grid-template-columns: 2fr 1fr;
    }
    @include media-breakpoint-up('lg') {
        grid-template-columns: 3fr 1fr;
    }
}

//
// Footer Navigation
// --------------------------------------------------
.footer-navigation {
    ul {
        list-style: none;
        padding: 0;
        margin: 0;
    }
}
.footer-navigation-link {
    color: inherit !important;
    display: flex;
    align-items: center;
    gap: .25em;
}
.footer-navigation-link-icon {
    flex-grow: 0;
    flex-shrink: 0;
    svg,
    img {
        display: block;
        margin: 0;
    }
}
.footer-navigation-list-level-1 {
    display: flex;
    flex-wrap: wrap;
    gap: $grid-gutter-width;
}
.footer-navigation-link-level-1 {
    font-weight: bold;
    margin-bottom: .5rem;
}

//
// Footer Contact
// --------------------------------------------------
.footer-contact {
    > *:first-child {
        margin-top: 0;
    }
    > *:last-child {
        margin-bottom: 0;
    }
    .footer-contact-headline {
        font-size: inherit;
        font-weight: bold;
        line-height: inherit;
        margin-bottom: .5rem;
    }
}

//
// Footer Meta
// --------------------------------------------------
.footer-meta {
    .meta-menu {
        margin: 0;
        list-style: none;
        padding-left: 0;
        @include media-breakpoint-up('sm') {
            margin-left: -.5em;
            margin-right: -.5em;
            > li {
                display: inline-block;
                padding-left: .5em;
                padding-right: .5em;
            }
        }
        .active a {
            font-weight: bold;
        }
    }
}

//
// Footer Language
// --------------------------------------------------
.footer-language {
    .language-menu {
        margin: 0;
        list-style: none;
        padding-left: 0;
        @include media-breakpoint-up('sm') {
            margin-left: -.5em;
            margin-right: -.5em;
            > li {
                display: inline-block;
                padding-left: .5em;
                padding-right: .5em;
            }
        }
        .active a {
            font-weight: bold;
        }
        .inactive {
            opacity: .5;
        }
    }
}

//
// Footer Social
// --------------------------------------------------
.footer-sociallinks {
    @include media-breakpoint-up('sm') {
        .sociallinks-list {
            justify-content: center;
        }
    }
    .sociallinks-item {
        width: auto;
    }
    .sociallinks-link {
        justify-content: center;
        align-items: center;
        flex-shrink: 0;
        width: 2.5rem;
        height: 2.5rem;
        color: inherit;
        opacity: .75;
        transition: all ease-in-out .3s;
        background-color: rgba(255, 255, 255, .05);
        &:hover {
            opacity: 1;
            background-color: rgba(255, 255, 255, .15);
        }
    }
    .sociallinks-link-label {
        @include visually-hidden();
    }
}

//
// Footer Copyright
// --------------------------------------------------
.footer-copyright {
    p {
        margin-bottom: 0;
    }
}
