@use 'design-system' as *;

.footer {
    width: 100%;
    border-top: 1px solid var(--color-border-secondary);
    padding-top: $spacing-size-10;
    padding-bottom: calc($spacing-size-10 * 2);
    background-color: var(--color-bg-primary);
    color: var(--color-white);

    #{$selector-darkmode} & {
        color: var(--color-fg-primary);
        background-color: var(--color-bg-primary);
        border-top: 1px solid var(--color-border-primary);
    }

    p {
        color: var(--color-text-secondary);
        opacity: 0.666;
    }

    h4 {
        color: var(--color-fg-primary);
        font-weight: var(--text-semibold);
        opacity: 1;
        #{$selector-darkmode} & {
            color: var(--color-fg-white);
        }
    }

    svg {
        fill: var(--color-white);
    }
}

.footerColumns {
    max-width: calc(var(--layout-max-width-small) + var(--layout-horizontal-margins) * 2);
    margin-right: auto;
    margin-left: auto;
    padding: $spacing-size-2;

    @media screen and (min-width: $breakpoint-site-footer-five-column) {
        justify-content: space-between;
    }
}

.footerColumns .menuColumn:last-child a::after {
    content: ' ↗';
    opacity: 0.85;
}

.menuColumn {
    margin-bottom: $spacing-size-10;
    width: var(--layout-width-4-4);

    h2 {
        font-size: var(--text-fs-base);
        line-height: var(--text-lh-base);
        font-weight: var(--text-semibold);
    }

    &:first-child {
        width: 100%;
        text-align: center;
    }

    @media screen and (min-width: $breakpoint-site-footer-two-column) and (max-width: $breakpoint-site-footer-five-column) {
        width: var(--layout-width-2-4);

        &:nth-child(even) {
            text-align: right;
        }
    }

    @media screen and (min-width: $breakpoint-site-footer-five-column) {
        width: auto;

        &:first-child {
            max-width: 18%;
            min-width: 230px;
            margin-right: -4%;
            text-align: left;
        }

        &:last-child {
            text-align: right;
        }
    }

    li {
        overflow: hidden;
    }

    li a {
        text-decoration: underline;
        display: inline-block;
        min-width: $spacing-size-12;
        margin-top: -12px;
        margin-bottom: -12px;
        padding-top: 12px;
        padding-bottom: 20px;
        text-decoration-color: color-mix(in srgb, var(--color-text-secondary), var(--color-bg-primary) 80%);
        text-underline-offset: 4px;
        color: var(--color-text-secondary);
        transition: color $transition-default-timing;
        opacity: 1;
        font-weight: var(--text-regular);

        &:hover {
            color: var(--color-text-primary);
            opacity: 0.6;

            :global(.icon) {
                opacity: 1;
            }
        }
    }

    :global(.icon) {
        display: inline;
        position: relative;
        width: 22px;
        height: 22px;
        top: -1px;
        margin-right: $spacing-size-1;
        opacity: 0.6666;
        transition: opacity $transition-default-timing;
        fill: var(--color-text-tertiary);

        #{$selector-darkmode} & {
            fill: var(--color-fg-white);
        }
    }
}

.logoContainer a {
    display: inline-block;

    @media screen and (min-width: $breakpoint-site-footer-five-column) {
        margin-top: -18px;
        margin-left: -12px;
    }

    :global(.logotype) * {
        fill: var(--color-logo-text);

        #{$selector-darkmode} & {
            fill: var(--color-white);
        }
    }
}

.listStyleNone {
    display: flex;
    flex-direction: row;
    list-style: none;
    padding-left: 0;
    opacity: 0.7;

    #{$selector-darkmode} & {
        opacity: 1;
    }
}

.headerTitle {
    padding-top: $spacing-size-4;
    color: var(--color-text-secondary);
}
