/* Portfolio Carousel Widget Styles */
.portfolio-carousel-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.portfolio-carousel-wrapper .swiper-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.portfolio-carousel-wrapper .swiper-wrapper {
    display: flex;
    align-items: stretch;
}

.portfolio-carousel-wrapper .swiper-slide {
    height: auto;
    display: flex;
}

/* Portfolio Item */
.portfolio-carousel-item {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Image Container - FLEX LAYOUT */
.portfolio-carousel-image {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 75%; /* Default 4:3, will be overridden */
    overflow: hidden;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

/* Auto height - no padding */
.portfolio-carousel-image.auto-height {
    height: auto;
    padding-bottom: 0 !important;
    background: none;
}

/* Lightbox link - fills entire container */
.portfolio-carousel-image .aux-lightbox-btn {
    position: absolute !important;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Image - HIDDEN for background-image, VISIBLE only for auto-height */
.portfolio-carousel-image img {
    display: none;
}

/* Auto height images - relative positioning */
.portfolio-carousel-image.auto-height .aux-lightbox-btn {
    position: relative;
    height: auto;
}

.portfolio-carousel-image.auto-height img {
    position: relative;
    display: block;
    width: 100%;
    height: auto;
}

/* Content Area */
.portfolio-carousel-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* Title */
.portfolio-carousel-title {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.4;
    margin: 0 0 15px;
    color: #333;
}

/* Subtitle */
.portfolio-carousel-subtitle {
    font-size: 14px;
    line-height: 1.6;
    color: #666;
    margin-top: 10px;
}

/* Navigation Arrows */
.portfolio-carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    color: #333;
    font-size: 24px;
}

.portfolio-carousel-arrow:hover {
    background: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.portfolio-carousel-prev {
    left: 20px;
}

.portfolio-carousel-next {
    right: 20px;
}

.portfolio-carousel-arrow.swiper-button-disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Pagination Dots */
.portfolio-carousel-wrapper .swiper-pagination {
    position: relative;
    margin-top: 30px;
    text-align: center;
}

.portfolio-carousel-wrapper .swiper-pagination-bullet {
    width: 12px;
    height: 12px;
    background: #ddd;
    opacity: 1;
    transition: all 0.3s ease;
    margin: 0 5px;
}

.portfolio-carousel-wrapper .swiper-pagination-bullet-active {
    background: #0073aa;
    transform: scale(1.3);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .portfolio-carousel-arrow {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .portfolio-carousel-prev {
        left: 10px;
    }

    .portfolio-carousel-next {
        right: 10px;
    }

    .portfolio-carousel-title {
        font-size: 18px;
    }

    .portfolio-carousel-content {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .portfolio-carousel-arrow {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }

    .portfolio-carousel-title {
        font-size: 16px;
    }
}

/* Loading State */
.portfolio-carousel-wrapper.loading {
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.portfolio-carousel-wrapper.loading::before {
    content: '';
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* PhotoSwipe Caption Styles */
.pswp__caption__center {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    padding: 15px 20px;
}

.pswp__caption__center strong {
    display: block;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #fff;
}

.pswp__caption__center br + * {
    display: block;
    font-size: 14px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 5px;
}

/* Lightbox Button Hover Effect */
.aux-lightbox-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 60px;
    height: 60px;
    display: none; /* Hidden by default, controlled by Elementor */
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 2;
    pointer-events: none;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="white"><path d="m10 3.5c-3.587 0-6.5 2.913-6.5 6.5s2.913 6.5 6.5 6.5 6.5-2.913 6.5-6.5-2.913-6.5-6.5-6.5zm0 1c3.036 0 5.5 2.464 5.5 5.5s-2.464 5.5-5.5 5.5-5.5-2.464-5.5-5.5 2.464-5.5 5.5-5.5z"/><path d="m20.354 19.646-5.759-5.758c-.195-.195-.512-.195-.707 0s-.195.512 0 .707l5.758 5.759c.196.195.512.195.708 0 .195-.196.195-.512 0-.708z"/></svg>');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 24px 24px;
}

.portfolio-carousel-item:hover .aux-lightbox-btn::after {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}
