/* === News & Articles Page — Habr-style 2-column grid === */

/* Hero */
.news-hero {
    padding: 100px 0 48px;
    text-align: center;
    background: rgba(15, 20, 25, 0.35);
    border-bottom: 2px solid var(--primary);
    position: relative;
    z-index: 1;
}

.news-hero-badge {
    display: inline-block;
    padding: 6px 18px;
    border: 1px solid rgba(0, 217, 126, 0.4);
    border-radius: 20px;
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    background: rgba(0, 217, 126, 0.08);
}

.news-hero h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.8rem;
}

.news-hero p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Grid section */
.news-grid-section {
    padding: 80px 0 80px;
    position: relative;
    overflow: visible;
}

.news-grid-section > .container {
    overflow: visible;
}

.news-grid-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 20, 25, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: -1;
}

/* 2-column grid */
.news-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    position: relative;
    z-index: 10;
    padding-top: 6px;
}

/* Article card */
.news-card {
    background: rgba(26, 31, 46, 0.7);
    border: 1px solid rgba(0, 217, 126, 0.12);
    border-radius: 16px;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 10;
}

.news-card:hover {
    border-color: rgba(0, 217, 126, 0.4);
    box-shadow: 0 0 30px rgba(0, 217, 126, 0.12), 0 8px 32px rgba(0, 0, 0, 0.4);
    transform: translateY(-4px);
    z-index: 20;
}

/* Card image */
.news-card-img {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: rgba(15, 20, 25, 0.6);
    position: relative;
    border-radius: 16px 16px 0 0;
}

.news-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
    pointer-events: none;
    -webkit-user-drag: none;
    user-select: none;
}

.news-card:hover .news-card-img img {
    transform: scale(1.05);
}

/* Video in card */
.news-card-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Placeholder when no image */
.news-card-img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(0, 217, 126, 0.08), rgba(26, 31, 46, 0.9));
    font-size: 3rem;
}

/* Card body */
.news-card-body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Meta: date, category, reading time */
.news-card-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.news-card-date {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.news-card-category {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(0, 217, 126, 0.1);
    color: var(--primary);
    border: 1px solid rgba(0, 217, 126, 0.25);
}

.news-card-reading {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Title */
.news-card-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    line-height: 1.4;
    transition: color 0.3s ease;
}

.news-card-title a {
    color: inherit;
    text-decoration: none;
}

.news-card:hover .news-card-title {
    color: var(--primary);
    text-shadow: 0 0 12px rgba(0, 217, 126, 0.4);
}

/* Excerpt */
.news-card-excerpt {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.7;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Tags */
.news-card-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.news-tag {
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Read more link */
.news-card-read {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    margin-top: 1rem;
    transition: gap 0.3s ease;
}

.news-card-read:hover {
    gap: 0.7rem;
}

.news-card-read::after {
    content: '→';
}

/* Responsive */
@media (max-width: 768px) {
    .news-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 1rem;
    }

    /* FIX: compensate for 2-row fixed header (~120px) */
    .news-hero {
        padding: 40px 0 36px;
    }

    .news-hero h1 {
        font-size: 1.8rem;
    }

    .news-hero p {
        font-size: 1rem;
        padding: 0 1rem;
    }

    .news-grid-section {
        padding: 40px 0 60px;
    }

    /* Disable hover lift on touch */
    .news-card:hover {
        transform: none;
    }

    .news-card-title {
        font-size: 1.1rem;
    }

    .news-card-body {
        padding: 1.25rem;
    }
}
