/**
 * Sliders Module CSS
 * Styles for the slides shortcode and slider components
 * 
 * CSS Variables (set inline on slider element):
 * --logo-width-mobile, --logo-width-tablet, --logo-width-desktop
 * --slider-margin-mobile, --slider-margin-tablet, --slider-margin-desktop
 * --altura-mobile, --altura-tablet, --altura-desktop
 * --caption-max-width
 */

/* ========================================
   Responsive CSS Variables
   ======================================== */
.acore-slides,
.acore-single-slide {
    --logo-width: var(--logo-width-mobile, 100px);
    --slider-margin: var(--slider-margin-mobile, 10px);
    --altura: var(--altura-mobile, 400px);
    --legenda-largura: var(--legenda-largura-mobile, 100%);
}

@media (min-width: 768px) {
    .acore-slides,
    .acore-single-slide {
        --logo-width: var(--logo-width-tablet, 120px);
        --slider-margin: var(--slider-margin-tablet, 15px);
        --altura: var(--altura-tablet, 500px);
        --legenda-largura: var(--legenda-largura-tablet, 100%);
    }
}

@media (min-width: 1024px) {
    .acore-slides,
    .acore-single-slide {
        --logo-width: var(--logo-width-desktop, 150px);
        --slider-margin: var(--slider-margin-desktop, 20px);
        --altura: var(--altura-desktop, 600px);
        --legenda-largura: var(--legenda-largura-desktop, 100%);
    }
}

/* ========================================
   Base Styles
   ======================================== */

/* Single Slide Container - needs explicit height for video */
.acore-single-slide {
    position: relative;
    width: 100%;
    height: calc(var(--altura, 400px) - var(--top-offset, 0px));
    overflow: hidden;
}

.acore-single-slide .single-slide-content {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Slide Item - Parent Container */
.adsi-slide-item {
    position: relative;
    z-index: 1;
    width: 100%;
    height: calc(var(--altura, 400px) - var(--top-offset, 0px));
}

.splide__slide.adsi-slide-item {
    position: relative;
    z-index: 1;
    height: calc(var(--altura, 400px) - var(--top-offset, 0px));
}

/* Slide Item Image Container - Uses CSS variable for responsive height */
.adsi-slide-item-img {
    position: relative;
    width: 100%;
    height: calc(var(--altura, 400px) - var(--top-offset, 0px));
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.adsi-slide-item-img picture {
    width: 100%;
    height: 100%;
    display: block;
}

.adsi-slide-item-img picture img {
    width: 100%;
    height: 100%;
    display: block;
}

/* Caption max-width from CSS variable */
.adsi-slide-item-caption-inside {
    max-width: var(--caption-max-width, 100%);
}

/* Splide slide margin reset for fade transition */
.acore-slides .splide__slide {
    margin: 0 !important;
}

.acore-slides .splide__track .splide__list {
    gap: 0 !important;
}

/* Slide Item Content */
.adsi-slide-item-content {
    position: relative;
}

/* Video Containers - Base Styles */
.video-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

/* FASE 2: Video Foreground - Centering (CRÍTICO) */
.acore-slides .video-foreground,
.acore-single-slide .video-foreground {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.acore-slides .video-foreground iframe,
.acore-slides .video-foreground video,
.acore-single-slide .video-foreground iframe,
.acore-single-slide .video-foreground video {
    pointer-events: none;
}

/* FASE 3: Video Cover Styles */
.acore-slides .video-background.video-cover .video-foreground iframe,
.acore-slides .video-background.video-cover .video-foreground video,
.acore-single-slide .video-background.video-cover .video-foreground iframe,
.acore-single-slide .video-background.video-cover .video-foreground video {
    object-fit: cover;
    width: 100%;
    height: 100%;
    min-width: 100%;
    min-height: 100%;
}

/* FASE 4: Video Contain Styles */
.acore-slides .video-background.video-contain .video-foreground,
.acore-single-slide .video-background.video-contain .video-foreground {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
}

.acore-slides .video-background.video-contain .video-foreground iframe,
.acore-slides .video-background.video-contain .video-foreground video,
.acore-single-slide .video-background.video-contain .video-foreground iframe,
.acore-single-slide .video-background.video-contain .video-foreground video {
    object-fit: contain;
}

/* Video Fill Styles */
.acore-slides .video-background.video-fill .video-foreground iframe,
.acore-slides .video-background.video-fill .video-foreground video,
.acore-single-slide .video-background.video-fill .video-foreground iframe,
.acore-single-slide .video-background.video-fill .video-foreground video {
    object-fit: fill;
    width: 100%;
    height: 100%;
}

/* Video None Styles */
.acore-slides .video-background.video-none .video-foreground iframe,
.acore-slides .video-background.video-none .video-foreground video,
.acore-single-slide .video-background.video-none .video-foreground iframe,
.acore-single-slide .video-background.video-none .video-foreground video {
    object-fit: none;
    width: 100%;
    height: 100%;
}

/* Video Scale-Down Styles */
.acore-slides .video-background.video-scale-down .video-foreground,
.acore-single-slide .video-background.video-scale-down .video-foreground {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
}

.acore-slides .video-background.video-scale-down .video-foreground iframe,
.acore-slides .video-background.video-scale-down .video-foreground video,
.acore-single-slide .video-background.video-scale-down .video-foreground iframe,
.acore-single-slide .video-background.video-scale-down .video-foreground video {
    object-fit: scale-down;
}

/* Global Logo Positioning - Uses CSS variable for responsive width */
.msld-global-logo {
    position: absolute;
    z-index: 10;
    width: var(--logo-width, 150px);
    height: auto;
}

/* Logo positioning classes - use --slider-margin CSS variable */

.msld-global-logo-topo-centro {
    top: var(--slider-margin, 20px);
    left: 50%;
    transform: translateX(-50%);
}

.msld-global-logo-topo-esquerda {
    top: var(--slider-margin, 20px);
    left: var(--slider-margin, 20px);
}

.msld-global-logo-topo-direita {
    top: var(--slider-margin, 20px);
    right: var(--slider-margin, 20px);
}

.msld-global-logo-centro-esquerda {
    top: 50%;
    left: var(--slider-margin, 20px);
    transform: translateY(-50%);
}

.msld-global-logo-centro-direita {
    top: 50%;
    right: var(--slider-margin, 20px);
    transform: translateY(-50%);
}

.msld-global-logo-baixo-centro {
    bottom: var(--slider-margin, 20px);
    left: 50%;
    transform: translateX(-50%);
}

.msld-global-logo-baixo-esquerda {
    bottom: var(--slider-margin, 20px);
    left: var(--slider-margin, 20px);
}

.msld-global-logo-baixo-direita {
    bottom: var(--slider-margin, 20px);
    right: var(--slider-margin, 20px);
}

/* Slide Caption Container - Positioning System */
.adsi-slide-item-caption-container {
    position: absolute !important;
    top: var(--slider-margin, 20px) !important;
    left: 50% !important;
    transform: translateX(-50%);
    bottom: var(--slider-margin, 20px) !important;
    width: calc(100% - (var(--slider-margin, 20px) * 2));
    max-width: var(--legenda-container-largura, 100%);
    display: flex !important;
    pointer-events: none;
    z-index: 100 !important;
}

.adsi-slide-item-caption {
    pointer-events: auto; /* Re-enable clicks on caption content */
    /* Largura responsiva definida por slide via inline CSS variables */
    max-width: var(--slide-caption-width-mobile, var(--legenda-largura-mobile, 100%));
}

@media (min-width: 768px) {
    .adsi-slide-item-caption {
        max-width: var(--slide-caption-width-tablet, var(--legenda-largura-tablet, 100%));
    }
}

@media (min-width: 1024px) {
    .adsi-slide-item-caption {
        max-width: var(--slide-caption-width-desktop, var(--legenda-largura-desktop, 100%));
    }
}

/* Slide Overlay */
.adsi-slide-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
    pointer-events: none;
}

/* Caption Styles - Visual Themes */
/* Usa CSS variables com fallback para cores globais ou defaults */
/* A opacidade é aplicada via inline style no PHP quando cor personalizada é definida */
.adsi-slide-item-caption.caption-style-light {
    background: var(--caption-bg-light-rgba, rgba(255, 255, 255, var(--caption-bg-opacity, 0.9)));
    color: var(--caption-text-dark, var(--core-color-black, #333333));
    padding: 30px;
    border-radius: 8px;
}

.adsi-slide-item-caption.caption-style-dark {
    background: var(--caption-bg-dark-rgba, rgba(0, 0, 0, var(--caption-bg-opacity, 0.9)));
    color: var(--caption-text-light, var(--core-color-white, #ffffff));
    padding: 30px;
    border-radius: 8px;
}

.adsi-slide-item-caption.caption-style-transparent-light {
    background: transparent;
    color: var(--caption-text-light, var(--core-color-white, #ffffff));
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
}

.adsi-slide-item-caption.caption-style-transparent-dark {
    background: transparent;
    color: var(--caption-text-dark, var(--core-color-black, #333333));
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.5);
}

/* Herança de cor para elementos filhos */
.adsi-slide-item-caption .adsi-slide-item-title,
.adsi-slide-item-caption .adsi-slide-item-description {
    color: inherit;
}

.adsi-slide-item-caption-inside {
    width: 100%;
    margin: auto;
}

/* Vertical Alignment */
.caption-v-top {
    align-items: flex-start;
}

.caption-v-center {
    align-items: center;
}

.caption-v-bottom {
    align-items: flex-end;
}

/* Horizontal Alignment */
.caption-h-left {
    justify-content: flex-start;
}

.caption-h-center {
    justify-content: center;
}

.caption-h-right {
    justify-content: flex-end;
}

/* Caption Content Alignment */
.caption-h-left .adsi-slide-item-caption {
    text-align: left;
}

.caption-h-center .adsi-slide-item-caption {
    text-align: center;
}

.caption-h-right .adsi-slide-item-caption {
    text-align: right;
}

/* Scroll Down Button */
.slide-scroll-down {
    position: absolute;
    bottom: var(--slider-margin, 20px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    /* Alvo de toque mínimo 44px CSS (WCAG 2.5.5/2.5.8) — sem texto visível
       (.slide-scroll-text), a área clicável era só o tamanho da imagem
       (40x33.51px). min-width/height cresce a caixa clicável sem aumentar
       o ícone em si (continua 40px via .slide-scroll-down img abaixo). */
    min-width: 44px;
    min-height: 44px;
}

.slide-scroll-down img {
    max-width: 40px;
    height: auto;
}

.slide-scroll-text {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Progress Bar */
.my-carousel-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    z-index: 10;
}

.my-carousel-progress-bar {
    height: 100%;
    background: #fff;
    transition: width 0.3s ease;
}

/* Custom Navigation Arrows */
.msld-custom-arrows {
    max-width: 50px;
    height: auto;
}

/* Full Slide Link */
.adsi-slide-full-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

/* Single Slide (no Splide) */
.acore-single-slide {
    position: relative;
}

.single-slide-content {
    position: relative;
}

/* Video styles are in adsicore.css to avoid conflicts */

/* Splide Video Plugin Styles */
.splide__video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-flow: column;
    align-content: center;
    justify-content: center;
    flex-wrap: wrap;
}

.splide__video__wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.splide__video__wrapper iframe {
    width: 100%;
    height: 100%;
}

.splide__video__play:after {
    transition: border-left-color 0.2s ease;
    border-color: transparent transparent transparent #000;
    border-left-color: rgb(0, 0, 0);
    border-style: solid;
    border-width: 13px 0 13px 25px;
    content: "";
    display: inline-block;
    margin-left: 4px;
}

.splide__video__play {
    border-radius: 150px;
    padding: 20px;
    background-color: #ffffff;
}

/* Splide Pagination */
.splide__pagination {
    padding: 0 !important;
}

/* Splide Arrows - Apenas para módulo de sliders */
.acore-slides .splide__arrow {
    background: transparent;
    background-color: transparent;
    min-width: 58px !important;
    min-height: 58px !important;
    width: 58px !important;
    height: 58px !important;
    padding: 10px;
}

.acore-slides .splide__arrow svg {
    width: 100%;
    height: 100%;
}

/* Splide Arrows - Margem Global Responsiva */
.acore-slides .splide__arrow--prev {
    left: var(--slider-margin, 20px) !important;
}

.acore-slides .splide__arrow--next {
    right: var(--slider-margin, 20px) !important;
}

/* Slide Item Video Background */
.adsi-slide-item-video {
    background-size: cover;
    background-position: center center;
}

/* ========================================
   Layout: Hero Full Screen
   Class: .acore-slides--hero_full
   ======================================== */

/* Hero Full - Setas maiores */
.acore-slides--hero_full .splide__arrow {
    min-width: 70px !important;
    min-height: 70px !important;
    width: 70px !important;
    height: 70px !important;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.acore-slides--hero_full .splide__arrow:hover {
    opacity: 1;
}

@media (max-width: 768px) {
    .acore-slides--hero_full .splide__arrow {
        min-width: 50px !important;
        min-height: 50px !important;
        width: 50px !important;
        height: 50px !important;
    }
}

/* Hero Full - Legenda com mais destaque */
.acore-slides--hero_full .adsi-slide-item-title {
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.acore-slides--hero_full .adsi-slide-item-description {
    font-size: clamp(1rem, 2vw, 1.5rem);
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.5);
}

/* Hero Full - Botão com mais destaque */
.acore-slides--hero_full .adsi-slide-item-link,
.acore-slides--hero_full .adsi-slide-external-button-wrapper .core-button {
    font-size: 1.1rem;
    padding: 15px 40px;
}

/* Hero Full - Progress bar mais visível */
.acore-slides--hero_full .my-carousel-progress {
    height: 4px;
}

/* Hero Full - Scroll down animado */
.acore-slides--hero_full .slide-scroll-down {
    animation: heroScrollBounce 2s infinite;
}

@keyframes heroScrollBounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-10px);
    }
    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

/* ========================================
   Layout: Full Width
   Class: .acore-slides--full_width
   ======================================== */

/* Full Width - Setas maiores */
.acore-slides--full_width .splide__arrow {
    min-width: 65px !important;
    min-height: 65px !important;
    width: 65px !important;
    height: 65px !important;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.acore-slides--full_width .splide__arrow:hover {
    opacity: 1;
}

@media (max-width: 768px) {
    .acore-slides--full_width .splide__arrow {
        min-width: 45px !important;
        min-height: 45px !important;
        width: 45px !important;
        height: 45px !important;
    }
}

/* Full Width - Legenda com destaque */
.acore-slides--full_width .adsi-slide-item-title {
    font-size: clamp(1.5rem, 4vw, 3rem);
    font-weight: 600;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.acore-slides--full_width .adsi-slide-item-description {
    font-size: clamp(0.95rem, 1.8vw, 1.25rem);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

/* Full Width - Botão */
.acore-slides--full_width .adsi-slide-item-link,
.acore-slides--full_width .adsi-slide-external-button-wrapper .core-button {
    font-size: 1rem;
    padding: 12px 32px;
}

/* Full Width - Progress bar */
.acore-slides--full_width .my-carousel-progress {
    height: 3px;
}
