/* =========================================================
   TOP MODS MINECRAFT — карточки рейтинга
   Для классов: .topmesto .topcontent .topinfo
   .topversion .topversion2 .toplinck .topopis
   ========================================================= */

.topmesto {
    margin: 0 0 18px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #dfe6dc;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(35, 48, 37, .06);
}

.topcontent {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 390px;
    gap: 16px;
    align-items: center;
    min-width: 0;
}

.topinfo {
    min-width: 0;
    padding: 16px 0 14px 17px;
}

.topinfo h2 {
    margin: 0 0 12px;
    color: #2f3932;
    font-size: 19px;
    line-height: 1.3;
    font-weight: 700;
}

.topversion {
    margin: 0 0 13px;
    color: #59645b;
    font-size: 14px;
    line-height: 1.35;
    font-weight: 700;
}

.topversion > br {
    display: none;
    margin: 0;
}

.topversion2 {
    display: inline-flex;
    align-items: center;
    margin: 6px 5px 0 0;
    padding: 5px 9px;
    background: #f0f4ed;
    border: 1px solid #d2dfcd;
    border-radius: 7px;
    color: #4f6f43;
    font-size: 13px;
    line-height: 1;
    font-weight: 700;
    white-space: nowrap;
}

.toplinck {
    margin-top: 2px;
}

.toplinck a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 36px;
    padding: 0 12px;
    box-sizing: border-box;
    background: #5d7b50;
    border: 1px solid #526f47;
    border-radius: 7px;
    color: #fff !important;
    font-size: 14px;
    line-height: 1.2;
    font-weight: 700;
    text-decoration: none !important;
    transition: background .18s ease, border-color .18s ease, transform .18s ease;
}

.toplinck a:hover {
    background: #506c45;
    border-color: #48613e;
    color: #fff !important;
    text-decoration: none !important;
}

.toplinck a:active {
    transform: translateY(1px);
}

.toplinck .fa {
    flex: 0 0 auto;
    font-size: 14px;
}

.topcontent > img {
    display: block;
    width: 390px;
    max-width: calc(100% - 14px);
    height: 170px !important;
    margin: 14px 14px 14px 0;
    border-radius: 8px;
    object-fit: cover;
    object-position: center;
}

.topopis {
    padding: 13px 17px 15px;
    background: #fafcf9;
    border-top: 1px solid #edf1eb;
    color: #3c463f;
    font-size: 15px;
    line-height: 1.55;
}

/* Чтобы глобальное правило #dle-content img {height:auto} не ломало карточки */
#dle-content .topcontent > img {
    width: 390px;
    height: 170px !important;
    object-fit: cover;
}

/* Тёмная тема */
html[data-theme="dark"] .topmesto {
    background: #202722;
    border-color: #364139;
    box-shadow: none;
}

html[data-theme="dark"] .topinfo h2 {
    color: #eef3ef;
}

html[data-theme="dark"] .topversion {
    color: #b8c2ba;
}

html[data-theme="dark"] .topversion2 {
    background: #29332b;
    border-color: #405044;
    color: #b9d0ae;
}

html[data-theme="dark"] .topopis {
    background: #1c231e;
    border-color: #303a32;
    color: #d7dfd9;
}

html[data-theme="dark"] .toplinck a {
    background: #668756;
    border-color: #718f63;
}

/* Планшеты и телефоны */
@media (max-width: 760px) {
    .topmesto {
        margin-bottom: 14px;
        border-radius: 9px;
    }

    .topcontent {
        display: flex;
        flex-direction: column;
        gap: 0;
        align-items: stretch;
    }

    .topinfo {
        padding: 14px 14px 12px;
    }

    .topinfo h2 {
        margin-bottom: 10px;
        font-size: 17px;
    }

    .topversion {
        margin-bottom: 12px;
    }

    .topversion2 {
        margin-top: 5px;
        padding: 5px 8px;
        font-size: 12px;
    }

    .toplinck a {
        min-height: 36px;
        max-width: 100%;
        padding: 8px 11px;
    }

    .topcontent > img,
    #dle-content .topcontent > img {
        order: 2;
        width: calc(100% - 28px);
        max-width: none;
        height: auto !important;
        aspect-ratio: 390 / 170;
        margin: 0 14px 14px;
        object-fit: cover;
    }

    .topopis {
        padding: 12px 14px 14px;
        font-size: 14px;
        line-height: 1.5;
    }
}
