/* ========================================= */
/* СТРАНИЦА "НОВОСТИ" */
/* ========================================= */

@import url('personal-data.css');

/* ========================================= */
/* ОСНОВНОЙ КОНТЕЙНЕР */
/* ========================================= */

.news-page {
    position: relative;
    width: 100%;
    min-height: 100vh;
    box-sizing: border-box;

    background-image: url('../Images/Promo_background2.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;

    padding: 180px 60px 80px 60px;
}

.news-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 1;
}

.news-page .personal-title,
.news-subtitle,
.news-grid,
.news-page .personal-back {
    position: relative;
    z-index: 2;
    max-width: 1700px;
    margin-left: auto;
    margin-right: auto;
}

/* Подзаголовок */
.news-subtitle {
    font-family: 'Oswald', sans-serif;
    font-size: 20px;
    font-weight: 300;
    color: #fff;
    text-align: center;
    letter-spacing: 0.5px;
    line-height: 1.5;
    margin: 0 auto 60px auto;
    display: block;
    max-width: 900px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}

/* ========================================= */
/* СЕТКА НОВОСТЕЙ */
/* ========================================= */

.news-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin-bottom: 50px;
}

/* Карточка новости */
.news-card {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 0;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.news-card:hover {
    transform: translateY(-5px);
}

/* Фото новости */
.news-image {
    width: 100%;
    aspect-ratio: 16 / 9;   /* было 4:3 — теперь шире, подходит для большинства фото */
    overflow: hidden;
    border-radius: 6px;
    background: #1a1a1a;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.5s ease;
}

.news-card:hover .news-image img {
    transform: scale(1.05);
}

/* Заголовок новости */
.news-title {
    font-family: 'Oswald', sans-serif;
    font-size: 20px;
    font-weight: 500;
    color: #fff;
    letter-spacing: 0.5px;
    line-height: 1.3;
    margin: 0;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}

/* Превью текста */
.news-text {
    font-family: 'Oswald', sans-serif;
    font-size: 14px;
    font-weight: 300;
    color: #d5dde5;
    letter-spacing: 0.3px;
    line-height: 1.6;
    margin: 0;
    text-align: justify;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}

/* ========================================= */
/* МОДАЛЬНОЕ ОКНО НОВОСТИ */
/* ========================================= */

.news-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    cursor: zoom-out;
    opacity: 0;
    transition: opacity 0.3s ease;
    overflow-y: auto;
}

.news-modal.is-open {
    display: flex;
    opacity: 1;
}

.news-modal-content {
    position: relative;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;

    background: rgba(20, 30, 45, 0.98);
    border: 1px solid rgba(131, 211, 255, 0.3);
    border-radius: 12px;
    padding: 50px 60px;

    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
    cursor: default;

    animation: modalOpen 0.3s ease;
}

@keyframes modalOpen {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.news-modal-close {
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 40px;
    color: #fff;
    background: none;
    border: none;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s ease, transform 0.3s ease;
}

.news-modal-close:hover {
    color: #83D3FF;
    transform: scale(1.2);
}

/* Текст внутри модального окна */
.news-modal-body h2 {
    font-family: 'Oswald', sans-serif;
    font-size: 26px;
    font-weight: 500;
    color: #fff;
    margin: 0 0 25px 0;
    letter-spacing: 0.5px;
    line-height: 1.3;
    padding-right: 40px;
}

.news-modal-body p {
    font-family: 'Oswald', sans-serif;
    font-size: 17px;
    color: #d5dde5;
    line-height: 1.7;
    margin: 0 0 18px 0;
    text-align: justify;
}

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

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

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

@media (max-width: 768px) {
    .news-page {
        padding: 120px 20px 60px 20px;
    }

    .news-subtitle {
        font-size: 16px;
        margin-bottom: 40px;
        padding: 0 10px;
    }

    .news-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .news-title {
        font-size: 18px;
    }

    .news-text {
        font-size: 14px;
    }

    .news-modal-content {
        padding: 40px 25px;
    }

    .news-modal-body h2 {
        font-size: 20px;
        padding-right: 30px;
    }

    .news-modal-body p {
        font-size: 15px;
    }

    .news-modal-close {
        font-size: 32px;
        top: 10px;
        right: 18px;
    }
}