@charset "UTF-8";

/* --- 🎨 Chef's Note 全ページ共通デザインマスタ (統合・完全版) --- */

/* 1. 変数定義 */
:root { 
    --brand-color: #8b1c24;      /* 濃いボルドー */
    --brand-hover: #70161d;
    --brand-light: #a63b43;      
    --memo-blue: #4a90e2;        
    --text-dark: #1a1a1a; 
    --bg-light: #fcfcfb;
    --success-green: #198754;    
    
    /* 🌟 公認シェフ・Proプラン用カラー */
    --pro-blue: #0d6efd;         
    --premium-navy: #0f172a;     
    --premium-gold: #fbbf24;     

    --memo-yellow: #ffc107;
    --quiz-bg: #fdfbf5;
    --quiz-border: #e6dcb8;
    --quiz-text: #8c7335;
}

/* 2. 🌟 全ページ下部の「巨大な空白バグ」を消し去る強制リセット 🌟 */
html {
    background-color: var(--bg-light);
}
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden !important; 
    /* ↓ 画面が縦に無限に伸びるバグを強制的に止める最も重要な一行 ↓ */
    height: auto !important; 
}
body { 
    font-family: 'Noto Sans JP', sans-serif; 
    background-color: var(--bg-light); 
    color: var(--text-dark); 
    line-height: 1.6; 
    -webkit-font-smoothing: antialiased;
    word-wrap: break-word;
    overflow-wrap: break-word;
    position: relative;
    /* ↓ 以前のFlexboxが衝突していた場合の強制解除 ↓ */
    display: block !important; 
}

/* 🌟 ナビゲーションバー 🌟 */
.navbar {
    background-color: #ffffff !important;
    border-bottom: 1px solid #eaeaea;
}

@media (min-width: 768px) {
    .search-bar-nav {
        width: 200px;
        transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .search-bar-nav:focus {
        width: 300px !important;
    }
}

/* 🌟 文字かぶり・空白バグ修正用の特殊クラス 🌟 */
.z-text-front {
    position: relative;
    z-index: 10 !important;
    text-shadow: 0px 2px 4px rgba(0,0,0,0.5);
}
.z-bg-back {
    position: absolute;
    z-index: 1 !important;
    opacity: 0.05 !important; /* 視認性を邪魔しないよう極限まで薄く */
    pointer-events: none;     /* クリックを貫通させる */
    user-select: none;
}
.overflow-hidden {
    overflow: hidden !important;
}

/* 🌟 ボタンデザイン：保存・作成ボタンの統一 🌟 */
.btn-brand, .submit-btn, .btn-recipe-accent { 
    background-color: var(--brand-light) !important; 
    color: white !important; 
    border-radius: 25px; 
    font-weight: 700; 
    padding: 0.5rem 1.5rem; 
    border: none !important;
    box-shadow: 0 2px 4px rgba(139, 28, 36, 0.15);
    transition: all 0.2s ease;
    white-space: nowrap; 
}
.btn-brand:hover, .submit-btn:hover, .btn-recipe-accent:hover {
    background-color: var(--brand-hover) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(139, 28, 36, 0.2);
}

.btn-memo-accent {
    background-color: var(--memo-blue) !important;
    color: white !important;
    border-radius: 25px;
    font-weight: 700;
    padding: 0.5rem 1.5rem;
    border: none !important;
    box-shadow: 0 2px 4px rgba(74, 144, 226, 0.15);
    transition: all 0.2s ease;
    white-space: nowrap; 
}
.btn-memo-accent:hover {
    background-color: #387ac6 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(74, 144, 226, 0.2);
}

.btn-quiz-accent {
    background-color: var(--quiz-bg) !important;
    color: var(--quiz-text) !important;
    border: 1px solid var(--quiz-border) !important;
    border-radius: 25px;
    font-weight: 700;
    padding: 0.5rem 1.5rem;
    box-shadow: 0 2px 4px rgba(140, 115, 53, 0.05);
    transition: all 0.2s ease;
    white-space: nowrap; 
}
.btn-quiz-accent:hover {
    background-color: #f7f2e1 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(140, 115, 53, 0.1);
}

/* 🌟 特殊カード・エリア設定 🌟 */
.ai-accent-area {
    background-color: #fdfaf3;
    border-left: 5px solid var(--brand-color) !important;
    border-radius: 15px;
}
.payout-card {
    background-color: #f4fbf5 !important;
    border-left: 5px solid var(--success-green) !important;
}
.paid-content-area { 
    background-color: #eaf5eb !important; 
    border: 2px dashed var(--success-green) !important; 
    border-radius: 15px; 
    padding: 2rem; 
}

/* 記事一覧レイアウト調整 */
.article-card { transition: all 0.2s ease; border-radius: 12px; }
.article-card:hover { transform: translateY(-2px); }
.thumbnail-hover { overflow: hidden; border-radius: 12px; background-color: #f0f2f3; }
.thumbnail-hover img { transition: transform 0.5s ease; object-fit: cover; }
.article-card:hover .thumbnail-hover img { transform: scale(1.08); }

/* 🌟 タイポグラフィとバッジ設定 🌟 */
.badge-pro { 
    background-color: var(--pro-blue) !important; 
    color: white !important; 
    font-size: 0.7rem; 
    padding: 0.35em 0.8em; 
    border-radius: 50rem; 
    display: inline-flex; 
    align-items: center; 
    font-weight: bold;
    border: none;
    box-shadow: 0 2px 4px rgba(13, 110, 253, 0.2);
}

.badge-premium {
    background-color: var(--premium-navy) !important;
    color: var(--premium-gold) !important;
    border: 1px solid var(--premium-gold);
    font-size: 0.7rem; 
    padding: 0.35em 0.8em; 
    border-radius: 50rem; 
    display: inline-flex; 
    align-items: center; 
    font-weight: bold;
}

.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* 🌟 スマホ向け微調整（レスポンシブ・レイアウト崩れ対策） 🌟 */
@media (max-width: 767.98px) {
    h1, .h1 { font-size: 1.5rem !important; }
    h2, .h2 { font-size: 1.3rem !important; }
    
    .btn-memo-accent, .btn-recipe-accent, .btn-quiz-accent {
        font-size: 0.8rem !important;
        padding: 0.5rem 0.5rem !important;
    }
    
    .badge-pro, .badge-premium {
        display: inline-flex !important;
        transform: scale(0.9);
        transform-origin: left center;
        margin-left: 4px;
        margin-top: 2px;
    }

    /* スマホ版ダッシュボードの表の崩れ対策 */
    .dashboard-table-responsive table,
    .dashboard-table-responsive thead,
    .dashboard-table-responsive tbody,
    .dashboard-table-responsive th,
    .dashboard-table-responsive td,
    .dashboard-table-responsive tr {
        display: block;
    }
    .dashboard-table-responsive thead tr { display: none; }
    .dashboard-table-responsive tr {
        margin-bottom: 1.2rem;
        background-color: #fff;
        border-radius: 12px;
        border: 1px solid #e2e8f0;
        padding: 0;
        overflow: hidden;
        box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    }
    .dashboard-table-responsive td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border: none;
        border-bottom: 1px solid #f1f5f9;
        padding: 10px 15px;
        text-align: right;
        font-size: 0.9rem;
    }
    .dashboard-table-responsive td:last-child { border-bottom: 0; }
    .dashboard-table-responsive td::before {
        content: attr(data-label);
        font-weight: bold;
        font-size: 0.8rem;
        color: #64748b;
        text-align: left;
        margin-right: 15px;
    }
    .dashboard-table-responsive td.menu-name-cell {
        display: block;
        text-align: left;
        border-bottom: none;
        background-color: var(--premium-navy);
        color: white !important;
        padding: 12px 15px;
    }
    .dashboard-table-responsive td.menu-name-cell a { color: white !important; }
    .dashboard-table-responsive td.menu-name-cell::before { display: none; }
}

/* ========================================== */
/* 🌟 完食チップ（応援）機能 🌟  */
/* ========================================== */
.kanshoku-container { text-align: center; margin: 40px 0; }
.kanshoku-trigger-btn {
    background-color: transparent; 
    color: var(--brand-color);
    border: 2px solid var(--brand-color); 
    border-radius: 50px; 
    padding: 12px 40px; 
    font-size: 1.1rem; 
    font-family: 'Shippori Mincho', serif; 
    font-weight: bold; 
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(139, 28, 36, 0.05); 
    transition: all 0.3s ease;
}
.kanshoku-trigger-btn:hover { 
    background-color: var(--brand-color); 
    color: white;
    transform: translateY(-2px); 
    box-shadow: 0 6px 12px rgba(139, 28, 36, 0.15);
}
.kanshoku-trigger-btn .sub-text { 
    font-size: 0.75rem; 
    font-weight: normal; 
    font-family: 'Noto Sans JP', sans-serif;
    opacity: 0.8; 
    display: block;
    margin-top: 4px;
}

.kanshoku-modal {
    display: none; 
    position: fixed; 
    top: 0; left: 0; 
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.5); 
    backdrop-filter: blur(3px);
    z-index: 2000; /* ナビバーよりも前に出るように修正 */
    align-items: center; 
    justify-content: center;
}
.kanshoku-modal-content {
    background-color: white; 
    padding: 40px 30px; 
    border-radius: 16px;
    width: 90%; max-width: 420px; 
    text-align: center; 
    position: relative;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    animation: fadeIn 0.3s ease forwards;
}
@keyframes fadeIn { 
    from { opacity: 0; transform: translateY(20px); } 
    to { opacity: 1; transform: translateY(0); } 
}
.kanshoku-close { 
    position: absolute; 
    top: 15px; right: 20px; 
    font-size: 1.8rem; 
    cursor: pointer; color: #999; 
    transition: 0.2s;
}
.kanshoku-close:hover { color: var(--text-dark); }

.tip-options { display: flex; justify-content: space-between; margin: 30px 0; gap: 12px; }
.tip-option {
    flex: 1; 
    background-color: #f8f9fa; 
    border: 2px solid #eaeaea; 
    border-radius: 12px;
    padding: 15px 5px; 
    cursor: pointer; 
    transition: 0.2s;
}
.tip-option.active { 
    border-color: var(--brand-color); 
    background-color: #fdfaf3;
    color: var(--brand-color);
}
.tip-icon { font-size: 1.5rem; margin-bottom: 5px; display: block; }
.tip-amount { font-weight: bold; font-size: 1.1rem; }
.tip-label { font-size: 0.7rem; color: #666; display: block; margin-top: 5px;}

.kanshoku-textarea {
    width: 100%; height: 80px; 
    padding: 15px; 
    border: 1px solid #ddd;
    border-radius: 8px; 
    resize: none; 
    margin-bottom: 25px; 
    background-color: #fafafa;
}
.kanshoku-textarea:focus {
    outline: none;
    border-color: var(--brand-light);
    background-color: white;
}
.kanshoku-submit-btn {
    width: 100%; 
    background-color: var(--brand-color);
    color: white; 
    border: none;
    padding: 16px; 
    border-radius: 50px; 
    font-size: 1.1rem; 
    font-weight: bold; 
    cursor: pointer;
    transition: 0.2s;
}
.kanshoku-submit-btn:hover { background-color: var(--brand-hover); }

/* ========================================== */
/* 🌟 画像・その他コンポーネント 🌟 */
/* ========================================== */
.recipe-image-preview {
    max-height: 500px;
    width: 100%;
    object-fit: contain;
    border-radius: 12px;
    background-color: #f8f9fa;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.quiz-container {
    text-align: center;
    padding: 2.5rem 1.5rem;
    background-color: white;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.status-card {
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}
.progress-bar-bg {
    background-color: #e9ecef;
    border-radius: 50rem;
    height: 12px;
    width: 100%;
    overflow: hidden;
    margin-top: 10px;
}
.progress-bar-fill {
    background-color: var(--brand-color);
    height: 100%;
    border-radius: 50rem;
    transition: width 0.5s ease;
}
.upsell-banner {
    background: linear-gradient(135deg, #fdfaf3 0%, #fef4e8 100%);
    border: 1px solid #fae3c6;
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    margin-top: 2rem;
    box-shadow: 0 2px 8px rgba(250, 227, 198, 0.4);
}
.upsell-banner h4 {
    color: var(--brand-color);
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 10px;
}


/* ========================================== */
/* 🌟 サイト全体・ナビバーの重なり・ズーム対策 🌟 */
/* ========================================== */

/* 1. ナビバー（sticky）の裏にコンテンツが潜り込まないようにする */
body {
    /* ナビバーが2段構成などで高くなっているため、十分な余白を確保 */
    padding-top: 15px; 
}

/* 2. ページ内リンク（アンカー）で飛んだ際、ナビバーに被らないようにする */
:target {
    scroll-margin-top: 170px;
}

/* スクロールを滑らかにする */
html {
    scroll-behavior: smooth;
}

/* 3. ナビバーが常に最前面に来るようにする（Z-indexの交通整理） */
.navbar {
    z-index: 1080 !important;
}

/* 4. CKEditorのツールバーがナビバーを突き抜けないように制限 */
.cke_top {
    z-index: 1000 !important;
}

/* 5. スマホで入力欄をタップした際、勝手にズームしてガクッと動く現象を防止 */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="search"],
textarea,
select {
    font-size: 16px !important;
}
/* ========================================== */
/* 🌟 記事一覧カード内の共通スタイル 🌟 */
/* ========================================== */

/* タイトルの流動的なサイズ調整（スマホで小さく、PCで適切に） */
.article-title-fluid {
    font-size: 1.05rem !important; /* スマホ用最小サイズ */
    font-size: clamp(1.05rem, 4vw, 1.3rem) !important; /* 可変サイズ */
    line-height: 1.4;
    font-weight: bold;
}

/* 本文プレビューの文字サイズ（PC用を基本にする） */
.article-excerpt {
    font-size: 0.9rem !important; /* 🌟 PC用のサイズ（少し大きめ） */
    line-height: 1.6;
    color: #6c757d; /* text-muted 相当 */
}

/* 🌟 スマホ用のサイズ上書き */
@media (max-width: 767.98px) {
    .article-excerpt {
        font-size: 0.75rem !important; /* スマホでは圧迫感が出ないように小さく */
    }
}