/* ==========================================================================
   service.css
   サービスページ専用スタイル
   1. サービス詳細セクション (.service-detail-section)
   2. 課題・解決策サブセクション (.service-detail-subsection)
   3. サービス内容リスト (.service-detail-section__points)
   4. 画像ギャラリー (.service-detail-section__image-gallery)
   5. テキスト切り替えスライダー (.service-text-slider)
   6. レスポンシブ対応
   ========================================================================== */

/* === 1. サービス詳細セクション (.service-detail-section) === */
.service-page {
    counter-reset: service-counter;
    background-color: var(--color-bg-light);
}

.service-detail-section::before {
    content: '0' counter(service-counter);
    counter-increment: service-counter;
    position: absolute;
    top: 0;
    left: -10px;
    font-family: var(--font-family-heading);
    font-size: 8rem;
    font-weight: 700;
    color: var(--color-main);
    opacity: 0.1;
    line-height: 1;
    z-index: -1;
}

.service-detail-section {
    position: relative;
    padding: 60px 0;
    margin-bottom: 40px;
    border-bottom: 3px solid #dddddd;
}

.service-detail-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.service-detail-section__main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: flex-start;
}

.service-detail-section__header {
    margin-bottom: 30px;
}

.service-detail-section__number {
    display: block;
    font-family: var(--font-family-heading);
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-main);
    letter-spacing: 0.1em;
    margin-bottom: 10px;
}

.service-detail-section__title {
    font-size: 3rem;
    color: var(--color-main);
    margin-bottom: 20px
}

/* === 2. 課題・解決策サブセクション (.service-detail-subsection) === */
.service-detail-subsection {
    position: relative;
    margin-bottom: 30px;
    background-color: #fff;
    padding: 25px;
    border-radius: var(--radius);
    border: 1px solid #cacaca;
}

.service-detail-subsection::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 6px;
    width: 100%;
    height: 100%;
    background-color: var(--color-main);
    border-radius: var(--radius);
    z-index: -1;
}

.service-detail-subsection__title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-main);
    margin-bottom: 10px;
    padding-bottom: 15px;
    border-bottom: 2px solid;
    border-image: linear-gradient(to right, var(--color-main), transparent) 1;
}

.service-detail-subsection__text {
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    padding-left: 0;
}

.service-detail-subsection__title::before {
    display: block;
    content: '';
    flex-shrink: 0;
    width: 1.2em;
    height: 1.2em;
    background-color: var(--color-main);
}

.service-detail-subsection:nth-of-type(1) .service-detail-subsection__title::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M11 18h2v-2h-2v2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M11 18h2v-2h-2v2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4z'/%3E%3C/svg%3E");
}

.service-detail-subsection:nth-of-type(2) .service-detail-subsection__title::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm-2.01-7.29L7.81 11.41l-1.42 1.41 3.6 3.6 7.59-7.59L16.18 7.41l-6.19 6.3z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm-2.01-7.29L7.81 11.41l-1.42 1.41 3.6 3.6 7.59-7.59L16.18 7.41l-6.19 6.3z'/%3E%3C/svg%3E");
}

/* === 3. サービス内容リスト (.service-detail-section__points) === */
.service-detail-section__points {
    margin-top: 40px;
    overflow: hidden;
}

.service-detail-section__points h5,
.service-detail-section__points ul,
.service-detail-section__points li {
    margin: 0;
    padding: 0;
    list-style: none;
}
.service-detail-section__points li::before {
    display: none;
}

.service-detail-section__points h5 {
    display: inline-block;
    position: relative;
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--color-text-light);
    background-color: var(--color-main);
    padding: 8px 16px;
    border-radius: var(--radius) var(--radius) 0 0;
    z-index: 1;
}
.service-detail-section__points h5::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20px;
    width: 100vw;
    height: 2px;
    background-color: var(--color-main);
    z-index: -1;
}
.service-detail-section__points ul {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}
.service-detail-section__points li {
    position: relative;
    padding: 12px 20px;
    border-left: 5px solid var(--color-main);
    background-color: #fff;
    font-size: 0.95rem;
    font-weight: 500;
}

.service-detail-section__points li::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    width: 100%;
    height: 100%;
    background-color: var(--color-main);
    z-index: -1;
}

/* === 4. 画像ギャラリー (.service-detail-section__image-gallery) === */
.service-detail-section__image-gallery {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    aspect-ratio: 3 / 2;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.service-detail-section__image-gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.service-detail-section {
    scroll-margin-top: 100px;
}

/* === 5. テキスト切り替えスライダー (.service-text-slider) === */
.service-text-slider {
    position: relative;
}

.service-text-slider__content {
    display: grid;
}

.service-text-slide {
    grid-area: 1 / 1;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s;
    pointer-events: none;
}

.service-text-slide.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    z-index: 1;
}

.service-text-slider__nav {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 0;
}

@keyframes progress-bar {
    0% { width: 0; }
    100% { width: 100%; }
}

.service-text-slider__bar {
    position: relative;
    width: 50px;
    height: 4px;
    background-color: #ddd;
    border: none;
    cursor: pointer;
    padding: 0;
    overflow: hidden;
}

.service-text-slider__bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0;
    background-color: var(--color-main);
}

.service-text-slider__bar.is-active::after {
    animation: progress-bar 20s linear forwards;
}

.service-text-slider__bar.is-completed::after {
    width: 100%;
    animation: none;
}

/* === 6. レスポンシブ対応 === */

@media (max-width: 767px) {
    .service-detail-section {
        padding-bottom: 20px;
    }
    .service-detail-section__main {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .service-detail-section__image-gallery {
        order: -1;
    }
    .service-detail-section__points ul {
        grid-template-columns: 1fr;
    }
    .service-detail-section__title {
        font-size: 1.8rem;
    }
    .page-content {
        padding: 0;
    }
    .service-detail-section__number {
        margin: 0;
    }
    .service-detail-section::before {
        top: 0px;
        left: auto;
        right: -10px;
        font-size: 6rem;
    }
    .service-detail-subsection__title {
        font-size: 1rem;
    }
    .service-detail-subsection__text {
        font-size: 0.85rem;
    }

    .service-detail-section {
        padding-top: 30px;
        margin-bottom: 10px;
    }
}

@media (max-width: 575px) {
    .service-detail-section__header {
        margin-bottom: 20px;
    }
    .service-detail-section__title {
        font-size: 1.6rem;
    }
    .service-detail-subsection__text {
        padding-left: 0;
    }
}
