/**
 * Shortcode [streams_by_topic]: thẻ stream giống ảnh — nền trắng, góc bo, LIVE cam góc phải, chấm đỏ góc trái, dưới avatar + tên + brand badge + rank + streamer. 5 cột. Vừa 1 màn hình, không tràn ngang.
 */
.streams-by-topic {
	margin: 1.5rem 0;
	max-width: 100%;
	min-width: 0;
}

/* Header mục list: icon danh mục + tên UPPERCASE + mũi tên, click vào chi tiết danh mục */
.streams-by-topic__header {
	margin-bottom: 1rem;
}

.streams-by-topic__header-link {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem 0.5rem;
	text-decoration: none;
	color: #1a1a1a;
	font-weight: 700;
	font-size: 1.6rem;
	transition: color 0.2s;
}
.streams-by-topic__header-link:hover {
	color: #ea580c;
}

.streams-by-topic__header-icon {
	display: block;
	width: 24px;
	height: 24px;
	object-fit: contain;
}

.streams-by-topic__header-icon-fallback {
	font-size: 1.25rem;
	color: #dc2626;
}

.streams-by-topic__header-title {
	text-transform: uppercase;
	letter-spacing: 0.02em;
}

.streams-by-topic__header-arrow {
	font-size: 0.85rem;
	opacity: 0.8;
}

/* Filter: trạng thái + brand (giống stream_schedule) */
.streams-by-topic__filters {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin-bottom: 1rem;
}

.streams-by-topic__filter-label {
	display: flex;
	align-items: center;
	min-width: 0;
	font-size: 0.9rem;
}

.streams-by-topic__filter {
	flex: 1;
	min-width: 160px;
	max-width: 220px;
	padding: 0.35rem 2rem 0.35rem 1rem;
	border: 1px solid #ccc;
	border-radius: 6px;
	font-size: 0.9rem;
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	color: #333;
	cursor: pointer;
}

/* Thông báo khi filter không có kết quả */
.streams-by-topic__empty {
	padding: 2rem 1rem;
	text-align: center;
	color: #666;
	font-size: 1rem;
}

.streams-by-topic__grid {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 1rem;
	list-style: none;
	margin: 0;
	padding: 0;
	max-width: 100%;
	min-width: 0;
}

.streams-by-topic__item {
	margin: 0;
	min-width: 0;
	display: flex;
}

.streams-by-topic__card {
	display: flex;
	flex-direction: column;
	width: 100%;
	height: 100%;
	min-height: 0;
	text-decoration: none;
	color: inherit;
	background: #fff;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
	border: 1px solid rgba(0, 0, 0, 0.06);
	transition: transform 0.2s, box-shadow 0.2s;
	min-width: 0;
}
.streams-by-topic__card:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.streams-by-topic__thumb-wrap {
	position: relative;
	flex-shrink: 0;
	aspect-ratio: 3 / 2;
	background: #e5e5e5;
	overflow: hidden;
}

.streams-by-topic__thumb {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.streams-by-topic__thumb-placeholder {
	display: block;
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, #d4d4d4 0%, #a3a3a3 100%);
}

/* Góc trái: chấm đỏ (live) */
.streams-by-topic__viewer {
	position: absolute;
	top: 10px;
	left: 10px;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	color: #dc2626;
	font-size: 0.65rem;
	z-index: 2;
}
.streams-by-topic__viewer i {
	font-size: 0.5rem;
}

/* Góc phải: badge LIVE cam (pill cam, icon + chữ) */
.streams-by-topic__badge {
	position: absolute;
	top: 10px;
	right: 10px;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 5px 12px;
	font-size: 0.7rem;
	font-weight: 700;
	line-height: 1.2;
	color: #fff;
	border-radius: 999px;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
	z-index: 2;
}

.streams-by-topic__badge-icon {
	font-size: 0.7rem;
	opacity: 0.95;
}

.streams-by-topic__badge--live {
	background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
	color: #fff;
}

.streams-by-topic__badge--upcoming {
	background: rgba(30, 58, 138, 0.92);
	color: #fff;
}

/* Phần dưới: nền trắng, avatar + meta — flex: 1 để cùng hàng luôn cao bằng thẻ dài nhất */
.streams-by-topic__info {
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
	flex: 1 1 auto;
	min-height: 0;
	padding: 0.65rem 0.6rem 0.75rem;
	background: #fff;
}

.streams-by-topic__avatar {
	flex-shrink: 0;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	object-fit: cover;
	background: #f0f0f0;
}

.streams-by-topic__avatar--placeholder {
	display: block;
	background: linear-gradient(135deg, #e5e5e5 0%, #d4d4d4 100%);
}

.streams-by-topic__meta {
	flex: 1;
	min-width: 0;
	overflow: hidden;
}

.streams-by-topic__title {
	display: block;
	font-size: 0.9rem;
	font-weight: 700;
	line-height: 1.25;
	color: #1a1a1a;
	margin-bottom: 4px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.streams-by-topic__details {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.4rem 0.5rem;
	font-size: 0.75rem;
}

/* Brand: viền cam, nền trắng, chữ cam */
.streams-by-topic__brand-avatar {
	display: inline-block;
    width: 22px;
    height: auto;
    border-radius: 6px;
    object-fit: contain;
    vertical-align: middle;
}

.streams-by-topic__brand-badge {
	display: inline-flex;
	align-items: center;
	padding: 2px 8px;
	font-weight: 700;
	color: #ea580c;
	background: #fff;
	border: 1px solid #f97316;
	border-radius: 6px;
}

/* Rank: dùng cùng style + icon như stream-hot (pill trái icon, phải số). Reset position để không bị stream-hot.css ghi đè khi cùng trang. */
.streams-by-topic__details .stream-hot-streamer-rank {
	position: relative !important;
	left: auto !important;
	right: auto !important;
	top: auto !important;
	bottom: auto !important;
	transform: none !important;
	display: inline-flex;
	align-items: center;
	justify-content: flex-end;
	min-width: 40px;
	height: 18px;
	padding: 0 8px 0 26px;
	font-size: 0.75rem;
	font-weight: 700;
	line-height: 1;
	border-radius: 999px;
	overflow: visible;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.15);
	border: unset;
	background: linear-gradient(90deg, #c87838 0%, #c87838 26px, #6b3410 26px, #4a2608 100%);
	color: #fff5eb;
	text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
	box-sizing: border-box;
}
.streams-by-topic__details .stream-hot-streamer-rank::before {
	font-family: 'Font Awesome 6 Free';
	font-weight: 900;
	font-size: 0.7rem;
	position: absolute;
	left: 6px;
	top: 50%;
	margin-top: -0.4em;
	line-height: 1;
	content: '\f51e';
	color: rgba(255, 255, 255, 0.95);
	text-shadow: 0 0 1px rgba(0, 0, 0, 0.4);
}
.streams-by-topic__details .stream-hot-streamer-rank--golden {
	background: #ffd700;
	color: #2a2000;
	text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}
.streams-by-topic__details .stream-hot-streamer-rank--golden::before {
	content: '\f521';
	color: #1a1500;
	text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
}
.streams-by-topic__details .stream-hot-streamer-rank--silver {
	background: #a0a0a0;
	color: #fff;
	text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}
.streams-by-topic__details .stream-hot-streamer-rank--silver::before {
	content: '\f5a2';
	color: #fff;
	text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}
.streams-by-topic__details .stream-hot-streamer-rank--gaban {
	background: #c87838;
	color: #fff;
	text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}
.streams-by-topic__details .stream-hot-streamer-rank--gaban::before {
	content: '\f51e';
	color: #fff;
	text-shadow: 0 0 1px rgba(0, 0, 0, 0.3);
}

.streams-by-topic__streamer {
	color: #374151;
	font-weight: 500;
}

.streams-by-topic__toggle-wrap {
	display: flex;
	align-items: center;
	gap: 1rem;
	margin-top: 1.5rem;
}

.streams-by-topic__toggle-wrap::before,
.streams-by-topic__toggle-wrap::after {
	content: '';
	flex: 1;
	height: 0;
	border-top: 1px solid #d1d5db;
}

.streams-by-topic__toggle {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 0.25rem 0;
	font-size: 0.9375rem;
	font-weight: 400;
	color: #6b7280;
	background: transparent;
	border: none;
	cursor: pointer;
	text-decoration: none;
	transition: color 0.2s ease;
	margin: 0;
	text-transform: capitalize;
}
.streams-by-topic__toggle:hover {
	color: #ff9900;
}

.streams-by-topic__toggle-icon {
	font-size: 0.75rem;
	transition: transform 0.25s ease;
}

.streams-by-topic__toggle[aria-expanded="true"] .streams-by-topic__toggle-icon {
	transform: rotate(180deg);
}

/* 5 cột giữ tới 992px, sau đó thu nhỏ */
@media (max-width: 1200px) {
	.streams-by-topic__grid {
		grid-template-columns: repeat(5, minmax(0, 1fr));
		gap: 0.85rem;
	}
}

@media (max-width: 992px) {
	.streams-by-topic__grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 0.85rem;
	}
}

@media (max-width: 768px) {
	.streams-by-topic__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 0.75rem;
	}
	.streams-by-topic__title {
		font-size: 0.85rem;
	}
	.streams-by-topic__avatar {
		width: 36px;
		height: 36px;
	}
}

@media (max-width: 480px) {
	.streams-by-topic__grid {
		grid-template-columns: minmax(0, 1fr);
	}
}
