/**
 * VISBL Mortgage Rate Index page.
 *
 * Built from Figma node 1244:29378 ("1440w default", Search results page file).
 * Every measurement is an explicit px value: the site sets html{font-size:18px},
 * so rem-based utilities render 12.5% larger than their nominal size. Tailwind
 * here ships without preflight, so box-sizing is scoped in rather than assumed.
 */

.vri {
  /* Figma variables, verbatim. */
  --vri-blue: #002bc6;
  --vri-white: #ffffff;
  --vri-black: #000000;
  --vri-gray-50: #f5f7fc;
  --vri-gray-200: #c7cbd9;
  --vri-gray-300: #a8adbf;
  --vri-gray-400: #9296a6;
  --vri-gray-500: #73788c;
  --vri-gray-600: #535766;
  --vri-gray-700: #393e4d;
  --vri-info-60: rgba(218, 228, 248, 0.5);
  --vri-info-900: #0f378c;
  --vri-error-900: #8c0f0f;
  --vri-confirmation: #14ae5c;

  /* Card-selected and dark-panel colours are raw hex in the design. */
  --vri-sel-bg: #dce4ff;
  --vri-sel-border: #96aeff;
  --vri-panel: #0d1c45;
  --vri-panel-accent: #a1b5ff;
  --vri-panel-box: #0037ff;
  --vri-panel-diff: #25e981;

  background: var(--vri-white);
  width: 100%;
  max-width: 1276px;
  margin: 0 auto;
  padding: 40px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  font-family: 'Wavehaus', sans-serif;
}

.vri *,
.vri *::before,
.vri *::after {
  box-sizing: border-box;
}

.vri p,
.vri h1 {
  margin: 0;
}

.vri [hidden] {
  display: none !important;
}

/* ------------------------------------------------------------------ */
/* Title row                                                           */
/* ------------------------------------------------------------------ */

.vri-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 0 40px;
  width: 100%;
}

.vri-title__text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 24px 0;
  width: 695px;
  max-width: 100%;
}

.vri-eyebrow {
  font-size: 18px;
  font-weight: 700; /* Wavehaus 128 Bold */
  line-height: 25px;
  text-transform: uppercase;
  color: var(--vri-blue);
}

.vri-heading {
  font-size: 40px;
  font-weight: 700;
  line-height: normal;
  color: var(--vri-black);
}

.vri-lede {
  font-size: 18px;
  font-weight: 600; /* Wavehaus 95 SemiBold */
  line-height: normal;
  color: var(--vri-gray-600);
}

.vri-actions {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
}

/* Buttons ---------------------------------------------------------- */

.vri-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 48px;
  padding: 13px 24px;
  border-radius: 45px;
  border: 1px solid transparent;
  font-family: 'Wavehaus', sans-serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 16.025px;
  text-transform: lowercase;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.vri-btn--solid {
  background: var(--vri-blue);
  border-color: var(--vri-blue);
  color: var(--vri-gray-50);
  line-height: 21.34px;
}

.vri-btn--solid:hover,
.vri-btn--solid:focus-visible {
  background: #0022a0;
  color: var(--vri-gray-50);
}

.vri-btn--outline {
  background: var(--vri-white);
  border-color: var(--vri-blue);
  color: var(--vri-blue);
}

.vri-btn--outline:hover,
.vri-btn--outline:focus-visible {
  background: var(--vri-gray-50);
  color: var(--vri-blue);
}

.vri-btn__icon {
  width: 16px;
  height: 16px;
  flex: none;
  display: block;
}

/* Loan purpose / timeline controls --------------------------------- */

.vri-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 10px;
  width: 271px;
  flex: none;
}

.vri-controls__label {
  font-size: 14px;
  font-weight: 700;
  line-height: 25px;
  text-transform: uppercase;
  color: var(--vri-gray-500);
  width: 100%;
}

.vri-toggle {
  display: flex;
  align-items: center;
  padding: 4px;
  width: 100%;
  border: 1px solid var(--vri-gray-300);
  border-radius: 10px;
}

.vri-toggle__btn {
  flex: 1 0 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 24px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-family: 'Wavehaus', sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.31;
  letter-spacing: 0.28px;
  text-transform: uppercase;
  color: var(--vri-gray-700);
  white-space: nowrap;
  cursor: pointer;
}

.vri-toggle__btn[aria-pressed='true'] {
  background: var(--vri-blue);
  color: var(--vri-white);
}

.vri-timeline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 8px;
}

.vri-days {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 4px;
}

.vri-days__btn {
  width: 75px;
  height: 33px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border: 0;
  border-radius: 8px;
  background: var(--vri-white);
  font-family: 'Wavehaus', sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: normal;
  color: var(--vri-gray-600);
  white-space: nowrap;
  cursor: pointer;
}

.vri-days__btn[aria-pressed='true'] {
  background: var(--vri-gray-50);
  color: var(--vri-blue);
}

.vri-stamp {
  font-size: 12px;
  font-weight: 600;
  line-height: 25px;
  color: var(--vri-gray-500);
  white-space: nowrap;
}

/* ------------------------------------------------------------------ */
/* Rate cards                                                          */
/* ------------------------------------------------------------------ */

.vri-cards {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 24px;
  padding: 0 40px;
  width: 100%;
  flex-wrap: wrap;
}

.vri-card {
  width: 272px;
  flex: 0 0 272px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 24px;
  /* The stroke is an inset shadow so it costs no layout height (Figma draws it
     inside the frame). On the page these cards are <button>s, which would
     otherwise pick up the UA's default border and grow by 4px. */
  border: 0;
  box-shadow: inset 0 0 0 1px var(--vri-gray-200);
  border-radius: 8px;
  background: var(--vri-white);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: box-shadow 0.15s ease, background-color 0.15s ease;
}

.vri-card:hover {
  box-shadow: inset 0 0 0 1px var(--vri-sel-border);
}

.vri-card[aria-pressed='true'] {
  background: var(--vri-sel-bg);
  box-shadow: inset 0 0 0 1px var(--vri-sel-border);
}

.vri-card__head {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  padding-bottom: 8px;
  width: 100%;
}

.vri-card__label {
  flex: 1 0 0;
  min-width: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 25px;
  color: var(--vri-black);
}

.vri-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 21px;
  padding: 2px 8px;
  box-shadow: inset 0 0 0 1px var(--vri-info-900);
  border-radius: 16px;
  background: var(--vri-info-60);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  text-transform: uppercase;
  color: var(--vri-info-900);
  white-space: nowrap;
}

.vri-card__body {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 0;
  width: 100%;
}

.vri-card__rate {
  font-size: 36px;
  font-weight: 600;
  line-height: normal;
  text-align: center;
  color: var(--vri-black);
  white-space: nowrap;
}

.vri-compare {
  flex: 1 0 0;
  min-width: 0;
  height: 36px;
  display: flex;
  align-items: flex-end;
  gap: 4px;
}

/* The design draws the mover as a 13x25 triangle, pointing up for a rise. */
.vri-tri {
  width: 13px;
  height: 25px;
  flex: none;
  display: block;
}

.vri-compare__info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

.vri-compare__delta {
  height: 20px;
  display: flex;
  align-items: center;
  font-size: 14px;
  font-weight: 700;
  line-height: 25px;
}

.vri-compare__delta--up {
  color: var(--vri-error-900);
}

.vri-compare__delta--down {
  color: var(--vri-confirmation);
}

.vri-compare__delta--flat {
  color: var(--vri-gray-500);
}

.vri-compare__when {
  height: 15px;
  display: flex;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  line-height: 25px;
  color: var(--vri-gray-500);
  white-space: nowrap;
}

/* ------------------------------------------------------------------ */
/* Chart panel                                                         */
/* ------------------------------------------------------------------ */

.vri-panel {
  width: 1196px;
  max-width: calc(100% - 80px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 24px;
  border: 1px solid var(--vri-gray-200);
  border-radius: 8px;
  background: var(--vri-white);
}

.vri-panel__title {
  font-size: 28px;
  font-weight: 600;
  line-height: normal;
  color: var(--vri-black);
  min-height: 48px;
  display: flex;
  align-items: center;
  width: 100%;
}

.vri-panel__meta {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 24px;
  padding-right: 40px;
  width: 100%;
  border-bottom: 1px solid var(--vri-gray-200);
  flex-wrap: wrap;
}

.vri-panel__sub {
  flex: 1 0 0;
  min-width: 200px;
  font-size: 14px;
  font-weight: 700;
  line-height: 25px;
  color: var(--vri-gray-500);
}

.vri-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: none;
}

.vri-legend__swatch {
  width: 24px;
  height: 2px;
  border-radius: 8px;
  flex: none;
}

.vri-legend__swatch--visbl {
  background: var(--vri-blue);
}

.vri-legend__swatch--national {
  background: var(--vri-gray-600);
}

.vri-legend__label {
  font-size: 14px;
  font-weight: 700;
  line-height: 25px;
  color: var(--vri-gray-500);
  white-space: nowrap;
}

.vri-panel__body {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding-top: 24px;
}

/* Dark summary panel ------------------------------------------------ */

.vri-summary {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 24px;
  padding: 24px 32px;
  border-radius: 8px;
  background: var(--vri-panel);
}

.vri-summary__title {
  width: 156px;
  font-size: 16px;
  font-weight: 700;
  line-height: 25px;
  color: var(--vri-panel-accent);
}

.vri-summary__rates {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
}

.vri-summary__block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 16px 0;
  width: 100%;
}

.vri-summary__caption {
  width: 100%;
  font-size: 14px;
  font-weight: 600;
  line-height: normal;
  color: var(--vri-gray-200);
  text-align: center;
}

.vri-summary__value {
  width: 100%;
  font-size: 24px;
  font-weight: 600;
  line-height: normal;
  text-align: center;
  color: var(--vri-white);
}

.vri-summary__arrow {
  width: 24px;
  height: 24px;
  flex: none;
  display: block;
  /* The design rotates the shared arrow glyph 90deg to point down. */
  transform: rotate(90deg);
}

.vri-summary__box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  width: 100%;
  border: 1px solid var(--vri-panel-box);
  border-radius: 8px;
  background: var(--vri-panel-box);
}

.vri-summary__box .vri-summary__caption {
  color: var(--vri-white);
}

.vri-summary__diff {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  font-size: 14px;
  font-weight: 600;
  line-height: normal;
  text-align: center;
  white-space: nowrap;
}

.vri-summary__diff dt {
  margin: 0;
  color: var(--vri-gray-200);
}

.vri-summary__diff dd {
  margin: 0;
  color: var(--vri-panel-diff);
}

.vri-summary__diff dd[data-sign='above'] {
  color: #ff9c9c;
}

/* Chart ------------------------------------------------------------- */

.vri-chart {
  flex: 1 1 auto;
  min-width: 0;
  height: 310px;
  position: relative;
}

.vri-chart svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.vri-chart__grid {
  stroke: var(--vri-gray-200);
  stroke-width: 1;
  opacity: 0.6;
}

.vri-chart__axis {
  fill: var(--vri-gray-400);
  font-family: 'Wavehaus', sans-serif;
  font-size: 12px;
  font-weight: 600;
}

.vri-chart__line {
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.vri-chart__line--visbl {
  stroke: var(--vri-blue);
}

.vri-chart__line--national {
  stroke: var(--vri-gray-200);
}

.vri-chart__hover {
  stroke: var(--vri-gray-300);
  stroke-width: 1;
  stroke-dasharray: 3 3;
}

.vri-chart__dot {
  stroke: var(--vri-white);
  stroke-width: 2;
}

.vri-chart__empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 14px;
  font-weight: 600;
  color: var(--vri-gray-500);
  text-align: center;
  padding: 0 24px;
}

.vri-tip {
  position: absolute;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -100%);
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--vri-panel);
  color: var(--vri-white);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
  transition: opacity 0.1s ease;
}

.vri-tip[data-show='1'] {
  opacity: 1;
}

.vri-tip__date {
  color: var(--vri-panel-accent);
  display: block;
}

.vri-tip__row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.vri-tip__dot {
  width: 8px;
  height: 2px;
  border-radius: 8px;
  flex: none;
}

/* A reading with no neighbours close enough to join draws no line, so it is
   marked with a dot instead of disappearing. */
.vri-chart__solo--visbl {
  fill: var(--vri-blue);
}

.vri-chart__solo--national {
  fill: var(--vri-gray-200);
}

/* ------------------------------------------------------------------ */
/* Footnote and closing actions                                        */
/* ------------------------------------------------------------------ */

.vri-legal {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 40px;
  width: 100%;
}

.vri-legal p {
  flex: 1 0 0;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: normal;
  color: var(--vri-gray-600);
}

.vri-legal a {
  color: inherit;
  text-decoration: underline;
  text-underline-position: from-font;
}

.vri-close {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.vri[aria-busy='true'] .vri-cards,
.vri[aria-busy='true'] .vri-panel {
  opacity: 0.55;
  transition: opacity 0.15s ease;
}

/* ------------------------------------------------------------------ */
/* Responsive                                                          */
/* ------------------------------------------------------------------ */

@media (max-width: 1240px) {
  .vri-panel {
    width: 100%;
    max-width: calc(100% - 48px);
  }

  .vri-title,
  .vri-cards,
  .vri-legal {
    padding: 0 24px;
  }

  .vri-cards {
    flex-wrap: wrap;
  }

  .vri-card {
    flex: 1 1 calc(50% - 12px);
    width: auto;
    min-width: 240px;
  }
}

@media (max-width: 980px) {
  .vri-title {
    flex-direction: column;
    align-items: flex-start;
  }

  .vri-title__text {
    width: 100%;
    padding-bottom: 0;
  }

  .vri-controls {
    width: 100%;
    max-width: 320px;
  }

  .vri-panel__body {
    flex-direction: column;
    align-items: stretch;
  }

  .vri-summary {
    width: 100%;
  }

  .vri-summary__title {
    width: 100%;
  }

  .vri-chart {
    width: 100%;
    height: 260px;
  }
}

@media (max-width: 620px) {
  .vri-heading {
    font-size: 30px;
  }

  .vri-lede {
    font-size: 16px;
  }

  .vri-card {
    flex: 1 1 100%;
    width: auto;
  }

  .vri-card__body {
    flex-wrap: wrap;
  }
}

/* ------------------------------------------------------------------ */
/* Homepage band: Figma node 1395:3431                                 */
/*                                                                     */
/* Not the page with pieces hidden: the band lays the lede out as a    */
/* sibling column at 16px, pairs a solid and an outline button at a    */
/* 24px gap, pads the cards to 32px, and highlights no card.           */
/* ------------------------------------------------------------------ */

/* ------------------------------------------------------------------ */
/* Homepage placement                                                  */
/*                                                                     */
/* s2 does not use the plain bootstrap column: the theme gives it a 90%-*/
/* wide grey panel with 1.5rem of padding, so its content sits at       */
/* x=99..1341 on a 1440 page rather than the default 120..1320. The     */
/* band's column is given the same geometry so the two share one edge.  */
/*                                                                     */
/* That panel also paints 108px of itself BELOW the section            */
/* (`.s2 ... .col-10::after { bottom: -6rem; height: 6rem }`): space   */
/* that used to be covered by s3's wave. The band clears it rather than */
/* rendering on top of the grey.                                       */
/* ------------------------------------------------------------------ */

main.home .s-rate-index {
  background-color: #ffffff;
}

/*
 * s2 paints 108px of its grey panel BELOW itself so the colour runs under s3's
 * wave. With the band sitting between them that grey would print behind the
 * band's first rows instead, so it is retired when the band follows s2. Figma
 * ends the panel cleanly at the same point (node 1089:1664).
 */
main.home .s2:has(+ .s-rate-index) > .container-fluid > .row > .col-10::after {
  display: none;
}

main.home .s-rate-index > .container-fluid > .row > .col-10 {
  flex: 0 0 90%;
  width: 90%;
  margin-left: auto;
  margin-right: auto;
  padding: 0 1.5rem;
}

/*
 * On the homepage the band is wrapped in the theme's own container/row/column
 * (see templates/home.php), so the grid owns the left and right edges. The
 * Figma frame carries its own 24px/32px side padding and sits at x=82, which
 * would push the band out of line with the s2 heading directly above it; the
 * horizontal padding is dropped here so both share one edge. Every vertical
 * measurement below is the Figma one.
 */
.vri--compact {
  /* Node 3151:13481 is a full-width #f2fafe card (40px side, 24/32 vertical). */
  max-width: none;
  width: 100%;
  margin: 0 auto;
  padding: 24px 40px 32px;
  gap: 32px;
  background: #f2fafe;
  border-radius: 8px;
}

.vri-band {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 24px;
  width: 100%;
}

.vri-band__text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  padding: 24px;
  width: 779px;
  max-width: 100%;
  flex: none;
}

.vri-band__aside {
  display: flex;
  flex: 1 0 0;
  min-width: 0;
  flex-direction: column;
  gap: 32px;
}

.vri-band__lede {
  flex: 1 0 0;
  min-width: 0;
  font-size: 18px;
  font-weight: 600; /* Wavehaus 95 SemiBold */
  line-height: normal;
  color: var(--vri-gray-600);
}

.vri-band__explore {
  width: 237px;
  margin-top: 8px;
}

.vri-actions--band {
  gap: 24px;
}

/* Node 1395 fixes the solid button at 199px. */
.vri-btn--wide {
  width: 199px;
}

.vri-cards--band {
  padding: 0 24px;
  gap: 16px;
}

.vri--compact .vri-card {
  width: auto;
  flex: 1 1 0;
  min-width: 180px;
}

.vri--compact .vri-eyebrow {
  font-size: 24px;
}

.vri--compact .vri-heading {
  letter-spacing: -0.8px;
}

.vri--compact .vri-lede {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  line-height: normal;
  color: var(--vri-gray-600);
}

/* The stale-data notice on the full page. */
.vri-notice {
  width: 100%;
  max-width: calc(100% - 80px);
  padding: 12px 16px;
  border: 1px solid var(--vri-sel-border);
  border-radius: 8px;
  background: var(--vri-sel-bg);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--vri-info-900);
}

@media (max-width: 1240px) {
  .vri-notice {
    max-width: calc(100% - 48px);
  }
}

@media (max-width: 980px) {
  .vri-band {
    flex-direction: column;
    align-items: flex-start;
  }

  .vri-band__text {
    width: 100%;
    padding: 24px 16px;
  }

  .vri--compact {
    padding: 24px 16px;
    gap: 24px;
  }

  .vri--compact .vri-eyebrow {
    font-size: 16px;
  }

  .vri--compact .vri-heading {
    font-size: 32px;
    letter-spacing: -0.8px;
  }

  .vri--compact .vri-lede {
    font-size: 18px;
  }

  .vri--compact .vri-card {
    flex: 1 1 100%;
    min-width: 0;
  }

  .vri-band__lede {
    padding: 0;
  }

  .vri-band__aside {
    width: 100%;
  }
}

@media (max-width: 620px) {
  .vri-actions--band {
    gap: 12px;
  }

  .vri-btn--wide {
    width: auto;
  }
}
