/* ============================================================
   Bond ETF Guide — component styles
   Uses project CSS variables from style.css
   ============================================================ */

/* ── Hero stats strip — rounded summary cards ──────────────── */
.bond-hero-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .75rem;
  margin-bottom: 1.35rem;
}
.bond-hero-stat {
  background: var(--ledger-card, var(--surface-strong, #fff));
  border: 1px solid var(--ledger-rule, #d8ddd6);
  border-radius: 24px;
  padding: 0.85rem 1.1rem;
  text-align: left;
  position: relative;
}
.bond-hero-stat__value {
  font-family: var(--mono, 'Noto Sans KR', sans-serif);
  font-size: 1.18rem;
  font-weight: 600;
  color: var(--ledger-ink, #1a1f26);
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}
.bond-hero-stat__value.highlight { color: var(--bond-brand-strong, var(--brand-deep)); }
.bond-hero-stat__value.highlight-secondary { color: var(--ledger-gold, #065f46); }
.bond-hero-stat__label {
  font-size: 0.63rem;
  color: var(--bond-muted-text, var(--ink-muted, #5c656f));
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  margin-top: 3px;
  white-space: nowrap;
}

/* ── Maturity timeline bubble chart ────────────────────────── */
.maturity-timeline-card {
  background: var(--surface-strong, #fff);
  border: 1px solid var(--border-soft, #d8ddd6);
  border-radius: 24px;
  padding: 0.75rem 1rem 0.5rem;
  margin-bottom: 1.25rem;
}
.maturity-timeline-card .card-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-muted, #5c656f);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}
#maturityTimeline { max-height: 90px; }

/* ── Manager logo pill ──────────────────────────────────────── */
.manager-logo {
  height: 20px;
  width: 32px;
  object-fit: contain;
  border-radius: 3px;
  flex-shrink: 0;
}
.manager-logo-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 20px;
  min-width: 32px;
  padding: 0 7px;
  border-radius: 4px;
  font-size: 0.63rem;
  font-weight: 700;
  background: var(--surface-muted, #ecefea);
  color: var(--ink-muted, #5c656f);
  letter-spacing: 0.04em;
  flex-shrink: 0;
  border: 1px solid var(--border-soft, #d8ddd6);
}

/* ── YTM cell ───────────────────────────────────────────── */
.ytm-cell { min-width: 100px; }
.ytm-value {
  font-family: var(--mono, 'Noto Sans KR', sans-serif);
  color: var(--bond-brand-strong, var(--brand-deep));
  font-size: 1.02rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ── Spread quality badge — wax-seal tags ──────────────────── */
.spread-badge {
  display: inline-block;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: .03em;
  padding: 2px 7px;
  border-radius: 2px;
  margin-left: 5px;
  vertical-align: middle;
  border: 1px solid transparent;
  line-height: 1.3;
}
.spread-high { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-deep); }  /* 매력적 */
.spread-mid  { background: var(--surface-muted); border-color: var(--border-soft); color: var(--ink-muted); }  /* 적정 */
.spread-low  { background: var(--surface-tint); border-color: var(--border-soft); color: var(--text-secondary); }  /* 시장가 */
.spread-neg  { background: var(--negative-soft); border-color: var(--negative-soft-strong); color: var(--market-up); }  /* 주의 */

/* ── Spread value coloring ──────────────────────────────────── */
.spread-pos { color: var(--brand-deep); font-weight: 700; font-variant-numeric: tabular-nums; }
.spread-zero { color: var(--ink-muted); }
.spread-negative { color: var(--market-up); font-weight: 700; font-variant-numeric: tabular-nums; }

/* ── Credit rating chips — soft-tint pills (see DESIGN.md § Chips) ── */
.credit-gov,
.credit-special,
.credit-bank,
.credit-corp-aa,
.credit-corp-a,
.credit-card {
  display: inline-flex;
  align-items: center;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1;
  padding: 6px 12px;
  border-radius: 999px;
  border: none;
  background: var(--brand-soft, #e4f0ea);
  background: color-mix(in srgb, currentColor 12%, transparent);
}
.credit-gov     { color: var(--bond-ct-gov, #e8804a); }
.credit-special { color: var(--bond-ct-special, #6d28d9); }
.credit-bank    { color: var(--bond-ct-bank, #008254); }
.credit-corp-aa { color: var(--bond-ct-corp-aa, #2f9e6f); }
.credit-corp-a  { color: var(--bond-ct-corp-a, #647287); }
.credit-card    { color: var(--bond-ct-card, #1d56c8); }

/* ── Detail page: hero card ─────────────────────────────────── */
.bond-detail-hero {
  background: var(--surface-strong, #fff);
  border: 1px solid var(--border-soft, #d8ddd6);
  border-radius: 24px;
  overflow: hidden;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-soft, 0 18px 40px rgba(18,24,32,0.07));
}
.bond-detail-hero__top {
  padding: 1.25rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}
.bond-detail-hero__ytm-block { text-align: right; flex-shrink: 0; }
.bond-detail-hero__ytm-label {
  font-size: 0.72rem;
  color: var(--ink-muted, #5c656f);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.bond-detail-hero__ytm-value {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--ink-strong, #1a1f26);
  line-height: 1.1;
}
.bond-detail-hero__bottom {
  padding: 0.9rem 1.5rem;
  background: var(--surface, #f5f3e9);
  border-top: 1px solid var(--border-soft, #d8ddd6);
}

/* ── Maturity countdown bar ─────────────────────────────────── */
.maturity-countdown {
  margin-top: 0.6rem;
}
.maturity-countdown__label {
  font-size: 0.72rem;
  color: var(--ink-muted, #5c656f);
  margin-bottom: 3px;
}
.maturity-countdown__bar {
  height: 5px;
  background: var(--border-soft);
  border-radius: 3px;
  overflow: hidden;
}
.maturity-countdown__fill {
  height: 100%;
  border-radius: 3px;
  background: var(--brand-deep);
  transition: width 0.6s ease;
}
.maturity-countdown__fill.near-maturity { background: var(--warning); }
.maturity-countdown__fill.imminent { background: var(--market-up); }
.maturity-countdown__days {
  font-size: 0.78rem;
  font-weight: 600;
  margin-top: 3px;
}
.maturity-countdown__days.near { color: var(--warning); }
.maturity-countdown__days.imminent { color: var(--market-up); }

/* ── Spread gauge widget ────────────────────────────────────── */
.spread-gauge {
  position: relative;
  height: 6px;
  background: var(--border-soft);
  border-radius: 3px;
  margin: 6px 0;
}
.spread-gauge__track {
  position: absolute;
  top: 0; bottom: 0;
  border-radius: 3px;
}
.spread-gauge__track.positive { background: var(--brand); left: 50%; }
.spread-gauge__track.negative { background: var(--market-up); right: 50%; }
.spread-gauge__zero {
  position: absolute;
  left: 50%;
  top: -3px;
  bottom: -3px;
  width: 2px;
  background: var(--ink-muted);
  transform: translateX(-50%);
}
.spread-gauge__labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  color: var(--ink-muted, #5c656f);
  margin-top: 2px;
}

/* ── Comparison table (detail page) ────────────────────────── */
.comparison-table { font-size: 0.83rem; }
.comparison-table th {
  font-weight: 600;
  color: var(--ink-muted, #5c656f);
  background: var(--table-header-bg, #e6e0cc);
  white-space: nowrap;
  padding: 0.4rem 0.75rem;
}
.comparison-table td { padding: 0.4rem 0.75rem; vertical-align: middle; }
.comparison-table .highlight-col { background: var(--brand-soft); }
.comparison-table .better { color: var(--brand); font-weight: 600; }
.comparison-table .worse  { color: var(--market-up); }

/* ── Chart improvement ──────────────────────────────────────── */
.ytm-trend-card .stat-delta {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
}
.ytm-trend-card .stat-delta.up   { background: var(--brand-soft); color: var(--brand-deep); }
.ytm-trend-card .stat-delta.down { background: var(--negative-soft); color: var(--market-up); }
.ytm-trend-card .stat-delta.flat { background: var(--surface-muted); color: var(--ink-muted); }

/* ── No-data state ──────────────────────────────────────────── */
.no-data-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--bond-muted-text, var(--ink-muted, #5c656f));
}
.no-data-state__icon { font-size: 2rem; margin-bottom: 0.5rem; opacity: 0.4; }
.no-data-state__msg  { font-size: 0.85rem; }

/* ── ETF table — ledger rows ─────────────────────────────────── */
.bond-etf-table-wrap {
  border-top: 1px solid var(--ledger-rule-strong, #d8ddd6);
  background: transparent;
  margin-top: 0.5rem;
}
.bond-etf-table {
  margin: 0;
}
.bond-etf-table thead th {
  background: var(--table-header-bg);
  height: var(--table-header-height);
  vertical-align: middle;
  color: var(--ledger-ink-soft, #5c656f);
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 0;
  text-transform: none;
  padding: 0 12px;
  border-bottom: 1px solid var(--ledger-rule-strong, #d8ddd6);
  white-space: nowrap;
}
.bond-etf-table tbody td {
  padding: 16px 12px;
  border-color: var(--ledger-rule, #d8ddd6);
  border-style: solid;
  vertical-align: middle;
  color: var(--ledger-ink, #1a1f26);
  font-size: 13px;
}
.bond-etf-table tbody tr:last-child td {
  border-bottom: none;
}
.bond-etf-table td:first-child .fw-medium {
  font-weight: 700;
}
.bond-etf-table tbody tr {
  transition: background .12s ease;
}
.bond-etf-table tbody tr:hover {
  background: var(--ledger-paper-deep, #f5f3e9);
}
.bond-etf-table a {
  font-weight: 600;
  color: var(--ledger-ink, #1a1f26);
}
.bond-etf-table a:hover { color: var(--bond-brand-accent, #008254); text-decoration: none; }
.bond-etf-table .text-dark { color: var(--ledger-ink, #1a1f26) !important; }

/* ── Responsive adjustments ─────────────────────────────────── */
@media (max-width: 576px) {
  .bond-hero-stat { min-width: 100px; padding: 0.7rem 0.9rem; }
  .bond-hero-stat__value { font-size: 1.08rem; }
  .bond-hero-stat__label { white-space: normal; }
  .bond-detail-hero__ytm-value { font-size: 1.9rem; }
  .bond-detail-hero__top { flex-direction: column; }
  .bond-detail-hero__ytm-block { text-align: left; }
}
