/* =========================================================
   BLOG / HOME
   Чистый файл: главная, карточки, ленты.
   Без временных *_fix / *_polish слоёв.
========================================================= */

.home-modern {
    max-width: 1240px;
    margin: 0 auto;
    padding: 22px 0 48px;
}

.home-top-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, .55fr);
    gap: 22px;
    align-items: stretch;
}

/* Hero как на удачном варианте */
.home-hero-card {
    position: relative;
    display: block;
    min-height: 460px;
    overflow: hidden;
    border-radius: 30px;
    background: #0f172a;
    color: #ffffff;
    text-decoration: none;
    box-shadow: 0 22px 60px rgba(15, 23, 42, .16);
}

.home-hero-card img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.01);
}

.home-hero-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(15, 23, 42, .08), rgba(15, 23, 42, .86)),
        linear-gradient(90deg, rgba(15, 23, 42, .62), rgba(15, 23, 42, .08));
}

.home-hero-content {
    position: absolute;
    inset: auto 0 0 0;
    z-index: 2;
    padding: 36px;
}

.home-pill {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 42px;
    padding: 0 17px;
    border-radius: 999px;
    background: #2f80ed;
    color: #ffffff;
    font-size: 14px;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: .035em;
    box-shadow: 0 12px 28px rgba(47, 128, 237, .30);
}

.home-hero-content h1 {
    max-width: 780px;
    margin: 20px 0 14px;
    color: #ffffff;
    font-size: clamp(42px, 6vw, 70px);
    line-height: .98;
    letter-spacing: -.06em;
    text-shadow: 0 3px 24px rgba(0, 0, 0, .42);
}

.home-hero-content p {
    max-width: 720px;
    margin: 0;
    color: rgba(255,255,255,.92);
    font-size: 20px;
    line-height: 1.5;
    text-shadow: 0 2px 18px rgba(0, 0, 0, .36);
}

.home-hero-bottom {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-top: 34px;
    color: rgba(255,255,255,.94);
    font-weight: 850;
}

.home-dots {
    margin-left: auto;
    display: inline-flex;
    gap: 7px;
}

.home-dots span {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: rgba(255,255,255,.36);
}

.home-dots span.active {
    width: 22px;
    border-radius: 999px;
    background: #ffffff;
}

/* Сегодня */
.home-today-card,
.home-section,
.home-list-card {
    background: rgba(255,255,255,.96);
    border: 1px solid #dfe7ef;
    border-radius: 30px;
    box-shadow: 0 16px 42px rgba(15, 23, 42, .07);
}

.home-today-card {
    padding: 26px;
}

.home-today-card h2,
.home-section-head h2,
.home-list-card h2 {
    margin: 0;
    color: #101827;
    font-weight: 950;
    letter-spacing: -.045em;
}

.home-today-card h2 {
    font-size: 34px;
    margin-bottom: 18px;
}

.home-today-list {
    display: grid;
    gap: 12px;
}

.home-today-item {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 78px;
    padding: 13px;
    border: 1px solid #e3edf7;
    border-radius: 22px;
    background: #f8fbff;
    color: #101827;
    text-decoration: none;
}

.home-icon {
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    background: #eef6ff;
    font-size: 25px;
}

.home-today-item strong,
.home-useful-card strong {
    display: block;
    color: #101827;
    font-size: 18px;
    font-weight: 950;
}

.home-today-item small,
.home-useful-card small {
    display: block;
    margin-top: 3px;
    color: #64748b;
    font-size: 14px;
    line-height: 1.25;
    font-weight: 750;
}

.home-card-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 18px;
    color: #2563eb;
    font-weight: 950;
    text-decoration: none;
}

/* Секции */
.home-section {
    margin-top: 26px;
    padding: 28px;
}

.home-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 20px;
}

.home-section-head h2 {
    font-size: clamp(34px, 4vw, 50px);
}

.home-section-head a {
    color: #2563eb;
    font-weight: 950;
    text-decoration: none;
}

.home-section-head--inside {
    margin-bottom: 16px;
}

.home-section-head--inside h2 {
    font-size: 28px;
}

.home-main-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.home-news-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 100%;
    border: 1px solid #e3edf7;
    border-radius: 24px;
    background: #ffffff;
    color: #101827;
    text-decoration: none;
    box-shadow: 0 10px 26px rgba(15,23,42,.04);
}

.home-news-image {
    aspect-ratio: 16 / 10;
    background: #eaf3ff;
    overflow: hidden;
}

.home-news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.home-image-fallback {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    color: #2563eb;
    font-weight: 950;
}

.home-news-body {
    padding: 16px;
}

.home-news-body h3 {
    margin: 0 0 8px;
    color: #101827;
    font-size: 20px;
    line-height: 1.12;
    letter-spacing: -.03em;
}

.home-news-body p {
    margin: 0;
    color: #64748b;
    font-size: 15px;
    line-height: 1.45;
}

.home-news-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    color: #64748b;
    font-weight: 800;
}

/* Полезное */
.home-useful-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
}

.home-useful-card {
    min-height: 150px;
    padding: 18px;
    border: 1px solid #e3edf7;
    border-radius: 24px;
    background: #f8fbff;
    color: #101827;
    text-decoration: none;
}

.home-useful-card span {
    display: inline-flex;
    width: 54px;
    height: 54px;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    border-radius: 18px;
    background: #eef6ff;
    font-size: 25px;
}

/* Низ */
.home-bottom-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
    margin-top: 26px;
}

.home-list-card {
    padding: 24px;
}

.home-list-row,
.home-event-row,
.home-social-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 0;
    border-top: 1px solid rgba(148,163,184,.20);
    color: #101827;
    text-decoration: none;
}

.home-list-row time {
    flex: 0 0 50px;
    color: #64748b;
    font-weight: 950;
}

.home-list-row strong,
.home-event-row strong,
.home-social-row strong {
    display: block;
    color: #101827;
    font-weight: 950;
}

.home-list-row small,
.home-event-row small,
.home-social-row small,
.home-muted {
    color: #64748b;
    font-weight: 750;
}

.home-list-row img {
    width: 64px;
    height: 54px;
    margin-left: auto;
    object-fit: cover;
    border-radius: 14px;
}

.home-date-box,
.home-social-row span {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: #eef6ff;
    color: #2563eb;
    font-weight: 950;
}

.home-event-row em {
    margin-left: auto;
    color: #2563eb;
    font-style: normal;
    font-weight: 950;
}

/* Post card fallback */
.post-card {
    background: #ffffff;
    border: 1px solid #dfe7ef;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 10px 28px rgba(15,23,42,.06);
}

.post-card a {
    color: inherit;
    text-decoration: none;
}

/* Dark mode */
body.portal-dark .home-today-card,
body.portal-dark .home-section,
body.portal-dark .home-list-card,
body.portal-dark .home-news-card,
body.portal-dark .home-today-item,
body.portal-dark .home-useful-card {
    background: #101b2d !important;
    border-color: rgba(148,163,184,.24) !important;
    color: #e8f0fb !important;
}

body.portal-dark .home-today-card h2,
body.portal-dark .home-section-head h2,
body.portal-dark .home-list-card h2,
body.portal-dark .home-news-body h3,
body.portal-dark .home-today-item strong,
body.portal-dark .home-useful-card strong,
body.portal-dark .home-list-row strong,
body.portal-dark .home-event-row strong,
body.portal-dark .home-social-row strong {
    color: #f8fbff !important;
}

body.portal-dark .home-news-body p,
body.portal-dark .home-today-item small,
body.portal-dark .home-useful-card small,
body.portal-dark .home-list-row small,
body.portal-dark .home-event-row small,
body.portal-dark .home-social-row small,
body.portal-dark .home-muted {
    color: #9fb0c7 !important;
}

/* Mobile */
@media (max-width: 980px) {
    .home-top-grid,
    .home-bottom-grid {
        grid-template-columns: 1fr;
    }

    .home-main-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .home-useful-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .home-modern {
        padding: 14px 0 34px;
    }

    .home-top-grid {
        gap: 24px;
    }

    .home-hero-card {
        min-height: 430px;
        border-radius: 28px;
    }

    .home-hero-content {
        padding: 26px 22px;
    }

    .home-pill {
        min-height: 38px;
        padding: 0 15px;
        font-size: 13px;
    }

    .home-hero-content h1 {
        font-size: 46px;
        line-height: 1;
        margin-top: 18px;
    }

    .home-hero-content p {
        display: -webkit-box;
        -webkit-line-clamp: 4;
        -webkit-box-orient: vertical;
        overflow: hidden;
        font-size: 19px;
        line-height: 1.48;
    }

    .home-hero-bottom {
        margin-top: 28px;
        gap: 14px;
        font-size: 15px;
    }

    .home-today-card,
    .home-section,
    .home-list-card {
        padding: 22px;
        border-radius: 28px;
    }

    .home-section-head h2,
    .home-today-card h2 {
        font-size: 34px;
    }

    .home-main-grid {
        display: flex;
        gap: 16px;
        overflow-x: auto;
        padding-bottom: 10px;
        scroll-snap-type: x mandatory;
    }

    .home-news-card {
        flex: 0 0 78vw;
        scroll-snap-align: start;
    }

    .home-useful-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .home-useful-card {
        min-height: 145px;
    }
}

@media (max-width: 420px) {
    .home-hero-content h1 {
        font-size: 42px;
    }

    .home-useful-grid {
        gap: 12px;
    }

    .home-useful-card {
        padding: 16px;
    }
}


/* =========================================================
   HOME RESTORE — старый аккуратный вид + красная плашка
   Держать в самом конце blog.css.
========================================================= */

.home-modern {
    max-width: 1240px !important;
    margin: 0 auto !important;
    padding: 22px 0 48px !important;
}

.home-top-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr) !important;
    gap: 22px !important;
    align-items: stretch !important;
}

.home-hero-card {
    position: relative !important;
    display: block !important;
    min-height: 430px !important;
    overflow: hidden !important;
    border-radius: 30px !important;
    background: #0f172a !important;
    color: #ffffff !important;
    text-decoration: none !important;
    box-shadow: 0 18px 48px rgba(15,23,42,.16) !important;
}

.home-hero-card img {
    position: absolute !important;
    inset: 0 !important;
    z-index: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    filter: saturate(1.04) contrast(1.04) brightness(.9) !important;
}

.home-hero-overlay {
    position: absolute !important;
    inset: 0 !important;
    z-index: 1 !important;
    background:
        linear-gradient(180deg, rgba(15,23,42,.12), rgba(15,23,42,.82)),
        linear-gradient(90deg, rgba(15,23,42,.68), rgba(15,23,42,.10)) !important;
}

.home-hero-content {
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 3 !important;
    padding: 34px !important;
}

.home-pill,
.np-hero-badge,
.home-hero-badge,
.hero-badge,
.featured-badge,
.main-hero-badge,
.np-hero .badge,
.home-hero .badge {
    display: inline-flex !important;
    align-items: center !important;
    width: fit-content !important;
    min-height: 42px !important;
    padding: 0 17px !important;
    border-radius: 999px !important;
    background: #ef3340 !important;
    color: #ffffff !important;
    box-shadow: 0 14px 32px rgba(239,51,64,.28) !important;
    font-size: 14px !important;
    font-weight: 950 !important;
    letter-spacing: .035em !important;
    text-transform: uppercase !important;
}

.home-hero-content h1 {
    max-width: 820px !important;
    margin: 20px 0 14px !important;
    color: #ffffff !important;
    font-size: clamp(42px, 6vw, 66px) !important;
    line-height: 1 !important;
    letter-spacing: -.055em !important;
    text-shadow: 0 3px 24px rgba(0,0,0,.44) !important;
}

.home-hero-content p {
    max-width: 720px !important;
    margin: 0 !important;
    color: rgba(255,255,255,.92) !important;
    font-size: 20px !important;
    font-weight: 450 !important;
    line-height: 1.5 !important;
    text-shadow: 0 2px 18px rgba(0,0,0,.30) !important;
}

.home-hero-bottom {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 16px !important;
    margin-top: 32px !important;
    color: rgba(255,255,255,.94) !important;
    font-weight: 850 !important;
}

.home-dots {
    margin-left: auto !important;
    display: inline-flex !important;
    gap: 7px !important;
}

.home-dots span {
    width: 9px !important;
    height: 9px !important;
    border-radius: 50% !important;
    background: rgba(255,255,255,.35) !important;
}

.home-dots span.active {
    width: 22px !important;
    border-radius: 999px !important;
    background: #ffffff !important;
}

.home-hero-card:not(:has(img)) {
    min-height: 360px !important;
    background:
        linear-gradient(135deg, #111827 0%, #0f172a 58%, #1f2937 100%) !important;
}

.home-hero-card:not(:has(img)) .home-hero-content {
    top: 0 !important;
    bottom: auto !important;
    min-height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
}

.home-today-card,
.home-section,
.home-list-card {
    background: rgba(255,255,255,.96) !important;
    border: 1px solid #dfe7ef !important;
    border-radius: 30px !important;
    box-shadow: 0 14px 38px rgba(15,23,42,.07) !important;
}

.home-today-card {
    padding: 30px !important;
}

.home-today-card h2,
.home-section-head h2,
.home-list-card h2 {
    margin: 0 !important;
    color: #101827 !important;
    font-size: clamp(30px, 4.8vw, 46px) !important;
    font-weight: 950 !important;
    line-height: 1.05 !important;
    letter-spacing: -.045em !important;
}

.home-section-head {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 14px !important;
    margin-bottom: 20px !important;
}

.home-section-head a,
.home-card-link {
    color: #2f80ed !important;
    font-weight: 900 !important;
    text-decoration: none !important;
}

.home-card-link:hover,
.home-section-head a:hover {
    color: #ef3340 !important;
}

.home-today-list {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 14px !important;
    margin-top: 22px !important;
}

.home-today-item {
    display: flex !important;
    align-items: center !important;
    gap: 14px !important;
    min-width: 0 !important;
    min-height: 94px !important;
    padding: 16px !important;
    border: 1px solid #e0e9f2 !important;
    border-radius: 22px !important;
    background: #f8fbff !important;
    color: inherit !important;
    text-decoration: none !important;
    box-shadow: none !important;
}

.home-today-item,
.home-today-item * {
    text-decoration: none !important;
}

.home-icon {
    flex: 0 0 54px !important;
    width: 54px !important;
    height: 54px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 18px !important;
    background: #eef6ff !important;
    font-size: 26px !important;
}

.home-today-item span:last-child {
    display: block !important;
    min-width: 0 !important;
}

.home-today-item strong {
    display: block !important;
    color: #101827 !important;
    font-size: 18px !important;
    font-weight: 950 !important;
    line-height: 1.18 !important;
    white-space: normal !important;
}

.home-today-item small {
    display: block !important;
    margin-top: 4px !important;
    color: #64748b !important;
    font-size: 14px !important;
    font-weight: 750 !important;
    line-height: 1.25 !important;
    white-space: normal !important;
}

.home-section {
    margin-top: 24px !important;
    padding: 30px !important;
}

.home-main-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 16px !important;
}

.home-news-card,
.home-useful-card,
.home-list-row,
.home-event-row,
.home-social-row {
    text-decoration: none !important;
    color: inherit !important;
}

.home-news-card {
    overflow: hidden !important;
    border: 1px solid #e0e9f2 !important;
    border-radius: 24px !important;
    background: #ffffff !important;
}

.home-news-image {
    height: 180px !important;
    overflow: hidden !important;
    background: #eef6ff !important;
}

.home-news-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

.home-news-body {
    padding: 16px !important;
}

.home-news-body h3 {
    margin: 0 0 8px !important;
    color: #101827 !important;
    font-size: 22px !important;
    font-weight: 950 !important;
    line-height: 1.12 !important;
}

.home-news-body p,
.home-news-meta {
    color: #64748b !important;
}

.home-useful-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 14px !important;
}

.home-useful-card {
    display: block !important;
    min-height: 130px !important;
    padding: 18px !important;
    border: 1px solid #e0e9f2 !important;
    border-radius: 22px !important;
    background: #f8fbff !important;
}

.home-useful-card span {
    display: inline-flex !important;
    width: 52px !important;
    height: 52px !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 18px !important;
    background: #eef6ff !important;
    font-size: 25px !important;
}

.home-useful-card strong {
    display: block !important;
    margin-top: 14px !important;
    color: #101827 !important;
    font-size: 19px !important;
    font-weight: 950 !important;
}

.home-useful-card small {
    display: block !important;
    margin-top: 4px !important;
    color: #64748b !important;
    font-size: 14px !important;
    line-height: 1.28 !important;
}

.home-news-card,
.home-today-item,
.home-useful-card,
.home-list-row,
.home-event-row,
.home-social-row {
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease !important;
}

.home-news-card:hover,
.home-today-item:hover,
.home-useful-card:hover,
.home-list-row:hover,
.home-event-row:hover,
.home-social-row:hover {
    transform: translateY(-1px) !important;
    border-color: rgba(239,51,64,.24) !important;
    box-shadow: 0 14px 32px rgba(15,23,42,.08) !important;
}

.np-hero {
    background: #0f172a !important;
}

.np-hero-shade {
    background:
        linear-gradient(180deg, rgba(15,23,42,.14), rgba(15,23,42,.82)),
        linear-gradient(90deg, rgba(15,23,42,.68), rgba(15,23,42,.10)) !important;
}

@media (max-width: 980px) {
    .home-top-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 760px) {
    .home-modern {
        padding: 14px 0 36px !important;
    }

    .home-hero-card {
        min-height: 430px !important;
        border-radius: 28px !important;
    }

    .home-hero-card:not(:has(img)) {
        min-height: 350px !important;
    }

    .home-hero-content {
        padding: 26px 22px !important;
    }

    .home-hero-content h1 {
        font-size: 44px !important;
        line-height: 1.02 !important;
        letter-spacing: -.05em !important;
    }

    .home-hero-content p {
        display: -webkit-box !important;
        -webkit-line-clamp: 4 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
        font-size: 19px !important;
        line-height: 1.48 !important;
    }

    .home-today-card,
    .home-section,
    .home-list-card {
        border-radius: 28px !important;
        padding: 22px !important;
    }

    .home-today-card h2,
    .home-section-head h2,
    .home-list-card h2 {
        font-size: 34px !important;
        line-height: 1.05 !important;
    }

    .home-today-list {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .home-today-item {
        min-height: 78px !important;
        padding: 14px !important;
    }

    .home-icon {
        width: 48px !important;
        height: 48px !important;
        flex-basis: 48px !important;
        font-size: 23px !important;
    }

    .home-main-grid {
        display: flex !important;
        gap: 16px !important;
        overflow-x: auto !important;
        padding-bottom: 10px !important;
        scroll-snap-type: x mandatory !important;
    }

    .home-news-card {
        flex: 0 0 78vw !important;
        scroll-snap-align: start !important;
    }

    .home-useful-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 420px) {
    .home-hero-content h1 {
        font-size: 39px !important;
    }

    .home-useful-grid {
        grid-template-columns: 1fr !important;
    }
}
