/* ==========================================================================
   Stylish Sidebar - Related Posts & Social Media
   Mobile-first, responsive, self-contained styles.
   All classes are prefixed with "ssw-" to avoid theme conflicts.
   ========================================================================== */

.ssw-sidebar-wrap {
	--ssw-accent: #6c5ce7;
	--ssw-accent-dark: #5746c9;
	--ssw-text: #1f2330;
	--ssw-muted: #767e94;
	--ssw-bg: #ffffff;
	--ssw-border: #ececf3;
	--ssw-radius: 14px;
	--ssw-shadow: 0 6px 24px rgba(31, 35, 48, 0.08);

	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.ssw-sidebar-wrap * {
	box-sizing: border-box;
}

.ssw-block {
	background: var(--ssw-bg);
	border: 1px solid var(--ssw-border);
	border-radius: var(--ssw-radius);
	box-shadow: var(--ssw-shadow);
	padding: 20px;
	margin-bottom: 24px;
}

.ssw-block:last-child {
	margin-bottom: 0;
}

.ssw-heading {
	margin: 0 0 16px;
	font-size: 17px;
	font-weight: 700;
	color: var(--ssw-text);
	position: relative;
	padding-left: 14px;
	letter-spacing: 0.2px;
}

.ssw-heading::before {
	content: "";
	position: absolute;
	left: 0;
	top: 2px;
	bottom: 2px;
	width: 4px;
	border-radius: 4px;
	background: linear-gradient(180deg, var(--ssw-accent), #a29bfe);
}

/* ----------------------- Related Posts ----------------------- */

.ssw-related-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.ssw-related-item {
	margin: 0;
}

.ssw-related-link {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	text-decoration: none;
	color: inherit;
	padding: 8px;
	margin: -8px;
	border-radius: 10px;
	transition: background-color 0.2s ease, transform 0.2s ease;
}

.ssw-related-link:hover,
.ssw-related-link:focus {
	background-color: #f7f6ff;
	transform: translateX(2px);
}

.ssw-related-thumb {
	flex-shrink: 0;
	width: 64px;
	height: 64px;
	border-radius: 10px;
	overflow: hidden;
	background: #f1f2f6;
	display: block;
}

.ssw-related-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	border-radius: 10px;
}

.ssw-thumb-placeholder {
	width: 100%;
	height: 100%;
	display: block;
	background: linear-gradient(135deg, #a29bfe, #6c5ce7);
}

.ssw-related-content {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
}

.ssw-related-title {
	font-size: 14.5px;
	font-weight: 600;
	color: var(--ssw-text);
	line-height: 1.35;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.ssw-related-link:hover .ssw-related-title {
	color: var(--ssw-accent-dark);
}

.ssw-related-date {
	font-size: 12px;
	color: var(--ssw-muted);
}

.ssw-related-excerpt {
	font-size: 12.5px;
	color: var(--ssw-muted);
	line-height: 1.4;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	margin-top: 2px;
}

/* ----------------------- Social Media Icons ----------------------- */

.ssw-social-icons {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: 10px;
}

.ssw-social-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	aspect-ratio: 1 / 1;
	border-radius: 12px;
	color: #fff;
	text-decoration: none;
	transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.ssw-social-icon svg {
	width: 22px;
	height: 22px;
}

.ssw-social-icon:hover,
.ssw-social-icon:focus {
	transform: translateY(-3px) scale(1.05);
	filter: brightness(1.08);
	box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
}

.ssw-social-icon:active {
	transform: translateY(-1px) scale(0.98);
}

.ssw-facebook  { background: linear-gradient(135deg, #1877f2, #0e5fcf); }
.ssw-whatsapp  { background: linear-gradient(135deg, #25d366, #128c4a); }
.ssw-telegram  { background: linear-gradient(135deg, #34aadc, #1e88c7); }
.ssw-youtube   { background: linear-gradient(135deg, #ff0000, #cc0000); }
.ssw-instagram {
	background: linear-gradient(135deg, #f9ce34 0%, #ee2a7b 50%, #6228d7 100%);
}

/* ----------------------- Mobile Responsiveness ----------------------- */

@media (max-width: 480px) {
	.ssw-block {
		padding: 16px;
		border-radius: 12px;
	}

	.ssw-heading {
		font-size: 16px;
	}

	.ssw-related-thumb {
		width: 56px;
		height: 56px;
	}

	.ssw-related-title {
		font-size: 14px;
	}

	.ssw-social-icons {
		gap: 8px;
	}

	.ssw-social-icon svg {
		width: 20px;
		height: 20px;
	}
}

/* Extra-narrow screens: wrap social icons into 3 + 2 instead of cramming 5 */
@media (max-width: 340px) {
	.ssw-social-icons {
		grid-template-columns: repeat(3, 1fr);
	}
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
	.ssw-related-link,
	.ssw-social-icon {
		transition: none !important;
	}
}

/* Dark theme support: only applies if the active theme sets the standard
   prefers-color-scheme media feature on the body, this is opt-in safe */
@media (prefers-color-scheme: dark) {
	.ssw-sidebar-wrap {
		--ssw-bg: #1c1e26;
		--ssw-text: #f1f2f6;
		--ssw-muted: #9aa0b4;
		--ssw-border: #2c2f3a;
		--ssw-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
	}

	.ssw-related-link:hover,
	.ssw-related-link:focus {
		background-color: #262936;
	}
}
