.media-attachments {
    margin-top: 24px;
}

.media-attachments__title {
    margin-bottom: 4px;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.media-grid__item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    cursor: pointer;
    background: var(--main-blue-secondary__10);
    aspect-ratio: 1 / 1;
   /* max-height: 76vh;*/
}

.media-grid__thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.media-grid__item:hover .media-grid__thumb {
    transform: scale(1.04);
}

/* Ховер-оверлей для фото */
.media-grid__overlay {
    position: absolute;
    inset: 0;
    background: rgba(11, 43, 90, 0);
    transition: background 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.media-grid__item:hover .media-grid__overlay {
    background: rgba(11, 43, 90, 0.35);
}

.media-grid__overlay-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.media-grid__item:hover .media-grid__overlay-icon {
    opacity: 1;
    transform: scale(1);
}

.media-grid__overlay-icon svg {
    width: 20px;
    height: 20px;
    fill: var(--main-blue-dark, #0b2b5a);
}

.media-grid__more-badge {
    position: absolute;
    inset: 0;
    background: rgba(11, 43, 90, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    border-radius: 12px;
    pointer-events: none;
}

.media-grid__video-wrap {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
}

.media-grid__video-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.media-grid__video-wrap video {
    max-height: 100%;
    width: 100%;
    object-fit: cover;
}

.media-grid__play-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.media-grid__play-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.media-grid__item:hover .media-grid__play-circle {
    transform: scale(1.1);
}

.media-grid__play-circle svg {
    width: 18px;
    height: 18px;
    fill: var(--main-blue-dark);
    margin-left: 2px;
}

.neo-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.neo-lightbox.is-open {
    opacity: 1;
    pointer-events: all;
}

.neo-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 16, 38, 0.92);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.neo-lightbox__wrap {
   position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: 92vw;
    max-width: 1400px; /* Увеличьте с 1100px */
    height: 92vh; /* Добавьте */
    max-height: 92vh;
}

.neo-lightbox__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0 12px 0;
    flex-shrink: 0;
}

.neo-lightbox__counter {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--main-blue-secondary);
    letter-spacing: 0.04em;
}

.neo-lightbox__close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    /*background: rgba(255, 255, 255, 0.12);*/
    background: var(--main-blue-dark__80);
    border: 1px solid var(--main-blue-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

.neo-lightbox__close:hover {
    background: var(--main-blue-secondary__10);
}

.neo-lightbox__close svg {
    width: 16px;
    height: 16px;
    stroke: white;
    stroke-width: 2;
    fill: none;
}

.neo-lightbox__stage {
      flex: 1;
    min-height: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    overflow: hidden; /* Добавьте */
}

.neo-lightbox__slide {
    display: none;
    width: 100%;
  height: 100%;  align-items: center;
    justify-content: center;
    animation-duration: 0.2s;
    animation-fill-mode: both;
}

.neo-lightbox__slide.is-active {
    display: flex;
}

.neo-lightbox__img {
    max-width: 100%;
    max-height: 76vh;
    object-fit: contain;
    border-radius: 12px;
    display: block;
}

.neo-lightbox__video-wrap {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.neo-lightbox__video-wrap .news-neo-video {
   width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.neo-lightbox__video-wrap video {
   width: auto !important;
    height: auto !important;
    max-width: 100%;
    max-height: 100%;
    display: block;
    border-radius: 12px;
    object-fit: contain;
    margin: auto; /* Центрирование со всех сторон */
}

.neo-lightbox__btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--main-blue-dark__80);
    border: 1px solid var(--main-blue-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 2;
    flex-shrink: 0;
}

.neo-lightbox__btn:hover {
    background: rgba(255, 255, 255, 0.24);
}

.neo-lightbox__btn--prev {
    left: -60px;
}

.neo-lightbox__btn--next {
    right: -60px;
}

.neo-lightbox__btn svg {
    width: 20px;
    height: 20px;
    stroke: white;
    stroke-width: 2.2;
    fill: none;
}

.neo-lightbox__btn:disabled {
    opacity: 0.25;
    pointer-events: none;
}

.neo-lightbox--single .neo-lightbox__btn {
    display: none;
}

.neo-lightbox__strip {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    justify-content: center;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
    flex-shrink: 0;
}

.neo-lightbox__strip::-webkit-scrollbar {
    display: none;
}

.neo-lightbox__thumb {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;
    border: 2px solid transparent;
    transition: border-color 0.2s, opacity 0.2s;
    opacity: 0.55;
    position: relative;
    background: rgba(255, 255, 255, 0.08);
}

.neo-lightbox__thumb.is-active {
    border-color: var(--main-blue-secondary);
    opacity: 1;
}

.neo-lightbox__thumb img,
.neo-lightbox__thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

.neo-lightbox__thumb-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.neo-lightbox__thumb-play svg {
    width: 14px;
    height: 14px;
    fill: white;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.5));
}

@keyframes lb-slide-in-right {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes lb-slide-in-left {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.neo-lightbox__slide.anim-right {
    animation-name: lb-slide-in-right;
}

.neo-lightbox__slide.anim-left {
    animation-name: lb-slide-in-left;
}


@media (max-width: 1200px) {
    .media-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .media-grid__item {
        max-height: 160px;
    }


    .neo-lightbox__btn--prev {
        left: -48px;
    }

    .neo-lightbox__btn--next {
        right: -48px;
    }
}

@media (max-width: 768px) {
    .media-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    .media-attachments {
        margin-top: 16px;
    }

    .media-attachments__title {
        margin-bottom: 10px;
    }

    .media-grid__item {
        max-height: 140px;
        aspect-ratio: 1 / 1;
    }

    .media-grid__overlay-icon {
        width: 32px;
        height: 32px;
    }

    .media-grid__overlay-icon svg {
        width: 16px;
        height: 16px;
    }

    .media-grid__play-circle {
        width: 32px;
        height: 32px;
    }

    .media-grid__play-circle svg {
        width: 14px;
        height: 14px;
    }

    .media-grid__more-badge {
        font-size: 1rem;
    }

    /* === ИСПРАВЛЕНИЯ ДЛЯ МОБИЛЬНОГО LIGHTBOX === */
    
    .neo-lightbox__wrap {
        width: 100vw;
        max-width: 100vw;
        height: 100dvh; /* Добавьте */
        max-height: 100dvh;
        padding: 12px;
        box-sizing: border-box;
    }

    .neo-lightbox__stage {
        flex: 1;
        min-height: 0;
        overflow: hidden;
    }

    .neo-lightbox__slide {
        /* Уберите max-height: 60vh; */
        width: 100%;
        height: 100%;
        display: none;
        align-items: center;
        justify-content: center;
    }

    .neo-lightbox__slide.is-active {
        display: flex;
    }

    .neo-lightbox__video-wrap {
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
    }

    .neo-lightbox__video-wrap .news-neo-video {
        width: 100%;
        height: 100%;
        max-height: 100%;
    }

    .neo-lightbox__video-wrap video {
        width: auto !important;
        height: auto !important;
        max-width: 100%;
        max-height: 100%;
        margin: auto;
    }

    .neo-lightbox__img {
        max-width: 100%;
        max-height: 100%; /* Было 76vh */
        border-radius: 8px;
    }
    .neo-player{
height: unset !important;
    }

    .neo-lightbox__video-wrap,
    .neo-lightbox__video-wrap .news-neo-video,
    .neo-lightbox__video-wrap video {
        border-radius: 8px;
    }

    /* Кнопки навигации */
    .neo-lightbox__btn--prev {
        left: 4px;
        background: var(--main-blue-dark__80);
        z-index: 3;
        width: 36px;
        height: 36px;
    }

    .neo-lightbox__btn--next {
        right: 4px;
        background: var(--main-blue-dark__80);
        z-index: 3;
        width: 36px;
        height: 36px;
    }

    .neo-lightbox__strip {
        margin-top: 8px;
        gap: 6px;
    }

    .neo-lightbox__thumb {
        width: 40px;
        height: 40px;
    }

    .neo-lightbox__header {
        padding-bottom: 8px;
    }

    .neo-lightbox__close {
        width: 32px;
        height: 32px;
    }
}