/*
 * Shade Media — blog sidebar
 * Zakres celowo ograniczony do .shade-blog-sidebar, aby nie zmieniać styli Salient.
 */

.shade-blog-sidebar {
	--shade-blog-sidebar-accent: #7047eb;
	--shade-blog-sidebar-accent-dark: #5a31d6;
	--shade-blog-sidebar-ink: #16131d;
	--shade-blog-sidebar-muted: #6d6878;
	--shade-blog-sidebar-surface: #f4f2f8;
	--shade-blog-sidebar-line: rgba(22, 19, 29, 0.11);
	--shade-blog-sidebar-radius: 20px;
	box-sizing: border-box;
	display: grid;
	gap: 18px;
	width: 100%;
	max-width: 100%;
	font: inherit;
	color: var(--shade-blog-sidebar-ink);
}

.shade-blog-sidebar *,
.shade-blog-sidebar *::before,
.shade-blog-sidebar *::after {
	box-sizing: border-box;
}

.shade-blog-sidebar__panel {
	margin: 0;
	padding: 26px;
	border-radius: var(--shade-blog-sidebar-radius);
	background: #fff;
}

.shade-blog-sidebar__panel--cta {
	position: relative;
	overflow: hidden;
	color: #fff;
	background:
		radial-gradient(circle at 100% 0%, rgba(255,255,255,0.16), transparent 42%),
		var(--shade-blog-sidebar-ink);
}

.shade-blog-sidebar__panel--cta::after {
	content: "";
	position: absolute;
	right: -34px;
	bottom: -58px;
	width: 140px;
	height: 140px;
	border: 24px solid rgba(112, 71, 235, 0.46);
	border-radius: 50%;
	pointer-events: none;
}

.shade-blog-sidebar__panel--related {
	padding: 24px 0 4px;
	border-top: 1px solid var(--shade-blog-sidebar-line);
	border-bottom: 1px solid var(--shade-blog-sidebar-line);
	border-radius: 0;
}

.shade-blog-sidebar__panel--portfolio {
	border: 1px solid var(--shade-blog-sidebar-line);
	background: var(--shade-blog-sidebar-surface);
}

.shade-blog-sidebar__eyebrow,
.shade-blog-sidebar__heading,
.shade-blog-sidebar__text,
.shade-blog-sidebar__post-title {
	margin: 0;
	padding: 0;
}

.shade-blog-sidebar__eyebrow {
	position: relative;
	z-index: 1;
	margin-bottom: 11px;
	font-size: 11px;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--shade-blog-sidebar-accent);
}

.shade-blog-sidebar__panel--cta .shade-blog-sidebar__eyebrow {
	color: #bcaafd;
}

.shade-blog-sidebar__heading {
	position: relative;
	z-index: 1;
	font: inherit;
	font-size: clamp(22px, 2vw, 27px);
	font-weight: 650;
	line-height: 1.08;
	letter-spacing: -0.025em;
	color: inherit;
}

.shade-blog-sidebar__heading--related {
	margin: 0 24px 16px;
	font-size: 20px;
}

.shade-blog-sidebar__text {
	position: relative;
	z-index: 1;
	margin-top: 13px;
	font-size: 15px;
	line-height: 1.55;
	color: var(--shade-blog-sidebar-muted);
}

.shade-blog-sidebar__panel--cta .shade-blog-sidebar__text {
	max-width: 27ch;
	color: rgba(255, 255, 255, 0.76);
}

.shade-blog-sidebar__button {
	position: relative;
	z-index: 1;
	display: inline-flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	min-height: 48px;
	margin-top: 20px;
	padding: 12px 17px;
	border: 1px solid transparent;
	border-radius: 999px;
	font: inherit;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
	transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

.shade-blog-sidebar__button:hover {
	transform: translateY(-2px);
	text-decoration: none;
}

.shade-blog-sidebar__button:focus-visible,
.shade-blog-sidebar__post-link:focus-visible {
	outline: 3px solid rgba(112, 71, 235, 0.35);
	outline-offset: 3px;
}

.shade-blog-sidebar__button--primary {
	width: 100%;
	color: #fff;
	background: var(--shade-blog-sidebar-accent);
}

.shade-blog-sidebar__button--primary:hover {
	color: #fff;
	background: var(--shade-blog-sidebar-accent-dark);
}

.shade-blog-sidebar__button--secondary {
	color: var(--shade-blog-sidebar-ink);
	border-color: var(--shade-blog-sidebar-line);
	background: #fff;
}

.shade-blog-sidebar__button--secondary:hover {
	color: #fff;
	border-color: var(--shade-blog-sidebar-accent);
	background: var(--shade-blog-sidebar-accent);
}

.shade-blog-sidebar__posts {
	display: grid;
}

.shade-blog-sidebar__post {
	margin: 0;
	padding: 0 24px;
}

.shade-blog-sidebar__post + .shade-blog-sidebar__post {
	border-top: 1px solid var(--shade-blog-sidebar-line);
}

.shade-blog-sidebar__post-link {
	display: grid;
	grid-template-columns: 84px minmax(0, 1fr) 18px;
	align-items: center;
	gap: 13px;
	padding: 15px 0;
	color: var(--shade-blog-sidebar-ink);
	text-decoration: none;
}

.shade-blog-sidebar__post-link:hover {
	color: var(--shade-blog-sidebar-accent);
	text-decoration: none;
}

.shade-blog-sidebar__thumbnail,
.shade-blog-sidebar__placeholder {
	display: block;
	width: 84px;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	border-radius: 10px;
	background: #e8e5ee;
}

.shade-blog-sidebar__thumbnail-image {
	display: block;
	width: 100%;
	height: 100%;
	margin: 0;
	object-fit: cover;
	transition: transform 220ms ease;
}

.shade-blog-sidebar__post-link:hover .shade-blog-sidebar__thumbnail-image {
	transform: scale(1.04);
}

.shade-blog-sidebar__placeholder {
	display: grid;
	place-items: center;
	color: #918a9f;
}

.shade-blog-sidebar__placeholder svg {
	width: 28px;
	height: 28px;
	fill: currentColor;
}

.shade-blog-sidebar__post-title {
	display: -webkit-box;
	overflow: hidden;
	font: inherit;
	font-size: 14px;
	font-weight: 650;
	line-height: 1.35;
	letter-spacing: -0.01em;
	color: inherit;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
}

.shade-blog-sidebar__post-arrow {
	font-size: 17px;
	line-height: 1;
	transition: transform 180ms ease;
}

.shade-blog-sidebar__post-link:hover .shade-blog-sidebar__post-arrow {
	transform: translateX(3px);
}

@media (min-width: 1001px) {
	/*
	 * Blok shortcode i widżet mają zwykle wysokość równą komponentowi, co może
	 * ograniczyć sticky. display: contents usuwa tylko te dwa wrappery, które
	 * faktycznie zawierają ten sidebar; pozostałe widżety Salient są nietknięte.
	 */
	@supports selector(:has(*)) {
		.widget_block:has(.shade-blog-sidebar),
		.wp-block-shortcode:has(> .shade-blog-sidebar) {
			display: contents;
		}
	}

	.shade-blog-sidebar {
		position: sticky;
		top: var(--shade-blog-sidebar-sticky-offset, 112px);
		max-height: calc(100vh - var(--shade-blog-sidebar-sticky-offset, 112px) - 24px);
		overflow-y: auto;
		overflow-x: hidden;
		overscroll-behavior: contain;
		scrollbar-width: thin;
		scrollbar-color: rgba(22, 19, 29, 0.2) transparent;
	}
}

@media (max-width: 1000px) {
	.shade-blog-sidebar {
		position: static;
		max-height: none;
		overflow: visible;
		margin-top: 40px;
	}
}

@media (max-width: 520px) {
	.shade-blog-sidebar {
		gap: 14px;
	}

	.shade-blog-sidebar__panel {
		padding: 22px;
	}

	.shade-blog-sidebar__panel--related {
		padding-right: 0;
		padding-left: 0;
	}

	.shade-blog-sidebar__heading {
		font-size: 22px;
	}

	.shade-blog-sidebar__heading--related {
		margin-right: 20px;
		margin-left: 20px;
		font-size: 19px;
	}

	.shade-blog-sidebar__post {
		padding-right: 20px;
		padding-left: 20px;
	}

	.shade-blog-sidebar__post-link {
		grid-template-columns: 72px minmax(0, 1fr) 16px;
		gap: 11px;
	}

	.shade-blog-sidebar__thumbnail,
	.shade-blog-sidebar__placeholder {
		width: 72px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.shade-blog-sidebar *,
	.shade-blog-sidebar *::before,
	.shade-blog-sidebar *::after {
		scroll-behavior: auto;
		transition-duration: 0.01ms;
	}
}

/* Salient potrafi narzucać globalne rozmiary nagłówkom H3 w widżetach. */
.widget_block .shade-blog-sidebar .shade-blog-sidebar__post-title,
.shade-blog-sidebar .shade-blog-sidebar__post-title {
	font-size: 14px;
	line-height: 1.35;
	font-weight: 650;
	letter-spacing: -0.01em;
}

@media (min-width: 1001px) {
	.shade-blog-sidebar:focus {
		outline: none;
	}
}
