/**
 * Stories page — mockup-matched layout, highlights carousel, story viewer.
 */

.helia-stories-page {
  --sp-teal: #227671;
  --sp-teal-dark: #185652;
  --sp-teal-soft: #1e5d5d;
  --sp-orange: #f59556;
  --sp-text: #1c1917;
  --sp-muted: #78716c;
  --sp-panel: #f3f3f1;
  --sp-radius: 2rem;
}

/* ---------- Hero ---------- */
.helia-sp-hero {
  padding: 2.5rem 0 1.25rem;
}

@media (min-width: 640px) {
  .helia-sp-hero {
    padding: 3.25rem 0 1.75rem;
  }
}

.helia-sp-hero__inner {
  max-width: 46rem;
  margin: 0 auto;
  text-align: center;
}

.helia-sp-hero__title {
  margin: 0 0 0.85rem;
  font-family: Nunito, ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(1.65rem, 1.15rem + 2vw, 2.65rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--sp-text);
}

.helia-sp-hero__lead {
  margin: 0 auto;
  max-width: 40rem;
  font-size: clamp(0.9rem, 0.85rem + 0.35vw, 1.05rem);
  font-weight: 500;
  line-height: 1.65;
  color: var(--sp-muted);
}

/* ---------- Highlights toolbar ---------- */
.helia-sp-highlights {
  padding: 1rem 0 2.5rem;
}

@media (min-width: 640px) {
  .helia-sp-highlights {
    padding: 1.25rem 0 3.25rem;
  }
}

.helia-sp-highlights__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.35rem;
}

.helia-sp-highlights__hint {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sp-teal);
}

.helia-sp-highlights__dot {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 999px;
  background: var(--sp-teal);
  flex-shrink: 0;
}

.helia-sp-highlights__nav {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.helia-sp-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  border: 1px solid #e7e5e4;
  background: #fff;
  color: #44403c;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    transform 0.15s ease;
}

.helia-sp-nav-btn:hover {
  border-color: var(--sp-teal);
  color: var(--sp-teal);
  background: rgba(34, 118, 113, 0.04);
}

.helia-sp-nav-btn:active {
  transform: scale(0.96);
}

.helia-sp-nav-btn:disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

/* ---------- Track ---------- */
.helia-sp-track-wrap {
  position: relative;
}

.helia-sp-track {
  display: flex;
  gap: 1.35rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 0.35rem 0.15rem 0.75rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.helia-sp-track::-webkit-scrollbar {
  display: none;
}

@media (min-width: 1024px) {
  .helia-sp-track {
    gap: 1.75rem;
    justify-content: space-between;
  }
}

/* ---------- Highlight card ---------- */
.helia-sp-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  min-width: 6.25rem;
  max-width: 7.25rem;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  scroll-snap-align: start;
  text-align: center;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.helia-sp-card:hover {
  transform: translateY(-2px);
}

.helia-sp-card:focus-visible {
  outline: 2px solid var(--sp-teal);
  outline-offset: 4px;
  border-radius: 0.75rem;
}

.helia-sp-card__ring {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 999px;
  padding: 3px;
}

@media (min-width: 640px) {
  .helia-sp-card__ring {
    width: 6.15rem;
    height: 6.15rem;
  }
}

.helia-sp-card__ring--teal-orange {
  background: conic-gradient(from 210deg, var(--sp-teal), var(--sp-orange), var(--sp-teal));
}

.helia-sp-card__ring--orange-teal {
  background: conic-gradient(from 40deg, var(--sp-orange), #3b82f6, var(--sp-teal), var(--sp-orange));
}

.helia-sp-card__ring--teal {
  background: conic-gradient(from 180deg, var(--sp-teal), #5eead4, var(--sp-teal));
}

.helia-sp-card__ring--orange {
  background: conic-gradient(from 120deg, var(--sp-orange), #fbbf24, var(--sp-teal), var(--sp-orange));
}

.helia-sp-card__avatar {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  overflow: hidden;
  background: #fff;
  border: 3px solid #fff;
  box-sizing: border-box;
}

.helia-sp-card__avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.helia-sp-card__badge {
  position: absolute;
  right: 0.05rem;
  bottom: 0.05rem;
  z-index: 2;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: var(--sp-teal);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 800;
  line-height: 1.35rem;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  border: 2px solid #fff;
}

.helia-sp-card__name {
  display: block;
  font-size: 0.8125rem;
  font-weight: 800;
  color: var(--sp-text);
  line-height: 1.25;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.helia-sp-card__proc {
  display: block;
  margin-top: -0.2rem;
  font-size: 0.6875rem;
  font-weight: 500;
  color: #a8a29e;
  line-height: 1.3;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- CTA ---------- */
.helia-sp-cta {
  padding: 1rem 0 4rem;
  overflow: visible;
}

@media (min-width: 768px) {
  .helia-sp-cta {
    padding: 1.5rem 0 5.5rem;
  }
}

.helia-sp-cta__panel {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  background: var(--sp-panel);
  border-radius: var(--sp-radius);
  overflow: visible;
  min-height: 0;
}

.helia-sp-cta__copy {
  position: relative;
  z-index: 2;
  padding: 1.85rem 1.5rem 0.5rem;
}

.helia-sp-cta__title {
  margin: 0 0 0.85rem;
  max-width: 28rem;
  font-family: Nunito, ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(1.45rem, 1.1rem + 1.4vw, 2.15rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.18;
  color: #111;
}

.helia-sp-cta__text {
  margin: 0 0 1.35rem;
  max-width: 28rem;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.65;
  color: #6b6b6b;
}

.helia-sp-cta__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem;
  padding-bottom: 0.5rem;
}

.helia-sp-cta__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.9rem;
  padding: 0.75rem 1.35rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    transform 0.15s ease;
}

.helia-sp-cta__btn--ghost {
  color: #1c1917;
  background: #fff;
  border: 1px solid #d6d3d1;
}

.helia-sp-cta__btn--ghost:hover {
  border-color: var(--sp-teal);
  color: var(--sp-teal);
  background: #fff;
}

.helia-sp-cta__btn--solid {
  color: #fff;
  background: var(--sp-teal);
  border: 1px solid var(--sp-teal);
}

.helia-sp-cta__btn--solid:hover {
  background: var(--sp-teal-dark);
  border-color: var(--sp-teal-dark);
}

.helia-sp-cta__btn--solid:active,
.helia-sp-cta__btn--ghost:active {
  transform: scale(0.98);
}

.helia-sp-cta__btn svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.helia-sp-wa-icon {
  color: var(--sp-teal);
  flex-shrink: 0;
}

.helia-sp-cta__media {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  min-height: 240px;
  margin-top: -0.25rem;
  pointer-events: none;
}

.helia-sp-cta__photo {
  display: block;
  width: auto;
  max-width: min(88%, 380px);
  height: 270px;
  margin-top: -2.5rem;
  object-fit: contain;
  object-position: bottom center;
}

@media (min-width: 640px) {
  .helia-sp-cta__photo {
    height: 300px;
  }
}

@media (min-width: 900px) {
  .helia-sp-cta__panel {
    grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.85fr);
    align-items: stretch;
    min-height: 300px;
    border-radius: 2.4rem;
  }

  .helia-sp-cta__copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2.4rem 1.25rem 2.4rem 2.75rem;
  }

  .helia-sp-cta__actions {
    padding-bottom: 0;
  }

  .helia-sp-cta__media {
    min-height: 100%;
    margin-top: 0;
    align-items: flex-end;
    justify-content: flex-end;
    padding-right: 1.25rem;
  }

  .helia-sp-cta__photo {
    max-width: min(100%, 420px);
    height: calc(100% + 2.75rem);
    max-height: 360px;
    margin-top: -2.75rem;
    margin-bottom: 0;
  }
}

@media (min-width: 1200px) {
  .helia-sp-cta__panel {
    min-height: 318px;
    border-radius: 2.6rem;
  }

  .helia-sp-cta__copy {
    padding: 2.6rem 1.5rem 2.6rem 3.25rem;
  }

  .helia-sp-cta__title {
    font-size: 2.15rem;
  }

  .helia-sp-cta__photo {
    max-height: 380px;
  }
}

/* ---------- Story viewer ---------- */
.helia-sp-viewer[hidden] {
  display: none !important;
}

.helia-sp-viewer {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.helia-sp-viewer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 12, 12, 0.82);
  cursor: pointer;
}

.helia-sp-viewer__frame {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
  height: min(92vh, 760px);
  border-radius: 1.25rem;
  overflow: hidden;
  background: #111;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45);
}

.helia-sp-viewer__progress {
  position: absolute;
  top: 0.65rem;
  left: 0.65rem;
  right: 0.65rem;
  z-index: 5;
  display: flex;
  gap: 0.28rem;
}

.helia-sp-viewer__bar {
  flex: 1;
  height: 2.5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  overflow: hidden;
}

.helia-sp-viewer__bar-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: #fff;
  border-radius: inherit;
  transform-origin: left center;
}

.helia-sp-viewer__bar.is-done .helia-sp-viewer__bar-fill {
  width: 100%;
}

.helia-sp-viewer__bar.is-active .helia-sp-viewer__bar-fill {
  animation: helia-sp-progress linear forwards;
  animation-duration: var(--sp-slide-ms, 4500ms);
}

@keyframes helia-sp-progress {
  from {
    width: 0%;
  }
  to {
    width: 100%;
  }
}

.helia-sp-viewer__top {
  position: absolute;
  top: 1.15rem;
  left: 0.85rem;
  right: 0.85rem;
  z-index: 5;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  pointer-events: none;
}

.helia-sp-viewer__meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.helia-sp-viewer__name {
  font-size: 0.875rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

.helia-sp-viewer__proc {
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.helia-sp-viewer__close {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  cursor: pointer;
}

.helia-sp-viewer__media {
  position: absolute;
  inset: 0;
}

.helia-sp-viewer__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.helia-sp-viewer__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  padding: 2.5rem 1.1rem 1.35rem;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
  color: #fff;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.72), transparent);
}

.helia-sp-viewer__hit {
  position: absolute;
  top: 3.5rem;
  bottom: 0;
  width: 42%;
  z-index: 4;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
}

.helia-sp-viewer__hit--prev {
  left: 0;
}

.helia-sp-viewer__hit--next {
  right: 0;
  width: 58%;
}

body.helia-sp-viewer-open {
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .helia-sp-viewer__bar.is-active .helia-sp-viewer__bar-fill {
    animation: none;
    width: 100%;
  }

  .helia-sp-card,
  .helia-sp-nav-btn,
  .helia-sp-cta__btn {
    transition: none;
  }
}
