/* スライドのフェードイン */
@keyframes fadeInSlide {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

/* テキストのフェードイン */
@keyframes fadeInText {
    0% {
        opacity: 0;
        transform: translate(0, 0);
    }
    100% {
        opacity: 1;
    }
}

/* テキスト1のフェードアウト＆左にスライドアウト */
@keyframes slideOutText1 {
    0% {
        opacity: 1;
        transform: translate(0, 0);
    }
    100% {
        opacity: 0;
        transform: translateX(-100%); /* 左にスライド */
    }
}

/* テキスト2のフェードアウト（その位置のまま） */
@keyframes fadeOutText2 {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

/* テキスト3のフェードアウト＆右にスライドアウト */
@keyframes slideOutText3 {
    0% {
        opacity: 1;
        transform: translate(0, 0);
    }
    100% {
        opacity: 0;
        transform: translateX(100%); /* 右にスライド */
    }
}

/* テキスト4のフェードイン（左の外側から中央へ移動） */
@keyframes slideInText4 {
    0% {
        opacity: 0;
        transform: translate(-150%, -50%); /* 左の外側からスタート */
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%); /* スライドの中央に到達 */
    }
}

/* ベースのスタイル */
.slide {
    width: 1000px;
    height: 300px;
    position: relative;
    margin: 0 auto;
    overflow: hidden;
    background-image: url("../img/recruit/slide-b.jpg");
    animation: fadeInSlide 1s ease-in 1s forwards; /* 1秒後にスライドがフェードイン */
    opacity: 0;
}

.text1, .text2, .text3 {
    width: auto;
    height: 25px;
    position: absolute;
    opacity: 0;
}
.text4 {
    width: auto;
    height: 22px;
    position: absolute;
    opacity: 0;
}

.text1 {
    top: 31%;
    left: 35%;
    animation: fadeInText 1s ease-in 2s forwards, slideOutText1 2s ease-out 7s forwards; /* 2秒待ってから2秒かけてフェードアウト */
}

.text2 {
    top: 45%;
    left: 38%;
    animation: fadeInText 1s ease-in 3s forwards, fadeOutText2 2s ease-out 7s forwards; /* 2秒待ってから2秒かけてフェードアウト */
}

.text3 {
    top: 59%;
    left: 41%;
    animation: fadeInText 1s ease-in 4s forwards, slideOutText3 2s ease-out 7s forwards; /* 2秒待ってから2秒かけてフェードアウト */
}

.text4 {
    top: 50%;
    left: 50%;
    transform: translate(-150%, -50%); /* 左の外側から始まり、中央に移動 */
    animation: slideInText4 2s ease-in 10s forwards; /* 2秒後にフェードイン開始 */
    opacity: 0;
}
