/* 金ETF（/market/gold-etf）2026-09-26。market.css の上に、このページだけの部品を足す。
   色は既存の --cy-* に従う。--cy-money は金額専用なので使わない。保有量の線だけ独立した落ち着いた金色。 */

.gold-etf {
  --ge-gold: #D7BA75;
  --ge-gap: 24px;
}
.cyber-theme[data-theme="light"] .gold-etf { --ge-gold: #76551D; }
@media (prefers-color-scheme: light) {
  .cyber-theme:not([data-theme="dark"]) .gold-etf { --ge-gold: #76551D; }
}

.gold-etf .market-panel { margin-bottom: var(--ge-gap); }
.gold-etf-muted { color: var(--cy-muted); font-size: .875rem; line-height: 1.7; }
.gold-etf-sub { display: block; color: var(--cy-muted); font-size: .8125rem; font-weight: 400; }
.gold-etf-warn { color: var(--mk-warn); font-weight: 700; }
.gold-etf a:focus-visible, .gold-etf button:focus-visible, .gold-etf select:focus-visible,
.gold-etf summary:focus-visible, .gold-etf-scroll:focus-visible { outline: 3px solid var(--cy-mint); outline-offset: 2px; }

/* プレビュー（ローカルの表示確認）だけで出る帯 */
.gold-etf-synthetic { margin: 0 0 16px; padding: 10px 16px; border: 2px dashed var(--cy-pink); border-radius: 8px; font-weight: 700; }

/* パンくず・見出し */
.gold-etf-crumbs ol { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; color: var(--cy-muted); font-size: .8125rem; }
.gold-etf-crumbs li + li::before { content: "/"; margin-inline-end: 8px; }
.gold-etf-crumbs a { color: var(--cy-muted); }
.gold-etf-hero { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 16px; }
.gold-etf-hero__main { flex: 1 1 420px; min-width: 0; }
.gold-etf-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.gold-etf-chips li { padding: 4px 12px; border: 1px solid var(--mk-line); border-radius: 999px; background: var(--cy-raised); font-size: .8125rem; font-weight: 700; }
.gold-etf-dates { display: flex; flex-wrap: wrap; gap: 8px 24px; flex-basis: 100%; margin: 0; font-size: .875rem; }
.gold-etf-dates div { display: flex; gap: 8px; }
.gold-etf-dates dt { color: var(--cy-muted); }
.gold-etf-dates dd { margin: 0; font-variant-numeric: tabular-nums; }

.gold-etf-anchors { display: flex; flex-wrap: wrap; gap: 4px 8px; margin: 0 0 var(--ge-gap); border-bottom: 1px solid var(--mk-line); }
.gold-etf-anchors a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; color: var(--cy-muted); }
.gold-etf-anchors a:hover { color: var(--cy-text); }

/* アクセス案内 */
.gold-etf-gate h2 { font-size: 1.25rem; }
.gold-etf-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 16px 0 0; }
.gold-etf-button { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 8px; font-weight: 700; }
.gold-etf-button--ghost { border: 1px solid var(--mk-line); color: var(--cy-text); }
.gold-etf-reasons { margin: 12px 0; padding-inline-start: 20px; line-height: 1.8; }
.gold-etf-reasons a { color: var(--cy-mint); font-weight: 700; }
.gold-etf-access { display: flex; align-items: center; gap: 8px; margin: 0 0 16px; color: var(--cy-muted); font-size: .875rem; }
.gold-etf-access .market-status__dot { background: var(--cy-mint); }

/* 対象月の選択 */
.gold-etf-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 var(--ge-gap); }
.gold-etf-toolbar label { font-weight: 700; }
.gold-etf-toolbar select, .gold-etf-toolbar button { min-height: 44px; padding: 0 12px; border: 1px solid var(--mk-line); border-radius: 8px; background: var(--cy-surface); color: var(--cy-text); font: inherit; }
.gold-etf-toolbar button { font-weight: 700; cursor: pointer; }
.gold-etf-toolbar p { flex-basis: 100%; margin: 0; }
.gold-etf-period { margin-inline-start: 8px; color: var(--cy-muted); font-size: .9375rem; font-weight: 400; }

/* KPI */
.gold-etf-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 12px 0; }
.gold-etf-kpi { min-width: 0; padding: 16px; border: 1px solid var(--mk-line); border-radius: 12px; background: var(--cy-raised); }
.gold-etf-kpi__label { margin: 0; color: var(--cy-muted); font-size: .875rem; font-weight: 700; }
.gold-etf-kpi__value { margin: 8px 0 0; font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.gold-etf-kpi__word { margin: 4px 0 0; font-size: .8125rem; }
.gold-etf-unit { margin-inline-start: 6px; color: var(--cy-muted); font-size: .875rem; font-weight: 700; }

/* 表示イメージ（固定の 0 の並び）。ぼかしは見た目だけ。読み上げからは外してある */
.gold-etf-preview-label { display: inline-block; margin: 0 0 8px; padding: 2px 10px; border: 1px dashed var(--mk-line); border-radius: 999px; color: var(--cy-muted); font-size: .8125rem; font-weight: 700; }
.gold-etf-sample { filter: blur(5px); user-select: none; }

/* 推移グラフ */
.gold-etf-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.gold-etf-spans { display: flex; flex-wrap: wrap; gap: 4px; }
.gold-etf-spans a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border: 1px solid var(--mk-line); border-radius: 8px; color: var(--cy-text); text-decoration: none; }
.gold-etf-spans a[aria-current="true"] { border-color: var(--cy-mint); font-weight: 700; box-shadow: inset 0 -3px 0 var(--cy-mint); }
.gold-etf-legend { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 8px 0; padding: 0; list-style: none; font-size: .875rem; }
.gold-etf-legend li { display: inline-flex; align-items: center; gap: 8px; }
.gold-etf-swatch { display: inline-block; width: 18px; height: 10px; border-radius: 2px; }
.gold-etf-swatch--line { height: 3px; background: var(--ge-gold); }
.gold-etf-swatch--bar { background: linear-gradient(90deg, var(--mk-pos) 50%, var(--mk-neg) 50%); }
.gold-etf-latest { margin: 0 0 8px; font-size: .9375rem; font-variant-numeric: tabular-nums; }
.gold-etf-chart { margin: 0; }
.gold-etf-plot { position: relative; display: grid; grid-template-columns: 64px minmax(0, 1fr); height: 220px; }
.gold-etf-plot--bars { height: 120px; margin-top: 12px; }
.gold-etf-plot--placeholder { display: flex; align-items: center; justify-content: center; height: 300px; border: 1px dashed var(--mk-line); border-radius: 12px; }
.gold-etf-axis { display: flex; flex-direction: column; justify-content: space-between; padding-inline-end: 8px; color: var(--cy-muted); font-size: .75rem; text-align: end; font-variant-numeric: tabular-nums; }
.gold-etf-svg { display: block; width: 100%; height: 100%; overflow: visible; }
.gold-etf-grid { stroke: var(--mk-line); stroke-width: 1; }
.gold-etf-line { fill: none; stroke: var(--ge-gold); stroke-width: 2.5; stroke-linejoin: round; }
.gold-etf-zero { stroke: var(--cy-muted); stroke-width: 1; }
.gold-etf-pos { fill: var(--mk-pos); }
.gold-etf-neg { fill: var(--mk-neg); }
.gold-etf-xaxis { display: flex; justify-content: space-between; margin-inline-start: 64px; color: var(--cy-muted); font-size: .75rem; }
.gold-etf-sample-chart { position: absolute; inset: 16px; width: calc(100% - 32px); height: calc(100% - 32px); filter: blur(4px); opacity: .5; }
.gold-etf-lock { position: relative; margin: 0; padding: 8px 16px; border: 1px solid var(--mk-line); border-radius: 999px; background: var(--cy-surface); font-weight: 800; }
.gold-etf-flat { fill: var(--cy-muted); }
.gold-etf-details { margin-top: 12px; }

/* SPDR Gold Shares（GLD）の日次。部品は上の KPI・推移グラフと同じものを使い、差分だけ足す */
.gold-etf-spdr__dates { margin: 8px 0 0; }
.gold-etf-spdr h3 { margin: 32px 0 8px; font-size: 1rem; }
.gold-etf-spdr .gold-etf-axis span:nth-child(2):not(:last-child) { opacity: .7; }
.gold-etf-details summary { display: inline-flex; align-items: center; min-height: 44px; cursor: pointer; color: var(--cy-mint); font-weight: 700; }
.gold-etf-details ul { margin: 8px 0 0; padding-inline-start: 20px; line-height: 1.8; font-size: .875rem; }

/* 表。横スクロールは表の中だけ。左の名前列は不透明の背景で固定。
   position: relative は必須（market.css の .market-scroll と同じ理由）。セル内の .sr-only
   （position: absolute）の基準をこの枠にしないと、右端の列の分だけページの横幅が広がる */
.gold-etf-scroll { position: relative; max-width: 100%; overflow-x: auto; }
.gold-etf-scroll-hint { display: none; margin: 0 0 4px; color: var(--cy-muted); font-size: .8125rem; }
.gold-etf-table { font-size: .9375rem; }
.gold-etf-table th[scope="row"] { font-weight: 700; overflow-wrap: anywhere; }
.gold-etf-table .market-num { white-space: nowrap; }
.gold-etf-table--sticky { min-width: 760px; }
.gold-etf-table--sticky th:first-child { position: sticky; inset-inline-start: 0; z-index: 1; min-width: 150px; background: var(--cy-surface); }
/* ランキングは狭い枠で文字を潰さず、枠の中で横スクロールさせる */
.gold-etf-ranking .gold-etf-table--compact { min-width: 560px; }
.gold-etf-ranking .gold-etf-table--compact th[scope="row"] { min-width: 180px; overflow-wrap: normal; word-break: normal; }
.gold-etf-world-row th, .gold-etf-world-row td { border-top: 2px solid var(--mk-line); background: var(--cy-raised); }
.gold-etf-empty-cell { color: var(--cy-muted); text-align: center; }

/* ランキング */
.gold-etf-rankings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.gold-etf-ranking { container-type: inline-size; min-width: 0; padding: 16px; border: 1px solid var(--mk-line); border-radius: 12px; background: var(--cy-raised); }
.gold-etf-ranking h3 { margin: 0 0 8px; font-size: 1rem; }
.gold-etf-ranking .gold-etf-table th[scope="row"] { background: transparent; }
.gold-etf-share { display: block; width: 100%; height: 6px; margin-top: 6px; }
.gold-etf-ranking--inflow .gold-etf-share rect { fill: var(--mk-pos); }
.gold-etf-ranking--outflow .gold-etf-share rect { fill: var(--mk-neg); }
/* 案内は表の最小幅（560px）が枠に収まらないときだけ。画面幅ではなく枠の幅で判断する。
   コンテナクエリ非対応では常に出る（隠れるより安全） */
.gold-etf-scroll-hint--ranking { display: block; }
@container (min-width: 560px) { .gold-etf-scroll-hint--ranking { display: none; } }

@media (max-width: 959px) {
  .gold-etf-rankings { grid-template-columns: minmax(0, 1fr); }
  .gold-etf-scroll-hint { display: block; }
}
@media (max-width: 599px) {
  .gold-etf { --ge-gap: 16px; --mk-pad: 16px; }
  .gold-etf-kpis { grid-template-columns: minmax(0, 1fr); }
  .gold-etf-plot { height: 180px; grid-template-columns: 52px minmax(0, 1fr); }
  .gold-etf-plot--bars { height: 80px; }
  .gold-etf-xaxis { margin-inline-start: 52px; }
  .gold-etf-plot--placeholder { height: 260px; }
  .gold-etf-toolbar { flex-direction: column; align-items: stretch; }
}
@media (prefers-reduced-motion: reduce) {
  .gold-etf * { transition: none !important; animation: none !important; }
}
/* 印刷ではプレビューごと出さない（ぼかしが外れた固定の 0 を実データと取り違えさせない） */
@media print {
  .gold-etf-sample, .gold-etf-sample-chart, .gold-etf-preview-label { display: none !important; }
  .gold-etf-anchors, .gold-etf-toolbar, .gold-etf-spans { display: none; }
}
