@layer reset, base, components, utilities;

@import url("reset.css") layer(reset);
@import url("base.css") layer(base);
@import url("common.css") layer(components);
@import url("utilities.css") layer(utilities);

@layer components {

    /* テキストリンクのホバーエフェクト */
    .main-content {

        /* 画像・動画を含むリンクはafter擬似要素を除外 */
        a:not(:has(img)):not(:has(video)) {
            position: relative;
            text-decoration: none;
            transition: color 0.1s ease-out;
        }

        a:not(:has(img)):not(:has(video))::after {
            content: '';
            position: absolute;
            left: 0;
            bottom: 0;
            width: 100%;
            height: 0;
            background-color: #000;
            transition: height 0.1s ease-out;
            z-index: -1;
        }

        a:not(:has(img)):not(:has(video)):hover {
            color: #fff;
        }

        a:not(:has(img)):not(:has(video)):hover::after {
            height: 100%;
        }

        /* リンク画像のホバーエフェクト */
        a>img {
            transition: filter 0.3s ease;
        }

        a:hover>img {
            filter: brightness(1.1);
        }

        a>video {
            transition: filter 0.3s ease;
        }

        a:hover>video {
            filter: brightness(1.15);
        }
    }

    /* Loading */
    .loading {
        position: fixed;
        inset: 0;
        background-color: var(--color-background);
        display: grid;
        place-items: center;
        z-index: 9999;
        transition: opacity var(--transition), visibility var(--transition);
    }

    .loading svg {
        width: 120px;
    }

    .loading svg path {
        opacity: 0;
        animation: fadeInLetter 0.6s ease-out forwards;
    }

    .loading svg path:nth-child(1) {
        animation-delay: 0s;
    }

    .loading svg path:nth-child(2) {
        animation-delay: 0.5s;
    }

    .loading svg path:nth-child(3) {
        animation-delay: 1.0s;
    }

    .loading svg path:nth-child(4) {
        animation-delay: 1.5s;
    }

    @keyframes fadeInLetter {
        from {
            opacity: 0;
            transform: translateY(20px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .loading.loaded {
        opacity: 0;
        visibility: hidden;
    }

    .loading__spinner {
        width: clamp(40px, 4vw, 60px);
        height: clamp(40px, 4vw, 60px);
        border: 3px solid var(--color-border);
        border-top-color: var(--color-primary);
        border-radius: 50%;
        animation: spin 1s linear infinite;
    }

    .loading__progress {
        position: absolute;
        bottom: 20%;
        width: clamp(150px, 15vw, 200px);
        height: 4px;
        background-color: var(--color-border);
        border-radius: 2px;
        overflow: hidden;
    }

    .loading__progress-bar {
        height: 100%;
        background-color: var(--color-primary);
        width: 0%;
        transition: width 0.3s ease;
    }

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

    .main-content {
        opacity: 0;
        overflow: hidden;
        transition: opacity 0.6s ease;
    }

    .main-content.visible {
        opacity: 1;
    }

    .reebag {
        display: inline-block;
        margin-right: 0.7rem;
        font-size: 1.8rem;
        font-weight: 410;
    }

    /* heroセクション */
    .hero {
        position: relative;

        /* PC版デフォルト表示 */
        .hero-bg-pc {
            display: flex;
            align-items: stretch;
        }

        /* SP版Swiperデフォルト非表示 */
        .hero-bg-sp {
            display: none;
        }

        .epor-logo {
            position: absolute;
            z-index: 9;
            width: 8vw;
            bottom: 80px;
            left: 48%;
        }

        .hero-bg {
            & div {
                flex: 1;
            }

            .hero-bg-left {
                border: 2.5vw solid #604e32;
                background-image: url("../assets/images/bnr_pc_left.webp");
                background-position: bottom;
                background-size: 110%;
                background-repeat: no-repeat;
                background-clip: padding-box;
                /* 最後で停止 */
                animation: zoomOut 30s ease-out 1 forwards;
            }
        }

        .hero-logo-container {
            transform: translateX(-50%);
            position: absolute;
            top: 10%;
            left: 52%;
            width: 100%;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            color: #fff;
            z-index: 99;

            .hero-logo-main-wrapper {
                position: relative;
                overflow: hidden;
                height: 1em;
                /* 文字の高さとぴったり合わせる */
                font-size: 8.4vw;
                /* 親要素でフォントサイズを定義 */
            }

            .hero-logo-main {
                font-size: inherit;
                /* 親から継承 */
                line-height: 1;
                font-weight: 500;
                position: relative;
            }

            .hero-logo-sub-1 {
                font-size: 4.2vw;
                line-height: 1.5;
            }

            .hero-logo-sub-2 {
                font-size: 2.2vw;
                line-height: 2;
            }
        }
    }

    @keyframes zoomOut {
        from {
            background-size: 150%;
            /* background-position: bottom 120%; */
        }

        to {
            background-size: 110%;
            /* background-position: bottom 100% */
        }
    }

    /* introセクション */
    .intro {
        margin-block: var(--space-fluid-lg);
        text-align: center;

        & p {
            text-align: center;
            font-size: var(--text-fluid-sm);
            line-height: var(--line-height-loose);
            color: var(--color-text-light);
        }

        & img {
            width: 40%;
            margin: var(--space-fluid-lg) auto 0 auto;
        }
    }

    /* Size block */
    .size-block {
        & .section-title {
            & .batsu {
                margin-inline: var(--space-fluid-sm);
                font-weight: 350;
                font-size: var(--text-fluid-6xl);
                vertical-align: sub;
            }
        }

        & .video {
            width: var(--width-40);
            margin: 0 auto;
        }

        & .credit {
            width: var(--width-100);
            margin: 0 auto;
            margin-block: var(--space-fluid-md);

            & .column {
                display: flex;
                justify-content: center;
                align-items: center;
                gap: var(--space-fluid-lg);

                & a {
                    font-size: var(--text-fluid-base);
                    border-bottom: 2px solid #000;
                }

            }
        }
    }

    /* Storage block */
    .storage-block {
        & .point {
            width: var(--width-40);
            margin: 0 auto;
            margin-block: var(--space-fluid-sm);

            & .credit {
                display: inline-block;
                font-size: var(--text-fluid-base);
                border-bottom: 1px solid #000;
            }
        }
    }

    /* Ultra lightweight block */
    .lightweight-block {
        & .point {
            width: var(--width-40);
            margin: 0 auto;
            margin-block: var(--space-fluid-sm);

            & .credit {
                display: inline-block;
                font-size: var(--text-fluid-base);
                border-bottom: 1px solid #000;
            }
        }
    }

    /* Other details block */
    .otherdetail-block {
        .inner {
            margin-top: var(--space-fluid-xl);

            .section-title {
                text-align: left;
                width: var(--width-70);
                margin: 0 auto;
            }

            .lead {
                margin: 0 auto;
                width: var(--width-70);
                text-align: left;
                margin-top: var(--space-fluid-md);
            }

            .detail-2 {
                .column {
                    position: relative;
                }

                .label {
                    font-size: var(--text-fluid-3xl);
                    color: #fff;
                    position: absolute;
                    bottom: 6px;
                    left: 16px;
                    z-index: 9;
                }
            }

        }
    }

    /* Lineup block */
    .lineup-block {
        & .grid {
            width: var(--width-50);
            margin: 0 auto;
            margin-block: var(--space-fluid-lg);
            gap: var(--space-fluid-sm);
        }

        .product a.photo {
            display: block;
            width: 90%;
            margin: 0 auto var(--space-fluid-md) auto;
        }

        .product a.credit {
            display: inline-block;
            /* margin: 0 auto var(--space-fluid-sm) auto; */
            border-bottom: 1px solid #000;
        }

        /* .photoホバー時に隣接する.creditもホバー状態にする */
        .product .photo:hover+.credit {
            color: #fff;
        }

        .product .photo:hover+.credit::after {
            height: 100%;
        }
    }

    /* Links */
    .links {
        margin-block: var(--space-fluid-2xl);
        text-align: center;

        .jun-grp {
            margin-bottom: var(--space-fluid-2xl);
        }

        .ex-grp {
            justify-content: center;
            margin: 0 auto;
            gap: var(--space-fluid-md);
        }
    }

    /* Footer */
    .footer {
        margin-top: 160px;

        & a:hover img {
            opacity: 0.5;
        }

        .footer-logo {
            margin: 0 auto 90px auto;
        }

        .footer-logo h3 {
            width: 6%;
            margin: 0 auto 5px auto;
        }

        .footer-logo h3 img {
            width: 100%;
        }

        .footer-logo p {
            font-size: 0.7rem;
            line-height: 2.4rem;
            letter-spacing: 0.1rem;
            text-align: center;
        }

        .footer-link {
            font-size: 0.8rem;
            letter-spacing: 0.1rem;
            margin: 0 auto 90px auto;
            text-align: center;
        }

        .footer-link span {
            color: #aaa;
            margin: 0 15px;
        }

        .footer-sns {
            margin: 0 auto 90px auto;
        }

        .footer-sns p {
            font-size: 1.2rem;
            letter-spacing: 0.1rem;
            margin: 0 auto 30px auto;
            text-align: center;
        }

        .footer-sns a {
            display: block;
            width: 40px;
            margin: 0 auto;
        }

        .footer-sns a:nth-of-type(3) img {
            margin: 0 15px 0 8px;
        }

        .footer-copyright {
            width: 100%;
            text-align: center;
            margin: 0 auto 90px auto;
        }

        .footer-copyright p {
            font-size: 0.7rem;
            letter-spacing: 0.1rem;
        }
    }
}

@media (max-width: 768px) {

    /* Common override */
    .section {
        width: var(--width-screen);
        margin-block: var(--space-fluid-xl);
        text-align: center;
    }

    .section-title--large {
        font-size: var(--text-fluid-4xl);
    }

    .section-title--medium {
        font-size: var(--text-fluid-2xl);
        font-weight: 450;
    }

    .section-title--small {
        font-size: var(--text-fluid-lg);
    }

    .flex {
        width: var(--width-90);
        flex-direction: row;
        gap: var(--space-fluid-sm);

        .column {
            flex: 1;
            max-width: calc(50% - var(--space-fluid-sm) / 2);
        }
    }

    .reebag {
        display: inline-block;
        margin-right: 0.5rem;
        font-size: 1.2rem;
        /* font-weight: 400; */
    }

    /* Loading */
    .loading svg {
        width: 80px;
    }

    /* Heroセクション SP対応 */
    .hero {

        /* PC版を非表示 */
        .hero-bg-pc {
            display: none;
        }

        /* SP版Swiperを表示 */
        .hero-bg-sp {
            display: block;
            height: 70vh;

            .swiper {
                height: 100%;

                /* SP版ではflex設定を無効化 */
                & div {
                    flex: none;
                }
            }

            .swiper-wrapper {
                height: 100%;
            }

            .swiper-slide {
                height: 100%;

                &>img {
                    width: 100%;
                    height: 100%;
                    object-fit: cover;
                }

                .hero-bg-left {
                    width: 100%;
                    height: 100%;
                    border: 4vw solid #604e32;
                    background-image: url("../assets/images/bnr_pc_left.webp");
                    background-size: cover;
                    background-position: center;
                    background-repeat: no-repeat;
                    background-clip: padding-box;
                }
            }

            .swiper-pagination {
                bottom: 20px;

                .swiper-pagination-bullet {
                    background: #fff;
                    opacity: 0.5;

                    &.swiper-pagination-bullet-active {
                        opacity: 1;
                    }
                }
            }
        }

        .epor-logo {
            position: absolute;
            z-index: 9;
            width: 18vw;
            bottom: 50px;
            left: 41%;
        }

        .hero-logo-container {
            .hero-logo-main-wrapper {
                font-size: 15vw;
                /* SPサイズ調整 */
            }

            .hero-logo-sub-1 {
                font-size: 8vw;
            }

            .hero-logo-sub-2 {
                font-size: 5vw;
            }
        }
    }

    .hero-logo-container {
        top: 5%;
        left: 50%;
        width: 100%;

        .hero-logo-main-wrapper {
            position: relative;
            overflow: hidden;
            height: 1em;
            /* 文字の高さとぴったり合わせる */
            font-size: 8.8vw;
            /* 親要素でフォントサイズを定義 */
        }

        .hero-logo-main {
            font-size: inherit;
            /* 親から継承 */
            line-height: 1;
            font-weight: 500;
            position: relative;
        }

        .hero-logo-sub-1 {
            font-size: 4.4vw;
            line-height: 1.5;
        }

        .hero-logo-sub-2 {
            font-size: 2.4vw;
            line-height: 2;
        }
    }

    /* introセクション */
    .intro {
        margin-block: 0;
        margin-top: var(--space-fluid-lg);

        & img {
            width: var(--width-90);
            margin: var(--space-fluid-lg) auto 0 auto;
        }
    }

    /* Size block */
    .size-block {
        & .section-title {
            & .batsu {
                margin-inline: var(--space-fluid-sm);
                font-weight: 350;
                font-size: var(--text-fluid-5xl);
                vertical-align: sub;
            }
        }

        & .video {
            width: var(--width-90);
            margin: 0 auto;
        }

        & .credit {
            width: var(--width-100);
            margin: 0 auto;
            margin-block: var(--space-fluid-md);

            & .column {
                display: flex;
                justify-content: center;
                align-items: center;
                gap: var(--space-fluid-lg);

                & a {
                    font-size: var(--text-fluid-base);
                    border-bottom: 2px solid #000;
                }

            }
        }
    }

    /* Storage block */
    .storage-block {
        & .point {
            width: var(--width-90);
            margin: 0 auto;
            margin-block: var(--space-fluid-sm);

            & .credit {
                display: inline-block;
                font-size: var(--text-fluid-base);
                border-bottom: 1px solid #000;
            }
        }
    }

    /* Ultra lightweight block */
    .lightweight-block {
        & .point {
            width: var(--width-90);
            margin: 0 auto;
            margin-block: var(--space-fluid-sm);

            & .credit {
                display: inline-block;
                font-size: var(--text-fluid-base);
                border-bottom: 1px solid #000;
            }
        }
    }

    /* Other details block */
    .otherdetail-block {
        .inner {
            margin-top: var(--space-fluid-lg);

            .section-title {
                width: var(--width-90);
            }

            .lead {
                width: var(--width-90);
                margin-top: var(--space-fluid-md);
            }

            .detail-2 {
                .column {
                    position: relative;
                }

                .label {
                    font-size: var(--text-fluid-2xl);
                    color: #fff;
                    position: absolute;
                    bottom: 2px;
                    left: 12px;
                    z-index: 9;
                }
            }

        }
    }

    /* Lineup block */
    .lineup-block {
        & .grid {
            width: 95%;
            margin: 0 auto;
            margin-block: var(--space-fluid-lg);
            /* gap: var(--space-fluid-sm); */
        }

        .product a.photo {
            display: block;
            width: 90%;
            margin: 0 auto var(--space-fluid-md) auto;
        }

        .product a.credit {
            display: inline-block;
            /* margin: 0 auto var(--space-fluid-sm) auto; */
            border-bottom: 1px solid #000;
        }

        /* .photoホバー時に隣接する.creditもホバー状態にする */
        .product .photo:hover+.credit {
            color: #fff;
        }

        .product .photo:hover+.credit::after {
            height: 100%;
        }
    }

    /* Links */
    .links {
        margin-block: var(--space-fluid-lg);
        text-align: center;

        .jun-grp {
            margin-bottom: var(--space-fluid-xl);
        }

        .ex-grp {
            justify-content: center;
            margin: 0 auto;
            gap: var(--space-fluid-md);
        }

        .flex {
            display: block;

            .column {
                width: var(--width-90);
                max-width: var(--width-90);
            }
        }
    }

    /* Footer */
    .footer {
        margin-top: 80px;

        .footer-logo h3 {
            width: 20%;
        }
    }
}