footer {
    opacity: .85;
    background-color: #868b92;
    color: #ffffff;
    font-size: 1.6rem;
    line-height: 1.6;
    font-family: biz-udgothic, sans-serif;
}

#footer .footer-wrapper{
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
    z-index: 1;
    padding: 60px 10%;

    gap: 40px;
}

#footer .left h2 {
    display: block;
    width: fit-content;
    margin-bottom: 10px;
    padding: 10px 15px;
    border-radius: 5px;
    background-color: #21a4dc;
    font-weight: bold;
    font-size: 3rem;
    line-height: 1.3;
    font-family: toppan-bunkyu-midashi-go-std, sans-serif;
}

#footer .contact-link {
    display: inline-flex;
    align-items: center;
    position: relative;
    width: fit-content;
    height: fit-content;
    margin-top: 30px;
    overflow: visible;
    font-size: 2.4rem;
    transition: background-color .3s ease, transform .3s ease;
}

#footer .contact-link .arrow {
    display: inline-block;
    position: relative;
    z-index: 2;
    width: 80px;
    height: 8px;
    margin-left: 15px;
}

/* グレー背景（下敷き） */
#footer .contact-link .arrow::before {
    position: absolute;
    top: -4px;
    left: -10px;
    z-index: 1;
    width: 80px;
    height: 15px;
    background-color: #868b92;
    content: "";
    transition: width .4s cubic-bezier(.4, 0, .2, 1),
    opacity .4s cubic-bezier(.4, 0, .2, 1);
}

#footer .contact-link .arrow::after {
    position: absolute;
    top: 50%;
    left: 0;
    z-index: 3;
    transform: translateY(-50%);
    width: 80px;
    height: 1px;
    background-color: #ffffff;
    content: "";
    transition: width .4s cubic-bezier(.4, 0, .2, 1),
    background-color .4s cubic-bezier(.4, 0, .2, 1);
}

#footer .contact-link .triangle {
    position: absolute;
    top: 50%;
    right: 0;
    z-index: 4;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 10px solid #ffffff;
    transition: transform .4s cubic-bezier(.4, 0, .2, 1);
}

#footer .contact-circle {
    position: absolute;
    top: 50%;
    right: -9%;
    transform: translateY(-50%);
    width: 85px;
    height: 85px;

    pointer-events: none;
}

#footer .contact-circle svg {
    width: 100%;
    height: 100%;
    animation: contact-spin 15s linear infinite;
}

#footer .contact-circle text {
    font-weight: 700;
    font-size: 8.5px;
    letter-spacing: 1.1px;

    fill: #ffffff;
}

@keyframes contact-spin {
    to {
        transform: rotate(360deg);
    }
}

#footer ul.location {
    max-width: 700px;
    padding: 0;
    border-radius: 10px;
}

#footer ul.location li.item {
    margin-bottom: 10px;
    overflow: hidden;
    border-bottom: 1px solid #e0e6ef;
    transition: background-color .3s ease;
}

#footer ul.location li.item:last-child {
    margin-bottom: 0;
    border-bottom: none;
}

#footer ul.location .space {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    cursor: pointer;
    transition: background-color .3s ease;
}

#footer ul.location .space-title {
    font-weight: bold;
    font-size: 2rem;
}

#footer .toggle-icon {
    display: inline-block;
    width: 35px;
    height: 35px;
    background-position: center;
    background-size: contain;
    background-repeat: no-repeat;
    vertical-align: middle;
    transition: transform .3s ease;
}

#footer .item:not(.active) .toggle-icon {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" data-name=\"レイヤー 2\" viewBox=\"0 0 40.35 40.35\"><g data-name=\"Layer 1\"><circle cx=\"20.17\" cy=\"20.17\" r=\"20.17\" style=\"fill:%2321a4dc\"/><path d=\"m9.83 27.48 15.42-10.89\" style=\"fill:none;stroke:%23fff;stroke-miterlimit:10\"/><path d=\"m26.76 21.02 3.76-8.15-8.94.81z\" style=\"fill:%23fff\"/></g></svg>");
}

#footer .item.active .toggle-icon {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" data-name=\"レイヤー 2\" viewBox=\"0 0 40.35 40.35\"><g data-name=\"Layer 1\"><circle cx=\"20.17\" cy=\"20.17\" r=\"20.17\" style=\"fill:%23edea39\"/><path d=\"m9.83 27.48 15.42-10.89\" style=\"fill:none;stroke:%234d6d90;stroke-miterlimit:10\"/><path d=\"m26.76 21.02 3.76-8.15-8.94.81z\" style=\"fill:%234d6d90\"/></g></svg>");
}

#footer ul.location .address {
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(-5px);
    max-height: 0;
    padding: 0 20px 15px 50px;
    overflow: hidden;
    font-size: 2rem;
    line-height: 1.5;
    transition: opacity .5s ease, transform .5s ease, max-height .5s ease;

    gap: 5px;
    pointer-events: none;
}

#footer ul.location li.item.active .address {
    opacity: 1;
    transform: translateY(0);
    max-height: 500px;

    pointer-events: auto;
}

/* パソコンサイズではJavaScriptで制御するため、:hoverは無効化 */
@media (min-width: 1026px) {
    #footer ul.location li.item:hover:not(.active) .address {
        opacity: 0;
        transform: translateY(-5px);
        max-height: 0;
        pointer-events: none;
    }
}

#footer .under.footer-menu {
    position: relative;
    z-index: 1;
    padding: 30px 5%;
    border-top: 1px solid #ffffff;
}

#footer .footer-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    list-style: none;
    margin-left: 0;
    padding: 0;

    gap: 25px;
}

#footer .footer-nav-item {
    font-size: 2rem;
    transition: color .3s ease, opacity .3s ease;
}

#footer .footer-nav-item:hover {
    opacity: .8;
    color: #21a3dc;
}

#footer .copyright {
    padding: 25px 5%;
    background-color: #21a3dc;
}

#footer .copyright small {
    font-size: 1.6rem;
}

@media (min-width: 1026px) {
    #footer .footer-wrapper::before {
        position: absolute;
        top: 0;
        bottom: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 1px;
        background-color: #ffffff;
        content: "";
    }

    #footer .contact-link:hover {
        transform: translateX(6px);
    }


    #footer .contact-link:hover .arrow::before {
        opacity: .9;
    }

    #footer .contact-link:hover .triangle {
        transform: translate(6px, -50%);
    }

    #footer .contact-link:hover .contact-text {
        transform: scale(1.08);

        filter: brightness(1.1);
    }
}

@media (max-width: 1025px) {
    #footer .footer-wrapper{
        padding: 50px 6%;

        gap: 35px;
    }

    #footer .footer-wraper::before {
        display: none;
    }

    #footer .footer-wraper::before {
        left: 50%;
        height: 100%;
    }

    #footer .left h2 {
        padding: 8px 12px;
        font-size: 2.6rem;
    }

    #footer .contact-link {
        font-size: 2.2rem;
    }

    #footer .footer-wrapper{
        flex-direction: column;
        align-items: flex-start;
    }

    #footer .left,
    #footer .right {
        width: 100%;
    }

    #footer .contact-circle {
        right: -8%;
        transform: translateY(-50%) scale(.8);

        transform-origin: center;
    }

    #footer ul.location {
        max-width: 100%;
    }

    #footer ul.location .space-title {
        font-size: 2rem;
    }

    #footer ul.location .address {
        font-size: 1.8rem;
    }

    #footer .footer-nav {
        flex-wrap: wrap;

        gap: 20px;
    }

    #footer .footer-nav-item {
        font-size: 1.9rem;
    }

    /* タッチ端末で :hover が残るのを抑止（activeは優先） */
    #footer ul.location li.item:hover:not(.active) .address {
        opacity: 0;
        transform: translateY(-5px);
        max-height: 0;
        pointer-events: none;
    }
}

@media (max-width: 767px) {
    #footer .footer-wrapper{
        flex-direction: column;
        align-items: flex-start;
        padding: 40px 5%;

        gap: 30px;
    }

    #footer .left h2 {
        padding: 8px 10px;
        font-size: 1.8rem;
    }

    #footer .contact-link {
        padding-left: 3%;
        font-size: 1.8rem;
    }

    #footer .contact-circle {
        right: -14%;
        transform: translateY(-50%) scale(.7);

        transform-origin: center;
    }

    #footer ul.location .space-title {
        font-size: 1.8rem;
    }

    #footer .contact-link .arrow {
        margin-left: 30px;
    }

    #footer ul.location .address {
        font-size: 1.6rem;
    }

    #footer .footer-nav {
        flex-direction: column;
        align-content: center;

        gap: 15px;
    }

    #footer .footer-nav-item {
        font-size: 1.8rem;
    }

    #footer .copyright small {
        font-size: 1.4rem;
    }
}

/* トップへ戻る */
#pagetop {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    position: fixed;
    right: 40px;
    bottom: 35px;
    z-index: 999;
    width: 50px;
    height: 50px;
    cursor: pointer;
    transition: .3s;
}

#pagetop .page-top {
    position: relative;
    width: 100%;
    height: 100%;
}

#pagetop .page-top::before {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: -1;
    transform: translate(-50%, -50%);
    width: 100%;
    border-radius: 50%;
    background-color: #21a3dc;
    content: "";
    transition: all .45s cubic-bezier(.4, 0, .2, 1);

    aspect-ratio: 1 / 1;
    pointer-events: none;
}

/* 矢印（既存） */
#pagetop .circle-arrow {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 2;
    transform: translate(-50%, -50%);
}

#pagetop .circle-arrow .arrow-triangle {
    width: 0;
    height: 0;
    border-right: 6px solid transparent;
    border-bottom: 10px solid #ffffff;
    border-left: 6px solid transparent;
    transition: border-bottom-color .45s cubic-bezier(.4, 0, .2, 1);
}

#pagetop .circle-arrow .arrow-line {
    width: 2px;
    height: 22px;
    background-color: #ffffff;
    transition: background-color .45s cubic-bezier(.4, 0, .2, 1);
}

/* 円周SVG */
#pagetop .pagetop-text {
    position: relative;
    z-index: 1;
    width: 115%;
    height: 115%;
    margin-top: -8%;
    margin-left: -8%;
    animation: rotate-circle 15s linear infinite;
    pointer-events: none;
}

/* 円周文字 */
#pagetop .pagetop-circle-text {
    font-weight: 700;
    font-size: 8px;
    letter-spacing: .28em;

    fill: #222222;
}

/* hover */
#pagetop:hover .page-top::before {
    background-color: #edea39;
}

#pagetop:hover .circle-arrow .arrow-line {
    background-color: #222222;
}

#pagetop:hover .circle-arrow .arrow-triangle {
    border-bottom-color: #222222;
}

#pagetop:hover .pagetop-circle-text {
    fill: #222222;
}

/* 回転 */
@keyframes rotate-circle {
    from {
        transform: scale(1.4) rotate(0deg);
    }
    to {
        transform: scale(1.4) rotate(360deg);
    }
}

@media (max-width: 820px) {
    #pagetop {
        display: none !important;
    }
}
