/**
 * ITM Social Feeds — card layout with thumbnails.
 *
 * @package Ignite_The_Mic_Core
 */

.itm-social-feeds {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.itm-feed-platform {
	margin: 0;
}

.itm-feed-heading {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 12px;
	font-size: 0.72rem;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--itm-text-muted, #6b7280);
}

.itm-feed-heading i {
	width: 22px;
	height: 22px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 6px;
	font-size: 0.75rem;
	color: #fff;
	flex-shrink: 0;
}

.itm-feed-twitter .itm-feed-heading i,
.itm-feed-x .itm-feed-heading i {
	background: #111;
}

.itm-feed-instagram .itm-feed-heading i {
	background: linear-gradient(135deg, #f58529, #dd2a7b, #8134af);
}

.itm-feed-youtube .itm-feed-heading i {
	background: #ff0000;
}

.itm-feed-facebook .itm-feed-heading i {
	background: #1877f2;
}

.itm-feed-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.itm-feed-item {
	margin: 0;
}

.itm-feed-item-link {
	display: flex;
	align-items: stretch;
	gap: 12px;
	padding: 10px;
	border: 1px solid var(--itm-border, rgba(0, 0, 0, 0.08));
	border-radius: 12px;
	background: var(--itm-bg, #ffffff);
	text-decoration: none;
	color: inherit;
	transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s, background 0.2s;
}

.itm-feed-item-link:hover {
	border-color: rgba(var(--itm-accent-rgb, 82, 82, 91), 0.28);
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
	transform: translateY(-1px);
	background: var(--itm-bg-card, #fff);
}

.itm-feed-thumb {
	flex: 0 0 72px;
	width: 72px;
	height: 72px;
	border-radius: 10px;
	overflow: hidden;
	position: relative;
	background: #111;
}

.itm-feed-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.itm-feed-thumb-fallback {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	color: #fff;
	font-size: 1.35rem;
}

.itm-feed-thumb-fallback--twitter,
.itm-feed-thumb-fallback--x {
	background: linear-gradient(145deg, #222, #000);
}

.itm-feed-thumb-fallback--instagram {
	background: linear-gradient(145deg, #f58529, #dd2a7b);
}

.itm-feed-thumb-fallback--youtube {
	background: linear-gradient(145deg, #ff0000, #990000);
}

.itm-feed-thumb-fallback--facebook {
	background: linear-gradient(145deg, #1877f2, #0d5bd7);
}

.itm-feed-thumb-play {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.28);
	color: #fff;
	font-size: 1.1rem;
	opacity: 0;
	transition: opacity 0.2s;
	pointer-events: none;
}

.itm-feed-item-link:hover .itm-feed-thumb-play {
	opacity: 1;
}

.itm-feed-body {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 6px;
	min-width: 0;
	flex: 1;
}

.itm-feed-text {
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	font-size: 0.86rem;
	line-height: 1.45;
	font-weight: 600;
	color: var(--itm-heading, #111);
}

.itm-feed-item-link:hover .itm-feed-text {
	color: var(--itm-accent, #52525b);
}

.itm-feed-body time {
	font-size: 0.72rem;
	font-weight: 500;
	color: var(--itm-text-muted, #6b7280);
}

/* Sidebar widget context */
.itm-social-feed-banner {
	display: block;
	margin: 0 0 16px;
	line-height: 0;
	overflow: hidden;
}

.itm-social-feed-banner img {
	display: block;
	width: 100%;
	height: auto;
}

.itm-social-feed-widget .itm-social-feeds {
	gap: 16px;
}

.itm-social-feed-widget .itm-feed-item-link {
	background: var(--itm-bg-card, #fff);
}

.itm-social-feed-widget .itm-feed-thumb {
	flex: 0 0 64px;
	width: 64px;
	height: 64px;
}

@media (max-width: 480px) {
	.itm-feed-thumb {
		flex: 0 0 56px;
		width: 56px;
		height: 56px;
	}
}

/* Homepage — 2x2 grid beside latest review */
.itm-home-review-social__feed .itm-social-feeds,
.itm-home-review-social__feed .itm-social-feeds--latest {
	height: 100%;
}

.itm-home-review-social__feed .itm-social-feeds--latest .itm-feed-list--latest {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	grid-template-rows: repeat(2, minmax(0, 1fr));
	gap: 12px;
	height: 100%;
	min-height: 380px;
}

.itm-home-review-social__feed .itm-social-feeds--latest .itm-feed-item,
.itm-home-review-social__feed .itm-social-feeds--latest .itm-feed-item-link {
	height: 100%;
}

.itm-home-review-social__feed .itm-social-feeds--latest .itm-feed-item-link {
	min-height: 0;
}

.itm-home-review-social__feed .itm-social-feeds--latest .itm-feed-thumb {
	aspect-ratio: 16 / 11;
}

.itm-home-review-social__feed .itm-social-feeds--latest .itm-feed-text {
	-webkit-line-clamp: 2;
}

@media (max-width: 1024px) {
	.itm-home-review-social__feed .itm-social-feeds--latest .itm-feed-list--latest {
		min-height: 340px;
	}
}

@media (max-width: 768px) {
	.itm-home-review-social__feed .itm-social-feeds--latest .itm-feed-list--latest {
		min-height: 0;
	}
}

/* Legacy homepage row layout (if used elsewhere) */
.itm-home-social-feed {
	padding-bottom: 12px;
}

.itm-social-feeds--latest .itm-feed-list--latest {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 16px;
}

.itm-social-feeds--latest .itm-feed-item-link {
	flex-direction: column;
	height: 100%;
	padding: 0;
	overflow: hidden;
}

.itm-social-feeds--latest .itm-feed-thumb {
	flex: none;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 10;
	border-radius: 12px 12px 0 0;
}

.itm-social-feeds--latest .itm-feed-body {
	padding: 12px 14px 14px;
}

.itm-feed-platform-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 0.68rem;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--itm-text-muted, #6b7280);
}

.itm-feed-platform-badge i {
	width: 18px;
	height: 18px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 4px;
	font-size: 0.62rem;
	color: #fff;
}

.itm-feed-platform-badge--twitter i,
.itm-feed-platform-badge--x i {
	background: #111;
}

.itm-feed-platform-badge--instagram i {
	background: linear-gradient(135deg, #f58529, #dd2a7b);
}

.itm-feed-platform-badge--youtube i {
	background: #ff0000;
}

.itm-feed-platform-badge--facebook i {
	background: #1877f2;
}

@media (max-width: 1024px) {
	.itm-social-feeds--latest .itm-feed-list--latest {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 600px) {
	.itm-social-feeds--latest .itm-feed-list--latest {
		grid-template-columns: 1fr;
	}
}
