/* QVU Home hero statements (CO-15). */

.home-hero h1.hero-badge {
  font: 600 12px/1.65 var(--font-body);
  letter-spacing: .08em;
  margin: 0 0 24px;
  color: var(--muted);
}

.qv-rotator {
  --qv-statement-size: clamp(45px, 4.5vw, 64px);
  --qv-statement-weight: 500;
  --qv-statement-color: #04234A;
  --qv-answer-color: #0B8F99;
  --qv-control-color: #04234A;
  --qv-control-border: #8495a6;
  --qv-dot: #8495a6;
  --qv-dot-active: #0B8F99;
  --qv-fade: 400ms;
  margin: 0 0 1.25rem;
}

@media (max-width: 767px) {
  .qv-rotator {
    --qv-statement-size: clamp(43px, 12vw, 64px);
  }
}

/* All statements share one grid cell, so the block is always as tall as the
   longest statement and nothing below it moves when the text changes. */
.qv-rotator__stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.qv-rotator__item {
  grid-area: 1 / 1;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--qv-fade) ease, visibility 0s linear var(--qv-fade);
}

.qv-rotator__item.is-active {
  opacity: 1;
  visibility: visible;
  transition: opacity var(--qv-fade) ease, visibility 0s;
}

.qv-rotator__statement,
.qv-rotator__answer {
  display: block;
  font: var(--qv-statement-weight) var(--qv-statement-size)/.99 var(--font-display);
  letter-spacing: -.045em;
}

.qv-rotator__statement {
  color: var(--qv-statement-color);
}

.qv-rotator__answer {
  color: var(--qv-answer-color);
  margin-top: .18em;
}

.qv-rotator__controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 1rem;
}

/* Controls appear only once the script is running. */
.qv-rotator:not(.is-ready) .qv-rotator__controls {
  display: none;
}

.qv-rotator__toggle {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--qv-control-border);
  background: transparent;
  color: var(--qv-control-color);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.qv-rotator__toggle svg {
  width: 16px;
  height: 16px;
}

.qv-rotator__toggle .qv-icon-play,
.qv-rotator__toggle.is-paused .qv-icon-pause {
  display: none;
}

.qv-rotator__toggle.is-paused .qv-icon-play {
  display: block;
}

.qv-rotator__dots {
  display: flex;
  align-items: center;
}

/* 24px touch target around a 10px dot */
.qv-rotator__dot {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.qv-rotator__dot::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--qv-dot);
  transition: background-color 200ms ease, transform 200ms ease;
}

.qv-rotator__dot[aria-current="true"]::before {
  background: var(--qv-dot-active);
  transform: scale(1.2);
}

.qv-rotator__toggle:focus-visible,
.qv-rotator__dot:focus-visible {
  outline: 2px solid var(--qv-dot-active);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .home-hero .hero-content {
    animation: none;
  }
  .qv-rotator__toggle {
    display: none;
  }
  .qv-rotator__item,
  .qv-rotator__item.is-active,
  .qv-rotator__dot::before {
    transition: none;
  }
}
