/* ------------------------------------------------
    Header
------------------------------------------------- */
.header {
    --gap: 46px;

    background: transparent;
    container-type: inline-size;
    height: var(--headerHeight);
    margin-top: var(--gap);
    padding-block: 0 5px;
    padding-inline: 3.125cqi 3.33cqi;
    position: sticky;
    top: var(--gap);
    z-index: var(--zIndexHeader);
}

.header::before {
    background: url("../../image/img_header-texture.png") no-repeat center center / cover;
    bottom: -119px;
    content: "";
    display: block;
    height: 119px;
    left: 0;
    opacity: 1;
    pointer-events: none;
    position: absolute;
    transition:
        opacity 0.3s 0.6s,
        visibility 0.3s 0.6s;
    visibility: visible;
    width: 100%;
    z-index: -1;
}

.header__bg {
    height: 100%;
    left: 0;
    object-fit: cover;
    opacity: 1;
    position: absolute;
    top: 0;
    transition:
        opacity 0.5s 0.5s,
        visibility 0.5s 0.5s;
    visibility: visible;
    width: 100%;
    z-index: -1;
}

body:has(.hero__skip.skiped) .hero {
    height: var(--headerHeight);
}

body:has(.hero__section--1.active) .header,
body:has(.hero .active) .header__bg,
body:has(.hero .active) .header::before {
    opacity: 0;
    visibility: hidden;
}

body:has(.hero__skip.skiped) .header,
body:has(.hero__skip.skiped) .header::before,
body:has(.hero__skip.skiped) .header__bg,
body:has(.hero.hidden) .header,
body:has(.hero.hidden) .header__bg,
body:has(.hero.hidden) .header::before,
body:has(.subpage) .header,
body:has(.subpage) .header__bg,
body:has(.subpage) .header::before {
    opacity: 1;
    transition:
        opacity 0s 0s,
        visibility 0s 0s;
    visibility: visible;
}

.header__inner {
    align-items: end;
    border-bottom: 1px solid transparent;
    border-image: url("../../image/common/border_header-bottom.png") 2 repeat;
    display: flex;
    height: 100%;
    justify-content: space-between;
    margin-inline: auto;
    padding-block-end: 10px;
    padding-inline-end: 8px;
    width: 100%;
}

body:has(.hero.animated) .header__inner,
body:has(.hero__skip.skiped) .header__inner {
    border-image: none;
}

.header__menu {
    z-index: calc(var(--zIndexGnav));
}

.header__logo a {
    display: inline-grid;
}

@media (max-width: 768px) {
    .header {
        --gap: 29px;

        padding-block: 0 10px;
        padding-inline: 16px 28px;
    }

    .header::before {
        background: url("../../image/img_header-texture-sp.png") no-repeat center center / cover;
        bottom: -70px;
        height: 70px;
    }

    .header__inner {
        padding-inline-end: 0;
    }

    .header__logo {
        max-width: 100px;
        transform: translateY(9px);
    }
}

/* ------------------------------------------------
    Global Navigation
------------------------------------------------- */
.navToggle {
    margin-block-end: -4px;
    position: relative;
    z-index: calc(var(--zIndexHeader) + 2);
}

.navToggle::after {
    bottom: -16px;
    content: "";
    display: block;
    height: 16px;
    left: 0;
    position: absolute;
    width: 100%;
}

.navToggle__open,
.navToggle__close {
    position: relative;
    transition: opacity 0.3s;
}

.navToggle__open {
    opacity: 1;
    transition: opacity 0.3s;

    @starting-style {
        opacity: 1;
    }
}

.navToggle[aria-expanded="true"] .navToggle__open,
.navToggle__close {
    display: none;
    opacity: 0;
    transition: opacity 0.3s;

    @starting-style {
        opacity: 1;
    }
}

.navToggle[aria-expanded="true"] .navToggle__close {
    display: block;
    opacity: 1;
    transition: opacity 0.3s;

    @starting-style {
        opacity: 0;
    }
}

.navToggle[aria-expanded="true"] + .gnav {
    animation: fadeInGnav 0.3s;
    display: block;

    @starting-style {
        opacity: 0;
    }
}

.navToggle:not([aria-expanded="true"]) + .gnav {
    animation: fadeOutGnav 0.3s;
    opacity: 0;
    pointer-events: none;
}

@keyframes fadeInGnav {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeOutGnav {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

.gnav {
    background: var(--colorWhite);
    border: 1px solid var(--colorBeige);
    container-type: inline-size;
    display: none;
    height: 700px;

    /* max-height: 992px; */
    max-width: 754px;

    /* min-height: 91.85vh; */
    overflow: clip auto;
    position: fixed;
    right: 0;
    top: 18px;
    width: 100%;
    z-index: calc(var(--zIndexHeader) + 1);
}

.gnav__bg {
    height: 100%;
    left: 0;
    object-fit: cover;
    position: absolute;
    top: 0;
    width: 100%;
}

.gnav__inner {
    height: 100%;
    overflow-y: auto;
    padding-block: 110px 100px;
    padding-inline: 10.61cqi;
    position: relative;
}

.gnav__home {
    align-items: center;
    background-color: var(--colorOrange);
    border-radius: 10px;
    color: var(--colorWhite);
    display: grid;
    font-size: 35px;
    font-weight: 700;
    height: 70px;
    letter-spacing: 0.1em;
    max-width: 468px;
    padding-inline: 26px;
    position: relative;
    text-decoration: none;
    width: 100%;
}

.gnav__list {
    display: grid;
    margin-top: 8px;
    max-width: fit-content;
    padding-left: 26px;
    position: relative;
    width: 100%;
}

.gnav__item {
    align-items: center;
    display: inline-flex;
    gap: 30px;
}

.gnav__item + .gnav__item {
    margin-top: -1px;
}

.gnav__item:last-of-type {
    margin-top: -6px;
}

.gnav__item:last-of-type a {
    transform: translateY(15px);
}

.gnav__item::before {
    align-items: center;
    content: url("../../image/figures/figure_nav-tree-middle.svg");
}

.gnav__item:last-of-type::before {
    content: url("../../image/figures/figure_nav-tree-bottom.svg");
}

.gnav__link {
    color: var(--colorBlack);
    display: inline-flex;
    font-size: 30px;
    font-weight: 500;
    letter-spacing: 0.1em;
    line-height: 1.467;
    text-decoration: none;
    transition: color 0.15s;
}

.gnav__link:hover {
    color: var(--colorOrange);
}

@media (max-width: 1300px) {
    .navToggle {
        max-width: 107px;
    }
}

@media (max-width: 768px) {
    .navToggle {
        max-width: 73px;
    }

    .navToggle::after {
        bottom: -8px;
        height: 8px;
    }
}

@media (max-width: 576px) {
    .navToggle {
        margin-block-end: 0;
        max-width: 73px;
    }

    .navToggle::after {
        bottom: -8px;
        height: 8px;
    }

    .gnav {
        height: 540px;
        max-height: 508px;
        max-width: 470px;
        min-height: auto;
        top: 3.3%;
    }

    .gnav__inner {
        max-width: 100%;
        padding-block: 78px 90px;
        padding-inline: 20px;
    }

    .gnav__home {
        font-size: 22px;
        height: 50px;
    }

    .gnav__item {
        gap: 12px;
        height: fit-content;
        width: 100%;
    }

    .gnav__item::before {
        height: 48px;
    }

    .gnav__link {
        font-size: 16px;
        margin-top: 21px;
    }

    .gnav__item:last-of-type a {
        transform: translateY(0);
    }
}

/* ------------------------------------------------
    Footer
------------------------------------------------- */
.footer {
    background: var(--colorOrange);
    position: relative;
}

.footer__bg {
    height: 100%;
    left: 0;
    object-fit: cover;
    position: absolute;
    top: 0;
    width: 100%;
    z-index: 0;
}

.footer__inner {
    align-items: flex-end;
    display: flex;
    gap: 14px 48px;
    padding: 70px 4vw;
    position: relative;
}

.footerLogo {
    align-items: flex-end;
    column-gap: 48px;
    display: flex;
}

.footerLogo img {
    height: 48px;
    width: auto;
}

.footer__copyright {
    color: var(--colorWhite);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.1em;
    line-height: 1.46;
}

.footer__nav {
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.1em;
    line-height: 1.46;
    margin-bottom: 1px;
}

.footer__link {
    color: var(--colorWhite);
}

.toTopButton {
    bottom: 20px;
    cursor: pointer;
    display: none;
    position: fixed;
    right: 30px;
    z-index: calc(var(--zIndexHeader) - 1);
}

body:has(.hero.animated) .toTopButton {
    display: inline-block;
}

@media screen and (max-width: 768px) {
    .footer__inner {
        align-items: center;
        flex-direction: column;
        padding: 27px 0;
    }

    .footerLogo {
        align-items: center;
        flex-direction: column;
        justify-content: center;
        row-gap: 8px;
    }

    .footerLogo img {
        height: 30px;
    }

    .footer__copyright {
        font-size: 10px;
    }
}
