/* ──────────────────────────────────────────────
   gallery.css — стили галереи в новостях
   ────────────────────────────────────────────── */

/* Общий контейнер галереи */
.news-gallery {
    margin: 20px 0;
}

/* ── 1-2 фото рядом ────────────────────────── */
.gallery-small {
    display: block;
    margin: 10px 0;
}

/* Одно фото — на всю ширину */
.gallery-small img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    cursor: pointer;
    transition: opacity 0.2s;
    margin-bottom: 10px;
}
.gallery-small img:hover {
    opacity: 0.9;
}

/* Два фото — рядом через float */
.gallery-small.gallery-two img {
    float: left;
    width: calc(50% - 5px);
    max-width: calc(50% - 5px);
    height: auto;
    margin-right: 10px;
    margin-bottom: 10px;
}
.gallery-small.gallery-two img:last-child {
    margin-right: 0;
}
.gallery-small.gallery-two::after {
    content: '';
    display: table;
    clear: both;
}
.gallery-small img:hover {
    opacity: 0.9;
}

/* ── Карусель (3+ фото) ─────────────────────── */
.gallery-carousel {
    position: relative;
    width: 100%;
    user-select: none;
}

.gallery-track-wrap {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    background: #f5f5f5;
}

.gallery-track {
    display: flex;
    transition: transform 0.4s ease;
    will-change: transform;
}

.gallery-track img {
    flex: 0 0 100%;
    width: 100%;
    height: auto;
    max-height: 600px;
    object-fit: contain;
    cursor: pointer;
    display: block;
    background: #f5f5f5;
}

/* Стрелки */
.gallery-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(0,0,0,0.45);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    padding: 0;
}
.gallery-btn:hover {
    background: rgba(0,0,0,0.75);
}
.gallery-btn.prev { left: 10px; }
.gallery-btn.next { right: 10px; }

/* Точки */
.gallery-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}
.gallery-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background: #bbb;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s;
}
.gallery-dot.active,
.gallery-dot:hover {
    background: #476184;
}

/* ── Лайтбокс ───────────────────────────────── */
.gallery-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,0.92);
    align-items: center;
    justify-content: center;
}
.gallery-lightbox.open {
    display: flex;
}
.gallery-lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 4px 40px rgba(0,0,0,0.7);
}
.lightbox-close {
    position: absolute;
    top: 18px;
    right: 24px;
    background: none;
    border: none;
    color: #fff;
    font-size: 38px;
    cursor: pointer;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}
.lightbox-close:hover { opacity: 1; }

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.12);
    border: none;
    color: #fff;
    font-size: 48px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    padding: 0;
    line-height: 1;
}
.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255,255,255,0.25);
}
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }
