/* Shared styles for the strategy fact sheets (strategies/<id>/index.html)
   and the strategy cards on the home and strategies pages. */

/* ── Header breadcrumb ───────────────────────────────────────────────────── */

.nav-breadcrumb {
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}
.nav-breadcrumb a { color: var(--accent); text-decoration: none; }
.nav-breadcrumb a:hover { text-decoration: underline; }
.nav-breadcrumb .sep { color: var(--border); }
.nav-breadcrumb .current {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Strategy cards (home + strategies list) ─────────────────────────────── */

.strategy-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem;
}

.strategy-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.6rem 1.2rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.strategy-card:hover,
.strategy-card:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 6px 20px rgba(42,111,219,0.12);
  transform: translateY(-1px);
  outline: none;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}

.pill {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--muted);
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
  display: inline-flex;
  width: fit-content;
  text-transform: uppercase;
}

.card-name { font-size: 1.15rem; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); margin: 0 0 0.3rem; }
.card-tagline { font-size: 0.82rem; color: var(--muted); line-height: 1.45; margin: 0 0 1.1rem; flex: 1; }

.card-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  padding: 0.9rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}

.card-metric { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.card-metric-label { font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.card-metric-value { font-size: 1.3rem; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.card-metric-sub { font-size: 0.68rem; color: var(--muted); }

.card-cta { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; font-size: 0.78rem; color: var(--accent); font-weight: 600; }
.card-period { font-size: 0.72rem; color: var(--muted); font-weight: 400; }

.card-loading {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.6rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-style: italic;
}

.alpha-pos { color: var(--green); font-weight: 700; }
.alpha-neg { color: var(--red); font-weight: 700; }

/* ── Fact sheet: hero ────────────────────────────────────────────────────── */

.strategy-hero {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 2rem;
  box-shadow: var(--shadow-sm);
}

.strategy-name {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 0.35rem;
  line-height: 1.2;
}

.strategy-tagline { color: var(--muted); font-size: 0.92rem; margin: 0; }

.hero-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.9rem 1.5rem;
  margin: 1.25rem 0 0;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border);
}

.hero-meta div { min-width: 0; }
.hero-meta dt {
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-bottom: 0.15rem;
}
.hero-meta dd { margin: 0; font-size: 0.84rem; color: var(--ink); line-height: 1.4; }

/* ── Fact sheet: KPI cards ───────────────────────────────────────────────── */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.kpi-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.kpi-value {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.kpi-vs { font-size: 0.78rem; color: var(--muted); margin-top: 0.3rem; line-height: 1.45; }
.kpi-vs .bm-val { font-weight: 600; color: var(--ink); }
.kpi-note { font-size: 0.72rem; color: var(--muted); }

/* ── Fact sheet: section cards ───────────────────────────────────────────── */

.fact-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  box-shadow: var(--shadow-sm);
  min-width: 0;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 0 0 1.1rem;
}

.fact-section h2 {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0;
}

.section-note { font-size: 0.75rem; color: var(--muted); margin: 0.9rem 0 0; }

/* ── Charts ──────────────────────────────────────────────────────────────── */

.chart-wrap { position: relative; height: 320px; }
.chart-wrap.short { height: 240px; }

.seg {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px;
  background: var(--bg-page);
}
.seg button {
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  background: none;
  border: none;
  border-radius: 999px;
  padding: 0.22rem 0.75rem;
  cursor: pointer;
}
.seg button[aria-pressed="true"] { background: var(--bg-card); color: var(--accent); box-shadow: var(--shadow-sm); }
.seg button:hover:not([aria-pressed="true"]) { color: var(--ink); }

/* ── Annual returns table ────────────────────────────────────────────────── */

.yr-table { font-variant-numeric: tabular-nums; }
.yr-table th, .yr-table td { padding: 0.42rem 0.6rem; }
.yr-table th:not(:first-child), .yr-table td:not(:first-child) { text-align: right; }
.yr-table td:first-child { font-weight: 600; }
.yr-table .num-pos { color: var(--green); }
.yr-table .num-neg { color: var(--red); }
.yr-table .partial { color: var(--muted); font-weight: 400; }
.yr-table td.alpha-cell { font-weight: 700; white-space: nowrap; }
.yr-table th.bar-col, .yr-table td.bar-col { width: 40%; padding-left: 1.2rem; }

.alpha-bar {
  position: relative;
  height: 10px;
  background: linear-gradient(to right, transparent calc(50% - 0.5px), var(--border) calc(50% - 0.5px), var(--border) calc(50% + 0.5px), transparent calc(50% + 0.5px));
}
.alpha-bar span {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 2px;
}
.alpha-bar .pos { left: 50%; background: rgba(26,138,74,0.55); }
.alpha-bar .neg { right: 50%; background: rgba(192,57,43,0.55); }

/* ── Rolling returns ─────────────────────────────────────────────────────── */

.rolling-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.rolling-window {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.1rem;
  background: #f8fafc;
}

.rolling-window h3 {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 0.5rem;
  text-transform: none;
  letter-spacing: 0;
}

.rolling-table { font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.rolling-table th { font-size: 0.64rem; padding: 0.25rem 0; border-bottom-width: 1px; }
.rolling-table td { padding: 0.28rem 0; }
.rolling-table th:not(:first-child), .rolling-table td:not(:first-child) { text-align: right; width: 4.5rem; }
.rolling-table td:first-child { color: var(--muted); }
.rolling-table td.s { font-weight: 700; }
.rolling-table td.b { color: var(--muted); }
.rolling-table tbody tr:hover { background: none; }

.rolling-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 0.8rem;
}
.rolling-stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.45rem 0.6rem;
  font-size: 0.7rem;
  color: var(--muted);
  line-height: 1.3;
}
.rolling-stat strong { display: block; font-size: 1.05rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.rolling-foot { display: flex; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.6rem; font-size: 0.7rem; color: var(--muted); }

/* ── Other strategies ────────────────────────────────────────────────────── */

.other-strategies { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.other-strategies a {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
}
.other-strategies a:hover { border-color: var(--accent); }

.loading { color: var(--muted); font-size: 0.9rem; font-style: italic; }

/* ── Risk profile, who it may suit, comparison ───────────────────────────── */

.pill-risk { color: var(--accent); border-color: rgba(42,111,219,0.35); background: rgba(42,111,219,0.06); }

.risk-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}
.risk-stat {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
  background: #f8fafc;
  min-width: 0;
}
.risk-label { font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.risk-value { font-size: 1.3rem; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); font-variant-numeric: tabular-nums; margin-top: 0.15rem; }
.risk-sub { font-size: 0.7rem; color: var(--muted); line-height: 1.35; }

.suit-summary { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 0.6rem; }
.suit-lead { margin: 0 0 1rem; font-size: 0.92rem; }
.suit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.suit-col { border: 1px solid var(--border); border-radius: 8px; padding: 0.9rem 1.1rem; background: #f8fafc; }
.suit-col h3 { font-size: 0.8rem; font-weight: 800; margin: 0 0 0.4rem; text-transform: uppercase; letter-spacing: 0.06em; }
.suit-yes h3 { color: var(--green); }
.suit-no h3 { color: var(--red); }
.suit-col ul { margin: 0; padding-left: 1.1rem; font-size: 0.85rem; line-height: 1.5; }
.suit-col li + li { margin-top: 0.3rem; }

.aq-compare { min-width: 720px; }
.aq-compare td, .aq-compare th { text-align: left; vertical-align: top; }
.aq-compare td.num, .aq-compare th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.aq-compare td:first-child, .aq-compare td:nth-child(3) { white-space: nowrap; }
.aq-compare td:last-child { color: var(--muted); font-size: 0.8rem; width: 30%; }
.aq-combos { min-width: 520px; }
.aq-combos td:last-child { color: inherit; font-size: inherit; width: auto; }
.aq-combos tr.combo-mix td:first-child { font-weight: 700; }
.aq-combos tr.combo-bm td { color: var(--muted); }

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rolling-grid { grid-template-columns: minmax(0, 1fr); }
  .risk-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .strategy-grid { grid-template-columns: minmax(0, 1fr); }
  .strategy-hero { padding: 1.25rem 1.2rem; }
  .fact-section { padding: 1.15rem 1rem; }
  .strategy-name { font-size: 1.4rem; }
  .kpi-grid { gap: 0.6rem; }
  .suit-grid { grid-template-columns: minmax(0, 1fr); }
  .aq-compare { min-width: 560px; }
  .aq-compare:not(.aq-combos) th:last-child, .aq-compare:not(.aq-combos) td:last-child { display: none; }
  .aq-combos { min-width: 0; }
  .kpi-card { padding: 0.9rem 1rem; }
  .kpi-value { font-size: 1.55rem; }
  .chart-wrap { height: 260px; }
  .chart-wrap.short { height: 200px; }
  .yr-table th.bar-col, .yr-table td.bar-col { display: none; }
  .yr-table th, .yr-table td { padding: 0.4rem 0.35rem; font-size: 0.82rem; }
  .yr-table th { font-size: 0.64rem; }
  /* On phones the header shows just the current page, not the full trail. */
  .nav-breadcrumb .crumb-trail { display: none; }
}

@media (max-width: 380px) {
  .kpi-value { font-size: 1.35rem; }
  .card-metric-value { font-size: 1.1rem; }
}

.section-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin: 0 0 0.9rem;
}
.rolling-table .num-pos { color: var(--green); }
.rolling-table .num-neg { color: var(--red); }
