/* ========================================
   治療の流れ - エレガント＆シンプル
   ======================================== */

.treatment-flow {
    background: var(--light-gray);
    position: relative;
    overflow: hidden;
}

.treatment-flow::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 50%, rgba(184, 152, 111, 0.03) 0%, transparent 70%);
    pointer-events: none;
}

.flow-timeline {
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

/* PC版：2行×3列のグリッド */
@media (min-width: 769px) {
    .flow-timeline {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ステップカード */
.flow-step {
    position: relative;
    background: white;
    padding: 48px 36px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--border-light);
}

/* スクロールアニメーション用の初期状態 */
.flow-step:not(.animate-in) {
    opacity: 0;
    transform: translateY(30px);
}

/* スクロールアニメーション - 表示時（JavaScriptで遅延制御） */
.flow-step.animate-in {
    animation: fadeInNatural 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes fadeInNatural {
    0% {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* アニメーション完了後、ホバーエフェクトを有効化 */
.flow-step.animate-in {
    animation-fill-mode: forwards;
}

/* ホバーエフェクトのトランジション（アニメーション完了後のみ） */
.flow-step {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                box-shadow 0.4s ease, 
                border-color 0.4s ease;
}

/* トップライン（エレガントなアクセント） */
.flow-step::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-gold);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.flow-step:hover::before {
    transform: scaleX(1);
}

/* ホバーエフェクト - 控えめに（アニメーション完了後のみ適用） */
.flow-step.animate-in:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
    border-color: var(--accent-gold);
}

/* ステップ番号エリア */
.step-circle {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--light-gray);
    border: 2px solid var(--border-light);
    transition: all 0.4s ease;
}

.flow-step:hover .step-circle {
    background: linear-gradient(135deg, rgba(184, 152, 111, 0.1) 0%, rgba(26, 77, 122, 0.1) 100%);
    border-color: var(--accent-gold);
}

/* ステップ番号 */
.step-number {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    font-size: 2.5rem;
    font-weight: 400;
    color: var(--primary-navy);
    font-family: 'Noto Serif JP', serif;
    opacity: 1;
    transition: all 0.4s ease;
}

/* アイコン */
.step-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    font-size: 1.6rem;
    color: var(--accent-gold);
    opacity: 0;
    transition: all 0.4s ease;
}

.flow-step:hover .step-number {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
}

.flow-step:hover .step-icon {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* ステップコンテンツ */
.step-content {
    text-align: center;
}

.step-content h4 {
    font-family: 'Noto Serif JP', serif;
    color: var(--primary-navy);
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: 16px;
    letter-spacing: 0.08em;
    line-height: 1.6;
    transition: color 0.3s ease;
}

.step-content p {
    color: var(--text-medium);
    font-size: 0.9rem;
    line-height: 1.9;
    letter-spacing: 0.03em;
    margin: 0;
}

.flow-step:hover .step-content h4 {
    color: var(--accent-gold);
}

/* 番号バッジ - シンプルな表示 */
.step-circle::after {
    content: attr(data-step);
    position: absolute;
    bottom: -12px;
    right: -12px;
    width: 32px;
    height: 32px;
    background: var(--accent-gold);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    opacity: 0;
    transform: scale(0);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.flow-step:hover .step-circle::after {
    opacity: 1;
    transform: scale(1);
}

/* コネクター - シンプルなライン */
.step-connector {
    display: none;
}

/* ========================================
   レスポンシブ対応（モバイル）
   ======================================== */

@media (max-width: 768px) {
    .flow-timeline {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .flow-step {
        padding: 28px 20px;
    }
    
    .flow-step::before {
        height: 2px;
    }
    
    /* サークルを小さく */
    .step-circle {
        width: 60px;
        height: 60px;
        margin-bottom: 20px;
    }
    
    .step-number {
        font-size: 1.8rem;
    }
    
    .step-icon {
        font-size: 1.4rem;
    }
    
    .step-content h4 {
        font-size: 1.05rem;
        margin-bottom: 10px;
        line-height: 1.5;
    }
    
    .step-content p {
        font-size: 0.85rem;
        line-height: 1.7;
    }
    
    /* モバイルでのホバーエフェクトを無効化 */
    .flow-step:hover {
        transform: none;
        box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
        border-color: var(--border-light);
    }
    
    .flow-step:hover .step-circle {
        background: var(--light-gray);
        border-color: var(--border-light);
    }
    
    /* 番号バッジを非表示 */
    .step-circle::after {
        display: none;
    }
}

@media (max-width: 480px) {
    .flow-timeline {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .flow-step {
        padding: 24px 20px;
    }
    
    .step-circle {
        width: 56px;
        height: 56px;
        margin-bottom: 16px;
    }
    
    .step-number {
        font-size: 1.5rem;
    }
    
    .step-icon {
        font-size: 1.2rem;
    }
    
    .step-content h4 {
        font-size: 1rem;
        margin-bottom: 8px;
    }
    
    .step-content p {
        font-size: 0.8rem;
        line-height: 1.6;
    }
}
