/* ========================================================
   СТРАНИЦА НОВОСТЕЙ
   News page layout, grid, cards
======================================================== */

.news-page {
    padding: 60px 0;
    background: #ffffff;
    min-height: calc(100vh - 200px);
}

/* ========================================================
   ЗАГОЛОВОК СТРАНИЦЫ
======================================================== */

.news-header {
    text-align: center;
    margin-bottom: 60px;
    padding: 40px 0;
    border-bottom: 2px solid var(--border-color);
}

.news-page-title {
    font-size: var(--font-size-6xl);
    font-weight: 900;
    color: var(--dark-bg);
    margin: 0 0 16px 0;
    text-transform: uppercase;
    letter-spacing: -1px;
}

.news-page-subtitle {
    font-size: var(--font-size-lg);
    color: #64748b;
    margin: 0;
    line-height: 1.6;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* ========================================================
   СЕТКА НОВОСТЕЙ (3 колонки)
======================================================== */

.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    margin-bottom: 60px;
}

/* ========================================================
   КАРТОЧКА НОВОСТИ
======================================================== */

.news-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: var(--shadow-sm);
    position: relative;
}

.news-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: transparent;
    transition: var(--transition);
    z-index: 1;
}

.news-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.news-card:hover::before {
    background: var(--primary);
}

.news-card:hover .news-card-image img {
    transform: scale(1.08);
}

/* ========================================================
   ИЗОБРАЖЕНИЕ НОВОСТИ
======================================================== */

.news-card-image {
    width: 100%;
    height: 240px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.news-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.news-card-image-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    color: #cbd5e1;
}

/* ========================================================
   СОДЕРЖАНИЕ КАРТОЧКИ
======================================================== */

.news-card-content {
    padding: 24px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background: #ffffff;
}

.news-card-date {
    font-size: var(--font-size-xs);
    color: var(--secondary);
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 12px;
    display: inline-block;
    background: rgba(234, 88, 12, 0.1);
    padding: 6px 12px;
    border-radius: 4px;
    width: fit-content;
    letter-spacing: 0.5px;
}

.news-card-title {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--dark-bg);
    margin: 0 0 12px 0;
    line-height: 1.4;
    transition: var(--transition);
    min-height: 56px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card:hover .news-card-title {
    color: var(--primary);
}

.news-card-excerpt {
    font-size: var(--font-size-sm);
    color: #64748b;
    margin: 0 0 16px 0;
    line-height: 1.6;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ========================================================
   КНОПКА "ЧИТАТЬ ПОЛНОСТЬЮ"
======================================================== */

.news-card-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
    font-size: var(--font-size-sm);
    transition: var(--transition);
    padding: 8px 0;
    border-bottom: 2px solid transparent;
    width: fit-content;
}

.news-card-link:hover {
    color: var(--secondary);
    border-bottom-color: var(--secondary);
    gap: 12px;
}

/* ========================================================
   ПУСТОЕ СОСТОЯНИЕ
======================================================== */

.news-empty {
    text-align: center;
    padding: 80px 40px;
    background: #f8fafc;
    border-radius: var(--radius);
    border: 2px dashed var(--border-color);
}

.news-empty p {
    font-size: var(--font-size-lg);
    color: #64748b;
    margin: 0;
}

/* ========================================================
   АДАПТИВНЫЕ СТИЛИ - ПЛАНШЕТ (768px - 1024px)
======================================================== */

@media (max-width: 1024px) {
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 32px;
    }

    .news-page-title {
        font-size: var(--font-size-5xl);
    }

    .news-header {
        margin-bottom: 48px;
        padding: 32px 0;
    }
}

/* ========================================================
   АДАПТИВНЫЕ СТИЛИ - МОБИЛЬНЫЙ (до 768px)
======================================================== */

@media (max-width: 768px) {
    .news-page {
        padding: 40px 0;
    }

    .news-header {
        margin-bottom: 40px;
        padding: 24px 0;
    }

    .news-page-title {
        font-size: var(--font-size-4xl);
        margin-bottom: 12px;
    }

    .news-page-subtitle {
        font-size: var(--font-size-base);
    }

    .news-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .news-card-image {
        height: 200px;
    }

    .news-card-content {
        padding: 20px;
    }

    .news-card-title {
        font-size: var(--font-size-base);
        min-height: 48px;
    }

    .news-card-excerpt {
        font-size: var(--font-size-sm);
        margin-bottom: 12px;
    }
}

/* ========================================================
   АДАПТИВНЫЕ СТИЛИ - МАЛЕНЬКИЙ МОБИЛЬНЫЙ (до 480px)
======================================================== */

@media (max-width: 480px) {
    .news-page {
        padding: 24px 0;
    }

    .news-header {
        margin-bottom: 32px;
        padding: 16px 0;
    }

    .news-page-title {
        font-size: var(--font-size-3xl);
        margin-bottom: 8px;
    }

    .news-page-subtitle {
        font-size: var(--font-size-sm);
    }

    .news-grid {
        gap: 16px;
    }

    .news-card-image {
        height: 160px;
    }

    .news-card-content {
        padding: 16px;
    }

    .news-card-date {
        font-size: var(--font-size-xs);
        padding: 4px 8px;
        margin-bottom: 8px;
    }

    .news-card-title {
        font-size: var(--font-size-sm);
        margin-bottom: 8px;
        min-height: auto;
    }

    .news-card-excerpt {
        font-size: var(--font-size-xs);
        margin-bottom: 8px;
        -webkit-line-clamp: 2;
    }

    .news-card-link {
        font-size: var(--font-size-xs);
    }
}

/* ========================================================
   ТАБЛИЦЫ НА СТРАНИЦЕ НОВОСТЕЙ (АДАПТИВНЫЕ)
======================================================== */

.news-page table {
    width: 100%;
    border-collapse: collapse;
    margin: 30px 0;
    background: white;
    box-shadow: var(--shadow-md);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.news-page table th,
.news-page table td {
    border: 1px solid var(--border-color);
    padding: 20px;
    text-align: center;
}

.news-page table th {
    background: #fdfdfd;
    text-align: left;
    font-weight: 700;
    font-size: var(--font-size-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.news-page table td {
    font-size: var(--font-size-sm);
    color: #475569;
}

.news-page table td:first-child {
    text-align: left;
    font-weight: 600;
    background: #f8fafc;
    color: var(--text-color);
}

.news-page table tbody tr {
    transition: var(--transition);
}

.news-page table tbody tr:hover {
    background: #f8fafc;
}

.news-page table tbody tr:last-child td {
    border-bottom: none;
}

/* Контейнер для таблицы с прокруткой (как на странице сравнения) */
.news-table-wrapper {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
    margin: 30px -20px;
    padding: 0 20px;
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}

.news-table-wrapper table {
    margin: 0;
    min-width: 100%;
}

/* Мобильный (до 768px) */
@media (max-width: 768px) {
    .news-table-wrapper {
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-x;
        margin: 20px -20px;
        padding: 0 20px;
        width: 100vw;
        position: relative;
        left: 50%;
        right: 50%;
        margin-left: -50vw;
        margin-right: -50vw;
    }

    .news-page table {
        font-size: 14px;
        min-width: 600px;
    }

    .news-page table th,
    .news-page table td {
        padding: 12px 8px;
    }

    .news-page table th {
        font-size: 11px;
    }
}

/* Маленький мобильный (до 480px) */
@media (max-width: 480px) {
    .news-table-wrapper {
        margin: 16px -16px;
        padding: 0 16px;
        width: 100vw;
        position: relative;
        left: 50%;
        right: 50%;
        margin-left: -50vw;
        margin-right: -50vw;
    }

    .news-page table {
        font-size: 12px;
        min-width: 500px;
    }

    .news-page table th,
    .news-page table td {
        padding: 10px 6px;
    }

    .news-page table th {
        font-size: 10px;
    }
}
