/* ============================================
   HOMEPAGE ARTICLE
   Блок статей главной страницы
   Version: 1.0.1
   Description: Сетка 4 колонки → 2 → 1, на основе блока турниров
   Dependencies: theme-vars.css, content-blocks.css, article-card.css
   ============================================ */

/* =============================================================
   1. КОНТЕЙНЕР БЛОКА
   ============================================================= */

.homepage-articles {
    padding: 24px;
}

.homepage-articles__inner {
    display: flex;
    flex-direction: column;
}

/* =============================================================
   2. ЗАГОЛОВОК СЕКЦИИ
   ============================================================= */

.homepage-articles__heading {
    font-family: var(--font-headings);
    font-size: var(--h2-size);
    font-weight: var(--font-bold);
    line-height: var(--h2-line-height);
    color: var(--text-primary);
    text-transform: uppercase;
    border-bottom: 3px solid var(--info);
    padding-bottom: var(--spacing-sm);
    margin: 0 !important;
    text-align: center;
}

/* =============================================================
   3. БЛОК ТЕГОВ
   ============================================================= */

.homepage-articles__topics {
    padding: var(--spacing-sm) 0 0;
}

.homepage-articles__topics .hero-hashtags-list {
    justify-content: center;
}

/* =============================================================
   4. СЕТКА СТАТЕЙ
   ============================================================= */

.homepage-articles__list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-md, 16px);
    align-items: stretch;
    padding-bottom: 14px;
}

.homepage-articles__item {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* =============================================================
   5. КАРТОЧКА СТАТЬИ ВНУТРИ БЛОКА
   ============================================================= */

.homepage-articles__item .article-card {
    --ha-card-bg: #1e1e2e;
    --ha-card-bg-hover: #252538;
    --ha-card-border: rgba(255, 255, 255, 0.08);
    --ha-card-border-hover: rgba(255, 255, 255, 0.14);
    --ha-card-title: #ffffff;
    --ha-card-text: #b0b0c8;
    --ha-card-radius: var(--radius-lg, 12px);
    --ha-card-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    --ha-card-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.25);

    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    background: var(--ha-card-bg);
    border: 1px solid var(--ha-card-border);
    border-radius: var(--ha-card-radius);
    overflow: hidden;
    box-shadow: var(--ha-card-shadow);
    transition: all 0.3s ease;
}

.homepage-articles__item .article-card:hover {
    background: var(--ha-card-bg-hover);
    border-color: var(--ha-card-border-hover);
    transform: translateY(-4px);
    box-shadow: var(--ha-card-shadow-hover);
}

.homepage-articles__item .article-card__image-link {
    display: block;
    flex-shrink: 0;
}

.homepage-articles__item .article-card__image-wrapper {
    position: relative;
    width: 100%;
    height: 170px;
    overflow: hidden;
    background: linear-gradient(135deg, #1e1e2e 0%, #2a2a3d 100%);
}

.homepage-articles__item .article-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.homepage-articles__item .article-card:hover .article-card__image {
    transform: scale(1.05);
}

.homepage-articles__item .article-card__body {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    text-align: center;
    align-items: center;
}

.homepage-articles__item .article-card__title {
    width: 100%;
    margin: 0 0 12px;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.35;
    flex-grow: 1;
}

.homepage-articles__item .article-card__title a {
    color: var(--ha-card-title);
    text-decoration: none;
    transition: color 0.25s ease;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.homepage-articles__item .article-card__title a:hover {
    color: var(--primary, #ffffff);
}

.homepage-articles__item .article-card__meta {
    width: 100%;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: center;
    align-items: center;
}

.homepage-articles__item .article-card__date {
    font-size: 12px;
    line-height: 1.3;
    color: var(--ha-card-text);
    font-weight: 500;
}

/* =============================================================
   6. ПУСТОЕ СОСТОЯНИЕ
   ============================================================= */

.homepage-articles__empty {
    padding: var(--spacing-xl) var(--spacing-lg);
    text-align: center;
    background: var(--bg-secondary, rgba(255, 255, 255, 0.04));
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: var(--font-base);
    line-height: var(--line-height-relaxed);
}

/* =============================================================
   7. КНОПКИ БЛОКА
   ============================================================= */

.homepage-articles__actions {
    display: flex;
    gap: var(--spacing-md);
    flex-wrap: wrap;
    justify-content: flex-start;
}

/* =============================================================
   8. АДАПТИВНОСТЬ
   ============================================================= */

@media (max-width: 1023px) {
    .homepage-articles__list {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .homepage-articles__heading {
        font-size: var(--h2-size-tablet, var(--h2-size));
    }

    .homepage-articles__actions {
        flex-direction: column;
    }

    .homepage-articles__actions .gt-button {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 767px) {
    .homepage-articles__list {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .homepage-articles__heading {
        font-size: var(--h2-size-mobile, var(--h2-size));
    }

    .homepage-articles__item .article-card__image-wrapper {
        height: 140px;
    }

    .homepage-articles__item .article-card__body {
        padding: 12px;
    }

    .homepage-articles__item .article-card__title {
        font-size: 14px;
        margin-bottom: 10px;
    }

    .homepage-articles__item .article-card__date {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .homepage-articles__list {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .homepage-articles__item .article-card__image-wrapper {
        height: 120px;
    }

    .homepage-articles__item .article-card__title {
        font-size: 13px;
        margin-bottom: 8px;
    }
}
