/* Style dla edytora */
.wp-block-cwks-resovia-lightbox-gallery {
    padding: 10px;
    border: 1px solid #ccc; /* Ramka tylko w edytorze */
    border-radius: 2px;
}

.wp-block-cwks-resovia-lightbox-gallery .lightbox-gallery-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.wp-block-cwks-resovia-lightbox-gallery .lightbox-gallery-header .dashicons {
    margin-right: 5px;
    color: #1e1e1e;
}

.wp-block-cwks-resovia-lightbox-gallery .lightbox-gallery-instructions {
    margin-bottom: 10px;
    font-size: 13px;
    color: #1e1e1e;
}

.wp-block-cwks-resovia-lightbox-gallery .gallery-preview {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.wp-block-cwks-resovia-lightbox-gallery .button-container {
    display: flex;
    flex-direction: row;
    gap: 10px; /* Odstęp między przyciskami */
    margin-top: 10px; /* Odstęp od zdjęć */
}

/* Style dla przycisków */
.wp-block-cwks-resovia-lightbox-gallery .components-button.is-primary {
    background-color: #007cba;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    margin-right: 10px;
    transition: background-color 0.2s ease;
}

.wp-block-cwks-resovia-lightbox-gallery .components-button.is-primary:hover,
.wp-block-cwks-resovia-lightbox-gallery .components-button.is-primary:focus {
    background-color: #006ba1;
}

/* Specyficzny styl dla przycisku "Biblioteka mediów" */
.wp-block-cwks-resovia-lightbox-gallery .components-button.block-editor-media-placeholder__button.block-editor-media-placeholder__upload-button.is-next-40px-default-size:not(.is-primary) {
    background-color: #f0f0f0; /* Szary kolor tła */
    color: #1e1e1e;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 8px 16px;
    transition: background-color 0.2s ease;
}

.wp-block-cwks-resovia-lightbox-gallery .components-button.block-editor-media-placeholder__button.block-editor-media-placeholder__upload-button.is-next-40px-default-size:not(.is-primary):hover,
.wp-block-cwks-resovia-lightbox-gallery .components-button.block-editor-media-placeholder__button.block-editor-media-placeholder__upload-button.is-next-40px-default-size:not(.is-primary):focus {
    background-color: #e0e0e0; /* Lekko jaśniejszy szary przy hover/focus */
}

/* Style dla frontendu - 5 kolumn, max 20%, bez ramki */
.wp-block-cwks-resovia-lightbox-gallery.has-nested-images {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 20%)); /* Maksymalnie 20% szerokości na kolumnę */
    gap: 1rem;
    justify-content: center;
    border: none; /* Usunięcie ramki na froncie */
}

.wp-block-cwks-resovia-lightbox-gallery .wp-block-image {
    margin: 0;
    max-width: 100%; /* Obrazy nie mogą być szersze niż kolumna */
    width: 100%; /* Pełna szerokość kolumny */
}

.wp-block-cwks-resovia-lightbox-gallery img {
    width: 100%; /* Obrazy wypełniają kontener wp-block-image */
    max-width: 200px;
    height: auto;
    transition: opacity 0.3s ease;
    display: block; /* Usuwa dodatkowe odstępy pod obrazami */
}

.wp-block-cwks-resovia-lightbox-gallery img:hover {
    opacity: 0.8;
}

/* Responsywność */
@media (min-width: 601px) and (max-width: 860px) {
    .wp-block-cwks-resovia-lightbox-gallery.has-nested-images {
        grid-template-columns: repeat(3, minmax(0, 33.333%)); /* 3 kolumny po max 33.333% */
    }
}

@media (max-width: 600px) {
    .wp-block-cwks-resovia-lightbox-gallery.has-nested-images {
        grid-template-columns: repeat(2, minmax(0, 50%)); /* 2 kolumny po max 50% */
    }
}