/* Container principal */
.story-carousel {
    position: relative;
    max-width: 420px;
    margin: 0 auto;
    box-sizing: border-box;
    border-radius: 14px;
    overflow: hidden;
    height: auto;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Foco para acessibilidade */
.story-carousel:focus {
    outline: 2px solid #00f2fe;
    outline-offset: 2px;
}

/* Wrapper interno */
.story-carousel-inner {
    padding: 16px; /* Altere isso conforme seu controle no Elementor */
    box-sizing: border-box;
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 200px;
    overflow: hidden;
}

/* Slides */
.story-slide {
    position: relative;
    display: none;
    width: 100%;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s ease;
}

.story-slide-img-wrapper {
  position: relative;
}

.story-slide.active {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

/* Imagens */
.story-slide img {
  width: 100%;
  height: auto;
  border-radius: 14px;
  display: block;
  object-fit: cover;
  transition: transform 0.3s ease;
}

/* Áreas de clique invisíveis */
.story-click-area {
    position: absolute;
    top: 0;
    width: 50%;
    height: 100%;
    z-index: 2;
    cursor: pointer;
    background: transparent;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.story-click-prev {
    left: 0;
}

.story-click-next {
    right: 0;
}

/* Mostrar áreas de clique ao hover (debug) */
.story-carousel:hover .story-click-area {
    opacity: 0.1;
}

.story-click-area:hover {
    opacity: 0.2 !important;
    background: rgba(255, 255, 255, 0.1);
}

/* Indicadores */
.story-indicators {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    position: relative;
    z-index: 3;
}

.story-indicators .indicator {
    height: 4px;
    flex-grow: 1;
    min-width: 10px;
    max-width: 60px;
    border-radius: 2px;
    background-color: #444;
    transition: background-color 0.3s ease, transform 0.2s ease;
    cursor: pointer;
}

.story-indicators .indicator:hover {
    transform: scaleY(1.2);
}

.story-indicators .indicator.active {
    background-color: #00f2fe;
    transform: scaleY(1.3);
    animation: fadeIndicator 0.4s ease forwards;
}

@keyframes fadeIndicator {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Navegação */
.story-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 36px;
    margin-top: 10px;
    position: relative;
    z-index: 3;
}

.story-nav button {
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #222;
    color: #fff;
    width: 40px;
    height: 40px;
    font-size: 24px;
    line-height: 1;
    border-radius: 8px;
    transition: all 0.3s ease;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    margin-bottom: 8px;
}

.story-nav button:hover {
    background-color: #333;
    transform: scale(1.1);
}

.story-nav button:active {
    transform: scale(0.95);
}

.story-nav button:focus {
    outline: 2px solid #00f2fe;
    outline-offset: 2px;
}

/* Overlay para transições */
.story-slide-img-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
}

.story-slide-img-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 14px;       /* Arredondamento do contêiner */
  overflow: hidden;          /* Garante que o overlay respeite o border-radius */
}

.story-slide-img-wrapper .story-fade-overlay {
  position: absolute;
  inset: 0;
  background: black;
  opacity: 0;
  pointer-events: none;
  z-index: 2;
  transition: opacity 0.4s ease;
  border-radius: inherit;    /* Herda o arredondamento do pai */
}

.story-slide-img-wrapper .story-fade-overlay.flash {
  animation: flashFade 0.7s ease forwards;
}

@keyframes flashFade {
  0% { opacity: 0.8; }
  100% { opacity: 0; }
}

.story-fade-overlay.flash {
  animation: flashFade 0.5s ease forwards;
}

@keyframes flashFade {
  0% {
    opacity: 0;
  }
  30% {
    opacity: 0.3;
  }
  70% {
    opacity: 0.3;
  }
  100% {
    opacity: 0;
  }
}

/* Responsividade */
@media (max-width: 768px) {
    .story-carousel {
        max-width: 100%;
        margin: 0;
    }
    
    .story-nav {
        gap: 20px;
        margin-top: 15px;
    }
    
    .story-nav button {
        width: 35px;
        height: 35px;
        font-size: 20px;
    }
    
    .story-indicators {
        padding: 8px;
        gap: 4px;
    }
    
    .story-indicators .indicator {
        height: 3px;
        min-width: 8px;
    }
}

@media (max-width: 480px) {
    .story-nav button {
        width: 30px;
        height: 30px;
        font-size: 18px;
    }
    
    .story-indicators {
        padding: 6px;
        gap: 3px;
    }
    
    .story-indicators .indicator {
        height: 2px;
        min-width: 6px;
    }
}

/* Estado vazio */
.story-carousel-empty {
    padding: 40px 20px;
    text-align: center;
    color: #666;
    font-style: italic;
    border: 2px dashed #ddd;
    border-radius: 14px;
}

/* Melhorias de performance */
.story-carousel * {
    box-sizing: border-box;
}

/* Prevenção de scroll horizontal */
.story-carousel-wrapper {
    overflow-x: hidden;
}

/* Animações suaves */
@media (prefers-reduced-motion: reduce) {
    .story-slide,
    .story-fade-overlay,
    .story-nav button,
    .story-indicators .indicator {
        transition: none !important;
    }
}