/* ==========================================================================
   Site Footer
   ========================================================================== */

.site-footer {
    position: relative;
    /* CTA内の重なり要素より上で、追従TOPボタンを表示する。 */
    z-index: 4;
    background-color: #fc7a62;
    margin-top: 0;
    padding: 0 4rem;
    isolation: isolate;
}

.site-footer::before {
    position: absolute;
    z-index: 0;
    inset: 0;
    border-radius: 20px 20px 0 0;
    background-color: #fdf6f4;
    content: "";
}

/* Beige nav area */
.site-footer__inner {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 3rem;
    max-width: 1280px;
    margin: 0 auto;
}

/* ---------- Back to top button ---------- */

.site-footer__top-btn {
    position: fixed;
    top: auto;
    bottom: 24px;
    right: 1rem;
    display: block;
    width: 56px;
    height: 56px;
    text-decoration: none;
    z-index: 40;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(8px);
    transition:
        opacity 0.3s ease,
        transform 0.3s ease,
        visibility 0s linear 0.3s;
}

.site-footer__top-btn.site-footer__top-btn--visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    transition-delay: 0s;
}

.site-footer__top-icon {
    display: block;
    width: 100%;
    height: 100%;
}

.site-footer__top-icon rect {
    transition: fill 0.2s ease;
}

.site-footer__top-btn.site-footer__top-btn--docked {
    position: absolute;
    top: -28px;
    right: 20px;
    bottom: auto;
    z-index: 2;
}

.site-footer__top-btn.site-footer__top-btn--visible:hover {
    opacity: 1;
}

.site-footer__top-btn.site-footer__top-btn--visible:hover .site-footer__top-icon rect {
    fill: #79a0e0;
}

@media (prefers-reduced-motion: reduce) {
    .site-footer__top-btn {
        transform: none;
        transition: none;
    }
}

/* ---------- Inner layout ---------- */

.site-footer__inner {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 3rem;
    max-width: 1280px;
    margin: 0 auto;
    padding: 3.75rem 0;
    position: relative;
    z-index: 1;
}

/* ---------- Branding ---------- */

.site-footer__branding {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.site-footer__logo-icon {
    width: 60px;
    height: auto;
}

/* ---------- Navigation ---------- */

.site-footer__nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
}

.site-footer__col {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: 0 1.5rem;
}

.site-footer__col--bordered {
    border-left: none;
}

/* ---------- Link groups ---------- */

.site-footer__link-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.site-footer__eyebrow {
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 15px;
    letter-spacing: 0.2em;
    color: #d8c9c6;
    font-family: "Segoe UI", Geologica, sans-serif;
    text-transform: uppercase;
}

.site-footer__link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    color: #5a4e4e;
    font-family: "Noto Sans JP", sans-serif;
    text-decoration: none;
    transition: color 0.2s ease;
}

.site-footer__link:hover {
    color: #fc7a62;
}

.site-footer__link-group--external .site-footer__link:hover {
    color: #4875be;
}

.site-footer__link-arrow {
    flex: 0 0 6px;
    width: 6px;
    height: 11px;
    margin-left: auto;
    background: center / 6px 11px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='6' height='11' viewBox='0 0 6 11'%3E%3Cpath d='M.5.5l5 5-5 5' fill='none' stroke='%23fc7a62' stroke-width='1'/%3E%3C/svg%3E");
}

.site-footer__link-icon {
    width: 0.75rem;
    height: 0.75rem;
    display: block;
    object-fit: contain;
    opacity: 1;
    margin-left: auto;
}

/* ---------- Sub-links ---------- */

.site-footer__sublinks {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.site-footer__sublinks a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: #5a4e4e;
    font-family: "Noto Sans JP", sans-serif;
    text-decoration: none;
    transition: color 0.2s ease;
}

.site-footer__sublink-mark {
    width: 12px;
    height: 1px;
    flex: 0 0 12px;
    background-color: #d8c9c6;
}

.site-footer__sublinks a:hover {
    color: #fc7a62;
}

/* ---------- Copyright ---------- */

.site-footer__copyright {
    text-align: center;
    min-height: 40px;
    padding: 0 4rem;
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.site-footer__copyright p {
    font-size: 0.875rem;
    color: #5a4e4e;
    font-family: "Noto Sans JP", sans-serif;
    margin: 0;
    letter-spacing: normal;
}

@media (min-width: 1025px) {
    .site-footer {
        padding: 0 2rem;
    }

    .site-footer__inner {
        grid-template-columns: 120px minmax(0, 1fr);
        gap: 0;
        padding: 3.75rem 0;
    }

    .site-footer__branding {
        align-items: center;
    }

    .site-footer__logo-icon {
        width: 100px;
    }

    .site-footer__nav {
        grid-template-columns:
            minmax(0, 320fr)
            minmax(0, 249fr)
            minmax(0, 249fr)
            minmax(0, 274fr);
    }

    .site-footer__col {
        position: relative;
        gap: 1.5rem;
        padding: 0 1rem;
    }

    .site-footer__col--bordered::before {
        content: "";
        position: absolute;
        inset: 0 auto 0 0;
        width: 1px;
        background: repeating-linear-gradient(
            to bottom,
            #d8c9c6 0 3px,
            transparent 3px 6px
        );
    }

    .site-footer__link {
        width: 100%;
        max-width: 100%;
    }

    .site-footer__sublinks {
        gap: 1rem;
    }

    .site-footer__copyright {
        height: 40px;
        min-height: 0;
        padding: 0 4rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

@media (min-width: 1400px) {
    .site-footer {
        padding-inline: 4rem;
    }

    .site-footer__inner {
        grid-template-columns: 188px minmax(0, 1fr);
    }

    .site-footer__col {
        padding-inline: 1.875rem;
    }

    .site-footer__link {
        width: 190px;
    }
}

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
    .site-footer {
        padding: 0 2rem;
    }

    .site-footer__nav {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }

    .site-footer__col--bordered {
        border-left: none;
    }

    .site-footer__col:nth-child(odd) {
        border-left: none;
    }
}

@media (max-width: 768px) {
    .site-footer {
        padding-inline: 1.5rem;
    }

    .site-footer__top-btn {
        right: 1rem;
        bottom: 16px;
    }

    .site-footer__top-btn.site-footer__top-btn--docked {
        top: -28px;
        right: 1rem;
        bottom: auto;
    }

    .site-footer__inner {
        grid-template-columns: 1fr;
        gap: 3rem;
        padding: 1.5rem 0 2.5rem;
    }

    .site-footer__branding {
        flex-direction: row;
        justify-content: center;
    }

    .site-footer__logo-icon {
        width: 100px;
    }

    .site-footer__nav {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .site-footer__col {
        padding: 0;
        gap: 1.5rem;
    }

    .site-footer__col--bordered {
        border-left: none;
        border-top: 0;
        padding-top: 0;
    }

    .site-footer__link {
        width: max-content;
        max-width: 100%;
        gap: 1.25rem;
        font-size: 0.9375rem;
    }

    .site-footer__link-arrow,
    .site-footer__link-icon {
        margin-left: 0;
    }

    .site-footer__sublinks {
        gap: 1rem;
    }

    .site-footer__copyright {
        min-height: 40px;
        padding: 0 1.5rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .site-footer__copyright p {
        line-height: 20px;
        white-space: nowrap;
    }
}
