﻿@keyframes fade-footer-bus {
    from {
        opacity: 0;
        transform: translateX(calc(10vw + var(--bus-height) * 3.5));
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fade-footer-bus-2 {
    0% {
        opacity: 0;
        transform: translateX(calc(10vw + var(--bus-height) * 3.5));
    }

    50% {
        opacity: 1;
    }

    100% {
        transform: translateX(calc(10px + var(--bus-height) * 3.5));
    }
}

@keyframes fade-footer-sns {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

footer {
    overflow-x: hidden;
    padding-top: 32px;
    background-color: var(--light-background-color);
}

    footer > .footer-bus {
        --bus-height: 60px;
        content: "";
        position: relative;
        margin: 160px 10% 0 auto;
        width: calc(var(--bus-height) * 3.5);
        height: var(--bus-height);
    }

        footer > .footer-bus.footer-bus-wo-sns {
            margin-top: 32px;
        }

        footer > .footer-bus::after {
            content: "";
            position: absolute;
            right: calc(10% + var(--bus-height) * 4);
            bottom: 0;
            width: 10px;
            height: calc(var(--bus-height) * 0.6);
            background: url("/img/busstop.svg") bottom / contain no-repeat transparent;
        }

        footer > .footer-bus > ul.footer-sns {
            position: absolute;
            display: flex;
            margin: 0 calc(50% - 104px);
            padding: 48px 0 0 0;
            top: -160px;
            width: 208px;
            height: 120px;
            background-color: var(--share-background-color);
            color: var(--light-text-color);
            justify-content: center;
            opacity: 0;
        }

            footer > .footer-bus > ul.footer-sns.fade {
                opacity: 1;
                animation: fade-footer-sns 0.25s linear 2s backwards;
            }

            footer > .footer-bus > ul.footer-sns::before {
                content: "Share!";
                position: absolute;
                top: 18px;
                width: 100%;
                text-align: center;
                font-weight: 500;
                font-size: 1.25em;
                line-height: 1;
            }

            footer > .footer-bus > ul.footer-sns::after {
                content: "";
                position: absolute;
                bottom: -20px;
                border-top: 20px solid var(--share-background-color);
                border-left: 20px solid transparent;
                border-right: 20px solid transparent;
            }

            footer > .footer-bus > ul.footer-sns > li {
                display: block;
                margin: 12px;
                width: 40px;
                height: 40px;
            }

                footer > .footer-bus > ul.footer-sns > li > a {
                    display: block;
                    width: 100%;
                    height: 100%;
                    background: center / contain no-repeat;
                }

                    footer > .footer-bus > ul.footer-sns > li > a.footer-sns-twitter {
                        background-image: url("/img/social/twitter.svg");
                    }

                    footer > .footer-bus > ul.footer-sns > li > a.footer-sns-facebook {
                        background-image: url("/img/social/facebook.svg");
                    }

                    footer > .footer-bus > ul.footer-sns > li > a.footer-sns-hatena {
                        background-image: url("/img/social/hatena.svg");
                    }

        footer > .footer-bus > .footer-bus-body,
        footer > .footer-bus > .footer-bus-body-2 {
            opacity: 0;
            width: 100%;
            height: 100%;
            background: bottom / contain no-repeat transparent;
        }

        footer > .footer-bus > .footer-bus-body-2 {
            margin-top: calc(-1 * var(--bus-height));
        }

        footer > .footer-bus > .footer-bus-body.fade {
            opacity: 1;
            animation: fade-footer-bus 1.5s ease-out 0.5s backwards;
        }

        footer > .footer-bus > .footer-bus-body-2.fade {
            opacity: 1;
            animation: fade-footer-bus-2 4s cubic-bezier(0.39, 0.575, 0.565, 1) 30.5s both;
        }

    footer > .footer-main {
        display: block;
        background-color: var(--footer-background-color);
        color: var(--footer-text-color);
    }

        footer > .footer-main hr {
            margin: 0;
            border: none;
            border-top: 1px solid var(--separator-color);
        }

        footer > .footer-main > .footer-basic {
            padding: 12px 0;
        }

            footer > .footer-main > .footer-basic > small {
                display: block;
                text-align: center;
            }

                footer > .footer-main > .footer-basic > small a {
                    text-decoration: none;
                }

@media screen and (max-width: 959px) {
    footer > .footer-bus {
        --bus-height: 40px;
        margin-top: 128px;
    }

        footer > .footer-bus::after {
            --bus-height: 40px;
        }

        footer > .footer-bus > ul.footer-sns {
            margin: 0 calc(50% - 80px);
            padding: 40px 0 0 0;
            top: -128px;
            width: 160px;
            height: 96px;
        }

            footer > .footer-bus > ul.footer-sns::before {
                top: 8px;
            }

            footer > .footer-bus > ul.footer-sns > li {
                margin: 8px;
                width: 32px;
                height: 32px;
            }
}
