/*************************************
 * Story Carousel
 * Heading → horizontal card carousel → progress bar + arrows + CTA.
 ************************************/

.story-carousel {
  background: var(--blue);
  overflow: hidden;
}

.story-carousel-title {
  color: var(--white);
  margin: 0 0 28px;
}

/* ---- Track ---- */

.story-carousel-track-wrap {
  overflow: hidden;
}

.story-carousel-track {
  display: flex;
  will-change: transform;
}

/* ---- Card ---- */

.story-card {
  flex: 0 0 auto;
  width: 320px;
  min-height: 320px;
  margin-right: 20px;
  background: var(--white);
  border-radius: 13px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 160px 1fr;
  position: relative;
}

.story-card-content {
  padding: 22px 22px 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  grid-row: 2;
}

.story-card-title {
  font-family: 'BureauGrotesque', sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 1.6em;
  line-height: 1.1;
  color: var(--light-blue);
  margin: 0 0 12px;
}

.story-card-body {
  font-size: 0.85em;
  line-height: 1.4;
  color: #231f20;
  margin: 0 0 16px;
}

.story-card-link {
  font-weight: 700;
  color: var(--red);
  text-decoration: none;
  align-self: flex-start;
  transition: color 200ms ease;
}
.story-card-link:hover {
  color: var(--blue);
}

/* ---- Card image (curved organic shape with red accent) ---- */

.story-card-image {
  position: relative;
  overflow: visible;
  grid-row: 1;
}

.story-card-image-bg {
  position: absolute;
  inset: 0;
  background: var(--red);
  @media (min-width: 50em) {
    border-radius: 0 0 60% 60% / 0 0 40% 40%;
  }
  transform: translateY(6px);
  z-index: 0;
}

.story-card-image-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  @media (min-width: 50em) {
    border-radius: 0 0 60% 60% / 0 0 40% 40%;
  }
  overflow: hidden;
  background: var(--blue);
}

.story-card-image-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.story-card-tag {
  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--red);
  color: var(--white);
  font-size: 0.7em;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 3px;
  z-index: 2;
}

/* ---- Controls ---- */

.story-carousel-controls {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 16px;
  row-gap: 18px;
  width: 100%;
  padding-top: 24px;
  box-sizing: border-box;
}

.story-carousel-progress {
  grid-column: 1 / -1;
  order: 3;
  width: 100%;
  height: 4px;
  background: #ffffff;
  border-radius: 999px;
  overflow: hidden;
}

.story-carousel-progress-fill {
  height: 100%;
  background: #a9d1ee;
  border-radius: 999px;
  width: 33%;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.story-carousel-arrows {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  order: 1;
  justify-self: start;
}

.story-carousel-arrow {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: transparent;
  border: 0;
  color: var(--white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    background-color 200ms ease,
    color 200ms ease,
    opacity 200ms ease;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
.story-carousel-arrow:hover:not(:disabled) {
  background: transparent;
  color: var(--light-blue);
}
.story-carousel-arrow:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.story-carousel-cta {
  order: 2;
  justify-self: end;
  white-space: nowrap;
}

/* ============================
   Medium and up: cards become wider with side-by-side layout
   ============================ */
@media screen and (min-width: 50em) {
  .story-carousel-title {
    margin-bottom: 36px;
  }

  .story-card {
    width: min(760px, calc(100vw - 48px));
    min-height: 313px;
    margin-right: 24px;
    grid-template-columns: minmax(0, 1fr) 50%;
    grid-template-rows: 1fr;
  }

  .story-card-content {
    padding: 24px 26px;
    grid-row: 1;
    min-height: 313px;
    box-sizing: border-box;
  }
  .story-card-title {
    margin-bottom: 14px;
  }
  .story-card-body {
    font-size: 0.88em;
    margin-bottom: 18px;
  }

  .story-card-image {
    grid-row: 1;
    overflow: visible;
  }
  .story-card-image-bg,
  .story-card-image-inner {
    border-radius: 0;
    clip-path: circle(65% at 67% center);
  }
  .story-card-image-bg {
    inset: -1.5%;
    transform: none;
    border-radius: 40px;
  }
  .story-card-image-inner {
    height: 100%;
  }
  .story-card-tag {
    top: 24px;
    right: 26px;
    border-radius: 50px;
    padding: 4px 9px;
    font-size: 14px;
    letter-spacing: 0;
    text-transform: none;
    box-shadow: 0 0 12px #00000033;
  }

  .story-carousel-controls {
    grid-template-columns: minmax(0, 1fr) minmax(120px, 280px) auto minmax(0, 1fr) auto;
    padding-top: 36px;
    column-gap: 32px;
    row-gap: 0;
  }
  .story-carousel-progress {
    grid-column: 2;
    order: 0;
    height: 6px;
    justify-self: stretch;
    align-self: center;
  }
  .story-carousel-arrows {
    grid-column: 3;
    order: 0;
    gap: 14px;
    justify-self: center;
  }
  .story-carousel-arrow {
    width: 44px;
    height: 44px;
  }
  .story-carousel-cta {
    grid-column: 5;
    order: 0;
    justify-self: end;
  }
}
