/* ============================================================
   10年比較セクション (gold-10y-compare) - エリアチャート版
============================================================ */

.g10c {
  padding: 28px 0 24px;
}

/* ============================================================
   見出し
   ※ h2.heading は他のセクションと共通CSS (gold.css側) を使用
============================================================ */

/* カードタイトル内のセパレータ */
.g10c-card__title-sep {
  margin: 0;
  opacity: 0.5;
  font-weight: 400;
}

/* カードタイトル内のSEOキーワード部分 */
.g10c-card__title-kw {
  font-size: 14px;
  font-weight: 600;
  opacity: 0.95;
}

/* ============================================================
   グリッド
============================================================ */
.g10c__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 16px;
}

.g10c__grid--extra {
  /* 閉じてる時: 最初の数十pxだけ見せて、残りはmax-heightで切る */
  max-height: 100px;  /* カード上部 (ヘッダー画像 + ピル) が少し覗く高さ */
  overflow: hidden;
  opacity: 0.85;
  /* 閉じる時: overflowを即座にhidden化 (アニメ可能に) */
  transition:
    max-height 0.5s ease,
    opacity 0.3s ease,
    overflow 0s 0s;
}

.g10c__grid--extra.is-open {
  max-height: 2400px;
  opacity: 1;
  overflow: visible;
  /* 開く時: アニメ完了(0.5s)後にoverflowをvisible化 (画像はみ出しOK) */
  transition:
    max-height 0.5s ease,
    opacity 0.3s ease,
    overflow 0s 0.5s;
}

.g10c__grid--single {
  grid-template-columns: 1fr;
  /* max-width 制約は外す: PCで2カラムレイアウトを活かす */
  margin-left: auto;
  margin-right: auto;
}

/* ============================================================
   単金種モード・SP: 比較ボックスを縦並びに
   (横並びだと各ボックスが狭くて数字が読みにくいため)
============================================================ */

/* ============================================================
   単金種モード・PC: チャート左 + 比較右 の2カラムレイアウト
   (子ページの間延び対策。SPでは従来の縦並び)
============================================================ */
@media (min-width: 769px) {
  .g10c--single .g10c-card__body {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    grid-template-areas:
      "chartLabel compareHead"
      "chart      compareGrid";
    column-gap: 24px;
    row-gap: 8px;
    align-items: start;
  }

  .g10c--single .g10c-card__chart-label-wrap {
    grid-area: chartLabel;
    margin-bottom: 0;
  }

  .g10c--single .g10c-card__chart-wrap {
    grid-area: chart;
    margin-bottom: 0;
  }

  .g10c--single .g10c-card__compare-head {
    grid-area: compareHead;
    margin-top: 0;
  }

  .g10c--single .g10c-card__compare-grid {
    grid-area: compareGrid;
    /* 右カラムは縦に2個並べる */
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

/* ============================================================
   折りたたみエリア (フェードアウト + ボタン重ね)
============================================================ */
.g10c__expand {
  position: relative;
  margin-top: 20px;
  padding-bottom: 70px; /* ボタン分のスペース */
}

.g10c__expand.is-open {
  padding-bottom: 20px;
}

/* フェードオーバーレイ (下部からじわっと白く) */
.g10c__expand-fade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 200px;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.8) 40%,
    rgba(255, 255, 255, 1) 80%
  );
  pointer-events: none;
  z-index: 5;
  transition: opacity 0.4s ease;
}

.g10c__expand.is-open .g10c__expand-fade {
  opacity: 0;
  pointer-events: none;
}

/* ボタンを中央下に配置 */
.g10c__expand-btn-wrap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10px;
  display: flex;
  justify-content: center;
  z-index: 10;
  transition: bottom 0.4s ease;
}

.g10c__expand.is-open .g10c__expand-btn-wrap {
  position: relative;
  bottom: auto;
  margin-top: 10px;
}

/* ============================================================
   カード
============================================================ */
.g10c-card {
  background: #fff;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  border: 1px solid #ede5d0;
}

.g10c-card--gold      { border-color: #e6d3a0; }
.g10c-card--platinum  { border-color: #c5d5d0; }
.g10c-card--silver    { border-color: #d4d4d4; }
.g10c-card--palladium { border-color: #c8cfd9; }

/* ============================================================
   カードヘッダー (グラデーション + インゴット画像)
============================================================ */
.g10c-card__head {
  position: relative;
  padding: 18px 20px 18px 110px;
  min-height: 60px;
  color: #fff;
  display: flex;
  align-items: center;
}

.g10c-card--gold .g10c-card__head {
  background: linear-gradient(135deg, #e6c97a 0%, #c9a961 60%, #a8862a 100%);
}
.g10c-card--platinum .g10c-card__head {
  background: linear-gradient(135deg, #b8d0c8 0%, #7a9d92 60%, #4a7068 100%);
}
.g10c-card--silver .g10c-card__head {
  background: linear-gradient(135deg, #c5c5c5 0%, #9a9a9a 60%, #6c6c6c 100%);
}
.g10c-card--palladium .g10c-card__head {
  background: linear-gradient(135deg, #a8b3c2 0%, #6b7a8f 60%, #4a5567 100%);
}

.g10c-card__head-ingot {
  position: absolute;
  left: -15px;
  top: 50%;
  transform: translateY(-50%);
  width: 115px;
  height: auto;
  z-index: 2;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.g10c-card__title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.g10c-card__title-jp {
  font-size: 21px;
}

.g10c-card__title-en {
  font-size: 14px;
  font-weight: 500;
  opacity: 0.95;
  margin-left: 4px;
}

/* ============================================================
   カードボディ
============================================================ */
.g10c-card__body {
  padding: 16px 18px 18px;
}

/* 「価格推移チャート(円/g)」ピル */
.g10c-card__chart-label-wrap {
  text-align: center;
  margin-bottom: 8px;
}

.g10c-card__chart-label {
  display: inline-block;
  padding: 6px 16px;
  background: #fbf5e6;
  color: #8c6f2e;
  font-size: 12px;
  font-weight: 700;
  border-radius: 16px;
  letter-spacing: 0.04em;
}

.g10c-card--platinum  .g10c-card__chart-label { background: #e8f0ee; color: #2d564c; }
.g10c-card--silver    .g10c-card__chart-label { background: #ededed; color: #555; }
.g10c-card--palladium .g10c-card__chart-label { background: #e6e9ee; color: #2f3a4a; }

/* ============================================================
   チャート + アノテーション
============================================================ */
.g10c-card__chart-wrap {
  position: relative;
  width: 100%;
  height: 220px;
  margin-bottom: 16px;
}

.g10c-card__chart {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 196px;  /* wrap高さ - X軸ラベル分(24px) */
  width: 100%;
}

/* X軸ラベル (10年前 / 5年前 / 現在) - JSが動的に位置設定 */
.g10c-card__xaxis {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 18px;
  font-size: 11px;
  color: #888;
  font-weight: 600;
  pointer-events: none;
}

.g10c-card__xaxis-label {
  position: absolute;
  top: 0;
  white-space: nowrap;
}

/* データポイント上の丸マーカー */
.g10c-card__marker {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 90;
  left: -9999px;
  top: -9999px;
}

.g10c-card__marker--today {
  width: 14px;
  height: 14px;
  border-width: 3px;
}

.g10c-card--gold .g10c-card__marker      { background: #c9a961; }
.g10c-card--gold .g10c-card__marker--today { background: #a8862a; }
.g10c-card--platinum .g10c-card__marker  { background: #5e8a7e; }
.g10c-card--platinum .g10c-card__marker--today { background: #4a7068; }
.g10c-card--silver .g10c-card__marker    { background: #8a8a8a; }
.g10c-card--silver .g10c-card__marker--today { background: #6c6c6c; }
.g10c-card--palladium .g10c-card__marker { background: #6b7a8f; }
.g10c-card--palladium .g10c-card__marker--today { background: #4a5567; }

/* アノテーション吹き出し */
.g10c-card__anno {
  position: absolute;
  background: #fff;
  border: 1.5px solid;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 11px;
  line-height: 1.3;
  text-align: center;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  z-index: 100;
  min-width: 70px;
  left: -9999px;
  top: -9999px;
}

/* テーマカラー */
.g10c-card--gold .g10c-card__anno {
  border-color: #c9a961;
  color: #8c6f2e;
}

.g10c-card--platinum .g10c-card__anno {
  border-color: #5e8a7e;
  color: #2d564c;
}

.g10c-card--silver .g10c-card__anno {
  border-color: #8a8a8a;
  color: #555;
}

.g10c-card--palladium .g10c-card__anno {
  border-color: #6b7a8f;
  color: #2f3a4a;
}

/* 「今日」アノテーションは塗りつぶし */
.g10c-card__anno--today {
  color: #fff !important;
}

.g10c-card--gold .g10c-card__anno--today {
  background: linear-gradient(135deg, #c9a961, #a8862a);
}
.g10c-card--platinum .g10c-card__anno--today {
  background: linear-gradient(135deg, #5e8a7e, #4a7068);
}
.g10c-card--silver .g10c-card__anno--today {
  background: linear-gradient(135deg, #9a9a9a, #6c6c6c);
}
.g10c-card--palladium .g10c-card__anno--today {
  background: linear-gradient(135deg, #6b7a8f, #4a5567);
}

/* 「今日」吹き出しは塗りつぶしのまま (しっぽは無し) */

.g10c-card__anno-label {
  font-size: 10px;
  opacity: 0.85;
  margin-bottom: 2px;
}

.g10c-card__anno-price {
  font-size: 13px;
  font-weight: 700;
}

/* ============================================================
   下部: 「10年前・5年前と比較」見出し
============================================================ */
.g10c-card__compare-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.g10c-card__compare-head-line {
  flex: 1;
  height: 1px;
  background: #888;
}

.g10c-card__compare-head-text {
  font-size: 13px;
  font-weight: 700;
  color: #2a3450;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

/* ============================================================
   比較ボックス (2分割)
============================================================ */
.g10c-card__compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.g10c-card__compare-box {
  background: #fbf5e6;
  border-radius: 6px;
  padding: 12px 8px 10px;
  text-align: center;
}

.g10c-card--platinum  .g10c-card__compare-box { background: #e8f0ee; }
.g10c-card--silver    .g10c-card__compare-box { background: #ededed; }
.g10c-card--palladium .g10c-card__compare-box { background: #e6e9ee; }

.g10c-card__compare-label {
  font-size: 11px;
  font-weight: 700;
  color: #8c6f2e;
  margin-bottom: 4px;
  letter-spacing: 0.04em;
}

.g10c-card--platinum  .g10c-card__compare-label { color: #2d564c; }
.g10c-card--silver    .g10c-card__compare-label { color: #555; }
.g10c-card--palladium .g10c-card__compare-label { color: #2f3a4a; }

.g10c-card__compare-value {
  font-size: 14px;
  font-weight: 700;
  color: #2a3450;
  line-height: 1;
  margin-bottom: 6px;
}

.g10c-card__compare-num {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 2px;
  color: #c0392b; /* デフォは赤 (1倍以上想定) */
}

/* 倍率: 1倍以上=赤 / 1倍未満=青 */
.g10c-card__compare-num.is-up   { color: #c0392b; }
.g10c-card__compare-num.is-down { color: #2980b9; }

.g10c-card__compare-diff {
  font-size: 13px;
  font-weight: 700;
}

/* 差額: プラス=赤 / マイナス=青 */
.g10c-card__compare-diff [data-diff10],
.g10c-card__compare-diff [data-diff5] {
  font-weight: 700;
  color: #c0392b;
}

.g10c-card__compare-diff [data-diff10].is-up,
.g10c-card__compare-diff [data-diff5].is-up {
  color: #c0392b;
}

.g10c-card__compare-diff [data-diff10].is-down,
.g10c-card__compare-diff [data-diff5].is-down {
  color: #2980b9;
}

/* ============================================================
   折りたたみボタン (フローティング型)
============================================================ */
.g10c__toggle {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 28px 14px 32px;
  background: #fff;
  color: #2a3450;
  border: 1.5px solid #d8c281;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  white-space: nowrap;
}

.g10c__toggle:hover {
  background: #fdf6e3;
  border-color: #c9a961;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  transform: translateY(-1px);
}

.g10c__toggle-label {
  display: inline-block;
}

.g10c__toggle-close-label {
  display: none;
}

.g10c__toggle.is-open .g10c__toggle-open-label {
  display: none;
}

.g10c__toggle.is-open .g10c__toggle-close-label {
  display: inline;
}

.g10c__toggle-icon {
  display: inline-flex;
  width: 14px;
  height: 14px;
  transition: transform 0.3s;
  color: #c9a961;
}

.g10c__toggle.is-open .g10c__toggle-icon {
  transform: rotate(180deg);
}

.g10c__toggle-icon svg {
  width: 100%;
  height: 100%;
}


/* ============================================================
   レスポンシブ (スマホ)
============================================================ */
@media (max-width: 768px) {
  .g10c {
    padding: 24px 0 18px;
  }

  .g10c__grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .g10c-card__head {
    padding: 14px 16px 14px 80px;
    min-height: 50px;
  }

  .g10c-card__head-ingot {
    left: -15px;
    width: 80px;
  }

  .g10c-card__title-jp {
    font-size: 21px;
  }

  .g10c-card__title-en {
    font-size: 13px;
  }

  .g10c-card__title-sep {
    margin: 0;
  }

  .g10c-card__title-kw {
    font-size: 12px;
  }

  .g10c-card__body {
    padding: 14px 14px 16px;
  }

  .g10c-card__chart-wrap {
    height: 190px;
  }

  .g10c-card__chart {
    height: 166px;
  }

  .g10c-card__anno {
    padding: 5px 10px;
    font-size: 10px;
    min-width: 60px;
  }

  .g10c-card__anno-price {
    font-size: 12px;
  }

  .g10c-card__compare-num {
    font-size: 30px;
  }

  .g10c__toggle {
    padding: 12px 22px 12px 26px;
    font-size: 13px;
    gap: 10px;
  }

  .g10c__expand {
    padding-bottom: 60px;
  }

  .g10c__expand-fade {
    height: 160px;
  }
}

@media (max-width: 400px) {
  .g10c {
    padding: 20px 8px 16px;
    margin-left: -4px;
    margin-right: -4px;
  }

  .g10c-card__head-ingot {
    width: 70px;
  }

  .g10c-card__head {
    padding-left: 84px;
  }

  .g10c-card__title-jp {
    font-size: 19px;
  }

  /* 極小画面ではキーワード部分は隠して金種名だけ表示 (デザイン優先) */
  .g10c-card__title-sep,
  .g10c-card__title-kw {
    display: none;
  }

  .g10c-card__chart-wrap {
    height: 160px;
  }

  .g10c-card__chart {
    height: 136px;
  }

  .g10c-card__compare-num {
    font-size: 26px;
  }
}
