/* ==========================================================
   SCOPE: 記事ページ共通コンポーネント（全ジャンル共通）
     - *, *::before, *::after  (box-sizing reset)
     - .edu-nav-banner-8, .edu-nav-item, .edu-nav-icon, .edu-nav-text
     - Desktop 3-column layout (.container, .left-banner, .right-banner, .main-content)
   DEPENDS: base.css
   NOTE: 各PHPファイルのインライン<style>から抽出した共通CSS。
         ジャンル固有のカラー（border-bottom等）は各ファイルに残す。
   CREATED: 2026-03-04
   ========================================================== */

/* --- Box-sizing Reset (全要素の計算方法を統一) --- */
*, *::before, *::after {
    box-sizing: border-box !important;
}

/* ==========================================================
   8連コンパクト教育ナビゲーションバナー（全ジャンル共通基盤）
   ========================================================== */
.edu-nav-banner-8 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 25px;
}

.edu-nav-item {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 10px 5px;
    text-align: center;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.08);
}

.edu-nav-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.12);
    background: var(--nav-hover-bg, #f0f0f0);
    border-color: var(--nav-hover-border, #e0e0e0);
}

.edu-nav-item.active {
    background: var(--nav-active-bg, #f0f0f0);
    border-color: var(--nav-active-border, #c9a84c);
    color: var(--nav-active-color, inherit);
    font-weight: bold;
}

.edu-nav-icon {
    font-size: 1.2rem;
    margin-bottom: 3px;
}

.edu-nav-text {
    font-size: 0.75rem;
    font-weight: bold;
    line-height: 1.2;
}

/* 小型スマホ向けナビテキスト縮小 */
@media screen and (max-width: 480px) {
    .edu-nav-text {
        font-size: 0.65rem;
    }
}

/* ==========================================================
   ジャンル別ナビボタンカラー（border-bottom アクセント）
   ========================================================== */

/* 証券（Securities） */
.btn-glossary  { border-bottom: 3px solid #ffd700; }
.btn-chart     { border-bottom: 3px solid #32cd32; }
.btn-nisa      { border-bottom: 3px solid #c9a84c; }
.btn-ideco     { border-bottom: 3px solid #ff8c00; }
.btn-us        { border-bottom: 3px solid #00bfff; }
.btn-index     { border-bottom: 3px solid #9932cc; }
.btn-dividend  { border-bottom: 3px solid #ff69b4; }
.btn-fire      { border-bottom: 3px solid #ff0000; }

/* FX・為替 */
.item-glossary  { border-bottom: 3px solid #888888; }
.item-chart     { border-bottom: 3px solid #32cd32; }
.item-funda     { border-bottom: 3px solid #9932cc; }
.item-mental    { border-bottom: 3px solid #1e90ff; }
.item-time      { border-bottom: 3px solid #ffd700; }
.item-indicator { border-bottom: 3px solid #d32f2f; }
.item-fibo      { border-bottom: 3px solid #ff8c00; }
.item-legend    { border-bottom: 3px solid #e5e4e2; }

/* 暗号資産（Crypto） */
.btn-crypto-glossary { border-bottom: 3px solid #888888; }
.btn-crypto-chart    { border-bottom: 3px solid #32cd32; }
.btn-crypto-fibo     { border-bottom: 3px solid #ff8c00; }
.btn-crypto-truth    { border-bottom: 3px solid #ffd700; }
.btn-crypto-security { border-bottom: 3px solid #00bfff; }
.btn-crypto-altboom  { border-bottom: 3px solid #ff0055; }
.btn-crypto-hodl     { border-bottom: 3px solid #9932cc; }
.btn-crypto-history  { border-bottom: 3px solid #e5e4e2; }

/* クレジットカード（Creditcard） */
.btn-cc-glossary { border-bottom: 3px solid #888888; }
.btn-cc-point    { border-bottom: 3px solid #e0007a; }
.btn-cc-brand    { border-bottom: 3px solid #1e90ff; }
.btn-cc-screen   { border-bottom: 3px solid #ffd700; }
.btn-cc-safe     { border-bottom: 3px solid #32cd32; }
.btn-cc-mile     { border-bottom: 3px solid #00bfff; }
.btn-cc-status   { border-bottom: 3px solid #d4af37; }
.btn-cc-multi    { border-bottom: 3px solid #9932cc; }

/* ==========================================================
   Desktop 3-column Layout (1024px+)
   sidebar-column(250px) > aside(sticky) + メイン(max 660px)
   ========================================================== */
@media screen and (min-width: 1024px) {
    .container {
        display: flex !important;
        justify-content: center !important;
        align-items: stretch !important;
        gap: 30px !important;
        max-width: 1200px !important;
        margin: 0 auto !important;
        padding: 20px 10px !important;
    }

    /* ラッパー列：stretch で main と同じ高さまで伸びる */
    .sidebar-column {
        width: 250px !important;
        flex-shrink: 0 !important;
        /* sticky なし、max-height なし → 親の高さまで自然に伸びる */
    }

    /* aside 本体：ラッパー内で sticky 追従 */
    .left-banner, .right-banner {
        width: 100% !important;
        flex-shrink: 0 !important;
        position: sticky !important;
        top: 20px !important;
        max-height: calc(100vh - 40px) !important;
        overflow-y: auto !important;
        z-index: 10 !important;
    }

    .main-content {
        flex: 1 !important;
        min-width: 0 !important;
        max-width: 660px !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .edu-nav-banner-8 {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }

    .edu-nav-text {
        font-size: 0.85rem;
    }
}

/* ============================================================
   WCAG AA コントラスト修正オーバーライド
   ranking-card.css の薄い文字色を WCAG AA 基準に上書き。
   ============================================================ */
.score-label { color: #555555; }
.catchphrase { color: #555555; }
.action-micro-copy { color: #555555; }
.review-score { color: #666666; }
.card-desc { color: #555555; }
.back-home-btn { color: #555555; }
.profile-role { color: #555555; }
.notice-text { color: #555555 !important; }  /* ranking-card.css uses !important */
.score-title { color: #555555; }
.status-label { color: #555555; }
.chat-name { color: #555555; }
.score-2 { color: #777777; }

/* ============================================================
   Score Box Overlap Prevention — 全パターン統一版（v2）
   ranking-card.css の .score-box { position: absolute } を
   全パターンで static に上書きし、フロー内に配置する。
   ============================================================ */

/* --- 全パターン共通：score-box を static 化 --- */
.card .score-box {
    position: static !important;  /* !important: override ranking-card.css absolute + inline styles */
    text-align: center;
    margin-bottom: 15px;
    background: rgba(201, 168, 76, 0.05);
    padding: 15px;
    border-radius: 8px;
}

/* score-title / score-num を縦並びに強制 */
.card .score-box .score-title {
    display: block;
    margin-bottom: 4px;
}

.card .score-box .score-num {
    display: block;
}

/* --- rank-badge: カードローン系インライン absolute を解除 --- */
/* ranking-card.css では position 指定なし(=static)。cardloan 19件のインライン
   <style> で position: absolute が設定されているため !important で上書き。
   他ジャンルは元々 static なので副作用なし。 */
.card .rank-badge {
    position: static !important;
    display: inline-block;
    margin-bottom: 10px;
}

/* --- パターンA（予約幅を解除）--- */
.card > .rank-badge {
    max-width: 100%;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
}

.card > .item-name {
    padding-right: 0;
}

/* --- パターンB: card-header-flex は flex 横並びを維持 --- */
.card-header-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.card-header-flex .score-box {
    margin-bottom: 0;
    background: transparent;
    padding: 10px 0;
    flex-shrink: 0;
}

/* --- モバイル（≤768px）--- */
@media screen and (max-width: 768px) {
    .card .score-box {
        text-align: center;
        margin-bottom: 15px;
        background: rgba(201, 168, 76, 0.05);
        padding: 15px;
        border-radius: 8px;
    }

    .card > .rank-badge {
        max-width: 100%;
    }

    .card > .item-name {
        padding-right: 0;
    }

    .card-header-flex {
        flex-direction: column;
        align-items: stretch;
    }

    .card-header-flex .score-box {
        text-align: center;
        padding: 15px;
        background: rgba(201, 168, 76, 0.05);
        border-radius: 8px;
        margin-bottom: 15px;
    }
}

/* =============================================
   B-5: 記事更新ログ
   B-6: データ取得日注記
   2026-03-20 追加
   ============================================= */

/* B-5: 更新ログ */
.update-log {
  list-style: none;
  padding: 0;
  margin: 5px 0 15px 0;
  font-size: 0.78rem;
  color: #888;
  line-height: 1.6;
}
.update-log li {
  padding: 0;
  margin: 0;
}
.update-log li::before {
  content: "└ ";
  color: #bbb;
}

/* B-6: データ取得日 */
.data-as-of {
  font-size: 0.75rem;
  color: #999;
  text-align: right;
  margin: 5px 0 20px 0;
  padding: 0;
}

/* =============================================
   B-3: デメリットセクション
   B-4: コンサルタント視点コメント
   2026-03-21 追加
   ============================================= */

/* B-3: デメリットセクション */
.demerit-section {
  background: #fff8f0;
  border-left: 4px solid #e67e22;
  border-radius: 8px;
  padding: 20px 24px;
  margin: 24px 0;
}
.demerit-section h3 {
  font-size: 1.1rem;
  color: #c0392b;
  margin: 0 0 16px 0;
}
.demerit-item {
  margin-bottom: 16px;
}
.demerit-item:last-child {
  margin-bottom: 0;
}
.demerit-item h4 {
  font-size: 0.95rem;
  font-weight: bold;
  color: #333;
  margin: 0 0 6px 0;
}
.demerit-item p {
  font-size: 0.9rem;
  color: #555;
  line-height: 1.7;
  margin: 0;
}

/* B-4: コンサルタント視点コメント */
.consultant-comment {
  background: #f0f4f8;
  border-left: 4px solid #2d8a4e;
  border-radius: 8px;
  padding: 16px 20px;
  margin: 16px 0 32px 0;
}
.consultant-label {
  font-weight: bold;
  font-size: 0.9rem;
  color: #2d8a4e;
  margin: 0 0 8px 0;
}
.consultant-comment > p:last-child {
  font-size: 0.9rem;
  color: #333;
  line-height: 1.7;
  margin: 0;
}

/* ────── モバイル専用 便利ツールCTA ────── */
.mobile-tool-cta {
    display: none;
}
@media screen and (max-width: 1024px) {
    .mobile-tool-cta {
        display: block;
        background: #f8f9fa;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        padding: 16px 18px;
        margin: 25px 0;
    }
    .mobile-tool-cta-title {
        font-size: 0.95rem;
        font-weight: bold;
        color: #333;
        margin: 0 0 10px;
        padding-left: 10px;
        border-left: 3px solid;
    }
    .mobile-tool-cta-list {
        list-style: none;
        padding: 0;
        margin: 0;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }
    .mobile-tool-cta-list li a {
        display: block;
        font-size: 0.82rem;
        font-weight: bold;
        text-decoration: none;
        padding: 8px 10px;
        background: #fff;
        border: 1px solid #e8e8e8;
        border-radius: 6px;
        transition: background 0.2s;
    }
    .mobile-tool-cta-list li a:hover {
        background: #f0f0f0;
    }
}
@media screen and (max-width: 480px) {
    .mobile-tool-cta-list {
        grid-template-columns: 1fr;
    }
}
