/**
 * Shared editorial sidebar for single posts.
 * Matches the dedicated magazine home without affecting pages or archives.
 */

body:is(.single-post, .archive) #secondary.widget-area .widget {
	margin: 0 0 32px !important;
	padding: 18px 0 26px !important;
	border: 0 !important;
	border-top: 4px solid var(--js-accent, #ef5b40) !important;
	border-bottom: 1px solid #e2e2e2 !important;
	border-radius: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
}

body:is(.single-post, .archive) #secondary.widget-area .widget:last-child {
	margin-bottom: 0 !important;
}

body:is(.single-post, .archive) #secondary.widget-area .widget-header,
body:is(.single-post, .archive) #secondary.widget-area .widget-title {
	margin: 0 0 18px !important;
	padding: 0 !important;
	border: 0 !important;
	color: #171717 !important;
	font-size: 21px !important;
	font-weight: 800 !important;
	line-height: 1.2 !important;
	letter-spacing: -.02em !important;
	text-transform: none !important;
}

body:is(.single-post, .archive) #secondary.widget-area .widget-articles {
	display: flex;
	flex-direction: column;
	gap: 0;
}

body:is(.single-post, .archive) #secondary.widget-area .post-card--small {
	display: grid !important;
	grid-template-columns: minmax(0, 1fr) !important;
	gap: 0 !important;
	width: 100% !important;
	max-width: none !important;
	min-height: 0 !important;
	margin: 0 !important;
	padding: 16px 0 !important;
	border: 0 !important;
	border-bottom: 1px solid #e6e6e6 !important;
	border-radius: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	transform: none !important;
}

body:is(.single-post, .archive) #secondary.widget-area .post-card--small:first-child {
	padding-top: 0 !important;
}

body:is(.single-post, .archive) #secondary.widget-area .post-card--small:last-child {
	padding-bottom: 0 !important;
	border-bottom: 0 !important;
}

body:is(.single-post, .archive) #secondary.widget-area .post-card--small:has(.post-card__thumbnail) {
	grid-template-columns: 92px minmax(0, 1fr) !important;
	gap: 14px !important;
}

body:is(.single-post, .archive) #secondary.widget-area .post-card--small .post-card__thumbnail,
body:is(.single-post, .archive) #secondary.widget-area .post-card--small .post-card__thumbnail a,
body:is(.single-post, .archive) #secondary.widget-area .post-card--small .post-card__thumbnail img {
	display: block !important;
	width: 92px !important;
	min-width: 92px !important;
	max-width: 92px !important;
	height: 92px !important;
	min-height: 92px !important;
	max-height: 92px !important;
	margin: 0 !important;
	border-radius: 0 !important;
}

body:is(.single-post, .archive) #secondary.widget-area .post-card--small .post-card__thumbnail img {
	object-fit: cover !important;
}

body:is(.single-post, .archive) #secondary.widget-area .post-card--small .post-card__body {
	display: block !important;
	min-width: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
}

body:is(.single-post, .archive) #secondary.widget-area .post-card__category {
	display: block !important;
	margin: 0 0 6px !important;
	padding: 0 !important;
	color: var(--js-accent, #ef5b40) !important;
	font-size: 11px !important;
	font-weight: 700 !important;
	line-height: 1.25 !important;
	letter-spacing: .035em !important;
	text-transform: uppercase !important;
}

body:is(.single-post, .archive) #secondary.widget-area .post-card__title {
	margin: 0 0 9px !important;
	padding: 0 !important;
	color: #171717 !important;
	font-size: 15px !important;
	font-weight: 750 !important;
	line-height: 1.32 !important;
	letter-spacing: -.012em !important;
}

body:is(.single-post, .archive) #secondary.widget-area .post-card__title a {
	color: inherit !important;
	text-decoration: none !important;
}

body:is(.single-post, .archive) #secondary.widget-area .post-card__title a:hover {
	color: var(--js-accent, #ef5b40) !important;
}

body:is(.single-post, .archive) #secondary.widget-area .post-card__meta {
	display: flex !important;
	align-items: center !important;
	gap: 14px !important;
	margin: 0 !important;
	padding: 0 !important;
	color: #8a8a8a !important;
	font-size: 12px !important;
	line-height: 1.3 !important;
}

body:is(.single-post, .archive) #secondary.widget-area .post-card__meta > * {
	margin: 0 !important;
}

@media (min-width: 992px) {
	body.archive,
	body.archive #page.site {
		overflow-y: visible !important;
	}

	body.archive #page.site {
		overflow-x: clip !important;
	}

	/*
	 * #secondary shares a flex row with #primary. Since #primary ends after
	 * #comments, this stretch creates the exact lower boundary for sticky.
	 * #related-posts is the next flex row and is never entered by the sidebar.
	 */
	body.single-post #secondary.widget-area {
		align-self: stretch !important;
		height: auto !important;
		padding-bottom: 0 !important;
		overflow: visible !important;
	}

	body.single-post #secondary .sticky-sidebar.js-sticky-sidebar {
		position: sticky !important;
		top: 128px !important;
		align-self: flex-start !important;
		height: auto !important;
		overflow: visible !important;
	}

	body.archive #secondary.widget-area {
		align-self: flex-start !important;
		height: var(--journal-archive-sidebar-height, auto) !important;
		padding-bottom: 0 !important;
		overflow: visible !important;
	}

	body.archive #secondary .sticky-sidebar.js-sticky-sidebar {
		position: sticky !important;
		top: 128px !important;
		align-self: flex-start !important;
		height: auto !important;
		overflow: visible !important;
	}

}

/* Compact archive pagination remains inside the posts column. */
body.archive .navigation.pagination {
	box-sizing: border-box !important;
	width: 100% !important;
	max-width: 100% !important;
	margin: 28px 0 0 !important;
	padding: 24px 0 0 !important;
	border-top: 1px solid #e2e2e2 !important;
}

body.archive .navigation.pagination .nav-links {
	display: flex !important;
	flex-wrap: wrap !important;
	align-items: center !important;
	justify-content: center !important;
	gap: 8px !important;
	width: 100% !important;
	margin: 0 !important;
	padding: 0 !important;
}

body.archive .navigation.pagination .page-numbers {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	box-sizing: border-box !important;
	width: 44px !important;
	min-width: 44px !important;
	height: 44px !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 1px solid #dedede !important;
	border-radius: 0 !important;
	background: #fff !important;
	color: #171717 !important;
	font-size: 15px !important;
	font-weight: 700 !important;
	line-height: 1 !important;
	text-decoration: none !important;
}

body.archive .navigation.pagination .page-numbers.current,
body.archive .navigation.pagination .page-numbers:hover {
	border-color: var(--js-accent, #ef5b40) !important;
	background: var(--js-accent, #ef5b40) !important;
	color: #fff !important;
}

body.archive .navigation.pagination .page-numbers.prev,
body.archive .navigation.pagination .page-numbers.next {
	width: auto !important;
	padding: 0 16px !important;
}
