/* ========================================
   СЕТКА МЕМОВ (2 колонки)
   ======================================== */

.taMemeGrid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

@media (max-width: 1200px) {
    .taMemeGrid {
        grid-template-columns: 1fr;
    }
}


/* ========================================
   КАРТОЧКА МЕМА
   ======================================== */

.taMemeCard {
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}


/* ========================================
   ШАПКА КАРТОЧКИ
   ======================================== */

.taMemeCard__header {
    padding: 15px;
    flex-shrink: 0;
}

.taMemeCard__author {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.taMemeCard__authorInfo {
    display: flex;
    flex-direction: column;
}

.taMemeCard__authorName {
    font-weight: 600;
    color: inherit;
    text-decoration: none;
}

.taMemeCard__authorName:hover {
    color: var(--theme-primary, #8BC34A);
}

.taMemeCard__date {
    font-size: 12px;
    color: var(--theme-text_light, #999);
}


/* ========================================
   ЗАГОЛОВОК (унифицирован с taNewsCard)
   ======================================== */

.taMemeCard__title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    text-transform: uppercase;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

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

.taMemeCard__title a:hover {
    color: var(--theme-primary, #8BC34A);
}

.taMemeCard__title .taBadge {
    vertical-align: middle;
    margin-right: 5px;
}


/* ========================================
   КОНТЕНТ (ИЗОБРАЖЕНИЕ) - ФИКСИРОВАННАЯ ВЫСОТА
   ======================================== */

.taMemeCard__content {
    position: relative;
    background: #1a1a1a;
    flex: 1;
}

.taMemeCard__imageWrapper {
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.taMemeCard__imageWrapper p {
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.taMemeCard__content img,
.taMemeCard__content .ipsImage {
    max-width: 100%;
    max-height: 100%;
    width: auto !important;
    height: auto !important;
    display: block;
    margin: 0 auto;
    object-fit: contain;
}

/* Скрываем текстовые описания внутри контента */
.taMemeCard__imageWrapper > *:not(p):not(img):not(a),
.taMemeCard__imageWrapper p ~ *,
.taMemeCard__imageWrapper > br,
.taMemeCard__imageWrapper > span,
.taMemeCard__imageWrapper > div:not(:has(img)) {
    display: none !important;
}

/* Скрываем текст, оставляем только картинки */
.taMemeCard__content .ipsType_richText,
.taMemeCard__content .ipsType_normal {
    font-size: 0;
    line-height: 0;
}

.taMemeCard__content .ipsType_richText img,
.taMemeCard__content .ipsType_normal img {
    font-size: 14px;
}


/* ========================================
   ПОДВАЛ (статистика и реакции)
   ======================================== */

.taMemeCard__footer {
    padding: 12px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid rgba(128, 128, 128, 0.15);
    flex-shrink: 0;
    margin-top: auto;
}

.taMemeCard__actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.taMemeCard__actions .ipsReact {
    opacity: 1 !important;
    visibility: visible !important;
}

.taMemeCard__actions .ipsReact_blurb {
    display: inline-flex !important;
    opacity: 1 !important;
}

.taMemeCard:hover .ipsReact {
    opacity: 1 !important;
}


/* ========================================
   АДАПТИВНОСТЬ
   ======================================== */

@media (max-width: 767px) {
    .taMemeCard {
        border-radius: 0;
    }
    
    .taMemeCard__header {
        padding: 12px;
    }
    
    .taMemeCard__title {
        font-size: 14px;
    }
    
    .taMemeCard__footer {
        padding: 10px 12px;
    }
    
    .taMemeCard__imageWrapper {
        height: 300px;
    }
}


/* ========================================
   ТЁМНАЯ ТЕМА
   ======================================== */

[data-theme="dark"] .taMemeCard__authorName,
[data-theme="dark"] .taMemeCard__title a {
    color: #e0e0e0;
}

[data-theme="dark"] .taMemeCard__footer {
    border-top-color: rgba(255, 255, 255, 0.1);
}