/**
 * Home — mobile & tablet only.
 * Design from new_design/components/home/home-content.tsx
 * Identical sizing: --gutter clamp(16px,4vw,32px), vc-radius-sm 6px, vc-radius-md 10px.
 */

:root {
  --home-gutter: clamp(12px, 3.5vw, 20px);
}

/* ========== Tablet & Mobile (max-width: 1024px) ========== */
@media (max-width: 1024px) {
    body .main-layout {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .home-page-container {
        display: flex !important;
        flex-direction: column;
        grid-template-columns: none !important;
        margin-left: 0 !important;
        padding: 0 0 calc(var(--bottom-bar-h, 64px) + env(safe-area-inset-bottom, 0px) + 24px) !important;
        gap: 0;
        min-height: auto;
        box-sizing: border-box;
        touch-action: pan-y;
        -webkit-overflow-scrolling: touch;
        overflow-x: hidden;
    }

    /* ── Шапка: главный баннер на всю ширину, ниже сетка 2×2 ── */
    .home-top-showcase {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 0;
        margin: 0;
    }

    .home-top-showcase__main-card {
        width: 100%;
        border-radius: 0;
        aspect-ratio: 16 / 9;
    }

    .home-top-showcase__main-card .home-top-showcase__image-wrap--main {
        border-radius: 0;
    }

    .home-top-showcase__right-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        grid-template-rows: auto auto !important;
        gap: 3px;
        width: 100%;
        height: auto;
        min-height: 0;
        background: #0b1020;
    }

    .home-top-showcase__small-card {
        aspect-ratio: 16 / 9;
        min-height: 0;
        border-radius: 0;
    }

    .home-top-showcase__overlay {
        left: clamp(12px, 3.5vw, 18px) !important;
        right: clamp(12px, 3.5vw, 18px) !important;
        bottom: clamp(12px, 3vw, 16px) !important;
    }

    .home-top-showcase__overlay--small {
        left: clamp(8px, 2.5vw, 12px) !important;
        right: clamp(8px, 2.5vw, 12px) !important;
        bottom: clamp(8px, 2.5vw, 12px) !important;
    }

    .home-top-showcase__title {
        font-size: clamp(20px, 5.5vw, 28px) !important;
        line-height: 1.12 !important;
    }

    .home-top-showcase__subtitle {
        max-width: 100% !important;
        font-size: clamp(12px, 3.2vw, 15px) !important;
    }

    .home-top-showcase__small-title {
        font-size: clamp(11px, 3vw, 14px) !important;
        line-height: 1.25 !important;
    }

    .home-top-showcase__top-badge {
        display: none !important;
    }

    .home-top-showcase__link {
        border-radius: 10px !important;
    }

    /* Основная колонка и сайдбар — с боковыми полями */
    .home-main-column {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
        padding: clamp(18px, 4vw, 22px) var(--home-gutter) 8px !important;
        gap: clamp(18px, 4vw, 24px);
        order: 1;
        overflow-x: hidden;
    }

    .home-news-section {
        max-width: 100%;
        min-width: 0;
    }

    .home-sidebar {
        order: 2;
        position: static !important;
        margin: 0 !important;
        padding: 8px var(--home-gutter) 0 !important;
        gap: 14px !important;
        width: 100%;
        max-width: 100%;
        min-width: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        grid-template-columns: 1fr !important;
        align-self: stretch;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }

    .home-sidebar > * {
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    /* Latest Community News: без лишней «коробки», только заголовок + карточка */
    .home-sidebar-community-news {
        padding: 0 !important;
        margin: 0 !important;
        background: none !important;
        border: none !important;
        box-shadow: none !important;
    }

    .home-sidebar-community-news .home-news-section__header {
        margin-bottom: 10px !important;
        padding-bottom: 0 !important;
        border-bottom: none !important;
    }

    .home-sidebar-community-news .home-news-card--community {
        max-width: 100%;
    }

    /* Секции: заголовок + полоска не наезжает на текст */
    .home-news-section__header {
        margin-bottom: 12px !important;
    }

    .home-news-section__title {
        display: flex !important;
        align-items: center !important;
        gap: 10px !important;
        line-height: 1.3 !important;
        font-size: clamp(14px, 3.8vw, 17px) !important;
        letter-spacing: 0.05em !important;
    }

    .home-news-section__title::before {
        width: 4px !important;
        min-width: 4px !important;
        height: 1.15em !important;
        min-height: 1em !important;
        flex-shrink: 0 !important;
        align-self: center !important;
        border-radius: 2px !important;
    }

    /* Сайдбар: тот же вид подзаголовка, что у Best Categories (перебиваем content: none с десктопа) */
    .home-sidebar-community-news .home-news-section__title {
        display: flex !important;
    }

    .home-sidebar-community-news .home-news-section__title::before {
        content: "" !important;
        display: block !important;
        width: 4px !important;
        min-width: 4px !important;
        height: 1.15em !important;
        min-height: 1em !important;
        flex-shrink: 0 !important;
        align-self: center !important;
        border-radius: 2px !important;
        background: linear-gradient(180deg, #d946ef 0%, #7c3aed 100%) !important;
    }

    /* Новости и вики: по 2 в ряд */
    .home-news-grid {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }

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

    /* На мобилке/планшете — максимум 4 вики-карточки в блоке */
    .home-wiki-grid .home-wiki-card:nth-child(n + 5) {
        display: none !important;
    }

    .home-news-card,
    .home-wiki-card {
        border-radius: 10px !important;
        border-color: #e4e7ec !important;
        box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    }

    .home-news-card__body {
        padding: 12px 12px 14px !important;
    }

    .home-news-card__date {
        font-size: 10px !important;
        margin-bottom: 6px !important;
        letter-spacing: 0.03em !important;
    }

    .home-news-card__title {
        font-size: clamp(12px, 3.4vw, 14px) !important;
        line-height: 1.3 !important;
        margin-bottom: 6px !important;
        -webkit-line-clamp: 2;
    }

    .home-news-card__desc {
        font-size: clamp(11px, 3vw, 13px) !important;
        line-height: 1.4 !important;
        margin-bottom: 10px !important;
        -webkit-line-clamp: 2;
    }

    .home-news-card__footer {
        flex-wrap: wrap;
        gap: 6px;
        align-items: center;
    }

    .home-news-card__views {
        gap: 0.4em !important;
    }

    .home-news-card__views,
    .home-news-card__read-more {
        font-size: 11px !important;
    }

    .home-wiki-card__body {
        padding: 6px 10px 8px !important;
    }

    .home-wiki-card__title {
        font-size: clamp(12px, 3.3vw, 14px) !important;
        line-height: 1.3 !important;
        white-space: nowrap !important;
        display: block !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        margin: 0 0 4px !important;
    }

    .home-wiki-card__divider {
        margin: 4px 0 6px !important;
    }

    .home-wiki-card__footer {
        flex-wrap: wrap;
        gap: 4px 6px;
        margin-top: 0 !important;
        padding-top: 0 !important;
    }

    .home-wiki-card__views {
        gap: 0.4em !important;
    }

    .home-wiki-card__views,
    .home-wiki-card__explore {
        font-size: 10px !important;
    }

    /* Сайдбар: компактные блоки; не вылезают за экран */
    .home-sidebar-block,
    .home-sidebar-stats {
        padding: 12px 14px !important;
        border-radius: 10px !important;
        box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06) !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        overflow-x: hidden;
    }

    .home-sidebar-stats__head {
        margin-bottom: 10px !important;
        padding-bottom: 8px !important;
    }

    .home-sidebar-stats__title {
        font-size: 12px !important;
        letter-spacing: 0.06em !important;
        line-height: 1.25 !important;
    }

    .home-news-card--community .home-news-card__body {
        padding: 12px 12px 14px !important;
    }

    .home-top-users {
        gap: 4px !important;
        max-width: 100%;
        min-width: 0;
    }

    .home-top-users__row {
        padding: 8px 4px !important;
        gap: 8px !important;
        border-bottom-style: solid !important;
        border-bottom-color: #eef1f6 !important;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    .home-quick-links {
        max-width: 100%;
        min-width: 0;
    }

    .home-quick-links__item {
        max-width: 100%;
        box-sizing: border-box;
    }

    .home-top-users__rank {
        font-size: 11px !important;
        min-width: 28px;
    }

    .home-top-users__avatar {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        min-height: 32px !important;
    }

    .home-top-users__name {
        font-size: 13px !important;
        min-width: 0;
    }

    .home-top-users__xp {
        font-size: 11px !important;
    }

    .home-sidebar-stats__grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 2px 10px !important;
    }

    .home-sidebar-stats__item {
        padding: 6px 0 !important;
        border-bottom: 1px solid #f1f5f9 !important;
    }

    .home-sidebar-stats__item:nth-last-child(-n + 2) {
        border-bottom: none !important;
    }

    .home-sidebar-stats__label {
        font-size: 12px !important;
    }

    .home-sidebar-stats__value {
        font-size: 14px !important;
    }

    .home-quick-links__item {
        padding: 10px 0 !important;
        font-size: 13px !important;
    }

    /* ── Welcome Banner: меньше закругление углов ── */
    .home-welcome-banner {
        padding: 16px 20px;
        border: 1px solid rgba(0, 0, 0, 0.06);
        border-radius: 6px;
    }

    .home-welcome-banner::before {
        height: 3px;
    }

    .home-welcome-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .home-welcome-left {
        gap: 12px;
    }

    .home-welcome-logo-badge {
        width: 48px;
        height: 48px;
        min-width: 48px;
        min-height: 48px;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .home-welcome-logo-icon {
        width: 28px;
        height: 28px;
    }

    .home-welcome-text h1 {
        font-size: 18px;
        font-weight: 800;
    }

    .home-welcome-text p {
        font-size: 13px;
        line-height: 1.5;
    }

    .home-welcome-right {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .home-btn-primary {
        padding: 8px 14px;
        font-size: 13px;
        border-radius: 8px;
    }

    .home-btn-primary i {
        font-size: 14px !important;
        line-height: 1 !important;
        width: auto !important;
        height: auto !important;
    }

    @media (max-width: 639px) {
        .home-welcome-right {
            display: none;
        }
    }

    /* ── Section Headers (design: icon 28–36px, title 16–22px) ── */
    .home-section-header {
        margin-bottom: 14px;
    }

    .home-section-title-row {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .home-section-icon {
        width: 36px;
        height: 36px;
        min-width: 36px;
        min-height: 36px;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    .home-section-icon i,
    .home-section-icon .fa,
    .home-section-icon .fas,
    .home-section-icon .home-section-icon-svg {
        font-size: 20px !important;
        line-height: 1 !important;
        width: 22px !important;
        height: 22px !important;
        min-width: 22px !important;
        min-height: 22px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .home-section-icon .home-section-icon-svg {
        display: block !important;
    }

    .home-section-title {
        font-size: 18px;
        font-weight: 700;
    }

    /* ── Latest News: 2 колонки как в newswire.php ── */
    .home-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: clamp(8px, 1vw, 16px);
    }

    .home-cards-grid .news-card-search {
        border-radius: 8px;
        border: 1px solid #cbd1e2;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }

    .home-cards-grid .news-card-search:hover {
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
        border-color: rgba(0, 0, 0, 0.06);
        transform: none;
    }

    .home-cards-grid .news-card-search:hover .news-image-search {
        transform: none;
    }

    .home-cards-grid .news-image-container-search {
        aspect-ratio: 16 / 9;
    }

    .home-cards-grid .news-content-search {
        padding: clamp(8px, 1vw, 14px);
        gap: 4px;
    }

    .home-cards-grid .news-date-search {
        font-size: 10px !important;
    }

    .home-cards-grid .news-stat-search {
        font-size: 11px;
        gap: 5px;
        background: none !important;
        padding: 0 !important;
    }

    .home-cards-grid .news-stat-search.likes {
        display: none !important;
    }

    .home-cards-grid .news-title-search {
        font-size: clamp(13px, 0.9vw, 15px);
        font-weight: 600;
        line-height: 1.35;
    }

    .home-cards-grid .news-description-search {
        font-size: clamp(11px, 0.66vw, 13px);
        line-height: 1.45;
    }

    .home-cards-grid .news-stat-search i {
        font-size: 11px !important;
        width: auto !important;
        height: auto !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        line-height: 1 !important;
    }

    .home-cards-grid .news-read-more {
        font-size: 12px;
    }

    .home-cards-grid .news-read-more::after {
        font-size: 12px;
    }

    .home-trending-grid .category-explore-link i,
    .category-container .cards-grid .category-explore-link i {
        font-size: 12px !important;
        width: auto !important;
        height: auto !important;
    }

    /* ── Trending Now (Wiki cards): 2 колонки, как новости — читаемый текст ── */
    /* Same styles for category page .cards-grid (wiki articles) */
    .home-trending-grid,
    .category-container .cards-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: clamp(8px, 1vw, 16px);
        overflow: visible;
    }

    .home-trending-grid .category-card-search,
    .category-container .cards-grid .category-card-search {
        border-radius: 8px;
        border: 1px solid #cbd1e2;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }

    .home-trending-grid .category-card-search:hover,
    .category-container .cards-grid .category-card-search:hover {
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
        border-color: rgba(0, 0, 0, 0.06);
        transform: none;
    }

    .home-trending-grid .category-card-search:hover .category-image-search,
    .category-container .cards-grid .category-card-search:hover .category-image-search {
        transform: none;
    }

    .home-trending-grid .category-image-container-search,
    .category-container .cards-grid .category-image-container-search {
        aspect-ratio: 16 / 9;
    }

    .home-trending-grid .category-content-search,
    .category-container .cards-grid .category-content-search {
        padding: 6px 12px 8px;
        gap: 4px;
    }

    .home-trending-grid .category-header-search,
    .category-container .cards-grid .category-header-search {
        gap: 6px;
    }

    .home-trending-grid .category-icon-search,
    .category-container .cards-grid .category-icon-search {
        width: 20px;
        height: 20px;
        min-width: 20px;
        min-height: 20px;
        border-radius: 4px;
        font-size: 10px;
    }

    .home-trending-grid .category-icon-search i,
    .category-container .cards-grid .category-icon-search i {
        font-size: 10px !important;
        width: auto !important;
        height: auto !important;
    }

    .home-trending-grid .category-title-search,
    .category-container .cards-grid .category-title-search {
        font-size: 14px;
        font-weight: 600;
        line-height: 1.35;
        -webkit-line-clamp: 2;
    }

    .home-trending-grid .category-footer-search,
    .category-container .cards-grid .category-footer-search {
        margin-top: 5px;
        padding-top: 6px;
        border-top: 1px solid rgba(0, 0, 0, 0.06);
    }

    .home-trending-grid .category-meta-info,
    .home-trending-grid .category-explore-link,
    .category-container .cards-grid .category-meta-info,
    .category-container .cards-grid .category-explore-link {
        font-size: 12px;
    }

    .home-trending-grid .category-meta-info,
    .category-container .cards-grid .category-meta-info {
        gap: 5px;
        padding: 0;
        background: none !important;
    }

    .home-trending-grid .category-meta-info i,
    .category-container .cards-grid .category-meta-info i {
        width: 10px;
        height: 10px;
        min-width: 10px;
        min-height: 10px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        line-height: 1;
    }

    /* ── Community Stats (design: p 10–16px, icon 28–38px, gap 6–10px) ── */
    .home-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .home-stat-card {
        padding: 14px 16px;
        border: 1px solid rgba(0, 0, 0, 0.06);
        border-radius: 10px;
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    .home-stat-card:hover {
        border-color: rgba(79, 110, 247, 0.4);
    }

    .home-stat-top-row {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .home-stat-icon {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    .home-stat-icon i,
    .home-stat-icon .fa,
    .home-stat-icon .fas,
    .home-stat-icon .home-stat-icon-svg {
        font-size: 20px !important;
        line-height: 1 !important;
        width: 22px !important;
        height: 22px !important;
        min-width: 22px !important;
        min-height: 22px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .home-stat-icon .home-stat-icon-svg {
        display: block !important;
    }

    .home-stat-value {
        font-size: 20px;
        font-weight: 800;
    }

    .home-stat-label {
        font-size: 13px;
    }

    /* ── Explore Vice Community (design: p 10–18px, icon 34–46px, gap 8–16px) ── */
    .home-nav-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .home-nav-link {
        display: flex;
        align-items: center;
        gap: 14px;
        padding: 14px 18px;
        border: 1px solid rgba(0, 0, 0, 0.06);
        border-radius: 10px;
        background: #fff;
        text-decoration: none;
        transition: none;
        width: 100%;
        box-sizing: border-box;
    }

    .home-nav-link:hover {
        transform: none;
    }

    .home-nav-icon {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    .home-nav-icon i,
    .home-nav-icon .fa,
    .home-nav-icon .fas,
    .home-nav-icon .home-nav-icon-svg {
        font-size: 22px !important;
        line-height: 1 !important;
        width: 24px !important;
        height: 24px !important;
        min-width: 24px !important;
        min-height: 24px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .home-nav-icon .home-nav-icon-svg {
        display: block !important;
    }

    .home-nav-text {
        flex: 1;
        min-width: 0;
    }

    .home-nav-title {
        font-size: 15px;
        font-weight: 600;
    }

    .home-nav-desc {
        font-size: 13px;
    }

    .home-nav-arrow {
        flex-shrink: 0;
    }

    .home-nav-arrow i,
    .home-nav-arrow .fa,
    .home-nav-arrow .fas,
    .home-nav-arrow .home-nav-arrow-svg {
        font-size: 18px !important;
        width: 20px !important;
        height: 20px !important;
        min-width: 20px !important;
        min-height: 20px !important;
    }

    .home-nav-arrow .home-nav-arrow-svg {
        display: block !important;
    }

    /* ── Sidebar (Top Users, Quick Links) ── */
    .home-sidebar-card {
        width: 100%;
        border: 1px solid rgba(0, 0, 0, 0.05);
        border-radius: 10px;
        overflow: hidden;
    }

    .home-sidebar-header {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 12px 16px;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }

    .home-sidebar-header i,
    .home-sidebar-header .fa,
    .home-sidebar-header .fas,
    .home-sidebar-header .home-sidebar-header-icon {
        font-size: 20px !important;
        line-height: 1 !important;
        width: 22px !important;
        height: 22px !important;
        min-width: 22px !important;
        min-height: 22px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .home-sidebar-header .home-sidebar-header-icon {
        display: block !important;
    }

    .home-sidebar-header span {
        font-size: 15px;
        font-weight: 600;
    }

    .home-sidebar-content {
        padding: 8px 12px 12px;
    }

    .home-contributor-row {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 10px 8px;
        border-radius: 6px;
    }

    .home-contributor-rank {
        width: 28px;
        height: 28px;
        min-width: 28px;
        min-height: 28px;
        font-size: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .home-contributor-avatar {
        width: 36px;
        height: 36px;
        min-width: 36px;
        min-height: 36px;
        border-radius: 50%;
    }

    .home-contributor-name {
        font-size: 14px;
    }

    .home-contributor-xp {
        font-size: 12px;
    }

    .home-quick-link {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 14px;
        border-radius: 6px;
    }

    .home-quick-link span {
        font-size: 14px;
    }

    .home-quick-link .home-quick-arrow i,
    .home-quick-link .home-quick-arrow .fa,
    .home-quick-link .home-quick-arrow .fas {
        font-size: 14px !important;
        width: auto !important;
        height: auto !important;
    }

    .home-ad-banner {
        width: 100%;
        min-height: 180px;
        border: 1px dashed #d1d5db;
        border-radius: 10px;
        padding: 24px;
        box-sizing: border-box;
        gap: 12px;
    }

    .home-ad-banner .home-ad-badge {
        font-size: 12px;
        padding: 6px 12px;
    }

    .home-ad-banner .home-ad-text {
        font-size: 14px;
    }

    .home-ad-banner .home-ad-subtext {
        font-size: 12px;
    }
}

/* ========== Tablet (641px–1024px) ── 2 col news, 3 col trending, 2 col nav ── */
@media (min-width: 641px) and (max-width: 1024px) {
    .home-welcome-right {
        display: flex !important;
    }

    .home-welcome-inner {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .home-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .home-trending-grid,
    .category-container .cards-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        overflow-x: visible;
        gap: 12px;
    }

    .home-trending-grid .category-card-search,
    .category-container .cards-grid .category-card-search {
        width: auto;
        min-width: 0;
    }

    .home-stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }

    .home-nav-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .home-show-all-stats-wrapper {
        display: none !important;
    }
}

/* ========== Mobile only (max-width: 640px) ── плотнее сетки legacy + stats ── */
@media (max-width: 640px) {
    .home-page-container {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .home-news-grid,
    .home-wiki-grid {
        gap: 8px !important;
    }

    .home-cards-grid,
    .home-trending-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    /* Legacy home grids: только 4 вики-карточки */
    .home-trending-grid .category-card-search:nth-child(n+5) {
        display: none !important;
    }

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

    .home-stat-card {
        padding: 14px 16px;
    }

    .home-stats-grid .home-stat-card.home-stat-hidden-mobile {
        display: none;
    }

    .home-stats-grid.home-stats-expanded .home-stat-card.home-stat-hidden-mobile {
        display: flex;
        flex-direction: column;
    }

    .home-show-all-stats-wrapper {
        display: block;
        margin-top: 10px;
    }

    .home-show-all-stats-btn {
        width: 100%;
        padding: 12px 16px;
        font-size: 14px;
        font-weight: 600;
        color: #4f6ef7;
        background: transparent;
        border: 1px solid rgba(79, 110, 247, 0.2);
        border-radius: 10px;
        cursor: pointer;
    }

    .home-show-all-stats-btn:hover {
        background: rgba(79, 110, 247, 0.04);
    }

    .home-stats-grid.home-stats-expanded + .home-show-all-stats-wrapper {
        display: none;
    }
}

/* Скрыть карточку Create Page на мобильных и планшетах */
@media (max-width: 1024px) {
    .home-nav-link--create {
        display: none !important;
    }
}

@media (min-width: 1025px) {
    .home-show-all-stats-wrapper {
        display: none !important;
    }
}
