/**
 * WordPress Gallery Swiper Styles
 *
 * Custom styling for Swiper navigation and pagination elements
 * when used with WordPress gallery blocks.
 *
 * @package AachenKardiologie
 * @since 1.0.0
 */

/* Gallery Slider Container */
.dn-gallery.swiper {
    position: relative;
    overflow: hidden;
    /* border-radius: 8px; */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Swiper Wrapper - contains all slides */
.dn-gallery .swiper-wrapper {
    display: flex;
    align-items: stretch;
}

/* Individual Slides (WordPress figure elements) */
.dn-gallery .swiper-slide {
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f8f9fa;
    position: relative;
}

/* Image styling within slides */
.dn-gallery .swiper-slide img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: cover;
    display: block;
}

/* Navigation Buttons */
.dn-gallery .swiper-button-next,
.dn-gallery .swiper-button-prev {
    color: #ffffff;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    margin-top: -22px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.dn-gallery .swiper-button-next:hover,
.dn-gallery .swiper-button-prev:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

.dn-gallery .swiper-button-next::after,
.dn-gallery .swiper-button-prev::after {
    font-size: 16px;
    font-weight: bold;
}

/* Navigation button positioning */
.dn-gallery .swiper-button-next {
    right: 15px;
}

.dn-gallery .swiper-button-prev {
    left: 15px;
}

/* Pagination Dots */
.dn-gallery .swiper-pagination {
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    position: absolute;
}

.dn-gallery .swiper-pagination-bullet {
    background: rgba(255, 255, 255, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.8);
    opacity: 1;
    width: 12px;
    height: 12px;
    margin: 0 4px;
    transition: all 0.3s ease;
}

.dn-gallery .swiper-pagination-bullet-active {
    background: #ffffff;
    transform: scale(1.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Dynamic bullets styling */
.dn-gallery .swiper-pagination-bullet-active-main {
    background: #ffffff;
}

.dn-gallery .swiper-pagination-bullet-active-prev,
.dn-gallery .swiper-pagination-bullet-active-next {
    background: rgba(255, 255, 255, 0.7);
    transform: scale(0.9);
}

/* Responsive adjustments */
@media (max-width: 768px) {

    .dn-gallery .swiper-button-next,
    .dn-gallery .swiper-button-prev {
        width: 36px;
        height: 36px;
        margin-top: -18px;
    }

    .dn-gallery .swiper-button-next::after,
    .dn-gallery .swiper-button-prev::after {
        font-size: 14px;
    }

    .dn-gallery .swiper-button-next {
        right: 10px;
    }

    .dn-gallery .swiper-button-prev {
        left: 10px;
    }

    .dn-gallery .swiper-pagination {
        bottom: 15px;
    }

    .dn-gallery .swiper-pagination-bullet {
        width: 10px;
        height: 10px;
        margin: 0 3px;
    }
}

/* Gallery fade effect adjustments */
.dn-gallery.swiper-fade .swiper-slide {
    pointer-events: none;
}

.dn-gallery.swiper-fade .swiper-slide-active {
    pointer-events: auto;
}

/* Loading state */
.dn-gallery.swiper:not(.swiper-initialized) {
    opacity: 0.5;
}

.dn-gallery.swiper.swiper-initialized {
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* Accessibility improvements */
.dn-gallery .swiper-button-next:focus,
.dn-gallery .swiper-button-prev:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.dn-gallery .swiper-pagination-bullet:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* Image alt text display on hover (optional) */
.dn-gallery .swiper-slide img[alt]:hover::after {
    content: attr(alt);
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px;
    font-size: 14px;
    opacity: 0;
    animation: fadeInAlt 0.3s ease forwards;
}

@keyframes fadeInAlt {
    to {
        opacity: 1;
    }
}