/* BW Slide Content Block Styles */

.bw-slide-content {
    position: relative;
    width: 100%;
    height: 80vh;
    min-height: 500px;
    overflow: hidden;
    background: #000;
}

/* Height Presets */
.bw-slide-content--height-small {
    height: 50vh !important;
    min-height: 350px;
}

.bw-slide-content--height-medium {
    height: 60vh !important;
    min-height: 400px;
}

.bw-slide-content--height-default {
    height: 80vh !important;
    min-height: 500px;
}

.bw-slide-content--height-large {
    height: 90vh !important;
    min-height: 600px;
}

.bw-slide-content--height-full {
    height: 100vh !important;
    min-height: 100vh;
}

/* Custom height - uses inline style */
.bw-slide-content--height-custom {
    min-height: 200px !important;
}

/* Full width alignment - break out of container */
.bw-slide-content.alignfull {
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
}

/* Wide alignment - use Kadence wide width */
.bw-slide-content.alignwide {
    width: 100%;
    max-width: var(--global-wide-width, 1200px);
    margin-left: auto;
    margin-right: auto;
}

/* Default/center alignment - respect container */
.bw-slide-content.aligncenter,
.bw-slide-content:not(.alignfull):not(.alignwide) {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

/* When inside Kadence Row Layout columns - respect column width */
.kadence-column .bw-slide-content:not(.alignfull),
.kt-inside-inner-col .bw-slide-content:not(.alignfull),
.kt-layout-id .bw-slide-content:not(.alignfull),
.wp-block-kadence-column .bw-slide-content:not(.alignfull) {
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* When in half-width column - adjust height only if using default height */
.kadence-column_layout-equal .bw-slide-content--height-default:not(.alignfull),
.kadence-column_layout-left-golden .bw-slide-content--height-default:not(.alignfull),
.kadence-column_layout-right-golden .bw-slide-content--height-default:not(.alignfull),
.kt-layout-column_layout-equal .bw-slide-content--height-default:not(.alignfull) {
    height: 60vh !important; /* Smaller height for column layouts */
    min-height: 400px;
}

/* When in narrow columns (1/3 or 1/4) - even smaller height only if using default */
.kadence-column_layout-left-forty .bw-slide-content--height-default:not(.alignfull),
.kadence-column_layout-right-forty .bw-slide-content--height-default:not(.alignfull),
.kadence-column_layout-three-grid .bw-slide-content--height-default:not(.alignfull),
.kadence-column_layout-four-grid .bw-slide-content--height-default:not(.alignfull) {
    height: 50vh !important;
    min-height: 350px;
}

/* Keep width adjustments for all columns */
.kadence-column_layout-equal .bw-slide-content:not(.alignfull),
.kadence-column_layout-left-golden .bw-slide-content:not(.alignfull),
.kadence-column_layout-right-golden .bw-slide-content:not(.alignfull),
.kt-layout-column_layout-equal .bw-slide-content:not(.alignfull) {
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Force full width when alignfull even in Kadence columns - DISABLED for better column support */
/* If you need full viewport width, move the block outside of columns */
.kt-layout-id .bw-slide-content.alignfull,
.kadence-column .bw-slide-content.alignfull {
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Respect Kadence content width */
.content-width-fullwidth .bw-slide-content.alignfull {
    width: 100vw !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
}

/* For narrow content width, only go full if alignfull */
.content-width-narrow .bw-slide-content.alignfull {
    width: 100vw !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
}

.content-width-narrow .bw-slide-content:not(.alignfull) {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

/* Slides Container */
.bw-slide-content__slides {
    position: relative;
    width: 100%;
    height: 100%;
    user-select: none; /* Prevent text selection during drag */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    will-change: contents; /* Optimize for smooth transitions */
}

/* Individual Slide */
.bw-slide-content__slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none !important; /* Hidden by default - IMPORTANT to override any conflicts */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), 
                visibility 0.8s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-touch-callout: none; /* Prevent callout on long-tap */
    -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
    pointer-events: none; /* Disable interaction when hidden */
    will-change: opacity, transform, visibility; /* Optimize for animations */
    -webkit-backface-visibility: hidden; /* Prevent flickering */
    backface-visibility: hidden;
}

/* Full width slides only when parent is full */
.bw-slide-content.alignfull .bw-slide-content__slide {
    width: 100vw !important;
}

.bw-slide-content .bw-slide-content__slide.active,
.bw-slide-content__slide.active {
    display: flex !important; /* Show slide when active */
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important; /* Enable interaction when visible */
    transform: translateX(0) !important;
}

/* Slide transition states for ultra-smooth animations */
.bw-slide-content__slide.slide-out-left {
    transform: translateX(-50px);
    opacity: 0;
}

.bw-slide-content__slide.slide-out-right {
    transform: translateX(50px);
    opacity: 0;
}

.bw-slide-content__slide.slide-in {
    transform: translateX(0);
    opacity: 1;
}

/* Main Slide Area */
.bw-slide-content__main {
    position: relative;
    width: calc(100% - 180px); /* Container width minus next preview */
    height: 100%;
    display: flex;
    align-items: center;
    overflow: hidden;
}

/* Full width specific */
.bw-slide-content.alignfull .bw-slide-content__main {
    width: calc(100% - 180px) !important;
}

/* Background Image */
.bw-slide-content__background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.bw-slide-content__background img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Apply zoom effect only when enabled */
.bw-slide-content--zoom-enabled .bw-slide-content__main:hover .bw-slide-content__background img {
    transform: scale(1.05);
}

/* Overlay Gradient */
.bw-slide-content__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, 
        rgba(0, 0, 0, var(--overlay-opacity-bottom, 0.6)) 0%, 
        rgba(0, 0, 0, var(--overlay-opacity-top, 0.2)) 100%);
    z-index: 2;
}

/* Content Container - Respects Kadence site width */
.bw-slide-content__container {
    position: relative;
    z-index: 3;
    width: 100%;
    height: 100%;
    max-width: var(--global-content-width, 1600px); /* Use Kadence global width */
    margin: 0 auto;
    padding: 0 60px 80px 60px; /* Add bottom padding for text at bottom */
    display: flex;
    align-items: flex-end; /* Align content to bottom */
}

/* Text Wrapper - 360px width on left side */
.bw-slide-content__text-wrapper {
    width: 360px;
    color: #fff;
    text-align: left;
}

/* Heading */
.bw-slide-content__heading {
    font-size: 42px;
    font-weight: 600;
    line-height: 1.2;
    margin: 0 0 20px 0;
    color: #fff;
}

/* Empty heading - hide margin */
.bw-slide-content__heading:empty {
    display: none;
}

/* Description */
.bw-slide-content__description {
    font-size: 16px;
    line-height: 1.6;
    margin: 0 0 30px 0;
    color: #fff;
    opacity: 0.9;
}

/* Empty description - hide margin */
.bw-slide-content__description:empty {
    display: none;
}

/* Button */
.bw-slide-content__button {
    display: inline-block;
    padding: 12px 30px;
    background: transparent;
    color: #fff;
    border: 2px solid #fff;
    text-decoration: none;
    text-transform: uppercase;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.bw-slide-content__button:hover {
    background: #fff;
    color: #000;
}

/* Next Slide Preview */
.bw-slide-content__next-preview {
    position: absolute;
    right: 0;
    top: 0;
    width: 180px;
    height: 100%;
    cursor: pointer;
    overflow: hidden;
    transition: width 0.3s ease;
    z-index: 5;
    pointer-events: auto; /* Ensure preview is clickable */
}

.bw-slide-content__next-preview:hover {
    width: 220px;
}

/* Adjust preview width when in columns */
.kadence-column .bw-slide-content__next-preview,
.kt-inside-inner-col .bw-slide-content__next-preview {
    width: 120px;
}

.kadence-column .bw-slide-content__next-preview:hover,
.kt-inside-inner-col .bw-slide-content__next-preview:hover {
    width: 150px;
}

/* Adjust main area width when in columns */
.kadence-column .bw-slide-content__main,
.kt-inside-inner-col .bw-slide-content__main {
    width: calc(100% - 120px);
}

/* Fix for image-only mode in columns with preview */
.kadence-column .bw-slide-content--image-only:not(.bw-slide-content--no-preview) .bw-slide-content__main,
.kt-inside-inner-col .bw-slide-content--image-only:not(.bw-slide-content--no-preview) .bw-slide-content__main {
    width: calc(100% - 120px);
}

/* Next Preview Background */
.bw-slide-content__next-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.bw-slide-content__next-background img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

/* Apply zoom effect on next preview only when enabled */
.bw-slide-content--zoom-enabled .bw-slide-content__next-preview:hover .bw-slide-content__next-background img {
    transform: scale(1.1);
}

/* Next Preview Overlay */
.bw-slide-content__next-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, 
        rgba(0, 0, 0, 0.7) 0%, 
        rgba(0, 0, 0, 0.4) 100%);
    z-index: 2;
}

/* Next Preview Content */
.bw-slide-content__next-content {
    position: absolute;
    bottom: 40px;
    left: 20px;
    right: 20px;
    z-index: 3;
    color: #fff;
}

.bw-slide-content__next-label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 10px;
    opacity: 0.7;
}

.bw-slide-content__next-title {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.2;
    margin: 0;
    color: #fff;
    word-wrap: break-word;
    hyphens: auto;
}

/* Slide Indicators - Elegant Luxury Style */
.bw-slide-content__indicators {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 16px;
    z-index: 10;
    pointer-events: auto; /* Ensure indicators are clickable */
}

.bw-slide-content__indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    padding: 0;
    margin: 0;
    position: relative;
    pointer-events: auto; /* Ensure each indicator is clickable */
    display: block;
    outline: none;
}

/* Hover effect with subtle glow */
.bw-slide-content__indicator:hover {
    background: rgba(255, 255, 255, 0.4);
    border-color: rgba(255, 255, 255, 0.8);
    transform: scale(1.3);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

/* Active indicator - elegant filled style */
.bw-slide-content__indicator.active {
    background: rgba(255, 255, 255, 0.9);
    border-color: #fff;
    transform: scale(1.1);
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.4);
}

.bw-slide-content__indicator.active:hover {
    transform: scale(1.3);
    background: #fff;
}

/* Without background image styles */
.bw-slide-content__main:not([data-has-image="true"]) {
    background: #222;
}

.bw-slide-content__next-preview:not([data-has-image="true"]) {
    background: #333;
}

/* Responsive Design - Tablet */
@media (max-width: 1024px) {
    .bw-slide-content {
        height: 70vh;
    }
    
    .bw-slide-content__container {
        padding: 0 40px;
    }
    
    .bw-slide-content__heading {
        font-size: 36px;
    }
    
    .bw-slide-content__next-preview {
        width: 150px;
    }
    
    .bw-slide-content__next-preview:hover {
        width: 180px;
    }
}

/* Responsive Design - Mobile */
@media (max-width: 768px) {
    /* Only apply mobile height adjustments for default height option */
    .bw-slide-content--height-default,
    .wp-block-bw-slide-content.bw-slide-content--height-default {
        height: 60vh !important;
        min-height: 400px;
        max-height: 600px;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        left: auto !important;
        right: auto !important;
        position: relative !important;
    }
    
    .bw-slide-content__slides {
        width: 100% !important;
        height: 100% !important;
        position: relative !important;
    }
    
    .bw-slide-content__slide {
        width: 100% !important;
        height: 100% !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        flex-direction: row !important;
        /* Display handled by active class */
    }
    
    /* Ensure active slide is visible on mobile */
    .bw-slide-content__slide.active {
        display: flex !important;
    }
    
    /* Main takes full area on mobile */
    .bw-slide-content__main {
        width: 100% !important;
        height: 100% !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
    }
    
    .bw-slide-content__container {
        padding: 20px 20px 40px 20px; /* Bottom padding for mobile */
        display: flex;
        align-items: flex-end; /* Keep text at bottom on mobile */
        justify-content: center;
        height: 100%;
        max-width: 100%;
    }
    
    .bw-slide-content__text-wrapper {
        width: 100%;
        max-width: 90%;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .bw-slide-content__heading {
        font-size: 24px;
        line-height: 1.1;
        white-space: nowrap;
        overflow: visible;
        margin-bottom: 10px;
        display: block;
        width: max-content;
        max-width: 100%;
    }
    
    .bw-slide-content__description {
        font-size: 14px;
        margin: 0 0 15px 0;
        line-height: 1.4;
    }
    
    .bw-slide-content__button {
        padding: 10px 24px;
        font-size: 13px;
    }
    
    /* Hide next preview on mobile - too complex for small screens */
    .bw-slide-content__next-preview {
        display: none !important;
    }
    
    /* Ensure background covers properly on mobile */
    .bw-slide-content__background {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
    }
    
    .bw-slide-content__background img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }
    
    /* Mobile overlay - more centered gradient for centered text */
    .bw-slide-content__overlay {
        background: linear-gradient(to right, 
            rgba(0, 0, 0, 0.2) 0%,
            rgba(0, 0, 0, var(--overlay-opacity-left, 0.4)) 30%,
            rgba(0, 0, 0, var(--overlay-opacity-left, 0.4)) 70%,
            rgba(0, 0, 0, 0.2) 100%) !important;
    }
    
    /* Image only mode on mobile */
    .bw-slide-content--image-only .bw-slide-content__main {
        width: 100% !important;
    }
    
    
    /* Indicators at bottom since no next preview */
    .bw-slide-content__indicators {
        bottom: 25px !important;
        gap: 12px;
    }
}

/* Prevent heading text splitting on mobile */
@media (max-width: 768px) {
    .bw-slide-content__heading {
        display: inline-block;
        font-size: clamp(20px, 5vw, 28px); /* Responsive font size */
        white-space: nowrap; /* Force single line */
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }
    
    /* For headings with multiple words, try to keep together */
    .bw-slide-content__heading::after {
        content: '';
        display: inline-block;
        width: 0;
    }
}

/* Mobile Portrait - Extra Small Screens */
@media (max-width: 480px) {
    /* Only apply mobile height adjustments for default height option */
    .bw-slide-content--height-default,
    .wp-block-bw-slide-content.bw-slide-content--height-default {
        height: 50vh !important;
        min-height: 350px;
        max-height: 500px;
    }
    
    .bw-slide-content__heading {
        font-size: clamp(18px, 6vw, 24px); /* Even more responsive on small screens */
        white-space: nowrap; /* Keep forcing single line */
    }
    
    .bw-slide-content__description {
        font-size: 14px;
    }
    
    .bw-slide-content__button {
        padding: 8px 20px;
        font-size: 12px;
    }
    
    .bw-slide-content__container {
        padding: 15px 15px 30px 15px; /* Keep text at bottom on very small screens */
    }
    
    .bw-slide-content__indicators {
        bottom: 20px !important;
        gap: 10px;
    }
    
    .bw-slide-content__indicator {
        width: 6px !important;
        height: 6px !important;
        border-width: 1px;
    }
    
    .bw-slide-content__indicator.active {
        transform: scale(1.2);
    }
}\n\n/* Image Only Mode - Hide overlays when showing only images */
.bw-slide-content--image-only .bw-slide-content__overlay {
    display: none !important;
}

/* When Image Only Mode is on and Next Preview is shown - ensure full coverage */
.bw-slide-content--image-only:not(.bw-slide-content--no-preview) .bw-slide-content__main {
    width: calc(100% - 180px);
}

/* Fix black gap by making slide full width in image-only mode with preview */
.bw-slide-content--image-only:not(.bw-slide-content--no-preview) .bw-slide-content__slide {
    width: 100% !important;
}

/* Remove text overlay from next preview in image-only mode */
.bw-slide-content--image-only .bw-slide-content__next-content {
    display: none !important;
}

.bw-slide-content--image-only .bw-slide-content__next-overlay {
    background: rgba(0, 0, 0, 0.2) !important;
}

/* When both Image Only Mode and No Preview - Full width edge to edge */
.bw-slide-content--image-only.bw-slide-content--no-preview .bw-slide-content__main {
    width: 100% !important;
}

/* Ensure no black gap on the right when preview is off */
.bw-slide-content--no-preview .bw-slide-content__slide {
    width: 100% !important;
}


/* Empty background styles */
.bw-slide-content__background--empty,
.bw-slide-content__next-background--empty {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}
