/* ==========================================
   My Wiki — home page UI v1
   Главная страница /wiki/
========================================== */

:root {
    --wiki-home-blue: #1565c0;
    --wiki-home-blue-dark: #0d47a1;
    --wiki-home-blue-soft: #e8f0fe;
    --wiki-home-text: #242424;
    --wiki-home-muted: #666;
    --wiki-home-border: #e4e7ec;
    --wiki-home-bg: #f6f8fb;
    --wiki-home-card: #ffffff;
    --wiki-home-radius: 18px;
    --wiki-home-shadow: 0 14px 40px rgba(15, 35, 70, .08);
}

.wiki-home,
.wiki-home * {
    box-sizing: border-box;
}

.wiki-home {
    max-width: 1500px;
    margin: 0 auto 50px;
    padding: 0 20px;
    color: var(--wiki-home-text);
}

.wiki-home a {
    color: inherit;
}

/* ==========================================
   HERO
========================================== */

.wiki-home-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 30px;
    align-items: end;
    margin: 26px 0 18px;
    padding: 34px;
    border-radius: 26px;
    background:
        radial-gradient(circle at top left, rgba(21, 101, 192, .18), transparent 34%),
        linear-gradient(135deg, #ffffff 0%, #f3f7ff 100%);
    border: 1px solid var(--wiki-home-border);
    box-shadow: var(--wiki-home-shadow);
}

.wiki-home-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: var(--wiki-home-blue);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .02em;
}

.wiki-home-title {
    margin: 0;
    font-size: clamp(34px, 4vw, 56px);
    line-height: 1.04;
    letter-spacing: -.03em;
}

.wiki-home-lead {
    max-width: 760px;
    margin: 16px 0 0;
    color: var(--wiki-home-muted);
    font-size: 18px;
    line-height: 1.65;
}

.wiki-home-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(92px, 1fr));
    gap: 10px;
    min-width: 320px;
}

.wiki-home-stat {
    padding: 16px 14px;
    border-radius: 18px;
    background: rgba(255,255,255,.78);
    border: 1px solid rgba(21, 101, 192, .12);
    text-align: center;
}

.wiki-home-stat strong {
    display: block;
    color: var(--wiki-home-blue);
    font-size: 28px;
    line-height: 1;
}

.wiki-home-stat span {
    display: block;
    margin-top: 7px;
    color: var(--wiki-home-muted);
    font-size: 13px;
}

/* ==========================================
   SEARCH
========================================== */

.wiki-home-search-section {
    position: relative;
    z-index: 80;
    margin: 18px 0 30px;
}

.wiki-home-search-card {
    padding: 22px;
    border-radius: var(--wiki-home-radius);
    background: var(--wiki-home-card);
    border: 1px solid var(--wiki-home-border);
    box-shadow: var(--wiki-home-shadow);
}

.wiki-home-search-title {
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 700;
    color: var(--wiki-home-muted);
}

.wiki-home-search .mywiki-search-wrapper,
.wiki-home-search .mywiki-search-box {
    width: 100%;
    max-width: none;
    margin: 0;
}

.wiki-home-search .mywiki-search-results {
    z-index: 90;
}

/* Header menu is always above home search. */
body .site-header,
body .header,
body #header,
body .site-navigation,
body .main-navigation,
body #main-navigation,
body .navigation {
    position: relative;
    z-index: 10000 !important;
}

body .site-header .sub-menu,
body .header .sub-menu,
body .site-navigation .sub-menu,
body .main-navigation .sub-menu,
body #main-navigation .sub-menu,
body .menu-item-has-children > .sub-menu {
    z-index: 10010 !important;
}

/* ==========================================
   MAIN GRID
========================================== */

.wiki-home-main-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 30px;
    align-items: start;
}

.wiki-home-main-column,
.wiki-home-side-column {
    min-width: 0;
}

.wiki-home-section,
.wiki-home-widget {
    margin-bottom: 26px;
    padding: 24px;
    border-radius: var(--wiki-home-radius);
    background: var(--wiki-home-card);
    border: 1px solid var(--wiki-home-border);
    box-shadow: 0 10px 30px rgba(15, 35, 70, .045);
}

.wiki-home-section-head {
    margin-bottom: 18px;
}

.wiki-home-section-head h2,
.wiki-home-widget-title {
    margin: 0;
    font-size: 24px;
    line-height: 1.2;
}

.wiki-home-widget-title {
    font-size: 18px;
    padding-bottom: 14px;
    margin-bottom: 14px;
    border-bottom: 2px solid var(--wiki-home-blue);
}

.wiki-home-section-head p {
    margin: 8px 0 0;
    color: var(--wiki-home-muted);
    line-height: 1.6;
}

/* ==========================================
   TOPIC CARDS
========================================== */

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

.wiki-home-topic-card {
    min-width: 0;
    border: 1px solid var(--wiki-home-border);
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
}

.wiki-home-topic-main {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 18px;
    text-decoration: none;
    background: #fbfcff;
    transition: background .16s, color .16s;
}

.wiki-home-topic-main:hover {
    background: var(--wiki-home-blue-soft);
}

.wiki-home-topic-name {
    min-width: 0;
    font-weight: 800;
    color: var(--wiki-home-text);
    overflow-wrap: anywhere;
}

.wiki-home-topic-count {
    flex: 0 0 auto;
    color: var(--wiki-home-blue);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.wiki-home-topic-children {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 14px 18px 16px;
    border-top: 1px solid var(--wiki-home-border);
}

.wiki-home-topic-children a {
    display: inline-flex;
    padding: 5px 9px;
    border-radius: 999px;
    background: var(--wiki-home-blue-soft);
    color: var(--wiki-home-blue);
    text-decoration: none;
    font-size: 12px;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.wiki-home-topic-children a:hover {
    background: var(--wiki-home-blue);
    color: #fff;
}

/* ==========================================
   ARTICLE LISTS
========================================== */

.wiki-home-article-list-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.wiki-home-article-card,
.wiki-home-recent-item,
.wiki-home-link-list a {
    text-decoration: none;
}

.wiki-home-article-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    border-radius: 14px;
    background: #fbfcff;
    border: 1px solid var(--wiki-home-border);
    transition: background .16s, border-color .16s, transform .16s;
}

.wiki-home-article-card:hover {
    background: var(--wiki-home-blue-soft);
    border-color: rgba(21, 101, 192, .25);
    transform: translateY(-1px);
}

.wiki-home-article-title {
    color: var(--wiki-home-text);
    font-weight: 700;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.wiki-home-article-meta {
    color: var(--wiki-home-muted);
    font-size: 13px;
}

.wiki-home-recent-list,
.wiki-home-link-list {
    display: grid;
    gap: 8px;
}

.wiki-home-recent-item,
.wiki-home-link-list a {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid var(--wiki-home-border);
}

.wiki-home-recent-item:last-child,
.wiki-home-link-list a:last-child {
    border-bottom: 0;
}

.wiki-home-recent-item span,
.wiki-home-link-list span {
    min-width: 0;
    color: var(--wiki-home-text);
    font-weight: 600;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.wiki-home-recent-item small,
.wiki-home-link-list small {
    flex: 0 0 auto;
    color: var(--wiki-home-muted);
    font-size: 12px;
}

.wiki-home-recent-item:hover span,
.wiki-home-link-list a:hover span {
    color: var(--wiki-home-blue);
}

/* ==========================================
   TAGS + CONTENT
========================================== */

.wiki-home-tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.wiki-home-tag-cloud a {
    display: inline-flex;
    padding: 5px 10px;
    border-radius: 999px;
    background: var(--wiki-home-blue-soft);
    color: var(--wiki-home-blue);
    text-decoration: none;
    font-size: 13px;
    line-height: 1.3;
}

.wiki-home-tag-cloud a:hover {
    background: var(--wiki-home-blue);
    color: #fff;
}

.wiki-home-content-body {
    font-size: 16px;
    line-height: 1.75;
    color: var(--wiki-home-text);
    overflow-wrap: anywhere;
}

.wiki-home-content-body > *:first-child {
    margin-top: 0;
}

.wiki-home-content-body > *:last-child {
    margin-bottom: 0;
}

.wiki-home-empty {
    padding: 16px;
    border-radius: 14px;
    background: #f8f8f8;
    color: #888;
    font-size: 14px;
}

/* ==========================================
   TABLET / MOBILE
========================================== */

@media (max-width: 1100px) {
    .wiki-home-hero {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .wiki-home-stats {
        width: 100%;
        min-width: 0;
    }

    .wiki-home-main-grid {
        grid-template-columns: 1fr;
    }

    .wiki-home-side-column {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 18px;
    }

    .wiki-home-side-column .wiki-home-widget:first-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 760px) {
    .wiki-home {
        padding: 0 12px 36px;
    }

    .wiki-home-hero {
        margin-top: 18px;
        padding: 24px 18px;
        border-radius: 20px;
    }

    .wiki-home-lead {
        font-size: 16px;
    }

    .wiki-home-stats,
    .wiki-home-topic-grid,
    .wiki-home-article-list-cards,
    .wiki-home-side-column {
        grid-template-columns: 1fr;
    }

    .wiki-home-search-card,
    .wiki-home-section,
    .wiki-home-widget {
        padding: 18px;
        border-radius: 16px;
    }

    .wiki-home-search-section {
        margin-bottom: 22px;
    }

    .wiki-home-topic-main,
    .wiki-home-recent-item,
    .wiki-home-link-list a {
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .wiki-home-title {
        font-size: 34px;
    }

    .wiki-home-stat strong {
        font-size: 24px;
    }

    .wiki-home-section-head h2 {
        font-size: 22px;
    }

    .wiki-home-topic-main {
        flex-direction: column;
        align-items: flex-start;
    }

    .wiki-home-topic-count {
        white-space: normal;
    }
}
