/* calc/assets/css/home.css */

/* ==========================================================================
   АДАПТИВ ЗАГОЛОВКА: Split Header & Status Badge
   ========================================================================== */
.home-intro { 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    margin-bottom: 32px; 
    gap: 20px; 
}

.page-h1 { 
    font-size: 28px; 
    font-weight: 800; 
    color: var(--text-primary); 
    letter-spacing: -0.02em; 
    margin: 0;
}

.intro-badge {
    display: inline-flex; 
    align-items: center; 
    gap: 8px; 
    padding: 8px 14px; 
    background: #ffffff; 
    border: 1px solid #e5e7eb; 
    border-radius: 8px; 
    font-size: 14px; 
    font-weight: 500; 
    color: var(--text-secondary);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
    user-select: none; 
    flex-shrink: 0; 
}

.intro-badge i { 
    color: var(--text-secondary); 
    font-size: 18px; 
}

.intro-badge strong {
    color: var(--text-primary); 
    font-weight: 700;
}

@media (max-width: 640px) {
    .home-intro {
        flex-direction: column;
        align-items: flex-start; 
        gap: 12px;
        margin-bottom: 24px;
    }
    .page-h1 {
        font-size: 24px;
        line-height: 1.25;
    }
}

/* ==========================================================================
   PILL CLOUD: Строгий дизайн с цветными акцентами и анимацией
   ========================================================================== */
.pill-cloud-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 12px; 
    justify-content: flex-start;
    margin-bottom: 32px;
}

.action-pill {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 20px 8px 10px; 
    border-radius: 100px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14.5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s ease, border-color 0.3s ease;
    background: #ffffff;
    color: var(--text-primary); 
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.action-pill::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.6) 50%, rgba(255,255,255,0) 100%);
    transform: skewX(-20deg);
    transition: none;
    z-index: 1;
}

.action-pill:hover::after {
    animation: shimmer 0.7s forwards;
}

@keyframes shimmer {
    100% { left: 200%; }
}

.action-pill-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 15px;
    position: relative;
    z-index: 2;
    flex-shrink: 0;
}

.action-pill-text {
    position: relative;
    z-index: 2;
}

.action-pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.12);
    background: #f8fafc;
}

@keyframes pillEntrance {
    0% { opacity: 0; transform: translateY(15px); }
    100% { opacity: 1; transform: translateY(0); }
}

.animate-pill {
    opacity: 0;
    animation: pillEntrance 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* ИСПРАВЛЕНИЕ ДЛЯ ПИЛЮЛЬ НА МОБИЛЬНЫХ УСТРОЙСТВАХ */
@media (max-width: 768px) {
    .pill-cloud-wrapper {
        display: grid;
        grid-template-rows: repeat(2, auto); 
        grid-auto-flow: column; 
        grid-auto-columns: max-content; 
        overflow-x: auto;
        margin: 0 -20px 32px -20px; 
        padding: 4px 20px 16px 20px; 
        scroll-snap-type: x mandatory; 
        scrollbar-width: none;
        -ms-overflow-style: none;
        -webkit-overflow-scrolling: touch; 
        gap: 8px 10px;
    }
    
    .pill-cloud-wrapper::-webkit-scrollbar {
        display: none;
    }

    .pill-cloud-wrapper .action-pill {
        scroll-snap-align: start; 
        padding: 6px 16px 6px 8px;
        font-size: 13.5px;
        max-width: 280px; 
        white-space: normal; 
    }

    .pill-cloud-wrapper .action-pill-text {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        line-height: 1.25;
    }
    
    .pill-cloud-wrapper .action-pill-icon {
        width: 26px;
        height: 26px;
        font-size: 14px;
    }
}

/* ==========================================================================
   КАРТОЧКА-РАЗДЕЛИТЕЛЬ: Светлый премиум-баннер с супер-компактом для Мобайла
   ========================================================================== */
.service-separator-wrapper {
    margin-bottom: 32px;
    width: 100%;
}

.service-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 24px 32px;
    text-decoration: none;
    color: var(--text-primary);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}

.service-banner::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: var(--accent-blue);
    border-radius: 4px 0 0 4px;
}

.service-banner:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
    border-color: #cbd5e1;
}

.service-banner__content {
    display: flex;
    align-items: center;
    gap: 20px;
}

.service-banner__icon {
    width: 56px; 
    height: 56px;
    border-radius: 16px;
    background: #eff6ff;
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    flex-shrink: 0;
}

.service-banner__title {
    font-size: 20px;
    font-weight: 800;
    margin: 0 0 4px 0;
    color: var(--text-primary);
}

.service-banner__desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

.service-banner__cta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 15px;
    color: #2563eb;
    background: #eff6ff;
    padding: 10px 20px;
    border-radius: 12px;
    transition: background 0.2s;
    white-space: nowrap;
}

.service-banner:hover .service-banner__cta {
    background: #dbeafe;
}

@media (max-width: 640px) {
    .service-banner {
        flex-direction: column;
        align-items: stretch; 
        padding: 16px; 
        border-radius: 16px;
        gap: 16px;
    }
    
    .service-banner__content {
        gap: 12px; 
    }
    
    .service-banner__icon {
        width: 44px; 
        height: 44px;
        font-size: 22px;
        border-radius: 12px;
    }
    
    .service-banner__title {
        font-size: 16px; 
        margin-bottom: 2px;
    }
    
    .service-banner__desc {
        font-size: 13px;
        line-height: 1.35;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    .service-banner__cta {
        width: 100%;
        justify-content: center; 
        padding: 10px;
        font-size: 14px;
        border-radius: 10px;
    }
}

/* ==========================================================================
   Стили для блока последних статей на Главной (Рефакторинг 2026)
   ========================================================================== */
.latest-articles-section {
    margin-top: 0;
    margin-bottom: 0;
    padding-top: 80px;
    padding-bottom: 80px;
    border-top: none; /* Убрана линия */
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.section-title {
    font-size: 1.875rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    letter-spacing: -0.02em;
}

.view-all-link {
    color: #3b82f6;
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s;
}

.view-all-link:hover {
    color: #2563eb;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.home-article-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 24px;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%; /* Идеальное выравнивание карточек по высоте */
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.home-article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px -4px rgba(0, 0, 0, 0.08);
    border-color: #cbd5e1;
}

.home-article-card-badge {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    background: #eff6ff; /* Фон пилюли */
    color: #2563eb; /* Текст пилюли */
    font-size: 12px; /* Уменьшенный шрифт */
    font-weight: 700; /* Жирное начертание */
    padding: 6px 12px;
    border-radius: 999px; /* Скругление формы пилюли */
    text-transform: none; /* Убран капс */
    margin-bottom: 16px; /* Внутренний отступ от тега до заголовка */
}

.home-article-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 12px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Ограничение в 3 строки */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: normal;
    overflow-wrap: break-word;
}

.home-article-card-desc {
    font-size: 0.95rem;
    color: #475569;
    margin: 0 0 20px 0;
    flex-grow: 1; /* Выталкивает подвал вниз, заставляя его быть прибитым к краю */
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Ограничение в 3 строки */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: normal;
    overflow-wrap: break-word;
}

.home-article-card-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.875rem;
    color: #64748b;
    border-top: 1px solid #f1f5f9;
    padding-top: 16px;
    margin-top: auto; /* Жестко прибивает блок к низу */
}

.home-article-card-meta .meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

@media (max-width: 640px) {
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .latest-articles-section {
        padding-top: 40px; /* Отступы для мобильной версии */
        padding-bottom: 40px;
    }
}