/* Bank page /banca/{slug} (web-spec W05). Colors only through the tokens of base.css. */

/* ---------- Cobalt panel ---------- */

.b-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 690px);
  grid-template-areas:
    'head nums'
    'site ctrl';
  grid-template-rows: 1fr auto;
  column-gap: 24px;
  min-height: 300px;
}

.b-hero__head {
  grid-area: head;
  min-width: 0;
}

.b-hero__title {
  margin-top: 12px;
  font-size: 40px;
  line-height: 48px;
  font-weight: 800;
  letter-spacing: -0.035em;
  overflow-wrap: anywhere;
}

.b-hero__nums {
  grid-area: nums;
  min-width: 0;
}

.b-hero__line1 {
  font-size: 15px;
  line-height: 20px;
  font-weight: 500;
  color: var(--on-hero-label);
}

.b-hero__big {
  font-size: 52px;
  line-height: 62px;
  font-weight: 800;
  letter-spacing: -0.035em;
  overflow-wrap: anywhere;
}

/* No number (stale, no card rate): a short sentence instead of the sum. */
.b-hero__big--text {
  font-size: 36px;
  line-height: 44px;
  letter-spacing: -0.02em;
}

.b-hero__compare {
  font-size: 14px;
  line-height: 18px;
  font-weight: 500;
  color: var(--on-hero-note);
}

.b-hero__ctrl {
  grid-area: ctrl;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
}

.b-hero__amount {
  width: 112px;
  height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 22px;
  background: var(--hero-control);
  color: var(--on-hero);
  font: inherit;
  font-size: 17px;
  font-weight: 700;
  text-align: right;
  --focus-color: var(--focus-ring-hero);
}

.b-hero__amount:hover {
  background: var(--hero-control-hover);
}

.b-hero__amount:focus {
  background: var(--hero-control-pressed);
}

.b-hero__site {
  grid-area: site;
  align-self: end;
  justify-self: start;
  margin-top: 24px;
  font-weight: 600;
}

.b-gone {
  margin-top: 24px;
}

/* ---------- Main grid ---------- */

.b-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
}

.b-table {
  width: calc(100% + 24px);
  margin: 8px -12px 0;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.b-th {
  height: 40px;
  padding: 0 12px;
  font-size: 13px;
  line-height: 18px;
  font-weight: 700;
  color: var(--text-secondary);
  text-align: left;
  vertical-align: middle;
}

.b-th--num {
  width: 140px;
  text-align: right;
}

.b-tr {
  position: relative;
  height: 56px;
  color: var(--ink);
}

.b-tr > th,
.b-tr > td {
  padding: 0 12px;
  font-weight: 600;
  text-align: right;
  vertical-align: middle;
  transition: background-color var(--transition);
}

.b-tr > th:first-child {
  text-align: left;
  border-radius: 16px 0 0 16px;
}

.b-tr > td:last-child {
  border-radius: 0 16px 16px 0;
}

.b-tr:hover > th,
.b-tr:hover > td {
  background: var(--row-hover);
}

.b-tr--grey,
.b-tr--grey .b-cur__code {
  color: var(--text-secondary);
}

.b-num {
  font-size: 17px;
  line-height: 22px;
  white-space: nowrap;
}

.b-none {
  font-size: 13px;
  line-height: 18px;
  font-weight: 400;
  color: var(--text-secondary);
}

.b-chev {
  width: 40px;
  color: var(--text-secondary);
}

.b-chev > svg {
  display: block;
  margin-left: auto;
}

.b-cur__in {
  display: flex;
  align-items: center;
  gap: 12px;
}

.b-cur__text {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 6px;
}

.b-cur__code {
  font-size: 17px;
  line-height: 22px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}

/* The whole row is the target of the code link (the table keeps its semantics). */
a.b-cur__code::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
}

a.b-cur__code:focus-visible {
  outline: none;
}

a.b-cur__code:focus-visible::after {
  outline: 2px solid var(--focus-color, var(--focus-ring));
  outline-offset: -2px;
}

.b-cur__name {
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  line-height: 18px;
  font-weight: 400;
  color: var(--text-secondary);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.b-report {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 8px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 15px;
  line-height: 20px;
  font-weight: 600;
  cursor: pointer;
}

/* ---------- Other banks ---------- */

.b-others-title {
  display: flex;
  align-items: center;
  min-height: 44px;
}

.b-other {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 60px;
  margin: 0 -12px;
  padding: 0 12px;
  border-radius: 16px;
  color: var(--ink);
  text-decoration: none;
  transition: background-color var(--transition);
}

a.b-other:hover {
  background: var(--row-hover);
}

a.b-other:active {
  background: var(--line);
}

.b-other--current {
  background: var(--surface-muted);
}

.b-other__name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  font-size: 17px;
  line-height: 22px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.b-other__right {
  flex: 0 0 auto;
  font-size: 17px;
  line-height: 22px;
  font-weight: 600;
  white-space: nowrap;
}

.b-other--best .b-other__name,
.b-other--best .b-other__right {
  font-weight: 700;
}

.b-other--best .b-other__right {
  color: var(--accent-text);
}

.b-other--old .b-other__right {
  color: var(--text-secondary);
}

.b-other--stale,
.b-other--missing {
  color: var(--text-secondary);
}

.b-other--stale .b-other__right,
.b-other--missing .b-other__right {
  font-size: 13px;
  line-height: 18px;
  font-weight: 500;
}

.b-other--missing .b-other__right {
  font-weight: 400;
}

/* ---------- Below 1024: one column ---------- */

@media (max-width: 1023px) {
  .b-hero {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      'head'
      'nums'
      'ctrl'
      'site';
    grid-template-rows: auto;
    min-height: 0;
    row-gap: 16px;
  }

  .b-hero__ctrl,
  .b-hero__site {
    margin-top: 0;
  }
}

@media (max-width: 767px) {
  .b-hero__title {
    margin-top: 4px;
    font-size: 28px;
    line-height: 34px;
  }

  .b-hero__big {
    font-size: 40px;
    line-height: 48px;
    letter-spacing: -0.03em;
  }

  .b-hero__big--text {
    font-size: 28px;
    line-height: 36px;
  }

  .b-th--num {
    width: 88px;
  }

  .b-tr > th,
  .b-tr > td {
    padding: 0 6px 0 12px;
  }

  .b-num {
    font-size: 16px;
  }

  .b-chev {
    width: 28px;
  }

  .b-cur__text {
    flex-direction: column;
    gap: 0;
  }

  /* Under the code the name may take a second line instead of being cut (RU «Швейцарский франк» at 390). */
  .b-cur__name {
    max-width: 100%;
    overflow: visible;
    white-space: normal;
  }

  .b-main > section + section {
    margin-top: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .b-tr > th,
  .b-tr > td,
  .b-other {
    transition: none;
  }
}
