/**
 * Top Posts — компактные карточки (виджет Recent Posts, режим by_ids).
 * Подключается на всех страницах фронта; селекторы с #secondary перебивают style.css.
 */

/* Заголовок Top Posts: flex-ряд (полоска + текст), серая линия — border-bottom блока */
#secondary .widget_posts_wrap .widgettitle,
#secondary .widget_posts_wrap h3.widget-title,
#secondary .widget_posts_wrap h4.widgettitle,
.sidebar#secondary .widget_posts_wrap .widgettitle,
.sidebar#secondary .widget_posts_wrap h3.widget-title,
.sidebar#secondary .widget_posts_wrap h4.widgettitle {
	display: flex;
	align-items: center;
	flex-wrap: nowrap;
	gap: 11px;
	box-sizing: border-box;
	background: transparent !important;
	color: #222 !important;
	font-weight: 600;
	line-height: 1.25;
	margin-top: 0 !important;
	margin-bottom: 10px;
	padding: 10px 0 8px !important;
	border: none !important;
	border-left: none !important;
	border-bottom: 1px solid #e5e5e5;
	position: relative;
}

/* Красная полоска ≈ высота текста, по центру с span; не stretch, не до серой линии */
#secondary .widget_posts_wrap .widgettitle::before,
#secondary .widget_posts_wrap h3.widget-title::before,
#secondary .widget_posts_wrap h4.widgettitle::before,
.sidebar#secondary .widget_posts_wrap .widgettitle::before,
.sidebar#secondary .widget_posts_wrap h4.widgettitle::before {
	content: "" !important;
	display: block !important;
	flex: 0 0 auto;
	align-self: center !important;
	width: 4px !important;
	height: 1.2em !important;
	max-height: 1.2em;
	min-height: 0;
	margin: 0 !important;
	padding: 0 !important;
	border: none !important;
	border-top: none !important;
	border-bottom: none !important;
	background: #c22 !important;
	position: static !important;
	top: auto !important;
	right: auto !important;
	bottom: auto !important;
	left: auto !important;
	z-index: auto;
}

#secondary .widget_posts_wrap .widgettitle > span,
#secondary .widget_posts_wrap h3.widget-title > span,
#secondary .widget_posts_wrap h4.widgettitle > span,
.sidebar#secondary .widget_posts_wrap .widgettitle > span,
.sidebar#secondary .widget_posts_wrap h4.widgettitle > span {
	flex: 1 1 auto;
	align-self: center;
	line-height: 1.25;
	background: transparent !important;
	padding: 0 !important;
	margin: 0 !important;
	position: static !important;
	z-index: auto;
}

/* Заголовок + список — один блок без лишнего зазора */
#secondary .widget_posts_wrap:has(.torrentmac-top-posts) .widget_posts,
#secondary .widget_posts_wrap .widget_posts:has(.torrentmac-top-posts),
#secondary .widget_posts_wrap .widget_posts,
#secondary .torrentmac-top-posts,
#sidebar-top .torrentmac-top-posts,
.torrentmac-top-posts {
	margin: 0;
	padding: 0;
}

#secondary .widget_posts_wrap .widget_posts .torrentmac-top-posts,
#secondary .torrentmac-top-posts,
#sidebar-top .torrentmac-top-posts,
.torrentmac-top-posts {
	display: flex;
	flex-direction: column;
	gap: 0;
	margin-top: 0 !important;
	list-style: none;
}

#secondary .widget_posts_wrap ul,
#secondary .widget_recent_posts ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

#secondary .torrentmac-top-posts a.torrentmac-top-post-card,
#secondary .torrentmac-top-posts a.torrentmac-top-post-card:visited,
#sidebar-top .torrentmac-top-posts a.torrentmac-top-post-card,
#sidebar-top .torrentmac-top-posts a.torrentmac-top-post-card:visited,
.torrentmac-top-posts a.torrentmac-top-post-card,
.torrentmac-top-posts a.torrentmac-top-post-card:visited {
	display: flex !important;
	align-items: flex-start;
	gap: 10px;
	margin: 0;
	padding: 10px 0;
	border-bottom: 1px solid #eee;
	text-decoration: none !important;
	color: #222 !important;
}

#secondary .torrentmac-top-posts a.torrentmac-top-post-card:first-child,
#sidebar-top .torrentmac-top-posts a.torrentmac-top-post-card:first-child,
.torrentmac-top-posts a.torrentmac-top-post-card:first-child {
	padding-top: 8px;
}

#secondary .torrentmac-top-posts a.torrentmac-top-post-card:last-child,
#sidebar-top .torrentmac-top-posts a.torrentmac-top-post-card:last-child,
.torrentmac-top-posts a.torrentmac-top-post-card:last-child {
	border-bottom: none;
}

#secondary .torrentmac-top-posts a.torrentmac-top-post-card:hover,
#secondary .torrentmac-top-posts a.torrentmac-top-post-card:focus,
.torrentmac-top-posts a.torrentmac-top-post-card:hover,
.torrentmac-top-posts a.torrentmac-top-post-card:focus {
	text-decoration: none !important;
}

#secondary .torrentmac-top-posts a.torrentmac-top-post-card:hover .torrentmac-top-post-card__title,
#secondary .torrentmac-top-posts a.torrentmac-top-post-card:focus .torrentmac-top-post-card__title,
.torrentmac-top-posts a.torrentmac-top-post-card:hover .torrentmac-top-post-card__title,
.torrentmac-top-posts a.torrentmac-top-post-card:focus .torrentmac-top-post-card__title {
	color: #c22 !important;
}

#secondary .torrentmac-top-post-card__thumb,
#sidebar-top .torrentmac-top-post-card__thumb,
.torrentmac-top-post-card__thumb {
	flex: 0 0 56px;
	width: 56px;
	height: 56px;
	overflow: hidden;
	border-radius: 6px;
	background: transparent;
	border: 1px solid #e8e8e8;
}

#secondary .torrentmac-top-post-card__img,
#secondary .torrentmac-top-post-card__thumb img,
#sidebar-top .torrentmac-top-post-card__img,
#sidebar-top .torrentmac-top-post-card__thumb img,
.sidebar .torrentmac-top-post-card__img,
.sidebar .torrentmac-top-post-card__thumb img,
.torrentmac-top-post-card__img,
.torrentmac-top-post-card__thumb img {
	display: block !important;
	width: 56px !important;
	height: 56px !important;
	max-width: 56px !important;
	max-height: 56px !important;
	min-width: 0;
	min-height: 0;
	object-fit: contain;
	object-position: center;
	margin: 0 !important;
	padding: 0;
	float: none !important;
}

#secondary .torrentmac-top-post-card__thumb-placeholder,
.torrentmac-top-post-card__thumb-placeholder {
	display: block;
	width: 56px;
	height: 56px;
	background: linear-gradient(135deg, #ececec 0%, #f8f8f8 100%);
}

#secondary .torrentmac-top-post-card__body,
.torrentmac-top-post-card__body {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
	line-height: 1.35;
}

#secondary .torrentmac-top-posts .torrentmac-top-post-card__title,
#sidebar-top .torrentmac-top-posts .torrentmac-top-post-card__title,
.torrentmac-top-posts .torrentmac-top-post-card__title {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
	font-size: 0.95em;
	font-weight: 600;
	color: #222 !important;
	line-height: 1.35;
	word-wrap: break-word;
	overflow-wrap: anywhere;
}

#secondary .torrentmac-top-posts .torrentmac-top-post-card__meta,
#secondary .torrentmac-top-posts .torrentmac-top-post-card__meta .torrentmac-top-post-card__category,
#secondary .torrentmac-top-posts .torrentmac-top-post-card__meta .torrentmac-top-post-card__downloads,
#secondary .torrentmac-top-posts .torrentmac-top-post-card__meta .torrentmac-top-post-card__date,
#secondary .torrentmac-top-posts .torrentmac-top-post-card__meta time,
.torrentmac-top-posts .torrentmac-top-post-card__meta,
.torrentmac-top-posts .torrentmac-top-post-card__meta .torrentmac-top-post-card__category,
.torrentmac-top-posts .torrentmac-top-post-card__meta .torrentmac-top-post-card__downloads,
.torrentmac-top-posts .torrentmac-top-post-card__meta .torrentmac-top-post-card__date,
.torrentmac-top-posts .torrentmac-top-post-card__meta time {
	font-size: 0.8em;
	font-weight: 400;
	color: #777 !important;
	line-height: 1.4;
}

#secondary .torrentmac-top-posts .torrentmac-top-post-card__meta,
.torrentmac-top-posts .torrentmac-top-post-card__meta {
	display: block;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

#secondary .torrentmac-top-posts .torrentmac-top-post-card__downloads .fa,
.torrentmac-top-posts .torrentmac-top-post-card__downloads .fa {
	margin-right: 3px;
	font-size: 0.9em;
	opacity: 0.7;
}

#secondary .torrentmac-top-posts .torrentmac-top-post-card__sep,
.torrentmac-top-posts .torrentmac-top-post-card__sep {
	margin: 0 0.2em;
	color: #bbb !important;
	opacity: 1;
}
