/* ============================================
   NEWS SECTION — Лента
   css/news.css
============================================ */

.news {
    padding: 0;
}

.news > .stack-card__surface {
    min-height: 100%;
    padding: 4rem 2rem;
    box-sizing: border-box;
    background-color: #0a0a0a;
    background-image:
        linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
    background-size: 60px 60px, 60px 60px;
    background-position: 0 0, 0 0;
}

/* ============================================
   СТАТИЧНЫЕ ЗАПИСИ — .news-item
   (fallback если telegram-feed не загрузился)
============================================ */
.news-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
    width: 100%;
}

.news-item {
    display: grid;
    grid-template-columns: 130px 1fr 110px;
    gap: 1.5rem;
    padding: 1.2rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    transition: background 0.3s;
    align-items: baseline;
}
.news-item:hover { background: rgba(255, 255, 255, 0.03); }

.news-item--link {
    text-decoration: none;
    display: grid;
    grid-template-columns: 130px 1fr 110px;
    gap: 1.5rem;
    padding: 1.2rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    color: inherit;
}

.news-date {
    font-family: 'Courier New', monospace;
    color: #666;
    font-size: 0.8rem;
}
.news-title    { font-weight: 600; color: #fff; }
.news-category {
    text-align: right;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(10, 0, 255, 0.8);
}

/* ============================================
   TELEGRAM FEED — карточки
============================================ */
.news-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: #0f0f0f;
    transition: border-color 0.3s, transform 0.3s;
    overflow: hidden;
}
.news-card:hover {
    border-color: rgba(10, 0, 255, 0.4);
    transform: translateY(-4px);
}

.news-card__photo {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background-size: cover;
    background-position: center;
    background-color: #1a1a1a;
}

.news-card__body {
    padding: 1rem 1.2rem 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.news-card__date {
    font-family: 'Terminus', 'Courier New', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #555;
}
.news-card__title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.35;
    margin: 0;
}
.news-card__desc {
    font-size: 0.8rem;
    color: #666;
    line-height: 1.5;
    margin: 0;
}

.news-loading {
    padding: 2rem 0;
    color: #444;
    font-size: 0.85rem;
    font-family: 'Terminus', monospace;
    letter-spacing: 0.1em;
    grid-column: 1 / -1;
}

/* Плей-иконка */
.news-card__play {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 48px; height: 48px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #fff;
    padding-left: 3px;
    pointer-events: none;
    transition: background 0.2s, border-color 0.2s;
}
.news-card--video:hover .news-card__play {
    background: rgba(10, 0, 255, 0.7);
    border-color: rgba(10, 0, 255, 0.9);
}

/* Карточка-ссылка на канал */
.news-card--channel {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    border: 1px solid rgba(10, 0, 255, 0.2);
    background: #0f0f0f;
}
.news-card--channel:hover {
    background: #12161c;
    border-color: rgba(10, 0, 255, 0.6);
}
.news-card__channel-inner {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}
.news-card__channel-icon {
    font-size: 2rem;
    color: rgba(10, 0, 255, 0.7);
    transition: transform 0.3s;
}
.news-card--channel:hover .news-card__channel-icon { transform: translateX(6px); }
.news-card__channel-label {
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #555;
    margin: 0;
}
.news-card__channel-name {
    font-size: 1rem;
    font-weight: 700;
    color: rgba(10, 0, 255, 0.8);
    margin: 0;
}

/* ============================================
   АДАПТИВ
============================================ */
@media (max-width: 768px) {
    .news {
        min-height: 100vh;
    }

    .news > .stack-card__surface {
        height: 100vh;
        min-height: 100vh;
        padding: 3rem 1.2rem 1rem;
        display: flex;
        flex-direction: column;
        gap: 1.2rem;
        overflow: hidden;
        transform: translateZ(0);
        backface-visibility: hidden;
        contain: paint;
    }

    .news-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        flex: 1 1 auto;
        min-height: 0;
        margin-top: 0;
        gap: 0.75rem;
        overflow: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-right: 0;
        align-content: start;
        transform: translateZ(0);
        backface-visibility: hidden;
    }

    .news-list::-webkit-scrollbar {
        display: none;
    }

    .news-item {
        grid-template-columns: 1fr;
        gap: 0.3rem;
    }
    .news-item--link {
        grid-template-columns: 1fr;
        gap: 0.3rem;
    }

    .news-card {
        display: grid;
        grid-template-rows: 58% 42%;
        aspect-ratio: 1 / 1;
        min-height: 0;
    }

    .news-card__photo {
        min-height: 0;
        height: 100%;
        aspect-ratio: auto;
        background-position: center;
    }

    .news-card__body {
        min-height: 0;
        padding: 0.85rem 0.95rem 0.95rem;
        gap: 0.22rem;
        overflow: hidden;
    }

    .news-card__date {
        font-size: 0.52rem;
        letter-spacing: 0.1em;
    }

    .news-card__title {
        font-size: 0.76rem;
        line-height: 1.2;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .news-card__desc {
        font-size: 0.62rem;
        line-height: 1.25;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .news-card--channel {
        aspect-ratio: 1 / 1;
        display: flex;
        min-height: 0;
    }

    .news-card__channel-inner {
        gap: 0.35rem;
        padding: 0.7rem;
    }

    .news-card__channel-icon {
        font-size: 1.5rem;
    }

    .news-card__channel-label {
        font-size: 0.6rem;
    }

    .news-card__channel-name {
        font-size: 0.88rem;
    }

    .news-category { text-align: left; }
}
