/* Стили для фронтенда */
.country-blocks-grid {
    margin: 2em 0;
}

.country-blocks-row {
    margin-bottom: 2em;
}

.country-blocks-row .wp-block-column {
    flex: 1;
}

.wp-block-gallery-country {
    margin: 0;
}

.wp-block-gallery-country .wp-block-image {
    margin: 0;
}

.wp-block-gallery-country figcaption {
    text-align: center;
    margin-top: 10px;
}

.wp-block-gallery-country figcaption h3 {
    margin: 0;
    font-size: 1.2em;
}

.wp-block-gallery-country figcaption a {
    text-decoration: none;
    color: inherit;
}

.wp-block-gallery-country figcaption a:hover {
    text-decoration: underline;
}

.wp-block-columns {
    align-items: normal !important;
    box-sizing: border-box;
    flex-wrap: wrap !important;
}

.wp-block-column {
    flex-grow: 1;
    min-width: 0;
    overflow-wrap: break-word;
    word-break: break-word;
}

figure.wp-block-gallery.has-nested-images {
    align-items: normal;
}

.wp-block-gallery.has-nested-images figure.wp-block-image {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: center;
    max-width: 100%;
    position: relative;
}

.wp-block-gallery.has-nested-images figure.wp-block-image:not(#individual-image) {
    margin: 0;
    width: calc(50% - var(--wp--style--unstable-gallery-gap, 16px) / 2);
}


.wp-block-gallery.has-nested-images.is-cropped figure.wp-block-image:not(#individual-image) {
    align-self: inherit;
}


.wp-block-gallery.has-nested-images figure.wp-block-image figcaption, .wp-block-gallery.has-nested-images figure.wp-block-image:has(figcaption):before {
    bottom: 0;
    left: 0;
    max-height: 100%;
    position: absolute;
    right: 0;
}

.wp-block-gallery.has-nested-images figure.wp-block-image:has(figcaption):before {
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    content: "";
    height: 100%;
    -webkit-mask-image: linear-gradient(0deg, #000 20%, #0000);
    mask-image: linear-gradient(0deg, #000 20%, #0000);
    max-height: 40%;
}

.wp-block-image img {
    box-sizing: border-box;
    height: auto;
    max-width: 100%;
    vertical-align: bottom;
}

.wp-block-gallery.has-nested-images figure.wp-block-image img {
    display: block;
    height: auto;
    max-width: 100% !important;
    width: auto;
}

.wp-block-gallery.has-nested-images.is-cropped figure.wp-block-image:not(#individual-image) a, .wp-block-gallery.has-nested-images.is-cropped figure.wp-block-image:not(#individual-image) img {
    flex: 1 0 0%;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.wp-block-gallery.has-nested-images figcaption {
    flex-basis: 100%;
    flex-grow: 1;
    text-align: center;
}

.wp-block-gallery.has-nested-images figure.wp-block-image figcaption, .wp-block-gallery.has-nested-images figure.wp-block-image:has(figcaption):before {
    bottom: 0;
    left: 0;
    max-height: 100%;
    position: absolute;
    right: 0;
}

.wp-block-gallery.has-nested-images figure.wp-block-image figcaption {
    background: linear-gradient(0deg, #0006, #0000);
    box-sizing: border-box;
    color: #fff;
    font-size: 13px;
    margin: 0;
    overflow: auto;
    padding: 1em;
    scrollbar-color: #0000 #0000;
    scrollbar-gutter: stable both-edges;
    scrollbar-width: thin;
    text-align: center;
    text-shadow: 0 0 1.5px #000;
    will-change: transform;
}

.wp-block-gallery.has-nested-images figure.wp-block-image figcaption a {
    color: inherit;
}

.wp-block-gallery.has-nested-images.is-cropped figure.wp-block-image:not(#individual-image) a, .wp-block-gallery.has-nested-images.is-cropped figure.wp-block-image:not(#individual-image) img {
    flex: 1 0 0%;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

/* Адаптивность */
@media (max-width: 768px) {
    .country-blocks-row {
        flex-direction: column;
    }
    
    .country-blocks-row .wp-block-column {
        margin-bottom: 1em;
    }
}

@media (min-width: 782px) {
    .wp-block-columns {
        flex-wrap: nowrap !important;
    }
    .wp-block-columns:not(.is-not-stacked-on-mobile)>.wp-block-column {
        flex-basis: 0;
        flex-grow: 1;
    }
}

@media (min-width: 600px) {
    .wp-block-gallery.has-nested-images.columns-default figure.wp-block-image:not(#individual-image) {
        width: calc(33.33% - var(--wp--style--unstable-gallery-gap, 16px) * .66667);
    }
    .wp-block-gallery.has-nested-images.columns-default figure.wp-block-image:not(#individual-image):first-child:last-child {
        width: 100%;
    }
}