.yarko-photo-gallery {
    padding-block: clamp(18px, 3.4vw, 42px);
}

.yarko-gallery-panel {
    container-type: inline-size;
    padding: clamp(16px, 3.5vw, 44px);
    border-radius: clamp(20px, 3vw, 32px);
    background: #eee5f6;
    color: var(--ink, #30233c);
}

.yarko-gallery-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px 30px;
    margin-block: 0 clamp(20px, 2.8vw, 34px);
}

.yarko-gallery-panel .yarko-gallery-kicker {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 8px;
    color: #64338c;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.yarko-gallery-kicker::before {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    background: var(--lime, #def099);
    box-shadow: inset 0 0 0 1px #748c2f;
    content: "";
    transform: rotate(45deg);
}

.yarko-gallery-panel .yarko-gallery-title {
    margin: 0;
    color: var(--ink, #30233c);
    font-size: clamp(31px, 4.3vw, 52px);
    line-height: 1.06;
    letter-spacing: -.045em;
}

.yarko-gallery-panel .yarko-gallery-intro {
    max-width: 300px;
    margin: 0;
    color: #564365;
    font-size: 13px;
    line-height: 1.65;
}

.wp-block-gallery.yarko-gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(8px, 1.25vw, 14px);
    margin: 0;
}

.yarko-gallery-grid > figure.wp-block-image {
    position: relative;
    display: block;
    width: 100% !important;
    min-width: 0;
    aspect-ratio: 4 / 3;
    margin: 0;
    overflow: hidden;
    border-radius: clamp(10px, 1.6vw, 19px);
    background: #dbcee6;
}

.yarko-gallery-grid > figure.wp-block-image img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 42%;
}

.yarko-gallery-grid:has(> figure.wp-block-image:nth-of-type(5):last-of-type) > figure.wp-block-image:first-child {
    grid-column: 1 / -1;
    aspect-ratio: 8 / 5;
}

.wp-block-gallery.yarko-gallery-grid > figure.wp-block-image figcaption {
    padding: 22px 10px 8px;
    background: linear-gradient(transparent, #251731e8);
    font-size: clamp(10px, 1.15vw, 13px);
    font-weight: 700;
    line-height: 1.25;
    text-align: left;
}

.wp-block-gallery.yarko-gallery-grid > figure.wp-block-image:has(figcaption)::before {
    content: none;
}

.yarko-photo-gallery .yarko-gallery-grid .wp-block-image button.lightbox-trigger {
    top: 5px;
    right: 5px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: transparent;
    opacity: 1;
}

.yarko-gallery-grid .lightbox-trigger::before {
    position: absolute;
    inset: 7px;
    border-radius: inherit;
    background: #392447e6;
    content: "";
}

.yarko-gallery-grid .lightbox-trigger svg {
    position: relative;
}

.yarko-photo-gallery .yarko-gallery-grid .wp-block-image button.lightbox-trigger:focus-visible {
    outline: 2px solid var(--lime, #def099);
    outline-offset: 2px;
}

.yarko-gallery-panel .yarko-gallery-hint {
    margin: 12px 0 0;
    color: #564365;
    font-size: 11px;
}

@container (min-width: 620px) {
    .wp-block-gallery.yarko-gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    }

    .wp-block-gallery.yarko-gallery-grid:has(> figure.wp-block-image:nth-of-type(5):last-of-type) {
        grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr));
    }

    .yarko-gallery-grid:has(> figure.wp-block-image:nth-of-type(5):last-of-type) > figure.wp-block-image:first-child {
        grid-column: 1;
        grid-row: span 2;
        aspect-ratio: auto;
    }
}
