/* =========================================
   MCF クラウドファンディング 統合スタイルシート
   1. 基本レイアウト & スクロール
   2. メインステータスボード（数字強調版）
   3. 進捗バー & ストレッチゴール演出
   4. リターンカード（高密度 & 在庫色分け）
   5. ストレッチゴールリスト（枠囲み & 薄緑背景）
   6. 本文折り畳み（続きを読む）
   7. 詳細情報（資金使途・スケジュール）& 関連リンク
   8. スマホ最適化 & 表示順序制御
   9. タブナビゲーション & コンテンツ制御
========================================= */

/* --- 1. 基本設定 --- */
.mcf-wrapper {
    width: 100%;
    font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
}

html {
    scroll-behavior: smooth;
}

.mcf-main {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.mcf-left {
    flex: 2;
    order: 1;
}

.mcf-sidebar {
    flex: 1;
    order: 2;
    position: sticky;
    top: 40px;
    align-self: flex-start;
}

/* --- 2. ステータスボード（Makuake/CAMPFIRE風） --- */
.mcf-status-board {
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 14px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    margin-bottom: 30px;
    position: relative;
}

.mcf-goal-badge {
    background: linear-gradient(135deg, #ff4d4f, #ff7875);
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    text-align: center;
    padding: 6px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.mcf-goal-stamp {
    position: absolute;
    top: -15px;
    right: -10px;
    background: linear-gradient(135deg, #ff9800, #ff5722);
    color: #fff;
    font-size: 14px;
    font-weight: 900;
    padding: 8px 15px;
    border: 3px double #fff;
    border-radius: 8px;
    transform: rotate(15deg);
    z-index: 10;
    box-shadow: 0 4px 15px rgba(255, 87, 34, 0.4);
    animation: mcf-stamp-in 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes mcf-stamp-in {
    0% { transform: scale(3) rotate(45deg); opacity: 0; }
    100% { transform: scale(1) rotate(15deg); opacity: 1; }
}

.mcf-stat-label { font-size: 13px; color: #8c8c8c; display: block; margin-bottom: 4px; }
.mcf-number { font-size: 42px; font-weight: 900; color: #262626; letter-spacing: -1px; line-height: 1.2; }
.mcf-unit { font-size: 16px; font-weight: bold; margin-left: 4px; color: #666; }

.mcf-progress-container {
    position: relative;
    margin: 20px 0;
}

.mcf-progress {
    background: #eee;
    height: 12px;
    border-radius: 20px;
    overflow: hidden;
}

.mcf-bar {
    height: 100%;
    background: #00a0d2;
    transition: 0.4s ease;
}

.mcf-bar.complete { background: linear-gradient(90deg, #ffd700, #ffcc00); }

.mcf-stretch-marker {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(255, 255, 255, 0.6);
    z-index: 5;
}

.mcf-stretch-marker.reached { background: #ffeb3b; box-shadow: 0 0 8px #ffeb3b; width: 3px; }

.mcf-sub-stats {
    display: flex;
    border-top: 1px solid #f0f0f0;
    padding-top: 20px;
    margin-top: 20px;
}

.mcf-sub-stat { flex: 1; }
.mcf-sub-number { font-size: 32px; font-weight: 800; color: #333; }
.mcf-sub-unit { font-size: 14px; font-weight: bold; color: #666; margin-left: 4px; }

.mcf-next-goal-card {
    background: #fffbe6;
    border: 1px solid #ffe58f;
    padding: 12px;
    border-radius: 8px;
    margin-top: 20px;
}

.mcf-jump-btn {
    display: block;
    background: #e53935;
    color: #fff;
    text-align: center;
    padding: 16px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: bold;
    font-size: 18px;
    margin-top: 24px;
    transition: 0.3s ease;
    box-shadow: 0 10px 25px rgba(229,57,53,0.3);
}

.mcf-jump-btn:hover { background: #c62828; transform: translateY(-2px); box-shadow: 0 15px 35px rgba(229,57,53,0.4); }

/* --- 3. リターンカード（高密度 & 売れる演出） --- */
.mcf-card {
    position: relative;
    background: #ffffff;
    border-radius: 14px;
    padding: 18px; /* 密度を高めるためパディング縮小 */
    margin-bottom: 20px;
    transition: all .25s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border: 1px solid #eee;
    display: flex;
    flex-direction: column;
    min-height: auto;
}

.mcf-card:hover { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(0,0,0,0.12); }

/* 画像表示の最適化 */
.mcf-card-image {
    margin: -18px -18px 15px -18px;
    overflow: hidden;
    border-radius: 14px 14px 0 0;
}
.mcf-card-image img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

/* 価格と支援中の隙間を最小化 */
.mcf-card-price {
    font-size: 24px !important;
    font-weight: 800 !important;
    color: #e53935 !important;
    margin: 0 0 8px 0 !important;
    line-height: 1;
}
.mcf-card-price span { font-size: 14px; margin-left: 2px; }

.mcf-card-footer-info {
    margin-top: auto;
    margin-bottom: 12px;
}

.mcf-card-sales {
    height: 20px;
    font-size: 13px;
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
}

.mcf-card-stock {
    height: 45px;
    display: flex;
    align-items: center;
}

.mcf-stock-label {
    width: 100%;
    padding: 8px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 13px;
    text-align: center;
    transition: all 0.3s ease;
}

.mcf-stock-label.is-critical {
    background: #ff9800 !important;
    color: #fff !important;
    animation: pulse 1.2s infinite;
}

.mcf-stock-label.is-normal {
    background: #fff3cd !important;
    color: #856404 !important;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.03); }
    100% { transform: scale(1); }
}

.mcf-card.recommended {
    border: 2px solid #ff4d4f;
    box-shadow: 0 8px 28px rgba(255,77,79,0.25);
    background: linear-gradient(180deg, #fff 0%, #fffefe 100%);
    transform: scale(1.02);
    z-index: 2;
}

.mcf-card.recommended::before {
    content: "🔥 おすすめ";
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #ff4d4f, #e53935);
    color: #fff;
    font-size: 13px;
    font-weight: bold;
    padding: 8px 20px;
    border-radius: 999px;
    box-shadow: 0 6px 18px rgba(229,57,53,0.4);
    white-space: nowrap;
}

.mcf-btn {
    display: block;
    background: #e53935;
    color: #fff;
    text-align: center;
    padding: 14px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    transition: .25s;
}

.mcf-btn:hover { background: #c62828; transform: translateY(-2px); }

/* --- 4. レイアウト切替ロジック --- */
.mcf-returns-section { margin-top: 60px; border-top: 2px solid #f0f0f0; padding-top: 40px; }
.mcf-returns-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }

@media(min-width: 769px) {
    .layout-sales .mcf-returns-section { display: none; }
    .layout-sales .mcf-sidebar .mcf-returns-grid { display: block; margin-top: 30px; }
}

/* --- 5. ストレッチゴールリスト --- */
.mcf-stretch-goals-list {
    background: #f4faf4;
    border: 1.5px solid #d4ead4;
    border-radius: 12px;
    padding: 18px;
    margin-top: 25px;
}

.mcf-stretch-title {
    font-size: 14px;
    font-weight: bold;
    color: #2e5a2e;
    margin-bottom: 12px;
    display: inline-block;
    border-bottom: 2px solid #84c684;
}

.mcf-stretch-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #c0dcc0;
}

.mcf-stretch-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.mcf-stretch-amount {
    font-size: 13px;
    font-weight: 800;
    color: #4a6b4a;
    background: #e6f2e6;
    padding: 2px 8px;
    border-radius: 4px;
    min-width: 80px;
    text-align: center;
}

.mcf-stretch-text {
    font-size: 13px;
    font-weight: bold;
    color: #333;
}

.mcf-stretch-item.reached .mcf-stretch-amount {
    background: #84c684;
    color: #fff;
}

.mcf-reached-badge {
    margin-left: auto;
    background: #e53935;
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
}

/* --- 6. 本文折り畳み（スマホのみ） --- */
@media(max-width: 768px) {
    .mcf-content-container {
        position: relative;
        max-height: 800px;
        overflow: hidden;
        transition: max-height 0.5s ease;
    }
    .mcf-content-container.is-expanded {
        max-height: none;
    }
    .mcf-read-more-overlay {
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 150px;
        background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,1) 85%);
        display: flex;
        align-items: flex-end;
        justify-content: center;
        padding-bottom: 20px;
    }
    .mcf-read-more-btn {
        background: #fff;
        border: 2px solid #e53935;
        color: #e53935;
        padding: 10px 40px;
        border-radius: 30px;
        font-weight: bold;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }
}

/* --- 7. 詳細情報（資金使途・スケジュール）& 関連リンク --- */
.mcf-extra-info-section {
    margin: 40px 0;
    display: grid;
    gap: 20px;
}

.mcf-info-box {
    background: #fdfdfd;
    border: 1px solid #eee;
    padding: 20px;
    border-radius: 10px;
}

.mcf-info-box h3 {
    margin-top: 0;
    font-size: 18px;
    border-bottom: 2px solid #ffd700;
    display: inline-block;
    padding-bottom: 5px;
    margin-bottom: 15px;
}

.mcf-info-content {
    font-size: 15px;
    line-height: 1.8;
    color: #444;
}

.mcf-project-links {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px dashed #ccc;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.mcf-link-item {
    font-size: 14px;
    color: #666;
    text-decoration: none;
    background: #f5f5f5;
    padding: 8px 15px;
    border-radius: 5px;
    transition: 0.2s;
}

.mcf-link-item:hover {
    background: #eee;
    color: #000;
}

/* --- 8. スマホ最適化 & 表示制御 --- */
@media(max-width: 768px) {
    /* PC用リターン表示をスマホで確実に消す */
    .mcf-pc-returns-sidebar, 
    .mcf-pc-only { 
        display: none !important; 
    }
    
    .mcf-sp-only { display: block !important; }

    .mcf-main { display: flex; flex-direction: column; }
    .mcf-sidebar { order: 1; width: 100%; margin-bottom: 30px; position: static; }
    .mcf-left { order: 2; }
    
    .mcf-number { font-size: 34px; }
    .mcf-sub-number { font-size: 28px; }
    .mcf-card.recommended { transform: none; margin-top: 20px; }

    /* スマホでは詳細情報のグリッドを1列に */
    .mcf-extra-info-section {
        grid-template-columns: 1fr;
    }
}

@media(min-width: 769px) {
    .mcf-sp-only { display: none !important; }
    .mcf-pc-only { display: block; }
    .mcf-read-more-overlay { display: none; }
    .mcf-content-container { max-height: none !important; }

    /* PCでは詳細情報を2列に並べる（任意） */
    .mcf-extra-info-section {
        grid-template-columns: 1fr 1fr;
    }
}

/* --- 9. タブナビゲーション & コンテンツ制御 --- */
.mcf-navigation-tabs {
    display: flex;
    border-bottom: 2px solid #eee;
    margin-bottom: 30px;
    gap: 10px;
    background: #fff;
    z-index: 100;
    padding-top: 10px;
}

.mcf-tab-btn {
    padding: 12px 25px;
    border: none;
    background: none;
    font-size: 16px;
    font-weight: bold;
    color: #666;
    cursor: pointer;
    position: relative;
    transition: 0.3s;
}

.mcf-tab-btn:hover {
    color: #e53935;
}

.mcf-tab-btn.active {
    color: #e53935;
}

.mcf-tab-btn.active::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 3px;
    background: #e53935;
}

.mcf-tab-content {
    display: none;
    animation: mcfFadeIn 0.5s ease;
}

.mcf-tab-content.active {
    display: block;
}

@keyframes mcfFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    .mcf-navigation-tabs {
        position: static;
        overflow-x: auto;
        white-space: nowrap;
    }
    .mcf-tab-btn {
        padding: 10px 15px;
        font-size: 14px;
        flex: 1;
        text-align: center;
    }
}