/* ========================================
   style_news.css — Новости
   ======================================== */
   
body {
    background-color: #fafafc;
}

/* Шапка раздела новостей */
.news-header-section {
    width: 100%;
    max-width: 1115px;
    margin: 0 auto;
    padding: 140px 20px 40px;
    text-align: left;
    color: #000;
}

.news-page-title {
    font-family: "Inter-Bold", sans-serif;
    font-size: 36px;
    font-weight: 700;
    margin: 0 0 15px;
    color: #000000;
    text-shadow: none;
}

.news-page-subtitle {
    font-family: "Inter-Regular", sans-serif;
    font-size: 16px;
    max-width: 600px;
    margin: 0;
    color: #666;
    opacity: 1;
}

/* Контейнер новостей - сетка 2 колонки */
.news-container {
    max-width: 1115px;
    margin: 0 auto 80px;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

/* Сообщение "нет новостей" */
.no-news {
    text-align: center;
    font-size: 18px;
    color: #777;
    padding: 60px 20px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    grid-column: span 2;
}

/* Карточка новости */
.news-item {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    padding: 0;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.news-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border-color: #00a896;
}

.news-image-link {
    display: block;
    overflow: hidden;
    background: #f7f7fd;
    display: flex;
    justify-content: center;
    align-items: center;
    max-height: 200px;
}

.news-item-image {
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: contain;
    object-position: center;
    display: block;
    transition: transform 0.3s ease;
}

.news-item:hover .news-item-image {
    transform: scale(1.02);
}

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

.news-item-header {
    margin-bottom: 10px;
}

.news-date {
    font-family: "Inter-Regular", sans-serif;
    font-size: 12px;
    color: #00a896;
    margin-bottom: 8px;
    display: block;
}

.news-title {
    font-family: "Inter-Bold", sans-serif;
    font-size: 18px;
    margin: 0 0 10px;
    line-height: 1.3;
}

.news-title a {
    color: #000000;
    text-decoration: none;
    transition: color 0.3s;
}

.news-title a:hover {
    color: #00a896;
}

/* Описание */
.news-excerpt {
    font-family: "Inter-Regular", sans-serif;
    font-size: 14px;
    color: #555;
    line-height: 1.5;
    margin: 0 0 16px;
    flex: 1;
}

/* Кнопка "Читать далее" */
.btn-read-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: "Inter-Medium", sans-serif;
    font-size: 13px;
    color: #00a896;
    text-decoration: none;
    transition: all 0.3s;
    align-self: flex-start;
}

.btn-read-more:hover {
    color: #008a7a;
    gap: 12px;
}

.btn-read-more i {
    font-size: 11px;
}

/* ========================================
   Страница конкретной новости (news_view.php)
   ======================================== */

/* Контейнер новости */
.news-detail-container {
    max-width: 900px;
    margin: 140px auto 80px;
    padding: 40px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #e0e0e0;
}

/* Шапка новости */
.news-detail-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e7e8f3;
}

/* Заголовок новости */
.news-detail-title {
    font-family: "Inter-Bold", sans-serif;
    font-size: 32px;
    color: #000000;
    margin: 0 0 15px;
    line-height: 1.3;
}

/* Мета-информация */
.news-detail-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.news-detail-date {
    font-family: "Inter-Medium", sans-serif;
    font-size: 14px;
    color: #00a896;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Главное изображение */
.news-main-image-wrapper {
    margin: 25px 0;
    border-radius: 12px;
    overflow: hidden;
    background: #f7f7fd;
    display: flex;
    justify-content: center;
    align-items: center;
}

.news-main-image {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

/* Содержание новости */
.news-detail-content {
    font-family: "Inter-Light", sans-serif;
    font-size: 17px;
    line-height: 1.7;
    color: #333;
    margin: 25px 0;
    white-space: pre-wrap;
}

/* Галерея */
.news-gallery {
    margin: 35px 0;
    padding-top: 25px;
    border-top: 2px solid #e7e8f3;
}

.gallery-title {
    font-family: "Inter-Bold", sans-serif;
    font-size: 22px;
    color: #000000;
    margin: 0 0 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
}

.gallery-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    background: #f7f7fd;
    display: flex;
    justify-content: center;
    align-items: center;
    aspect-ratio: 4/3;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 168, 150, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-overlay i {
    color: white;
    font-size: 28px;
}

/* Кнопка назад */
.news-detail-footer {
    margin-top: 35px;
    padding-top: 25px;
    border-top: 2px solid #e7e8f3;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #00a896;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-family: "Inter-Medium", sans-serif;
    font-size: 14px;
    transition: background 0.3s, transform 0.2s;
}

.btn-back:hover {
    background: #008a7a;
    transform: translateX(-3px);
}

/* Лайтбокс */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 95%;
    max-height: 95%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: white;
    font-size: 48px;
    cursor: pointer;
    transition: color 0.3s;
    z-index: 2001;
}

.lightbox-close:hover {
    color: #ddd;
}

/* ========================================
   АДАПТИВНОСТЬ
   ======================================== */

/* Планшеты (до 900px) */
@media (max-width: 900px) {
    .news-header-section {
        padding: 120px 20px 30px;
    }
    
    .news-page-title {
        font-size: 30px;
    }
    
    .news-page-subtitle {
        font-size: 15px;
    }
    
    .news-container {
        padding: 0 15px;
        gap: 25px;
    }
    
    .news-image-link {
        max-height: 180px;
    }
    
    .news-item-image {
        max-height: 180px;
    }
    
    .news-item-content {
        padding: 18px;
    }
    
    .news-title {
        font-size: 17px;
    }
    
    .news-excerpt {
        font-size: 13px;
    }
    
    .news-detail-container {
        margin: 120px 20px 60px;
        padding: 30px;
    }
    
    .news-detail-title {
        font-size: 28px;
    }
    
    .news-main-image {
        max-height: 320px;
    }
    
    .news-detail-content {
        font-size: 16px;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

/* Мобильные телефоны (до 768px) - переключаем на 1 колонку */
@media (max-width: 768px) {
    .news-header-section {
        padding: 110px 15px 25px;
    }
    
    .news-page-title {
        font-size: 28px;
    }
    
    .news-container {
        padding: 0 12px;
        margin-bottom: 60px;
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .no-news {
        grid-column: span 1;
    }
    
    .news-image-link {
        max-height: 200px;
    }
    
    .news-item-image {
        max-height: 200px;
    }
    
    .news-item-content {
        padding: 16px;
    }
    
    .news-title {
        font-size: 18px;
        margin: 0 0 10px;
    }
    
    .news-excerpt {
        font-size: 13px;
        margin: 0 0 12px;
    }
    
    .news-detail-container {
        margin: 110px 15px 50px;
        padding: 20px;
    }
    
    .news-detail-title {
        font-size: 24px;
    }
    
    .news-main-image {
        max-height: 250px;
    }
    
    .news-detail-content {
        font-size: 15px;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 12px;
    }
    
    .gallery-title {
        font-size: 20px;
    }
}

/* Маленькие мобильные (до 480px) */
@media (max-width: 480px) {
    .news-header-section {
        padding: 100px 12px 20px;
    }
    
    .news-page-title {
        font-size: 24px;
    }
    
    .news-page-subtitle {
        font-size: 14px;
    }
    
    .news-container {
        padding: 0 10px;
        gap: 20px;
    }
    
    .news-image-link {
        max-height: 160px;
    }
    
    .news-item-image {
        max-height: 160px;
    }
    
    .news-item-content {
        padding: 14px;
    }
    
    .news-title {
        font-size: 16px;
        margin: 0 0 8px;
    }
    
    .news-excerpt {
        font-size: 12px;
        margin: 0 0 10px;
    }
    
    .btn-read-more {
        font-size: 12px;
    }
    
    .news-detail-container {
        margin: 100px 10px 40px;
        padding: 16px;
        border-radius: 16px;
    }
    
    .news-detail-title {
        font-size: 20px;
    }
    
    .news-detail-date {
        font-size: 12px;
    }
    
    .news-main-image {
        max-height: 200px;
    }
    
    .news-detail-content {
        font-size: 14px;
        line-height: 1.6;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }
    
    .gallery-title {
        font-size: 18px;
    }
    
    .btn-back {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .lightbox-close {
        font-size: 36px;
        right: 20px;
        top: 10px;
    }
}

/* Очень маленькие экраны (до 360px) */
@media (max-width: 360px) {
    .news-page-title {
        font-size: 22px;
    }
    
    .news-image-link {
        max-height: 140px;
    }
    
    .news-item-image {
        max-height: 140px;
    }
    
    .news-title {
        font-size: 15px;
    }
    
    .news-detail-title {
        font-size: 18px;
    }
    
    .news-main-image {
        max-height: 160px;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
    }
}