/*メインコンテンツ共通部分　-----------------------------*/
.main-contents {
    position: relative;
    margin-left: 5%;
    margin-right: 5%;
}

.service-details h2 {
    font-size: 2.5rem;
    margin-bottom: 1.4vw;
    white-space: normal;       /* 改行を許可 */
    writing-mode: horizontal-tb; 
    text-orientation: mixed;
}

.service-details p {
    display: block;            
    font-size: 1.6rem;
    line-height: 1.8;
    margin: 0 0 2.8vw 0;    
    word-wrap: break-word;     
    word-break: break-word;    
}

.service-item {
    display: flex;
    flex-wrap: nowrap;       /* 折り返し禁止 */
    align-items: stretch;
    margin-bottom: 4.2vw;
    width: 100%;
    background-color: #afafaf;
}

.service-item.reverse {
    flex-direction: row-reverse;
}

.service-text,
.service-image {
    flex: 1;
    display: flex;
}

.service-text {
    padding: 2.8vw;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: #000;
}

.service-text h2 {
    font-size: 4rem;
    font-weight: 900;
    margin-bottom: 1.4vw;
    line-height: 1.4;
    position: relative;
    padding-left: 8.3vw;
    color: #333333;
    z-index: 1;
}

.service-text h2::before {
    content: attr(data-num);
    position: absolute;
    left: 0;
    top: -1.4vw;
    font-size: 12rem;
    font-weight: 900;
    color: #000;
    line-height: 1;
    font-family: "Agency FB", "Bebas Neue", "Arial Narrow", Impact,
                 "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", "Noto Sans JP", sans-serif;
    z-index: 0;  
}


.service-text p {
    position: relative;
    text-align: justify;
    z-index: 1;
    font-size: 1.6rem;
    line-height: 1.8;
    margin: 0;
    padding-left: 0;
    text-indent: 6.9vw;
    margin-top: 0.7vw;
}

.service-image img {
    width: 100%;
    height: auto;
    display: block;
}

@media screen and (max-width: 768px) {
    .service-item.reverse {
        flex-direction: column;
    }

    .service-item {
        position: relative;
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 2vw;
    }

    .service-image {
        position: absolute;
        right: 2.6vw;
        top: 3vw;
        width: 100%;
        max-width: 45vw;
        margin-bottom: 2.6vw;
        transform: translate(-2vw, 0);
    }

    .service-text {
        width: 90%;
        margin: 0 auto;
    }

    .service-image img {
        width: 100%;
        margin: 0 auto 2vw;
    }

    .service-text h2 {
        font-size: 2rem;
        padding-left: 0;
        margin-bottom: 2vw;
    }

    .service-text h2::before {
        font-size: 6rem;
        position: static;
        display: block;
        margin-top: 5vw;
        margin-bottom: 1vw;
    }

    .service-text p {
        width: 100%;
        font-size: 1.3rem;
        text-indent: 0;
        margin-top: 3vw;
        margin-bottom: 2vw;
    }
}
