/* ============================================
   СЕКЦИЯ НОВОСТЕЙ
============================================ */

.news-section {
    padding: 60px 0;
}

.news-subtitle {
    font-size: 24px;
    color: var(--black);
    text-align: center;
    margin-top: 12px;
    margin-bottom: 50px;
    font-weight: 300;
}

/* Карусель */
.news-carousel-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    margin-bottom: 40px;
}

.news-arrow {
    flex-shrink: 0;
    width: 84px;
    height: 84px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s, visibility 0.2s;
}

.news-arrow img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.news-arrow.disabled {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Сетка — 3 колонки */
.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    flex: 1;
    max-width: 1200px;
    transition: opacity 0.4s ease;
}

/* Карточка */
.news-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
}

.news-card-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
    background: #f5f5f5;
}

@supports not (aspect-ratio: 16/9) {
    .news-card-image {
        height: 200px;
    }
}

.news-card-content {
    padding: 20px 20px 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.news-card-date {
    font-size: 14px;
    color: #999;
    margin-bottom: 12px;
}

.news-card-title {
    font-size: 22px;
    font-weight: 500;
    color: var(--black);
    margin-bottom: 15px;
    line-height: 1.3;
}

.news-card-excerpt {
    font-size: 16px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 20px;
    flex: 1;
}

.news-card-link {
    color: var(--red);
    font-size: 15px;
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: gap 0.2s ease;
}

.news-card-link:hover {
    text-decoration: underline;
    gap: 10px;
}

/* Пагинация */
.news-pagination {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
}

.news-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ccc;
    cursor: pointer;
    transition: background 0.2s;
}

.news-dot.active {
    background: var(--red);
}

.news-dot:hover {
    background: var(--red);
    opacity: 0.7;
}

.news-loader {
    text-align: center;
    padding: 30px;
    font-size: 18px;
    color: var(--black);
}

/* ============================================
   МОДАЛЬНОЕ ОКНО
============================================ */

.news-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    overflow-y: auto;
    padding: 40px 20px;
}

.news-modal.active {
    display: flex;
}

.news-modal-content {
    background: #fff;
    max-width: 1200px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    border-radius: 0;
}

.news-modal-close {
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 40px;
    cursor: pointer;
    color: #fff;
    background: rgba(0,0,0,0.5);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    z-index: 20;
    transition: background 0.2s;
    line-height: 1;
}

.news-modal-close:hover {
    background: var(--red);
    color: #fff;
}

.news-gallery {
    position: relative;
    background: #1a1a1a;
}

.gallery-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
}

#galleryMainImg {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    font-size: 30px;
    cursor: pointer;
    width: 45px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 15;
}

.gallery-nav:hover {
    background: rgba(0,0,0,0.8);
}

.gallery-prev {
    left: 10px;
}

.gallery-next {
    right: 10px;
}

.gallery-thumbnails {
    position: absolute;
    bottom: 15px;
    left: 0;
    right: 0;
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    padding: 10px;
    z-index: 15;
}

.thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid white;
    transition: border-color 0.2s, opacity 0.2s;
    opacity: 0.7;
}

.thumbnail.active {
    border-color: var(--red);
    opacity: 1;
}

.thumbnail:hover {
    opacity: 1;
}

.news-modal-body {
    padding: 30px 35px 40px;
}

.news-modal-date {
    font-size: 14px;
    color: #999;
    margin-bottom: 12px;
}

.news-modal-title {
    font-size: 32px;
    color: var(--black);
    font-weight: 500;
    margin-bottom: 25px;
    line-height: 1.3;
}

.news-modal-text {
    font-size: 16px;
    color: #444;
    line-height: 1.6;
}

.news-modal-text p {
    margin-bottom: 15px;
}

/* ============================================
   АДАПТИВ
============================================ */

@media (max-width: 1024px) and (min-width: 769px) {
    .news-grid {
        gap: 20px;
    }
    .news-card-title {
        font-size: 20px;
    }
    .news-arrow {
        width: 60px;
        height: 60px;
    }
}

@media (max-width: 768px) {
    .news-section {
        padding: 40px 0;
    }
    .news-subtitle {
        font-size: 18px;
        margin-bottom: 30px;
    }
    .news-carousel-wrapper {
        gap: 15px;
    }
    .news-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .news-arrow {
        width: 40px;
        height: 40px;
    }
    .news-card-title {
        font-size: 18px;
    }
    .news-card-excerpt {
        font-size: 14px;
    }
    .gallery-nav {
        width: 35px;
        height: 60px;
        font-size: 24px;
    }
    .thumbnail {
        width: 45px;
        height: 45px;
    }
    .news-modal-title {
        font-size: 24px;
    }
    .news-modal-body {
        padding: 20px;
    }
    .news-modal-close {
        top: 10px;
        right: 10px;
        width: 35px;
        height: 35px;
        font-size: 30px;
    }
}

@media (max-width: 480px) {
    .news-card-content {
        padding: 15px;
    }
    .news-card-title {
        font-size: 17px;
    }
    .thumbnail {
        width: 40px;
        height: 40px;
    }
}