/**
 * Lubinik Gallery Base Styles
 * Common styles shared between all gallery types
 */

/* Full-width gallery container - break out of any parent containers */
.lubinik-container [class*="-gallery-container"] {
    margin-bottom: var(--lubinik-spacing-lg);
    margin-top: var(--lubinik-spacing-lg);
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(-50vw + 50%);
    position: relative;
    left: 50%;
    right: 50%;
    transform: translateX(-50%);
    padding: 0;
    overflow: hidden;
}

/* Only apply card styling when the card class is present */
.lubinik-container [class*="-gallery-container"].card-style {
    width: 100%;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    left: 0;
    right: 0;
    transform: none;
    position: relative;
    background-color: var(--lubinik-plugin-galleries-card-bg-color);
    border-radius: 12px;
    box-shadow: 0 10px 30px var(--lubinik-shadow-color-light);
    padding: 30px;
    border: 1px solid var(--lubinik-shadow-color-subtle);
}

/* Add decorative elements only when card style is enabled */
.lubinik-container [class*="-gallery-container"].card-style:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background-color: var(--lubinik-plugin-galleries-container-before-color);
}

/* Gallery title styling */
.lubinik-container [class*="-gallery-title"] {
    font-size: var(--lubinik-font-size-lg);
    margin-bottom: var(--lubinik-spacing-md);
    color: var(--lubinik-plugin-galleries-title-color);
    text-align: center;
    font-weight: 600;
    position: relative;
    display: block;
    padding-bottom: 15px;
}

.lubinik-container [class*="-gallery-title"]:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: var(--lubinik-plugin-galleries-title-after-width);
    height: var(--lubinik-plugin-galleries-title-after-height);
    background-color: var(--lubinik-plugin-galleries-title-after-color);
}

/* Common gallery shortcode container */
.lubinik-container [class*="gallery-"][class*="-shortcode"] {
    margin: 0 auto;
    width: 90%;
    max-width: var(--lubinik-container-width-lg);
}

/* Gallery item styles */
.lubinik-container [class*="gallery-"][class*="-shortcode"] .lubinik-gallery-item {
    padding: 0 10px;
    position: relative;
    overflow: hidden;
}

.lubinik-container [class*="gallery-"][class*="-shortcode"] .lubinik-gallery-item a {
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 5px 15px var(--lubinik-shadow-color-light);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.lubinik-container [class*="gallery-"][class*="-shortcode"] .lubinik-gallery-item a:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px var(--lubinik-shadow-color-medium);
}

.lubinik-container [class*="gallery-"][class*="-shortcode"] .lubinik-gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    transition: transform 0.5s ease;
}

.lubinik-container [class*="gallery-"][class*="-shortcode"] .lubinik-gallery-item a:hover img {
    transform: scale(1.03);
}

/* Caption styling */
.lubinik-container [class*="gallery-"][class*="-shortcode"] .lubinik-gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, var(--lubinik-shadow-color-darkest-07), transparent);
    color: var(--lubinik-plugin-galleries-caption-color);
    padding: 15px 10px 10px;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 0 0 8px 8px;
}

.lubinik-container [class*="gallery-"][class*="-shortcode"] .lubinik-gallery-item a:hover .lubinik-gallery-caption {
    opacity: 1;
}

/* Slick slider customization */
.lubinik-container [class*="gallery-"][class*="-shortcode"] .slick-prev,
.lubinik-container [class*="gallery-"][class*="-shortcode"] .slick-next {
    width: var(--lubinik-plugin-galleries-prev-next-width);
    height: var(--lubinik-plugin-galleries-prev-next-height);
    background-color: var(--lubinik-plugin-galleries-prev-next-bg-color);
    border-radius: 50%;
    z-index: 10;
    transition: background-color 0.3s;
}

.lubinik-container [class*="gallery-"][class*="-shortcode"] .slick-prev {
    left: 15px;
}

.lubinik-container [class*="gallery-"][class*="-shortcode"] .slick-next {
    right: 15px;
}

.lubinik-container [class*="gallery-"][class*="-shortcode"] .slick-prev:hover,
.lubinik-container [class*="gallery-"][class*="-shortcode"] .slick-next:hover {
    background-color: var(--lubinik-plugin-galleries-prev-next-hover-bg-color);
}

.lubinik-container [class*="gallery-"][class*="-shortcode"] .slick-prev:before,
.lubinik-container [class*="gallery-"][class*="-shortcode"] .slick-next:before {
    display: none;
}

.lubinik-container [class*="gallery-"][class*="-shortcode"] .slick-prev i,
.lubinik-container [class*="gallery-"][class*="-shortcode"] .slick-next i {
    color: var(--lubinik-plugin-galleries-prev-next-arrow-color);
    font-size: 18px;
    line-height: 40px;
}

/* Dots styling */
.lubinik-container [class*="gallery-"][class*="-shortcode"] .slick-dots {
    bottom: -30px;
}

.lubinik-container [class*="gallery-"][class*="-shortcode"] .slick-dots li button:before {
    font-size: 10px;
    color: var(--lubinik-plugin-galleries-dots-color);
    opacity: 0.5;
}

.lubinik-container [class*="gallery-"][class*="-shortcode"] .slick-dots li.slick-active button:before {
    opacity: 1;
    color: var(--lubinik-plugin-galleries-dots-active-color);
}

/* Responsive adjustments */
@media (max-width: 767px) {
    .lubinik-container [class*="gallery-"][class*="-shortcode"] {
        width: 100%;
        padding: 0 15px;
    }
    
    .lubinik-container [class*="gallery-"][class*="-shortcode"] .slick-prev {
        left: 5px;
    }
    
    .lubinik-container [class*="gallery-"][class*="-shortcode"] .slick-next {
        right: 5px;
    }
    
    .lubinik-container [class*="gallery-"][class*="-shortcode"] .slick-dots {
        display: none !important;
    }
}
