.wbp-header {
    padding: 20px;

    h3 {
        text-transform: uppercase;
        font-size: 20px;
    }
}

.wbp-widget {
    background-color: white;
    padding-bottom: 20px;
    padding-top: 20px;

    .posts {
        display: flex;

        .post-date {
            font-size: 12px;
        }

        .post {
            flex: 0 0 calc(100% / 3);
            scroll-snap-align: start;
            overflow: hidden;

            @media screen and (min-width: 1025px) {
                flex: 1 1 calc(100% / 3);
                overflow: visible !important;
                min-width: 0;
            }

            @media screen and (max-width: 1024px) {
                flex: 0 0 100%;
                width: 100%;
                min-width: 100%;
                max-width: 100%;
            }

            .post-title {
                display: block;
                margin: 10px 0;
            }

            .post-image {
                display: block;
                width: 100%;
                height: 130px;
                background-repeat: no-repeat;
                background-size: cover;
                background-position: 50% 50%;
            }

            .post-excerpt {
                text-wrap: wrap;
                text-align: justify;
                margin: 0;
            }
        }
    }
}

.wbp-widget .posts-wrapper {
    display: block;
}

    .posts {
        white-space: nowrap;
        gap: 20px;
        height: auto;
        overflow-x: hidden;
        overflow-y: hidden;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        display: flex;
        flex-direction: row;
        scroll-snap-type: x mandatory;
        
        /* On mobile: show only one post at a time */
        @media screen and (max-width: 1024px) {
            overflow-x: auto;
            gap: 0;
            width: 100%;
            scrollbar-width: none;
            -ms-overflow-style: none;
            
            &::-webkit-scrollbar {
                display: none;
            }
        }
    }

    .next, .prev {
        display: none !important;
    }

/* Fix title wrapping on desktop - allow titles to wrap normally */
@media screen and (min-width: 1025px) {
    .wbp-widget .post {
        white-space: normal !important;
        flex: 0 0 calc(100% / 3) !important;
        overflow: visible !important;
    }
    
    .wbp-widget .post-title {
        white-space: normal !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        width: 100% !important;
        max-width: none !important;
        overflow: visible !important;
    }
    
    .wbp-widget .post-outbound {
        white-space: normal !important;
        width: 100% !important;
        overflow: visible !important;
    }
    
    .wbp-widget .posts,
    .wbp-widget.has-slider .posts-wrapper .posts {
        white-space: normal !important;
        flex-wrap: wrap !important;
    }
    
    .wbp-widget.has-slider .posts-wrapper .post {
        white-space: normal !important;
        overflow: visible !important;
        flex: 1 1 calc(33.333% - 20px) !important;
        max-width: calc(33.333% - 10px) !important;
    }
}

/* Fix title wrapping ONLY on mobile */
@media screen and (max-width: 1024px) {
    .wbp-widget .post-title {
        white-space: normal !important;
        word-break: normal !important;
        overflow-wrap: normal !important;
        hyphens: none !important;
        word-wrap: normal !important;
        line-height: 1.4 !important;
        text-overflow: clip !important;
        overflow: visible !important;
    }
}
    
/* Pagination dots */
.wbp-widget .wbp-pagination {
    display: none;
    justify-content: center;
    padding: 15px 0;
    gap: 8px;
    width: 100%;
    position: relative;
}

@media screen and (max-width: 1024px) {
    .wbp-widget .wbp-pagination {
        display: flex !important;
    }
}

.wbp-widget .wbp-pagination .wbp-dot:hover {
    background-color: #666;
}

.wbp-widget:not(.has-slider) {
    
    /* Force wrapper structure on mobile */
    @media screen and (max-width: 1024px) {
        .posts {
            display: grid;
            grid-template-columns: 40px 1fr 40px;
            padding: 0;
            gap: 0;
        }
    }

    .posts {
        padding: 20px;
        gap: 20px;
        
        /* Force mobile layout even without slider */
        @media screen and (max-width: 1024px) {
            display: flex;
            overflow-x: hidden;
            padding: 10px;
            gap: 0;
            
            .post {
                flex: 0 0 100%;
                width: 100%;
                min-width: 100%;
                max-width: 100%;
            }
        }
    }

    .next, .prev {
        display: none;
        
        /* Show arrows on mobile even without slider class */
        @media screen and (max-width: 1024px) {
            display: flex;
            width: 40px;
            height: 100%;
            justify-content: center;
            align-items: center;
            font-weight: bold;
            color: black;
            font-size: 24px;
            cursor: pointer;
            user-select: none;
            background-color: rgba(255, 255, 255, 0.8);
            border-radius: 50%;
            margin: auto;
        }
    }
}

.wbp-widget.hook-display-left-column {
    .posts {
        display: block;

        .post {
            margin-bottom: 40px;
        }
    }
}

/* PAGINATION DOTS - FINAL RULES WITH HIGH PRIORITY */
.wbp-widget .wbp-pagination {
    display: none !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 20px 0 !important;
    margin: 0 auto !important;
    gap: 10px !important;
    width: 100% !important;
    background: transparent !important;
    position: relative !important;
    z-index: 10 !important;
}

@media screen and (max-width: 1024px) {
    .wbp-widget .wbp-pagination {
        display: flex !important;
    }
}

.wbp-widget .wbp-pagination .wbp-dot {
    width: 8px !important;
    height: 8px !important;
    border-radius: 50% !important;
    background-color: #cccccc !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    flex-shrink: 0 !important;
}

.wbp-widget .wbp-pagination .wbp-dot.active {
    background-color: #333333 !important;
    transform: scale(1.2) !important;
}

.wbp-widget .wbp-pagination .wbp-dot:hover {
    background-color: #666666 !important;
    transform: scale(1.1) !important;
}
