/* --- 変数設定 --- */
:root {
    --primary-color: #eb5562; /* サイトのメインの赤色 */
    --primary-light: #fef0f1; /* 赤色の薄い背景用 */
    --text-color: #333;
    --text-gray: #666;
    --bg-gray: #f4f6f9;
    --border-radius: 12px;
}

/* --- ベース設定 --- */
body {
    font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", sans-serif;
    margin: 0;
    color: var(--text-color);
    background-color: #fff;
}

.case-section {
    padding: 60px 20px;
}

.case-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* --- ヘッダー --- */
.section-header {
    text-align: center;
    margin-bottom: 40px;
}
.section-title {
    font-size: 28px;
    color: var(--primary-color);
    margin-bottom: 20px;
    position: relative;
    display: inline-block;
}
.section-title::after {
    content: "";
    display: block;
    width: 60px;
    height: 3px;
    background: var(--primary-color);
    margin: 10px auto 0;
}
.section-desc {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-gray);
}

/* --- タブナビゲーション --- */
.tab-nav {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.tab-item {
    background: transparent;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: bold;
    color: var(--text-gray);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: color 0.3s, background 0.3s;
}

.tab-item:hover {
    color: var(--primary-color);
    background-color: #fafafa;
}

.tab-item.active {
    color: var(--primary-color);
    border-bottom: 3px solid var(--primary-color);
}

/* --- コンテンツエリア (表示/非表示制御) --- */
.tab-content-wrapper {
    position: relative;
    min-height: 400px;
}

.case-content {
    display: none;
}

.case-content.active {
    display: block;
    animation: fadeIn 0.6s ease forwards;
}

@keyframes fadeIn {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* --- カードデザイン --- */
.case-main-card {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: var(--border-radius);
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

/* --- 💡 case-head (70:30のレイアウト) --- */
.case-head {
    /* Flexboxで子要素 (左70% / 右30%) を横並びにする */
    display: flex;
    gap: 30px; 
    
    margin-bottom: 40px;
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
}

/* 1. 左側エリア (タイトル情報など) */
.case-head-left {
    flex: 7; /* 70%の幅 */
}

/* 2. 右側エリア (画像など) */
.case-head-right {
    flex: 3; /* 30%の幅 */
    text-align: center;
    /* 画像を中央に寄せるための調整 */
    display: flex;
    align-items: center; /* 垂直方向の中央揃え */
    justify-content: center; /* 水平方向の中央揃え */
}

/* 💡 画像自体のスタイル (横長) */
.case-header-img {
    max-width: 100%; 
    height: auto;
    width: 300px; /* 親要素の幅に応じてサイズを調整するための基準値 */
    height: 150px; /* 縦幅を短く設定 */
    object-fit: contain; /* 画像全体を表示し、トリミングしない */
    border-radius: 8px;
    opacity: 0.85; 
}


/* 上段情報 (左側エリア内の要素) */
.case-meta {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 13px;
}
.tag-category { background: #333; color: #fff; padding: 4px 12px; border-radius: 4px; }
.tag-scale { background: #e0e0e0; color: #555; padding: 4px 12px; border-radius: 4px; }
.client-name { 
    font-size: 24px; 
    margin: 10px 0; /* Flexboxによりリセットされたマージンを戻す */
    color: var(--text-color); 
}
.catchphrase { 
    font-size: 18px; 
    font-weight: bold; 
    margin: 10px 0; /* マージンを調整 */
}

/* Before/After レイアウト */
.ba-container {
    display: flex;
    align-items: stretch;
    position: relative;
}
.ba-box {
    flex: 1;
    padding: 25px;
    border-radius: var(--border-radius);
}

/* Before */
.ba-box.before {
    background-color: #f0f2f5;
    margin-right: 20px;
}
.ba-label {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.icon-alert {
    display: inline-flex; justify-content: center; align-items: center;
    width: 24px; height: 24px; background: #888; color: #fff;
    border-radius: 50%; font-size: 14px; font-weight: bold;
}

/* After */
.ba-box.after {
    background-color: #fff;
    border: 2px solid var(--primary-color);
    margin-left: 20px;
    box-shadow: 0 4px 15px rgba(235, 85, 98, 0.1);
}
.ba-box.after .ba-label { color: var(--primary-color); }
.icon-check {
    display: inline-flex; justify-content: center; align-items: center;
    width: 24px; height: 24px; background: var(--primary-color); color: #fff;
    border-radius: 50%; font-size: 14px;
}

/* 矢印 */
.ba-arrow {
    display: flex; align-items: center; justify-content: center; z-index: 2;
}
.arrow-circle {
    width: 40px; height: 40px; background: #fff; border: 2px solid #ddd;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    color: #999; font-size: 12px;
}

/* テキスト・数値 */
.ba-text { font-size: 14px; line-height: 1.7; color: #444; }
.metrics-row {
    background: var(--primary-light); border-radius: 8px; padding: 15px;
    display: flex; align-items: center; gap: 15px; margin-bottom: 15px;
}
.metric-box {
    background: #fff; padding: 10px 15px; border-radius: 6px; text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05); min-width: 100px;
}
.m-label { display: block; font-size: 11px; color: var(--text-gray); margin-bottom: 4px; }
.m-value { display: block; font-size: 14px; font-weight: bold; color: var(--primary-color); }
.m-value .num { font-size: 24px; font-family: Arial, sans-serif; }
.metric-text { font-size: 14px; font-weight: bold; }

/* --- 詳細を見るボタンのスタイル --- */
.case-link-area {
    margin-top: 40px;
    text-align: center; /* ボタンを中央に配置 */
}

.detail-button {
    display: inline-block;
    padding: 12px 30px;
    background-color: var(--primary-color); /* 赤色背景 */
    color: #ffffff; /* 白文字 */
    font-size: 16px;
    font-weight: bold;
    text-decoration: none; /* 下線を削除 */
    border-radius: 6px;
    transition: background-color 0.3s, transform 0.1s;
    box-shadow: 0 4px 8px rgba(235, 85, 98, 0.3); /* ボタンに影を付けて浮き上がらせる */
}

.detail-button:hover {
    background-color: #d14a55; /* ホバーで少し暗く */
    transform: translateY(-1px); /* ホバーで少し浮き上がらせる */
}


/* --- レスポンシブ (スマホ対応) --- */
@media (max-width: 768px) {
    .case-main-card { padding: 20px; }
    
    /* 💡 case-head (スマホでは縦積み) */
    .case-head {
        flex-direction: column;
        gap: 20px;
    }
    
    .case-head-left { 
        order: 2; /* 縦積みになったとき、左側エリアを下にする */
        flex: auto;
    }
    
    .case-head-right {
        order: 1; /* 縦積みになったとき、画像エリアを上にする */
        flex: auto;
        padding-bottom: 0;
    }

    .case-header-img {
        width: 300px;
        height: 170px;
    }
    
    /* Before/After */
    .ba-container { flex-direction: column; }
    .ba-box.before { margin-right: 0; margin-bottom: 0; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
    .ba-box.after { margin-left: 0; margin-top: 0; border-top-left-radius: 0; border-top-right-radius: 0; }
    .ba-arrow { height: 30px; margin: -15px auto; }
    .arrow-circle { transform: rotate(90deg); }
    .metrics-row { flex-direction: column; align-items: flex-start; }
    
    /* タブ */
    .tab-nav { flex-direction: column; }
    .tab-item { border-bottom: 1px solid #eee; text-align: left; }
    .tab-item.active { background-color: var(--primary-light); border-left: 4px solid var(--primary-color); border-bottom: 1px solid #eee; }

    /* ボタン */
    .detail-button {
        width: 80%; /* スマホではボタンを少し大きく */
        padding: 15px 0;
    }
}