/* --- Ссылки в статье (класс news-lightbox только на <a>) --- */
.entry-content a.news-lightbox {
    display: inline-block;
    line-height: 0;
    cursor: zoom-in;
    position: static;
    width: auto;
    height: auto;
    inset: auto;
    z-index: auto;
    padding: 0;
    background: none;
    border: none;
}

.entry-content a.news-lightbox img {
    display: block;
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}

.entry-content table.news-gallery img {
    max-width: 100%;
    height: auto;
}

body.news-lightbox-open {
    overflow: hidden;
}

/* --- Модальное окно (другой класс — без конфликта с ссылками) --- */
.news-lightbox-overlay[hidden] {
    display: none !important;
}

.news-lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.92);
    border: none;
    cursor: zoom-out;
}

.news-lightbox-overlay__figure {
    position: relative;
    margin: 0;
    padding: 0;
    cursor: default;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: min(800px, 100%);
    max-height: 100%;
}

.news-lightbox-overlay__image {
    display: block;
    max-width: min(800px, calc(100vw - 40px));
    max-height: calc(100vh - 40px);
    width: auto;
    height: auto;
    object-fit: contain;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

.news-lightbox-overlay__close {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 100001;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-family: inherit;
    font-size: 32px;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.news-lightbox-overlay__close:hover {
    background: rgba(255, 255, 255, 0.35);
}

.news-lightbox-overlay__close:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}
