:root {
  --text-light: #ffffff;
  --progress-bar-bg: rgba(255, 255, 255, 0.45);
  --progress-bar-fill: #FFC700;
  --font-family-display: 'Teko', sans-serif;
  --font-family-body: 'Roboto', sans-serif;
}

*, *::before, *::after { 
  box-sizing: border-box; 
  margin: 0; 
  padding: 0; 
}

html, body { 
  background-color: #000; 
  font-family: var(--font-family-body); 
  height: 100%; 
  width: 100%;
  overflow: hidden; 
  position: relative; 
  margin: 0;
  padding: 0;
}

.story-background-blur {
  position: absolute; 
  top: -10%; 
  left: -10%;
  width: 120%; 
  height: 120%;
  background-size: cover; 
  background-position: center;
  filter: blur(25px) brightness(0.6);
  transition: background-image 0.5s ease-in-out;
  z-index: 1;
}

.story-wrapper {
  position: relative; 
  z-index: 2; 
  width: 100%; 
  height: 100%;
  display: flex; 
  align-items: center; 
  justify-content: center;
  margin: 0;
  padding: 0;
}

.visual-story-container {
  width: 100%; 
  height: 100%; 
  position: relative; 
  display: flex; 
  flex-direction: column;
  color: var(--text-light); 
  overflow: hidden; 
  background-color: transparent;
  -webkit-tap-highlight-color: transparent;
  margin: 0;
  padding: 0;
}

/* Mobile-first styles (full screen) */
.slide-image-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
}

.slide-image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}

.slide-content {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 1.5rem;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 20%, transparent);
  z-index: 5;
}

.slide-caption {
  position: relative;
  font-family: var(--font-family-display);
  font-size: clamp(1.5rem, 5vw, 2rem);
  line-height: 1.3;
  font-weight: 500;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.4);
  padding-left: 1.2rem;
  margin-bottom: 1rem;
}

/* Desktop/larger screens (original layout) */
@media (min-width: 768px) {
  .visual-story-container {
    max-width: 500px;
    max-height: 90vh;
    aspect-ratio: 9/16;
    border-radius: 16px;
    margin: auto;
  }

  .slide-image-container {
    padding: 3rem 1rem;
  }

  .slide-image-container img {
    object-fit: contain;
    border-radius: 12px;
  }

  .slide-content {
    padding: 6rem 1.5rem 2rem;
  }

  .slide-caption {
    font-size: clamp(1.8rem, 5vw, 2.2rem);
  }
}

/* Rest of your existing CSS remains the same */
.story-header {
  position: absolute; 
  top: 0; 
  left: 0; 
  width: 100%; 
  z-index: 10;
  padding: 0.75rem; 
  display: flex; 
  align-items: center; 
  gap: 0.75rem;
  background: linear-gradient(to bottom, rgba(0,0,0,0.4), transparent);
}

.progress-bar { 
  flex-grow: 1; 
  display: grid; 
  grid-auto-flow: column; 
  gap: 4px; 
}

.progress-segment { 
  background-color: var(--progress-bar-bg); 
  height: 5px; 
  border-radius: 5px; 
}

.progress-fill {
  height: 100%;
  width: 100%;
  background-color: var(--progress-bar-fill);
  transform: scaleX(0);
  transform-origin: left;
  transition-property: transform;
}

.story-controls { 
  display: flex; 
  gap: 0.75rem; 
  margin-left: auto; 
}

.control-btn { 
  background: transparent; 
  border: none; 
  color: var(--text-light); 
  cursor: pointer; 
  opacity: 0.9; 
  transition: opacity 0.2s, transform 0.2s; 
  padding: 0.25rem; 
}

.control-btn:hover { 
  opacity: 1; 
  transform: scale(1.1); 
}

.control-btn svg { 
  width: 24px; 
  height: 24px; 
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.6)); 
}

.story-slides-wrapper { 
  flex-grow: 1; 
  position: relative; 
  overflow: hidden; 
}

.story-slide { 
  position: absolute; 
  inset: 0; 
  opacity: 0; 
  visibility: hidden; 
  transition: opacity 0.4s, visibility 0s 0.4s; 
}

.story-slide.active { 
  opacity: 1; 
  visibility: visible; 
  z-index: 1; 
}

.caption-highlight { 
  position: absolute; 
  left: 0; 
  top: 4px; 
  width: 6px; 
  height: calc(100% - 8px); 
  background-color: var(--progress-bar-fill); 
  border-radius: 6px; 
}

.story-navigation-arrows { 
  position: absolute; 
  top: 50%; 
  left: 0; 
  width: 100%; 
  transform: translateY(-50%); 
  z-index: 20; 
  display: flex; 
  justify-content: space-between; 
  padding: 0 0.5rem; 
  pointer-events: none; 
}

.nav-arrow { 
  background-color: rgba(255, 255, 255, 0.8); 
  color: #000; 
  border: none; 
  width: 36px; 
  height: 36px; 
  border-radius: 50%; 
  cursor: pointer; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  pointer-events: auto; 
  box-shadow: 0 2px 5px rgba(0,0,0,0.2); 
  transition: transform 0.2s; 
}

.nav-arrow:hover { 
  transform: scale(1.1); 
}

.nav-arrow span { 
  font-size: 30px; 
  line-height: 1; 
  transform: translateY(-1px); 
}

/* Animations and end card styles remain the same */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes zoomIn {
  from { transform: scale(1); }
  to { transform: scale(1.15); }
}

@keyframes slideFromLeft {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

@keyframes slideFromRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.story-slide.active .slide-caption {
  animation: fadeIn 0.8s 0.4s ease-out both;
}

.story-slide[data-animation="fade"].active .slide-image-container img {
  animation: fadeIn 1s ease-in-out both;
}

.story-slide[data-animation="zoom-in"].active .slide-image-container img {
  animation: zoomIn 8s ease-in-out forwards;
}

.story-slide[data-animation="slide-left"].active .slide-image-container {
  animation: slideFromLeft 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.story-slide[data-animation="slide-right"].active .slide-image-container {
  animation: slideFromRight 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.end-card-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: rgba(0,0,0,0.9);
  color: white;
  padding: 2rem;
  text-align: center;
}

.related-stories-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  width: 100%;
  max-width: 800px;
  margin-top: 2rem;
}

.related-story-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: white;
}

.related-story-item img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 0.5rem;
}