/* Telas de índice (/indices/) — hub e página por índice.
   Segue o padrão visual de /selic/ e /indicadores/: cards escuros, hero com
   número grande, gráfico SVG próprio (sem Chart.js) e tabelas compactas. */

/* 1200px é a mesma largura do topbar e do footer (css/site-shell.css) — se
   divergir, o conteúdo fica visivelmente desalinhado do cabeçalho no desktop. */
.ix-wrap { max-width: 1200px; margin: 0 auto; width: 100%; padding: 18px 14px 60px; }

.ix-back { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; font-weight: 600;
  color: var(--text-muted); text-decoration: none; margin-bottom: 12px; }
.ix-back:hover { color: var(--text-secondary); }

.ix-card { background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg, 16px); padding: 20px; margin-bottom: 16px; }
.ix-card h2 { font-size: 1.12rem; margin: 0 0 4px; }
.ix-card > .ix-note { font-size: 0.82rem; color: var(--text-muted); margin: 0 0 14px; line-height: 1.5; }

/* ---------------------------------------------------------------- hero --- */
.ix-hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 18px; align-items: center; }
@media (max-width: 760px) { .ix-hero { grid-template-columns: 1fr; gap: 14px; } }

.ix-eyebrow { font-size: 0.7rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-muted); font-weight: 700; }
.ix-h1 { font-size: 1.35rem; font-weight: 800; margin: 6px 0 8px; line-height: 1.2; }
.ix-h1 .ix-ic { margin-right: 6px; }
.ix-lead { color: var(--text-secondary); font-size: 0.87rem; line-height: 1.55; margin: 0; }
.ix-lead strong { color: var(--text-primary); }
@media (max-width: 520px) { .ix-h1 { font-size: 1.18rem; } .ix-lead { font-size: 0.83rem; } }

.ix-big { font-size: 3.1rem; font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.ix-big .ix-un { font-size: 1.1rem; font-weight: 700; color: var(--text-secondary); margin-left: 6px; }
@media (max-width: 520px) { .ix-big { font-size: 2.5rem; } }

.ix-delta { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 0.85rem;
  padding: 5px 12px; border-radius: 20px; margin-top: 12px; width: fit-content; }
.ix-delta.up { background: rgba(63,185,80,.14); color: #3fb950; }
.ix-delta.down { background: rgba(248,81,73,.14); color: #f85149; }
.ix-delta.flat { background: rgba(139,148,158,.16); color: var(--text-secondary); }

.ix-hero-sub { font-size: 0.8rem; color: var(--text-muted); margin-top: 12px; line-height: 1.55; }
.ix-hero-sub b { color: var(--text-secondary); }

/* ------------------------------------------------------------ variações --- */
.ix-varios { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
@media (max-width: 700px) { .ix-varios { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 420px) { .ix-varios { grid-template-columns: repeat(2, 1fr); } }
.ix-var { background: var(--bg-tertiary); border-radius: 12px; padding: 12px 10px; text-align: center; }
.ix-var .k { display: block; font-size: 0.66rem; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-muted); font-weight: 700; }
.ix-var .v { display: block; font-size: 1.15rem; font-weight: 800; margin-top: 5px; }
.ix-var .v.up { color: #3fb950; } .ix-var .v.down { color: #f85149; }

/* --------------------------------------------------------------- chart --- */
.ix-periodo { display: flex; flex-wrap: wrap; gap: 4px; background: var(--bg-tertiary);
  border-radius: 14px; padding: 4px; width: fit-content; margin-bottom: 14px; }
.ix-periodo button { border: none; background: transparent; color: var(--text-secondary);
  font-weight: 700; font-size: 0.8rem; padding: 6px 13px; border-radius: 10px; cursor: pointer; transition: .15s; }
.ix-periodo button.active { background: var(--primary, #58a6ff); color: #fff; }

.ix-chart-wrap { position: relative; width: 100%; }
.ix-chart { width: 100%; height: auto; display: block; touch-action: none; }
.ix-tip { position: absolute; pointer-events: none; background: var(--bg-card);
  border: 1px solid var(--border-color); border-radius: 8px; padding: 7px 10px; font-size: 0.78rem;
  white-space: nowrap; transform: translate(-50%, -125%); opacity: 0; transition: opacity .1s;
  z-index: 5; box-shadow: 0 4px 14px rgba(0,0,0,.3); }
.ix-tip b { color: var(--text-primary); }
.ix-chart-foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  font-size: 0.73rem; color: var(--text-muted); margin-top: 8px; }

/* --------------------------------------------------------------- marcos --- */
.ix-marcos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 620px) { .ix-marcos { grid-template-columns: 1fr; } }
.ix-marco { background: var(--bg-tertiary); border-radius: 12px; padding: 14px; }
.ix-marco .k { font-size: 0.68rem; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-muted); font-weight: 700; }
.ix-marco .v { font-size: 1.35rem; font-weight: 800; margin: 4px 0 2px; }
.ix-marco .s { font-size: 0.78rem; color: var(--text-secondary); line-height: 1.45; }

.ix-recorde { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 12px;
  background: linear-gradient(135deg, rgba(210,153,34,.12), rgba(210,153,34,.02));
  border: 1px solid rgba(210,153,34,.25); margin-top: 12px; }
.ix-recorde .ic { font-size: 1.3rem; line-height: 1; }
.ix-recorde p { margin: 0; font-size: 0.85rem; color: var(--text-secondary); line-height: 1.55; }
.ix-recorde b { color: var(--text-primary); }

/* --------------------------------------------------------- composição --- */
.ix-comp-head { display: flex; justify-content: space-between; align-items: baseline;
  gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.ix-comp-busca { flex: 1; min-width: 160px; max-width: 260px; background: var(--bg-tertiary);
  border: 1px solid var(--border-color); border-radius: 10px; color: var(--text-primary);
  font-size: 0.82rem; padding: 8px 11px; }
.ix-comp-busca::placeholder { color: var(--text-muted); }

.ix-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.ix-table th { text-align: left; font-size: 0.66rem; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-muted); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--border-color); }
.ix-table th.num, .ix-table td.num { text-align: right; }
.ix-table td { padding: 9px 10px; border-bottom: 1px solid var(--border-color); }
.ix-table tr:last-child td { border-bottom: none; }
.ix-table .tk { font-weight: 800; }
.ix-table .tk a { color: var(--text-primary); text-decoration: none; }
.ix-table .tk a:hover { color: var(--primary, #58a6ff); text-decoration: underline; }
.ix-table .nm { color: var(--text-secondary); }
.ix-table .pp { font-weight: 700; }
.ix-bar { display: block; height: 4px; border-radius: 3px; background: var(--primary, #58a6ff);
  opacity: .55; margin-top: 4px; min-width: 2px; }
@media (max-width: 560px) {
  .ix-table th, .ix-table td { padding: 8px 6px; font-size: 0.79rem; }
  .ix-table th:nth-child(3), .ix-table td:nth-child(3) { display: none; }
}
.ix-showmore { display: block; margin: 12px auto 0; background: var(--bg-tertiary);
  border: 1px solid var(--border-color); color: var(--text-secondary); font-weight: 700;
  font-size: 0.82rem; padding: 9px 18px; border-radius: 10px; cursor: pointer; }

/* ------------------------------------------------------------ editorial --- */
.ix-prosa { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.65; }
.ix-prosa p { margin: 0 0 12px; }
.ix-prosa p:last-child { margin-bottom: 0; }
.ix-prosa strong { color: var(--text-primary); }
.ix-prosa ul { margin: 0 0 12px; padding-left: 20px; }
.ix-prosa li { margin-bottom: 6px; }
.ix-prosa h3 { font-size: 0.98rem; color: var(--text-primary); margin: 16px 0 6px; }
.ix-prosa a { color: var(--primary, #58a6ff); }

.ix-faq details { border-bottom: 1px solid var(--border-color); padding: 12px 0; }
.ix-faq details:last-child { border-bottom: none; }
.ix-faq summary { cursor: pointer; font-weight: 700; font-size: 0.9rem; color: var(--text-primary);
  list-style: none; display: flex; justify-content: space-between; gap: 10px; }
.ix-faq summary::-webkit-details-marker { display: none; }
.ix-faq summary::after { content: '+'; color: var(--text-muted); font-weight: 800; }
.ix-faq details[open] summary::after { content: '−'; }
.ix-faq .ans { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.6; margin-top: 8px; }
.ix-faq .ans a { color: var(--primary, #58a6ff); }

.ix-links { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 620px) { .ix-links { grid-template-columns: 1fr; } }
.ix-link { display: flex; align-items: center; gap: 10px; padding: 13px 14px; border-radius: 14px;
  background: var(--bg-tertiary); border: 1px solid var(--border-color); text-decoration: none; }
.ix-link:hover { border-color: var(--primary, #58a6ff); }
.ix-link .ic { font-size: 1.2rem; flex-shrink: 0; }
.ix-link .k { display: block; font-size: 0.68rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-muted); font-weight: 700; }
.ix-link .v { display: block; font-size: 0.85rem; color: var(--text-primary); font-weight: 600; }

.ix-fonte { font-size: 0.74rem; color: var(--text-muted); line-height: 1.55; }
.ix-disclaimer { font-size: 0.78rem; color: var(--text-muted); background: var(--bg-tertiary);
  border-radius: 12px; padding: 12px 14px; line-height: 1.55; }

/* ------------------------------------------------------------------ hub --- */
.ix-hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.ix-hub-card { display: block; background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg, 16px); padding: 18px; text-decoration: none; transition: .15s; }
.ix-hub-card:hover { border-color: var(--primary, #58a6ff); transform: translateY(-2px); }
.ix-hub-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.ix-hub-nome { font-size: 1.02rem; font-weight: 800; color: var(--text-primary); }
.ix-hub-desc { font-size: 0.76rem; color: var(--text-muted); margin-top: 2px; }
.ix-hub-val { font-size: 1.7rem; font-weight: 800; color: var(--text-primary); margin-top: 12px; line-height: 1; }
.ix-hub-spark { margin-top: 10px; height: 42px; display: block; width: 100%; }
.ix-hub-foot { font-size: 0.72rem; color: var(--text-muted); margin-top: 8px; }

/* --------------------------------------------------- bloco de abertura --- */
/* Número + gráfico juntos no topo: é o que o leitor vem buscar. */
.ix-abertura .ix-hero { align-items: flex-start; margin-bottom: 14px; }
.ix-abertura .ix-hero-num { text-align: right; }
@media (max-width: 760px) { .ix-abertura .ix-hero-num { text-align: left; } }
.ix-abertura .ix-h1 { margin-bottom: 0; }
.ix-abertura .ix-hero-sub { margin-top: 14px; }

/* ------------------------------------------------------ outros índices --- */
.ix-outros { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px; margin-top: 12px; }
.ix-outro { display: flex; align-items: center; gap: 11px; padding: 12px 13px; border-radius: 12px;
  background: var(--bg-tertiary); border: 1px solid var(--border-color); text-decoration: none;
  transition: border-color .15s, transform .15s; }
.ix-outro:hover { border-color: var(--primary, #58a6ff); transform: translateY(-1px); }
.ix-outro-ic { font-size: 1.25rem; flex-shrink: 0; }
.ix-outro-txt { flex: 1; min-width: 0; }
.ix-outro-txt .n { display: block; font-size: 0.87rem; font-weight: 700;
  color: var(--text-primary); line-height: 1.25; }
.ix-outro-txt .d { display: block; font-size: 0.72rem; color: var(--text-muted); margin-top: 1px; }
.ix-outro-num { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex-shrink: 0; }
.ix-outro-num > span:first-child { font-size: 0.92rem; font-weight: 800; color: var(--text-primary); }
.ix-outro-num .ix-delta { margin-top: 0; padding: 2px 7px; font-size: 0.68rem; }
.ix-outros-todos { display: inline-block; margin-top: 14px; font-size: 0.83rem; font-weight: 700;
  color: var(--primary, #58a6ff); text-decoration: none; }
.ix-outros-todos:hover { text-decoration: underline; }

/* ------------------------------------------- seleção de intervalo -------- */
/* Mesmo gesto do gráfico das páginas de FII: arrasta e vê a variação. */
.ix-chart { cursor: crosshair; user-select: none; -webkit-user-select: none; }
.ix-sel-box { margin-top: 10px; padding: 10px 13px; border-radius: 12px;
  background: var(--bg-tertiary); border: 1px solid var(--border-color); }
.ix-sel-box.up { border-color: rgba(63,185,80,.35); }
.ix-sel-box.down { border-color: rgba(248,81,73,.35); }
.ix-sel-datas { font-size: 0.74rem; color: var(--text-muted); font-weight: 700;
  text-transform: uppercase; letter-spacing: .03em; }
.ix-sel-datas span { text-transform: none; letter-spacing: 0; opacity: .8; margin-left: 6px; }
.ix-sel-vals { font-size: 0.95rem; color: var(--text-secondary); margin-top: 4px;
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.ix-sel-vals b { color: var(--text-primary); }
.ix-sel-delta { font-weight: 800; margin-left: auto; }
.ix-sel-box.up .ix-sel-delta { color: #3fb950; }
.ix-sel-box.down .ix-sel-delta { color: #f85149; }
.ix-sel-box.flat .ix-sel-delta { color: var(--text-secondary); }
.ix-sel-hint { font-size: 0.72rem; color: var(--text-muted); margin: 8px 0 0; }
@media (hover: none) { .ix-sel-hint { display: none; } }
