/* ========================================
   Case Study Section - 施工事例
   ======================================== */

.case-study-section {
    position: relative;
    width: 100%;
    margin: 80px 0;
    overflow: hidden;
    background: #f5f5f5;
    padding: 60px 0 80px;
}

/* スライダーコンテナ */
.case-study-slider {
    position: relative;
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px;
}

/* スライダートラック */
.case-study-track {
    display: flex;
    gap: 40px;
    transition: transform 0.5s ease;
    cursor: default;
}

/* 個別のスライド */
.case-study-slide {
    position: relative;
    flex: 0 0 800px;
    width: 800px;
    background: #ffffff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
    opacity: 0.7;
}

.case-study-slide.active {
    opacity: 1;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.case-study-slide:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.2);
}

/* Before/After比較コンテナ */
.ba-comparison {
    position: relative;
    width: 100%;
    height: 480px;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    touch-action: none;
}

/* 画像コンテナ */
.ba-image-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.ba-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

/* Before画像（上層、左側を表示） */
.ba-before-container {
    z-index: 2;
    clip-path: inset(0 50% 0 0);
}

/* After画像（下層） */
.ba-after-container {
    z-index: 1;
}

/* ラベル */
.ba-label {
    position: absolute;
    top: 20px;
    padding: 8px 20px;
    background: rgba(255, 255, 255, 0.95);
    color: #333333;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

.ba-label.before {
    left: 20px;
}

.ba-label.after {
    right: 20px;
}

/* ディバイダー（境界線） */
.ba-divider {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 100%;
    background: #ffffff;
    z-index: 3;
    cursor: ew-resize;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.ba-divider::before,
.ba-divider::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    background: #ffffff;
}

.ba-divider::before {
    top: 0;
    height: calc(50% - 30px);
}

.ba-divider::after {
    bottom: 0;
    height: calc(50% - 30px);
}

/* ハンドル（中央の円） */
.ba-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    background: transparent;
    border: 3px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4;
    cursor: ew-resize;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    transition: all 0.3s ease;
}

.ba-handle:hover {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

/* 矢印アイコン */
.ba-arrow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0 12px;
}

.ba-arrow svg {
    width: 12px;
    height: 18px;
    fill: #ffffff;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.ba-arrow svg:last-child {
    transform: rotate(180deg);
}

/* タイトル */
.case-study-title {
    padding: 20px 30px;
    background: #ffffff;
    border-top: 1px solid #e0e0e0;
}

.case-study-title h3 {
    font-size: 18px;
    font-weight: 700;
    color: #333333;
    margin: 0;
    text-align: center;
}

/* もっと見るボタン */
.case-study-more {
    text-align: center;
    margin-top: 50px;
}

.case-study-more-btn {
    display: inline-block;
    padding: 18px 60px;
    background: #666666;
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.case-study-more-btn:hover {
    background: #555555;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* インジケーター */
.case-study-indicators {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 40px;
}

.case-study-indicator {
    width: 12px;
    height: 12px;
    background: #cccccc;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    padding: 0;
}

.case-study-indicator.active {
    background: #666666;
    transform: scale(1.3);
}

.case-study-indicator:hover {
    background: #999999;
}

/* ========================================
   レスポンシブ対応
   ======================================== */

@media (max-width: 991px) {
    .case-study-section {
        padding: 40px 0 60px;
    }
    
    .case-study-slide {
        flex: 0 0 600px;
        width: 600px;
    }
    
    .ba-comparison {
        height: 360px;
    }
    
    .case-study-title h3 {
        font-size: 16px;
    }
}

@media (max-width: 767px) {
    .case-study-section {
        padding: 30px 0 40px;
    }
    
    .case-study-slider {
        padding: 0 10px;
    }
    
    .case-study-slide {
        flex: 0 0 calc(100vw - 40px);
        width: calc(100vw - 40px);
    }
    
    .ba-comparison {
        height: 280px;
    }
    
    .ba-label {
        font-size: 12px;
        padding: 6px 15px;
        top: 15px;
    }
    
    .ba-handle {
        width: 60px;
        height: 60px;
        border-width: 2px;
    }
    
    .ba-arrow {
        padding: 0 10px;
    }
    
    .ba-arrow svg {
        width: 10px;
        height: 16px;
    }
    
    .case-study-title {
        padding: 15px 20px;
    }
    
    .case-study-title h3 {
        font-size: 15px;
    }
    
    .case-study-more-btn {
        padding: 15px 50px;
        font-size: 16px;
    }
}

