:root {
    --vk-overlay: rgba(17, 21, 25, 0.86);
    --vk-panel: #1f2328;
    --vk-border: rgba(255, 255, 255, 0.08);
    --vk-text: #e6e8eb;
    --vk-muted: #9aa3ad;
    --vk-accent: #4a76a8;
}

body.vk-gallery-open {
    overflow: hidden;
}

.vk-gallery-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--vk-overlay);
}

.vk-gallery-modal.is-open {
    display: flex;
}

.vk-gallery-dialog {
    width: min(1200px, 96vw);
    height: min(760px, 92vh);
    display: flex;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 22px 56px rgba(0, 0, 0, 0.5);
    position: relative;
}

.vk-gallery-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
}

.vk-gallery-left {
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: #000;
}

.vk-gallery-image-wrap {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 56px 16px 12px;
    position: relative;
    overflow: hidden;
}

.vk-gallery-image {
    display: block;
    width: auto !important;
    height: auto !important;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.vk-gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    border: none;
    background: transparent;
    color: #fff;
    font-size: 60px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.18s ease;
}

.vk-gallery-prev {
    left: 12px;
}

.vk-gallery-next {
    right: 12px;
}

.vk-gallery-fullscreen-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    font-size: 17px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.18s ease;
}

.vk-gallery-image-wrap:hover .vk-gallery-nav,
.vk-gallery-image-wrap:hover .vk-gallery-fullscreen-btn {
    opacity: 1;
    visibility: visible;
}

.vk-gallery-dialog:fullscreen .vk-gallery-nav,
.vk-gallery-dialog:fullscreen .vk-gallery-fullscreen-btn {
    opacity: 1;
    visibility: visible;
}

.gallery a,
.gallery img,
.wp-block-gallery a,
.wp-block-gallery img,
.blocks-gallery-grid a,
.blocks-gallery-grid img,
[id^="gallery-"] a,
[id^="gallery-"] img {
    cursor: pointer;
}

.vk-gallery-footer {
    border-top: 1px solid var(--vk-border);
    padding: 14px 18px;
    color: var(--vk-muted);
    background: #0f1113;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.vk-gallery-footer-actions {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.vk-gallery-counter {
    display: inline-block;
}

.vk-gallery-share-inline {
    position: relative;
}

.vk-gallery-share-main-btn {
    border: none;
    background: transparent;
    color: var(--vk-text);
    cursor: pointer;
    font-size: 14px;
    padding: 0;
}

.vk-gallery-share-main-btn:hover {
    color: #fff;
}

.vk-gallery-mobile-info-toggle {
    display: none;
    border: none;
    background: transparent;
    color: var(--vk-text);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.vk-gallery-share-menu {
    position: absolute;
    right: 0;
    bottom: 24px;
    min-width: 220px;
    background: #20252b;
    border: 1px solid var(--vk-border);
    border-radius: 8px;
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.42);
    padding: 6px;
    z-index: 3;
}

.vk-gallery-share-menu-item {
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    color: var(--vk-text);
    font-size: 13px;
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
}

.vk-gallery-share-menu-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.vk-gallery-comments-placeholder {
    margin-top: 16px;
    min-height: 120px;
    border-top: 1px solid var(--vk-border);
}

.vk-gallery-likes-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 6px 0 14px;
}

.vk-gallery-like-btn {
    border: none;
    background: transparent;
    color: var(--vk-muted);
    font-size: 22px;
    line-height: 1;
    padding: 0;
    cursor: pointer;
}

.vk-gallery-like-btn[aria-pressed="true"] {
    color: #ff4d67;
}

.vk-gallery-like-count {
    color: var(--vk-text);
    font-size: 14px;
}

.vk-gallery-post-excerpt {
    margin-top: 10px;
    color: var(--vk-muted);
    font-size: 14px;
    line-height: 1.45;
}

.vk-gallery-comments {
    margin-top: 14px;
    border-top: 1px solid var(--vk-border);
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-top: 12px;
}

.vk-gallery-comments-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-right: 4px;
}

.vk-gallery-comment-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 10px;
}

.vk-gallery-comment-author {
    font-size: 13px;
    font-weight: 700;
}

.vk-gallery-comment-date {
    font-size: 11px;
    color: var(--vk-muted);
    margin-top: 2px;
}

.vk-gallery-comment-text {
    font-size: 13px;
    line-height: 1.4;
    margin-top: 6px;
    color: var(--vk-text);
}

.vk-gallery-comments-empty {
    color: var(--vk-muted);
    font-size: 15px;
    line-height: 1.35;
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 16px;
}

.vk-gallery-comment-composer {
    margin-top: 12px;
    border-top: 1px solid var(--vk-border);
    padding-top: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.vk-gallery-composer-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex: 0 0 auto;
}

.vk-gallery-composer-avatar-fallback {
    background: #38424d;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

.vk-gallery-comment-input {
    border: none;
    background: transparent;
    color: var(--vk-text);
    width: 100%;
    outline: none;
    font-size: 14px;
    min-width: 0;
}

.vk-gallery-comment-input::placeholder {
    color: var(--vk-muted);
}

.vk-gallery-comment-input:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    font-size: 12px;
}

.vk-gallery-comment-input:disabled::placeholder {
    font-size: 12px;
}

.vk-gallery-comment-send-btn {
    border: none;
    background: transparent;
    color: #6ea4ff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.vk-gallery-comment-send-btn:disabled {
    opacity: 0.55;
    cursor: default;
}

.vk-gallery-right {
    width: 360px;
    border-left: 1px solid var(--vk-border);
    background: var(--vk-panel);
    color: var(--vk-text);
    display: flex;
    flex-direction: column;
    padding: 58px 18px 18px;
    overflow: hidden;
}

.vk-gallery-site {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
}

.vk-gallery-site-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.vk-gallery-site-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--vk-accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
}

.vk-gallery-site-icon-image {
    object-fit: cover;
    background: #1b1f24;
}

.vk-gallery-site-name {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.25;
}

.vk-gallery-post-time {
    color: var(--vk-muted);
    font-size: 12px;
}

.vk-gallery-page-title {
    margin: 0;
    font-size: 18px;
    line-height: 1.35;
    font-weight: 700;
}

@media (max-width: 920px) {
    .vk-gallery-dialog {
        height: 95vh;
    }

    .vk-gallery-right {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(360px, 88vw);
        border-left: 1px solid var(--vk-border);
        border-top: none;
        padding-top: 58px;
        z-index: 4;
        transform: translateX(100%);
        transition: transform 0.22s ease;
        box-shadow: -12px 0 28px rgba(0, 0, 0, 0.45);
    }

    .vk-gallery-modal.vk-mobile-panel-open .vk-gallery-right {
        transform: translateX(0);
    }

    .vk-gallery-image-wrap {
        padding-top: 56px;
    }

    .vk-gallery-mobile-info-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}
