/*!
 * Single Card Page Styles
 * Extracted from templates/single-card-improved.php (v3.17.0)
 */

/* 基本スタイル */
/* ============================================================
   ファーストビュー結論サマリ (.cg-hero-summary)
   ============================================================ */
.cg-hero-summary {
    background: linear-gradient(135deg, #ffffff 0%, #f7f8fa 100%);
    border: 1px solid #e4e7ea;
    border-radius: 12px;
    padding: 16px 20px 18px;
    margin: 0 0 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
.cg-hero-meta {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}
.cg-hero-date {
    font-size: 12px;
    color: #666;
    background: #fff;
    border: 1px solid #e0e4e8;
    border-radius: 4px;
    padding: 2px 8px;
    font-weight: 500;
}
.cg-hero-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}
.cg-hero-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid #e4e7ea;
    border-radius: 8px;
    min-width: 0;
}
.cg-hero-cell-label {
    font-size: 11px;
    font-weight: 700;
    color: #667;
    letter-spacing: 0.04em;
}
.cg-hero-cell-value {
    font-size: 20px;
    font-weight: 800;
    color: #1a1a1a;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cg-hero-cell-value--muted { color: #999; font-weight: 600; font-size: 16px; }
.cg-hero-cell-sub {
    font-size: 11px;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cg-hero-cell--buy  .cg-hero-cell-value { color: #d32f2f; }
.cg-hero-cell--sell .cg-hero-cell-value { color: #1976d2; }
.cg-hero-cell--trend.cg-hero-trend--up   .cg-hero-cell-value { color: #2e7d32; }
.cg-hero-cell--trend.cg-hero-trend--down .cg-hero-cell-value { color: #c62828; }
.cg-hero-cell--trend.cg-hero-trend--flat .cg-hero-cell-value { color: #5f6368; }
.cg-hero-cell--poll .cg-hero-cell-value { color: #5e35b1; font-size: 15px; }
.cg-hero-conclusion {
    margin: 14px 0 0;
    padding: 12px 14px;
    background: #fff;
    border-left: 3px solid #3366cc;
    border-radius: 0 6px 6px 0;
    font-size: 14px;
    line-height: 1.65;
    color: #333;
}
@media (max-width: 767px) {
    .cg-hero-summary {
        padding: 12px 12px 14px;
        border-radius: 10px;
    }
    .cg-hero-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .cg-hero-cell {
        padding: 10px 10px;
    }
    .cg-hero-cell-value {
        font-size: 17px;
    }
    .cg-hero-cell--poll .cg-hero-cell-value { font-size: 13px; }
    .cg-hero-conclusion {
        font-size: 13px;
        padding: 10px 12px;
    }
}
@media (max-width: 360px) {
    .cg-hero-grid {
        grid-template-columns: 1fr;
    }
}
/* Hero 導入文の装飾（平均買取/販売・投票） */
.cg-hero-accent {
    font-weight: 800;
    font-size: 1.05em;
    padding: 0 2px;
}
.cg-hero-accent--buy  { color: #d32f2f; }
.cg-hero-accent--sell { color: #1976d2; }
/* 説明文中の価格テキスト装飾（買取・販売） */
.cg-text-accent {
    font-weight: 700;
    padding: 0 1px;
}
.cg-text-accent--buy  { color: #d32f2f; }
.cg-text-accent--sell { color: #1976d2; }
.cg-hero-poll {
    font-weight: 500;
    color: #666;
}
.cg-hero-poll.cg-hero-accent--winner {
    font-weight: 800;
    color: #e67e00;
    font-size: 1.08em;
}
.intro-section, .conclusion-section {
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.intro-text, .conclusion-text {
    line-height: 1.8;
    color: #333;
}

.section-description {
    padding: 1rem;
    color: #666;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}
/* テーブル下に配置する版: 上マージンを持たせ、背景を軽くしてまとめコメント風に */
.section-description--below {
    margin: 0.75rem 0 1.5rem;
    padding: 0.9rem 1rem;
    background: #fafafa;
    border-left: 3px solid #d0d0d0;
    border-radius: 4px;
    font-size: 13px;
}
@media (max-width: 600px) {
    .section-description--below {
        padding: 0.75rem 0.9rem;
        font-size: 12.5px;
    }
}

/* 価格変動インジケーター */
.price-movement-indicator {
    background: linear-gradient(135deg, #f5f5f5 0%, #ffffff 100%);
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

.current-price {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.current-price .label {
    font-size: 0.9rem;
    color: #666;
}

.current-price .price {
    font-size: 2rem;
    font-weight: bold;
    color: #333;
}

.current-price .indicator {
    font-size: 1.2rem;
    font-weight: bold;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
}

.current-price .indicator.up {
    color: #d32f2f;
    background: rgba(211, 47, 47, 0.1);
}

.current-price .indicator.down {
    color: #1976d2;
    background: rgba(25, 118, 210, 0.1);
}

.current-price .indicator.stable {
    color: #666;
    background: rgba(0, 0, 0, 0.05);
}

/* レスポンシブテーブル */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1.5rem 0;
}

.price-table, .info-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.price-table th, .price-table td,
.info-table th, .info-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

/* オリジナルテーブルヘッダー（高コントラスト・再現性優先） */
.card-section .table-wrapper .price-table thead th,
.card-section .card-info-table .info-table thead th,
.card-section .price-table th,
.card-section .info-table th {
    background: #f7f7f9 !important;
    font-weight: 700;
    color: #222 !important;
    letter-spacing: .02em;
}
.card-section .price-table tbody tr:nth-child(odd),
.card-section .info-table tbody tr:nth-child(odd) {
    background: #fafbfc;
}
.card-section .price-table tbody tr:hover,
.card-section .info-table tbody tr:hover {
    background: #f0f4ff;
}

.price-buy {
    color: #d32f2f;
    font-weight: bold;
}

.price-sell {
    color: #1976d2;
    font-weight: bold;
}

/* アフィリ/商品ページへのリンク (テーブルセル内) */
.price-table .shop-link {
    color: #1a73e8;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.12s;
}
.price-table .shop-link:hover {
    color: #0d47a1;
    text-decoration-thickness: 2px;
}
.price-table .shop-link--price {
    text-decoration: none;
}
.price-table .shop-link-arrow {
    display: inline-block;
    margin-left: 4px;
    width: 0.9em;
    height: 0.9em;
    vertical-align: -1px;
    fill: currentColor;
}
/* ハイライト行で価格リンク色を保つ */
.price-table tr.has-shop-link .price-buy .shop-link--price  { color: #d32f2f; }
.price-table tr.has-shop-link .price-sell .shop-link--price { color: #1976d2; }
.best-badge {
    display: inline-block;
    color: #ffd700;
    font-size: 1.2em;
    margin-right: 0.25rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.taxonomy-link {
    color: #1976d2;
    text-decoration: none;
    padding: 0.25rem 0.75rem;
    border: 1px solid #1976d2;
    border-radius: 20px;
    display: inline-block;
    transition: all 0.3s;
}

.taxonomy-link:hover {
    background: #1976d2;
    color: white;
}
/* タームバッジ */
.term-badge {
    display: inline-block;
    margin: 0 .25rem .25rem 0;
    padding: .2rem .6rem;
    border-radius: 999px;
    background: #eef2ff;
    color: #223;
    border: 1px solid #c7d2fe;
    font-size: 12px;
    text-decoration: none;
    transition: all .2s;
}
.term-badge:hover {
    background: #dbeafe;
    border-color: #bfdbfe;
}
/* チャートタブ */
.chart-controls {
    display: flex;
    gap: 8px;
    margin: .25rem 0 1rem;
    flex-wrap: wrap;
}
.chart-controls .chart-tab {
    border: 1px solid #d1d5db;
    background: #fff;
    color: #374151;
    border-radius: 999px;
    padding: .35rem .9rem;
    font-size: 13px;
    cursor: pointer;
    transition: all .2s;
}
.chart-controls .chart-tab:hover { background: #f9fafb; }
.chart-controls .chart-tab.active {
    background: #111827;
    color: #fff;
    border-color: #111827;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    /* 案B: テーブルを2列グリッドのコンパクトカードに変更
       7店舗 → 4行(3+3+1) にコンパクト化し1画面の情報密度を上げる */
    .table-wrapper {
        border: none;
        overflow: visible;
        background: transparent;
        box-shadow: none;
        padding: 0;
    }
    .price-table {
        display: block;
        width: 100%;
        border: none;
        background: transparent;
        box-shadow: none;
    }
    .price-table thead {
        display: none;
    }
    .price-table tbody {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .price-table tr {
        display: block;
        background: #fff;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        padding: 10px 12px;
        margin: 0;
        box-shadow: 0 1px 3px rgba(0,0,0,0.04);
        min-width: 0;
    }
    .price-table td {
        display: block;
        width: auto;
        border: none;
        padding: 0;
        text-align: left;
    }
    /* 店舗名: カード上部、縮小＋省略 */
    .price-table td[data-label="店舗"] {
        font-size: 12.5px;
        font-weight: 700;
        color: #444;
        border-bottom: 1px dashed #eee;
        padding-bottom: 5px;
        margin-bottom: 6px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    /* 価格: 大きめ、色はセクションに応じて (.price-buy / .price-sell で着色) */
    .price-table td[data-label="買取価格"],
    .price-table td[data-label="販売価格"] {
        font-size: 16px;
        font-weight: 800;
        line-height: 1.2;
    }
    .price-table td.price-buy  { color: #d32f2f; }
    .price-table td.price-sell { color: #1976d2; }
    /* data-label のプレフィックス表示はセクション見出しで文脈が明確なので隠す */
    .price-table td[data-label]::before {
        display: none;
    }
    /* ★ ベストバッジをより目立つサイズに */
    .price-table .best-badge {
        font-size: 12px;
        margin-right: 3px;
        vertical-align: 1px;
    }
    /* 最高買取/最安販売行はカード枠を強調 */
    .price-table tr:has(.best-badge) {
        border-color: #ffb300;
        box-shadow: 0 1px 4px rgba(255,152,0,0.18);
        background: #fff9ec;
    }
    .current-price {
        flex-direction: column;
    }
    .current-price .price {
        font-size: 1.5rem;
    }
}
/* 320px 以下の超狭幅: 万一gridが窮屈なら1列に戻す */
@media (max-width: 340px) {
    .price-table tbody {
        grid-template-columns: 1fr;
    }
}

/* カードアイテム関連のスタイルは public/css/card-item.css に集約 */
.no-data {
    padding: 3rem;
    text-align: center;
    background: linear-gradient(135deg, #f5f5f5 0%, #fafafa 100%);
    border-radius: 8px;
    color: #666;
    border: 1px dashed #ddd;
}
/* 平均価格サマリー */
.average-price-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 2rem 0;
}
/* 単一サマリー(買取セクション or 販売セクションで個別表示するときの幅制限) */
.average-price-summary--single {
    grid-template-columns: minmax(280px, 360px);
    justify-content: start;
}
@media (max-width: 600px) {
    .average-price-summary--single {
        grid-template-columns: 1fr;
    }
}
.summary-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 2px solid transparent;
    transition: all 0.3s;
}
.summary-card.buy {
    border-color: #d32f2f;
}
.summary-card.sell {
    border-color: #1976d2;
}
.summary-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}
/* h3 になったので SWELL テーマの h3 デフォルト装飾を打ち消す */
h3.summary-label {
    all: unset;
    display: block;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #666 !important;
    margin: 0 0 8px !important;
    padding: 0 !important;
    letter-spacing: 0.5px;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}
h3.summary-label::before,
h3.summary-label::after {
    display: none !important;
    content: none !important;
    background: none !important;
    border: none !important;
}
.summary-card.buy .summary-label {
    color: #d32f2f !important;
}
.summary-card.sell .summary-label {
    color: #1976d2 !important;
}
.summary-value {
    font-size: 2.5rem;
    font-weight: 900;
    color: #333;
    margin-bottom: 8px;
    line-height: 1;
}
.summary-card.buy .summary-value {
    color: #d32f2f;
}
.summary-card.sell .summary-value {
    color: #1976d2;
}
.summary-meta {
    font-size: 13px;
    color: #888;
    padding-top: 8px;
    border-top: 1px solid #e0e0e0;
}
/* --accent: 最高価格カード(塗りつぶし、白文字で主役的に目立たせる) */
.summary-card--accent.buy {
    background: linear-gradient(135deg, #d32f2f 0%, #a62027 100%);
    border-color: #a62027;
}
.summary-card--accent.sell {
    background: linear-gradient(135deg, #1976d2 0%, #0d47a1 100%);
    border-color: #0d47a1;
}
.summary-card--accent .summary-label,
.summary-card--accent.buy .summary-label,
.summary-card--accent.sell .summary-label {
    color: rgba(255, 255, 255, 0.9) !important;
}
.summary-card--accent .summary-value,
.summary-card--accent.buy .summary-value,
.summary-card--accent.sell .summary-value {
    color: #fff;
}
.summary-card--accent .summary-meta {
    color: rgba(255, 255, 255, 0.75);
    border-top-color: rgba(255, 255, 255, 0.25);
}
@media (max-width: 768px) {
    .average-price-summary {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    .summary-value {
        font-size: 2rem;
    }
}

/* 価格グラフコンテナー */
.price-chart-container {
    position: relative;
    height: 400px;
    margin: 2rem 0;
    background: white;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* SWELLヘッダースタイル */
.swell-block-head {
    margin-bottom: 1.5rem;
}

/* 旧・単段見出し（フォールバック用に editorial の墨基調へ寄せる） */
.swell-block-head__title {
    font-size: 1.5rem;
    font-weight: 400;
    line-height: 1.5;
    padding-bottom: 0.5rem;
    position: relative;
}

/* ============================================================
   セクション見出し（2 段: アイブロウ＝カード名 / 主役＝セクション名）
   keibanavi 競馬場記事の「小ラベル＋主役タイトル」の作法を、カードの世界観
   （墨 #15151c / 和紙 #f7f5ef / ネオン #ff2d6f / 明朝 Zen Antique / 数字 Oswald）へ移植。
   カード名(レア度)#番号 を毎セクション大文字で繰り返す冗長さを解消する。
   ============================================================ */
.cg-card-h2.swell-block-head__title {
    display: block;
    font-weight: 400;
    line-height: 1.35;
    padding: 0 0 0.55rem;
    border-bottom: 1px solid var(--cg-rule, rgba(21, 21, 28, .14));
    position: relative;
}
/* 旧・青いアクセントバー / 太い墨下線を無効化 */
.cg-card-h2.swell-block-head__title::after {
    content: none;
    display: none;
}

/* アイブロウ（カード名部分・小さく控えめ・数字書体で字間広め） */
.cg-card-h2__eyebrow {
    display: block;
    font-family: var(--cg-num, "Oswald", "Zen Kaku Gothic New", sans-serif);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    line-height: 1.4;
    color: var(--cg-sumi-40, rgba(21, 21, 28, .40));
    margin-bottom: 0.32rem;
}

/* 主役タイトル（セクション名・明朝・大きく墨・ネオンの細アクセントバー） */
.cg-card-h2__title {
    display: block;
    font-family: var(--cg-disp, "Zen Antique", "Yu Mincho", serif);
    font-size: 1.6rem;
    font-weight: 400;
    line-height: 1.4;
    color: var(--cg-sumi, #15151c);
    letter-spacing: 0.02em;
    padding-left: 0.72rem;
    border-left: 4px solid var(--cg-neon, #ff2d6f);
}

@media (max-width: 768px) {
    .cg-card-h2__title {
        font-size: 1.32rem;
    }
    .cg-card-h2__eyebrow {
        font-size: 0.72rem;
    }
}
/* カードアイテム関連の重複スタイルは public/css/card-item.css に集約 */
