/* ==========================================================================
                            トップページのスタイル
   ========================================================================== */


/* 共通スタイル
   ========================================================================== */
.top-section {
    padding: 5rem 0;
}

/* ヒーローセクション
   ========================================================================== */
.hero {
    position: relative;
    aspect-ratio: 1440 / 656;
    /* max-height: 900px; */
    width: 100%;

    .swiper-slide {
        position: relative;

        img {
            width: 100%;
            height: 100%;
            /* object-position: center; */
        }

        &::before {
            content: '';
            display: block;
            width: 100%;
            aspect-ratio: 1440 / 384;
            background-image: url(../assets/images/front-page/mv-line.png);
            background-size: 100%;
            background-repeat: no-repeat;
            background-position: center;
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            z-index: 2;
            pointer-events: none;

            /* 初期状態: 非表示 */
            clip-path: inset(0 100% 0 0);
        }

        /* 線描画アニメーション実行 */
        &.draw-line::before {
            animation: drawLine 1s cubic-bezier(.47, .1, .59, 1) 0.8s forwards;
        }
    }

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

    .hero__inner {
        position: relative;
        width: 100%;
        height: 100%;
        z-index: 2;
        pointer-events: none;
    }

    .hero__title__wrapper {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        left: calc(120 / 1440 * 100%);
        z-index: 3;
    }

    .hero__title {
        font-size: min(calc(36 / 1440 * 100vw), 48px);
        font-weight: 500;
        letter-spacing: 0.05em;
        color: var(--text-color);
        text-shadow: 0 3px 6px rgb(0 0 0 / 0.16);
        transition: color 1s ease, text-shadow 1s ease;
        animation: fadeInLeft 0.8s ease-out forwards;

        br {
            display: none;
        }
    }

    &:has(.hero__slide__3.swiper-slide-active),
    &:has(.hero__slide__4.swiper-slide-active) {
        .hero__title {
            color: var(--white-color);
        }
    }


    @media screen and (width <=800px) {
        aspect-ratio: 390 / 372;

        .swiper-slide {
            &::before {
                background-image: url(../assets/images/front-page/mv-line_sp.png);
                aspect-ratio: 390 / 114;
                bottom: calc(40 / 372 * 100%);
            }

        }

        .hero__title__wrapper {
            left: calc(16 / 390 * 100%);
            top: calc(86 / 372 * 100%);
            transform: none;
        }

        .hero__title {
            font-size: calc(18 / 390 * 100vw);
            letter-spacing: 0.1em;

            br {
                display: inline;
            }
        }
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-10rem);
    }

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

/* 曲線を左から右に描画するアニメーション */
@keyframes drawLine {
    from {
        clip-path: inset(0 100% 0 0);
    }

    to {
        clip-path: inset(0 0 0 0);
    }
}

.hero:has(.swiper-slide.is-slide-3) .hero__title {
    color: var(--white-color);
}


/* クロースパーツについてセクション
   ========================================================================== */
.top-about {
    padding-top: 6.5rem;
    padding-bottom: 8.5rem;
    background-image: url(../assets/images/common/bg-circle.svg);
    background-repeat: no-repeat;
    background-position: right -213px bottom -240px;
    background-size: 688px auto;

    .top-about__inner {
        display: flex;
        gap: 3.5rem;
        /* margin-left: calc(50% - 50vw); */
        padding-left: 0;
    }

    .top-about__image-container {
        /* width: min(50vw, 670px); */
        margin-left: calc(50% - 49vw);
        flex: 1;

        img {
            width: 100%;
            height: auto;
            display: block;
        }
    }

    .top-about__container {
        width: 50%;
        max-width: 600px;
        margin-top: max(5rem, calc(80 / 1440 * 100vw));
    }

    .top-about__text {
        h3 {
            font-size: clamp(1rem, 0.646rem + 0.94vw, 1.25rem);
            letter-spacing: 0.1em;
            margin-top: max(3.5rem, calc(56 / 1440 * 100vw));
            font-weight: 500;
            ;
        }

        p {
            margin-top: 1rem;
            line-height: 2;
            letter-spacing: 0.11em;

        }
    }

    .top-section__button {
        margin-left: auto;
        margin-top: max(1rem, calc(16 / 1440 * 100vw));
    }

    @media screen and (width <=600px) {
        padding-top: 2.5rem;
        padding-bottom: 5rem;
        background-image: url(../assets/images/common/bg-circle_sp.svg);
        background-size: 336px auto;
        background-position: right -100px bottom -54px;

        .top-about__inner {
            flex-direction: column;
            text-align: center;
            gap: 2rem;
        }

        .top-about__image-container {
            margin-left: 0;
            order: 2;
        }

        .top-about__container {
            width: 100%;
            max-width: none;
            margin-top: 1rem;
            display: contents;

            .section-title {
                width: 100%;
                order: 0;
                padding-left: 1rem;
            }

            .top-about__text {
                order: 1;
                padding-left: 1rem;

                h3 {
                    margin-top: 0;
                    text-align: left;
                }

                p {
                    text-align: left;
                }
            }
        }

        .top-about__button-wrapper {
            order: 3;
            padding-left: 1rem;
        }

    }
}

/* 事業内容セクション
   ========================================================================== */
.top-business {
    position: relative;
    padding-bottom: 4rem;

    &::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 65%;
        background-color: var(--primary-color);
        background-size: cover;
        z-index: 0;
    }

    .top-business__inner {
        position: relative;
        z-index: 1;
    }

    .top-business__list {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        margin-top: 2.5rem;
    }

    .top-business__item {
        padding: 1.5rem;
        background-repeat: no-repeat;
        background-size: 100%;
        background-position: center;
        position: relative;
        aspect-ratio: 40 / 32;
        transition: background-size 0.3s ease;

        .top-business__link {
            display: inline-block;
            width: 100%;
            height: 100%;
            text-align: center;
            align-content: center;
        }

        h3 {
            color: var(--white-color);
            font-size: clamp(1rem, 0.292rem + 1.89vw, 1.5rem);
            font-weight: 500;
            letter-spacing: 0.1em;
            position: relative;
            z-index: 2;
        }

        img {
            position: relative;
            z-index: 2;
            margin-inline: auto;
            margin-top: 1rem;
        }

        &::before {
            content: '';
            display: block;
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: #003264;
            opacity: 0.35;
            transition: opacity 0.3s ease;
            pointer-events: none;
        }

        &:hover {
            background-size: 110%;
        }

        &:hover::before {
            opacity: 0.7;
        }

        &:nth-of-type(1) {
            background-image: url(../assets/images/front-page/business01.jpg);
        }

        &:nth-of-type(2) {
            background-image: url(../assets/images/front-page/business02.jpg);
        }

        &:nth-of-type(3) {
            background-image: url(../assets/images/front-page/business03.jpg);
        }
    }

    @media screen and (width <=600px) {
        padding-top: 3rem;
        padding-bottom: 5rem;

        &::before {
            height: 57%;
        }

        .top-business__list {
            grid-template-columns: 1fr;
            height: auto;
            margin-top: 2rem;
        }

        .top-business__item {
            aspect-ratio: 358 / 96;
            padding: 0 3rem;
            background-position: center calc(50% + 1rem);

            .top-business__link {
                display: grid;
                grid-template-columns: 1fr auto 1fr;
                align-items: center;

                &::before {
                    content: '';
                    display: block;
                }

                img {
                    margin-left: auto;
                    margin-right: 0;
                    margin-top: 0;
                    width: 1.25rem;
                    justify-self: end;
                }
            }
        }
    }
}

/* 受注実績セクション
   ========================================================================== */
.top-works {
    padding-top: 0;

    .top-works__list {
        margin-top: 5rem;
        display: grid;
        grid-template-columns: min(380px, 100%) 1fr;
        align-items: start;
        gap: 5rem;
    }

    .top-works__term {
        background-color: var(--primary-color);
        color: var(--white-color);
        font-size: clamp(1rem, 0.505rem + 1.32vw, 1.35rem);
        font-weight: 500;
        letter-spacing: 0.1em;
        padding: 0.65rem;
        text-align: center;
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 0.5rem;

        &::before {
            content: '';
            display: block;
            width: clamp(1.75rem, -0.373rem + 5.66vw, 3.25rem);
            aspect-ratio: 1;
            background-image: url(../assets/images/front-page/works-icon01.svg);
            background-repeat: no-repeat;
            background-size: contain;
            background-position: center;
        }

        &:nth-of-type(2) {
            &::before {
                background-image: url(../assets/images/front-page/works-icon02.svg);
            }
        }

        &:nth-of-type(3) {
            &::before {
                background-image: url(../assets/images/front-page/works-icon03.svg);
            }
        }
    }

    .top-works__description {
        /* font-size: 1rem; */
        line-height: 2;
        letter-spacing: 0.1em;
        color: #146EC8;

        span {
            display: block;
            margin-bottom: 0.5rem;
            color: var(--text-color);
        }
    }

    @media screen and (width <=600px) {
        .top-works__list {
            margin-top: 2.5rem;
            grid-template-columns: 1fr;
            gap: 1.5rem;
        }

        .top-works__term {
            width: calc(240 / 358 * 100%);
            min-width: 15rem;

            &:not(:first-of-type) {
                margin-top: 1rem;
            }
        }
    }
}

/* クロースパーツの強みセクション
   ========================================================================== */
.top-features {
    background-color: var(--bg-color);
    padding-bottom: 10rem;
    overflow: hidden;

    .section-title__lg {
        --font-color: var(--primary-color);

        .en {
            opacity: 0.1;
        }
    }

    .top-features__list {
        margin-top: 5rem;
    }

    .top-features__item {
        display: flex;
        align-items: flex-end;

        &+.top-features__item {
            margin-top: 8rem;
        }
    }

    .top-features__item__image {
        position: relative;
        z-index: 1;
        width: calc(640 / 1440 * 100vw);
        max-width: 720px;
        /* width: min(50vw, 720px); */
        margin-left: calc(50% - 50vw);

        img {
            width: 100%;
            height: auto;
            display: block;
        }
    }

    .top-features__item__container {
        background-color: rgb(255 255 255 / 0.9);
        padding: 2.5rem;
        padding-top: 4rem;
        position: relative;
        z-index: 2;
        margin-left: -6rem;
        margin-right: 0;
        margin-bottom: -3rem;
        flex: 1;

        .top-features__number {
            font-size: 4.5rem;
            font-weight: 700;
            line-height: 1.2;
            color: var(--primary-color);
            position: absolute;
            top: -3rem;
            left: auto;
            right: 2rem;
            border-bottom: 1px solid var(--primary-color);
        }

        .top-features__title {
            font-size: clamp(1.125rem, -0.113rem + 3.3vw, 2rem);
            font-weight: 600;
            letter-spacing: 0.1em;
            color: var(--primary-color)
        }

        .top-features__text {
            margin-top: 1rem;
            line-height: 2;
            letter-spacing: 0.1em;
        }
    }

    .top-features__item:nth-child(odd) {
        flex-direction: row-reverse;

        .top-features__item__image {
            margin-left: 0;
            margin-right: calc(50% - 50vw);
        }

        .top-features__item__container {
            margin-right: -6rem;
            margin-left: 0;
        }

        .top-features__number {
            left: 2rem;
            right: auto;
        }
    }

    @media screen and (width <=800px) {
        padding-top: 4rem;
        padding-bottom: 5rem;

        .top-features__list {
            margin-top: 3.5rem;
        }

        .top-features__item {
            flex-direction: column;
            align-items: center;

            &+.top-features__item {
                margin-top: 2.5rem;
            }
        }

        .top-features__item__image {
            margin: 0;
            width: 100%;
            max-width: none;
        }

        .top-features__item__container {
            width: calc(334 / 358 * 100%);
            margin-left: auto;
            margin-right: 0;
            margin-bottom: 0;
            margin-top: -1.5rem;
            padding: 2.5rem 1rem;

            .top-features__number {
                left: 1rem;
                right: auto;
                top: -1.5rem;
                font-size: 2.5rem;
            }
        }



        .top-features__item:nth-child(odd) {
            flex-direction: column;

            .top-features__item__image {
                margin: auto;
            }

            .top-features__item__container {
                margin-left: auto;
                margin-right: 0;
            }

            .top-features__number {
                left: 1rem;
                right: auto;
            }
        }
    }
}

/* 新着情報セクション
   ========================================================================== */
.top-news {
    padding-bottom: 10rem;

    .top-news__list {
        margin-top: 1.5rem;
    }

    .top-news__item__link {
        display: flex;
        align-items: baseline;
        gap: 1.5rem;
        width: 100%;
        padding: 1.5rem 0 1rem;
        border-bottom: 1px solid #7B7B7B;
    }

    .top-news__date {
        font-size: clamp(0.625rem, 0.448rem + 0.47vw, 0.75rem);
        color: #7B7B7B;
        letter-spacing: 0.1em;
    }

    .top-news__category {
        font-size: clamp(0.625rem, 0.448rem + 0.47vw, 0.75rem);
        font-weight: 500;
        letter-spacing: 0.1em;
        color: #7B7B7B;
        border: 1px solid #7B7B7B;
        border-radius: 100vw;
        padding: 0.25rem 1.25rem;
    }

    .top-news__title {
        font-size: 1rem;
        font-weight: 500;
        letter-spacing: 0.1em;
    }

    .top-news__button {
        margin-top: 4rem;
        margin-left: auto;
    }

    @media screen and (width <=600px) {
        padding-bottom: 5rem;

        .top-news__item__link {
            display: grid;
            grid-template-columns: auto 1fr;
            row-gap: 0.5rem;
        }

        .top-news__date {
            grid-column: 1 / 2;
            grid-row: 1 / 2;
        }

        .top-news__category {
            grid-column: 2 / 3;
            grid-row: 1 / 2;
            justify-self: start;
            padding: 0.125rem 1.75rem;
        }

        .top-news__title {
            grid-column: 1 / 3;
            grid-row: 2 / 3;
            font-size: 0.875rem;
        }

        .top-news__button {
            margin-top: 2.5rem;
        }
    }
}

/* 各ページリンクセクション
   ========================================================================== */
.top-info {
    .top-info__recruit {
        display: block;
    }

    .top-info__company {
        display: block;
        background-color: var(--primary-color);
        color: var(--white-color);
        margin-top: 7.5rem;
        max-width: 1000px;
        width: 100%;
        height: 10rem;
        display: flex;
        align-items: center;
        gap: 2rem;
        padding: 0 5rem;
        margin-inline: auto;
        position: relative;

        .en {
            text-transform: uppercase;
            font-size: clamp(2.5rem, 0.377rem + 5.66vw, 4rem);
            font-weight: 700;
            letter-spacing: 0.1em;
            z-index: 2;
        }

        .ja {
            font-size: clamp(1.125rem, 0.948rem + 0.47vw, 1.25rem);
            font-weight: 500;
            letter-spacing: 0.1em;
            z-index: 2;
        }

        &::after {
            content: '';
            display: inline-block;
            margin-left: 0.5rem;
            background-image: url(../assets/images/common/btn-icon--blue.svg);
            width: 2rem;
            aspect-ratio: 1;
            background-size: contain;
            background-repeat: no-repeat;
            justify-self: end;
            z-index: 2;
            transition: background-image 0.3s ease;
        }

        &::before {
            content: '';
            display: block;
            width: 100%;
            height: 100%;
            background-color: var(--accent-color);
            position: absolute;
            top: 0;
            left: 0;
            z-index: 0;
            transform: scaleX(0);
            transform-origin: right;
            transition: transform 0.2s ease;
        }

        &:hover {
            &::before {
                transform: scaleX(1);
                transform-origin: left;
            }

            &::after {
                background-image: url(../assets/images/common/btn-icon--yellow.svg);
            }
        }

        @media screen and (width <=768px) {
            margin-top: 5rem;
            display: grid;
            grid-template-columns: auto 1fr;
            height: auto;
            padding: 1.75rem 2.5rem;
            column-gap: 1rem;
            row-gap: 0;

            .en {
                grid-column: 1 / 3;
                line-height: 1.5;
            }

            .ja {
                grid-column: 1 / 2;
            }

            &::after {
                justify-self: start;
            }
        }
    }
}

/* CTAセクション
   ========================================================================== */
.cta-section {
    margin-top: 10rem;

    @media screen and (width <=800px) {
        margin-top: 5rem;
    }
}