/* ==========================================================================
   «Индексы BankInfo» (views/indexes.php), BankInfo BSS (views/bss.php), ссылки на индексы в BDI.
   Подключается только на этих страницах (inc/bss.php). Основа — sections.css (sp-*, bdi-*).
   ========================================================================== */

.idx-hero {
  background:
    radial-gradient(40rem 22rem at 90% 0%, rgba(22, 119, 255, .14), transparent 70%),
    linear-gradient(180deg, #eef3fc 0%, #fff 100%);
}

.idx-kicker {
  margin-top: 1.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--c-blue);
}

.idx-kicker + .sp-hero__title {
  margin-top: 0.5rem;
}

.idx-h1 {
  font-size: 2.75rem;
}

.idx-warn {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  max-width: 40rem;
  margin-top: 1.25rem;
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  font-weight: 600;
  color: var(--c-navy);
  background: #fff;
  border: 0.0625rem solid var(--c-line);
  border-left: 0.1875rem solid var(--c-blue);
  border-radius: 0 0.5rem 0.5rem 0;
}

.idx-warn .icon {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.0625rem;
  color: var(--c-blue);
}

.idx-info .bdi-card__value {
  font-size: 2.75rem;
}

/* Карточки индексов на /rus/indexes/ */
.idx-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.idx-card {
  display: flex;
  flex-direction: column;
  padding: 2rem;
  background: #fff;
  border: 0.0625rem solid var(--c-line);
  border-radius: 1.25rem;
  box-shadow: 0 0.75rem 2rem rgba(7, 29, 73, .07);
}

.idx-card__tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--c-blue);
}

.idx-card__tag .icon {
  width: 1.125rem;
  height: 1.125rem;
}

.idx-card__title {
  margin-top: 0.875rem;
  font-size: 1.5rem;
  line-height: 1.25;
  font-weight: 800;
  color: var(--c-navy);
}

.idx-card__text {
  margin-top: 0.625rem;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--hp-ink);
}

.idx-card__facts {
  display: grid;
  gap: 0.625rem;
  margin: 1.25rem 0 1.5rem;
}

.idx-card__facts div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.625rem;
  font-size: 0.875rem;
  border-bottom: 0.0625rem solid var(--c-line);
}

.idx-card__facts dt {
  color: var(--c-muted);
}

.idx-card__facts dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
  color: var(--c-navy);
}

.idx-card__facts .idx-card__value {
  font-family: var(--font-head);
  font-size: 1.375rem;
  font-weight: 800;
  color: var(--c-blue);
}

.idx-card .button {
  align-self: flex-start;
  margin-top: auto;
}

/* Мини-шкала 0–100 на карточке BSS */
.idx-scale {
  position: relative;
  height: 0.5rem;
  margin: -0.5rem 0 1.5rem;
  background: linear-gradient(90deg, #e5484d 0%, #f2a33a 35%, #e9c84a 50%, #7cc576 65%, #16a34a 100%);
  border-radius: 1rem;
  opacity: .85;
}

/* Текстовые разделы */
/* Текст — по левому краю контейнера, строки не шире 52rem */
.idx-prose > * {
  max-width: 52rem;
}

.idx-prose > p,
.idx-lead {
  margin-top: 0.75rem;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--hp-ink);
}

.idx-prose .sp-title + p {
  margin-top: 0;
}

.idx-prose a,
.idx-lead a,
.idx-note a {
  color: var(--c-blue);
}

.idx-list {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.875rem;
  padding: 0;
  list-style: none;
}

.idx-list li {
  position: relative;
  padding-left: 1.25rem;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--hp-ink);
}

.idx-list li::before {
  content: "";
  position: absolute;
  top: 0.55em;
  left: 0;
  width: 0.4375rem;
  height: 0.4375rem;
  background: var(--c-blue);
  border-radius: 50%;
}

.idx-quote {
  margin-top: 1.25rem !important;
  padding: 1rem 1.25rem;
  font-family: var(--font-head);
  font-size: 1.125rem !important;
  line-height: 1.5;
  font-weight: 700;
  color: var(--c-navy) !important;
  background: var(--c-soft-2);
  border-left: 0.25rem solid var(--c-blue);
  border-radius: 0 0.75rem 0.75rem 0;
}

.idx-note {
  max-width: 52rem;
  margin-top: 1rem;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--c-muted);
}

/* Компоненты методологии */
.idx-comps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  padding: 0;
  list-style: none;
}

.idx-comp {
  padding: 1.25rem;
  background: #fff;
  border: 0.0625rem solid var(--c-line);
  border-radius: 1rem;
}

.idx-comp__weight {
  font-family: var(--font-head);
  font-size: 2rem;
  line-height: 1;
  font-weight: 800;
  color: var(--c-blue);
}

.idx-comp__title {
  margin-top: 0.75rem;
  font-size: 1rem;
  line-height: 1.35;
  font-weight: 700;
  color: var(--c-navy);
}

.idx-comp__text {
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--hp-ink);
}

.idx-comp__src {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--c-muted);
}

.idx-formula {
  margin-top: 1.25rem;
  padding: 1rem 1.25rem;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--c-navy);
  background: var(--c-soft);
  border-radius: 0.75rem;
}

/* Таблица результатов */
.idx-table td small {
  display: block;
  font-size: 0.75rem;
  color: var(--c-muted);
}

.idx-table td:nth-child(3) {
  white-space: nowrap;
}

.idx-bar {
  display: inline-block;
  width: 5rem;
  height: 0.5rem;
  margin-right: 0.625rem;
  vertical-align: middle;
  background: #e8edf5;
  border-radius: 1rem;
  overflow: hidden;
}

.idx-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #1677ff, #071d49);
  border-radius: 1rem;
}

.idx-table td a {
  color: var(--c-blue);
  font-weight: 600;
}

.idx-compare th[scope="row"] {
  width: 12rem;
  font-weight: 700;
  color: var(--c-navy);
  background: var(--c-soft-2);
}

/* Графическая шкала 0–100 */
.idx-gauge {
  max-width: 52rem;
  margin-bottom: 0.5rem;
}

.idx-gauge__bar {
  position: relative;
  display: flex;
  height: 1rem;
  border-radius: 1rem;
  overflow: visible;
}

.idx-gauge__band:first-child { border-radius: 1rem 0 0 1rem; }
.idx-gauge__band:nth-child(5) { border-radius: 0 1rem 1rem 0; }
.idx-gauge__band--0 { background: #f3b6b8; }
.idx-gauge__band--1 { background: #f7d29b; }
.idx-gauge__band--2 { background: #f1e3a0; }
.idx-gauge__band--3 { background: #bfe3bc; }
.idx-gauge__band--4 { background: #86cf98; }

.idx-gauge__dot {
  position: absolute;
  top: 50%;
  width: 0.875rem;
  height: 0.875rem;
  background: var(--c-navy);
  border: 0.125rem solid #fff;
  border-radius: 50%;
  box-shadow: 0 0.125rem 0.375rem rgba(7, 29, 73, .3);
  transform: translate(-50%, -50%);
}

.idx-gauge__ticks {
  position: relative;
  height: 1.25rem;
  margin-top: 0.375rem;
  font-size: 0.75rem;
  color: var(--c-muted);
}

.idx-gauge__ticks span {
  position: absolute;
  transform: translateX(-50%);
}

.idx-gauge__ticks span:nth-child(1) { left: 0; transform: none; }
.idx-gauge__ticks span:nth-child(2) { left: 35%; }
.idx-gauge__ticks span:nth-child(3) { left: 50%; }
.idx-gauge__ticks span:nth-child(4) { left: 65%; }
.idx-gauge__ticks span:nth-child(5) { left: 80%; }
.idx-gauge__ticks span:nth-child(6) { right: 0; left: auto; transform: none; }

.idx-gauge__cap {
  margin-bottom: 1rem;
  font-size: 0.8125rem;
  color: var(--c-muted);
}

/* Версии методологии */
.idx-versions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.idx-version {
  padding: 1.5rem;
  background: var(--c-soft-2);
  border: 0.0625rem dashed var(--c-field-line);
  border-radius: 1rem;
}

.idx-version.is-active {
  background: #fff;
  border: 0.0625rem solid rgba(22, 119, 255, .4);
  box-shadow: 0 0.5rem 1.5rem rgba(7, 29, 73, .06);
}

.idx-version__status {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--c-muted);
}

.idx-version.is-active .idx-version__status {
  color: var(--c-up);
}

.idx-version__title {
  margin-top: 0.5rem;
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--c-navy);
}

.idx-version__list {
  display: grid;
  gap: 0.5rem;
  margin-top: 1rem;
  padding: 0;
  list-style: none;
}

.idx-version__list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.5rem;
  font-size: 0.875rem;
  color: var(--hp-ink);
  border-bottom: 0.0625rem solid var(--c-line);
}

.idx-version__list small {
  display: block;
  font-size: 0.75rem;
  color: var(--c-muted);
}

.idx-version__list b {
  font-family: var(--font-head);
  color: var(--c-navy);
}

.idx-version__text {
  margin-top: 1rem;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--c-muted);
}

/* Ограничения */
.idx-limits {
  padding: 1.75rem 2rem;
  background: #fff8ec;
  border: 0.0625rem solid #f1dcb4;
  border-radius: 1rem;
}

.idx-limits .idx-list li::before {
  background: var(--c-orange);
}

/* Ссылки-карточки на индексы и материалы */
.idx-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: 0.875rem;
  padding: 0;
  list-style: none;
}

.idx-links .hp-calc {
  flex-direction: row;
  align-items: center;
  height: 100%;
}

.idx-links .hp-calc__text {
  flex: 1;
}

/* --------------------------------------------------------------------------
   Адаптив
   -------------------------------------------------------------------------- */

@media (max-width: 999px) {
  .idx-cards,
  .idx-versions {
    grid-template-columns: minmax(0, 1fr);
  }

  .idx-comps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .idx-h1 {
    font-size: 2.25rem;
  }
}

@media (max-width: 640px) {
  .idx-h1 {
    font-size: 1.75rem;
  }

  .idx-card {
    padding: 1.5rem 1.25rem;
  }

  .idx-card__title {
    font-size: 1.25rem;
  }

  .idx-comps {
    grid-template-columns: minmax(0, 1fr);
  }

  .idx-limits {
    padding: 1.25rem;
  }

  /* Таблицы BSS на телефоне — карточки строк (без горизонтального скролла) */
  .idx-table thead {
    display: none;
  }

  .idx-table,
  .idx-table tbody,
  .idx-table tr,
  .idx-table td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .idx-table tr {
    padding: 0.75rem 1rem;
    border-bottom: 0.0625rem solid var(--c-line);
  }

  .idx-table tbody tr:last-child {
    border-bottom: 0;
  }

  .idx-table td,
  .idx-table tbody tr:last-child > * {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.25rem 0;
    text-align: right;
    border: 0;
  }

  .idx-table td::before {
    content: attr(data-label);
    flex: none;
    max-width: 50%;
    text-align: left;
    color: var(--c-muted);
  }

  .idx-table:not(.idx-table--example) td:nth-child(2) {
    font-size: 1rem;
    font-weight: 700;
  }

  .idx-table .is-total td::before {
    content: none;
  }

  .idx-table caption {
    display: block;
  }

  .idx-compare th[scope="row"] {
    width: auto;
  }
}
