/*_______________________________________*/
/* Stories carousel                        */
/*_______________________________________*/

/* Instagram-stories-style image sequence for a sidebar column.
   Behaviour lives in assets/js/stories.js. */

.stories {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* ─── Slides ──────────────────────────────────────────── */

.stories__viewport {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: 25px;
  overflow: hidden;
  background-color: var(--f-purple);
}

.stories__track {
  position: absolute;
  inset: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}

.stories__slide {
  position: absolute;
  inset: 0;
}

.stories__slide[hidden] {
  display: none;
}

.stories__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* A single image needs no bars or toggle — just show it. */
.stories--single .stories__viewport {
  aspect-ratio: auto;
}

/* ─── Legal details note ──────────────────────────────── */

.stories__note {
  margin: 0;
  font-size: 0.935rem;
  line-height: 1.5;
  color: var(--f-teal-secondary);
}

/* ─── Split progress bar ──────────────────────────────── */

.stories__bars {
  display: flex;
  gap: 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.stories__bar {
  flex: 1 1 0;
  height: 4px;
  border-radius: 999px;
  overflow: hidden;
  background-color: color-mix(in srgb, var(--f-purple) 22%, transparent);
}

.stories__bar-fill {
  display: block;
  width: 0;
  height: 100%;
  background-color: var(--f-purple);
}

/* ─── Pause / play toggle (over the image, like the homepage hero) ── */

.stories__toggle {
  position: absolute;
  bottom: 0.75rem;
  right: 0.75rem;
  z-index: 3;
  width: 40px;
  height: 40px;
  padding: 9px;
  border: 1px solid var(--f-pale);
  border-radius: 50%;
  background-color: rgba(76, 10, 35, 0.5);
  color: var(--f-pale);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.stories__toggle:focus-visible {
  outline: 2px solid var(--f-pale);
  outline-offset: 2px;
}

.stories__icon {
  display: block;
  width: 100%;
  height: 100%;
  fill: currentColor;
}

/* Play/pause icon swap — pause shown while playing, play shown while paused. */
.stories__icon--play {
  display: none;
}

.stories.is-paused .stories__icon--pause {
  display: none;
}

.stories.is-paused .stories__icon--play {
  display: block;
}
