//* ===== Layout ===== */
.hpa-container-outer {
  position: relative;
  width: 100%;
}

.hpa {
  --hpa-duration: 10s;
  --hpa-text: #EFECFF;
  --hpa-muted: rgba(194, 191, 210, 0.74);
  --hpa-card-bg: #141024;
  --hpa-card-border: #3B3B45;
  --hpa-gradient: linear-gradient(90deg, #636CF9 14%, #69E4FD 29%, #89FCD0 43%, #F8F32B 57%, #FD8144 71%, #E84855 86%);

  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "heading"
    "media"
    "body";
  row-gap: 32px;
  padding: 40px 0;
  box-sizing: border-box;
}

.hpa-heading { grid-area: heading; }
.hpa-media   { grid-area: media; }
.hpa-body    { grid-area: body; }

@media (min-width: 768px) {
  .hpa {
    grid-template-columns: minmax(0, 45fr) minmax(0, 55fr);
    grid-template-rows: auto auto;
    grid-template-areas:
      "heading media"
      "body    media";
    column-gap: 60px;
    row-gap: 0;
    padding: 80px 0;
    align-items: center;
  }
  .hpa-heading {
    align-self: end;
    margin-bottom: 60px;
  }
  .hpa-body { align-self: start; }
}

/* ===== Heading ===== */
.hpa-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
}
@media (max-width: 767px) {
  .hpa-heading { text-align: center; }
  .hpa-eyebrow { justify-content: center; }
}

/* ===== Stacked slide copy ===== */
.hpa-tab-wrapper {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}
.hpa-tab {
  grid-area: 1 / 1; /* every slide sits in the same cell */
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.6s ease-in-out, visibility 0.6s ease-in-out;
}
.hpa-tab.active {
  visibility: visible;
  opacity: 1;
}
.hpa-tab h3 {
  margin: 0 0 12px;
  color: var(--hpa-text);
  font-size: 28px;
  line-height: 1.14;
}
.hpa-body p,
.hpa-body ol,
.hpa-body ul {
  color: var(--hpa-muted);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
}
.hpa-body p:last-child,
.hpa-body ol:last-child,
.hpa-body ul:last-child {
  margin-bottom: 0;
}

/* ===== Progress bar (auto-advance) ===== */
.hpa-progress {
  margin-top: 28px;
  width: 100%;
  height: 4px;
  background: rgba(217, 217, 217, 0.3);
  border-radius: 62px;
  overflow: hidden;
}
.hpa-progress-bar {
  width: 100%;
  height: 100%;
  background: var(--hpa-gradient);
  transform: scaleX(0);
  transform-origin: left center;
}
.hpa.is-running .hpa-progress-bar {
  animation: hpaProgress var(--hpa-duration) linear forwards;
}
.hpa.is-paused .hpa-progress-bar {
  animation-play-state: paused;
}
@keyframes hpaProgress {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

/* ===== Media card ===== */
.hpa-media {
  position: relative;
  width: 100%;
  max-width: 750px;
  justify-self: end;
  border-radius: 40px;
  border: 0.942px solid var(--hpa-card-border);
  background: var(--hpa-card-bg);
  overflow: hidden;
  box-sizing: border-box;
  aspect-ratio: 10 / 9;
  touch-action: pan-y;
}
.hpa-card-wrapper {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  height: 100%;
}
.hpa-card {
  grid-area: 1 / 1;
  position: relative;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.6s ease-in-out, visibility 0.6s ease-in-out;
}
.hpa-card.active {
  visibility: visible;
  opacity: 1;
}
/*
  The image fills the tile (minus a small equal inset) and scales to fit,
  so it is always centred horizontally and vertically.
  Your diagram files already carry empty space around the artwork, and that
  built-in margin is what keeps the graphic clear of the Next label + arrows.
  Tune the size with --hpa-graphic-inset (smaller = bigger graphic).
  !important guards against theme rules like img { height: auto !important }.
*/
.hpa-media {
  --hpa-graphic-inset: 24px;
}
.hpa-card img {
  position: absolute !important;
  top: var(--hpa-graphic-inset) !important;
  bottom: var(--hpa-graphic-inset) !important;
  left: var(--hpa-graphic-inset) !important;
  right: var(--hpa-graphic-inset) !important;
  display: block;
  width: calc(100% - 2 * var(--hpa-graphic-inset)) !important;
  height: calc(100% - 2 * var(--hpa-graphic-inset)) !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  object-fit: contain;
  object-position: center center;
}

/* ===== Arrow navigation (bottom-right of the card) ===== */
.hpa-nav {
  position: absolute;
  left: 32px;
  right: 32px;
  bottom: 32px;
  z-index: 2;
  display: flex;
  align-items: center; /* label is vertically centred on the buttons */
  justify-content: space-between;
  gap: 24px;
}
.hpa-next-label {
  display: flex;
  align-items: baseline;
  gap: 0.6em;
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  color: var(--hpa-text);
  font-size: 14px;
  line-height: 1;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  white-space: nowrap;
}
.hpa-next-kicker {
  flex: 0 0 auto;
  opacity: 0.75;
  font-weight: 400;
}
.hpa-next-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
}
.hpa-arrows {
  display: flex;
  flex: 0 0 auto;
  gap: 12px;
}
.hpa .hpa-arrow {
  /* resets in case the theme styles <button> */
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  padding: 0;
  min-width: 0;
  box-shadow: none;
  border: 0;
  text-transform: none;

  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: #FFFFFF;
  color: var(--hpa-card-bg);
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}
.hpa .hpa-arrow:hover {
  background: var(--hpa-text);
}
.hpa .hpa-arrow:active {
  transform: scale(0.94);
}
.hpa .hpa-arrow:focus-visible {
  outline: 2px solid #69E4FD;
  outline-offset: 3px;
}

@media (max-width: 767px) {
  .hpa-media {
    max-width: 420px;
    justify-self: center;
    border-radius: 32px;
    aspect-ratio: 1 / 1;
  }
  .hpa-media {
    --hpa-graphic-inset: 16px;
  }
  .hpa-nav {
    left: 20px;
    right: 16px;
    bottom: 16px;
    gap: 12px;
  }
  .hpa-arrows {
    gap: 8px;
  }
  .hpa-next-label {
    font-size: 11px;
    letter-spacing: 0.2em;
  }
  .hpa .hpa-arrow {
    width: 48px;
    height: 48px;
  }
  .hpa-tab h3 { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .hpa-tab,
  .hpa-card,
  .hpa .hpa-arrow {
    transition: none;
  }
}