/**
 * Sidebar layout: keep the main column at full width when a sidebar is shown.
 *
 * Default theme splits #primary / #secondary 70/30 inside a 1230px container,
 * which squeezes the 3-column blog grid. Widen #content-wrap by the sidebar
 * track so #primary keeps the original content width.
 *
 * .sidebar-scroll is the wheel target: sticky on #secondary, scroll on the inner
 * panel so hover-scroll stays in the sidebar instead of the page.
 */

@media screen and (min-width: 1024px) {
	.has-sidebar #content-wrap.container {
		/* ~30% of the original 1230px content column (matches the old sidebar size) */
		--cube-sidebar-width: 370px;
		--cube-sidebar-gap: 20px;
		--cube-content-max: 1230px;
		--cube-sidebar-top: 30px;
		--cube-sidebar-bottom-gap: 30px;

		display: flex;
		align-items: flex-start;
		gap: var(--cube-sidebar-gap);
		max-width: calc(
			var(--cube-content-max) + var(--cube-sidebar-width) + var(--cube-sidebar-gap)
		);
	}

	.has-sidebar.left-sidebar #content-wrap {
		flex-direction: row-reverse;
	}

	.has-sidebar.right-sidebar #content-wrap {
		flex-direction: row;
	}

	.has-sidebar #primary {
		width: auto;
		flex: 1 1 var(--cube-content-max);
		min-width: 0;
		float: none;
		padding-left: 0;
		padding-right: 0;
		margin-bottom: 0;
	}

	.has-sidebar #secondary {
		width: var(--cube-sidebar-width);
		flex: 0 0 var(--cube-sidebar-width);
		min-width: var(--cube-sidebar-width);
		float: none;
		position: sticky;
		top: var(--cube-sidebar-top);
		align-self: flex-start;
	}

	.has-sidebar #secondary .sidebar-scroll {
		max-height: calc(
			100vh - var(--cube-sidebar-top) - var(--cube-sidebar-bottom-gap)
		);
		overflow-x: hidden;
		overflow-y: auto;
		overscroll-behavior-y: contain;
		-webkit-overflow-scrolling: touch;
		-ms-overflow-style: none;
		scrollbar-width: none;
	}

	.has-sidebar #secondary .sidebar-scroll::-webkit-scrollbar {
		display: none;
		width: 0;
		height: 0;
	}

	.admin-bar.has-sidebar #content-wrap.container {
		--cube-sidebar-top: 52px;
	}

	.menu-sticky.has-sidebar #content-wrap.container {
		--cube-sidebar-top: 120px;
	}

	.admin-bar.menu-sticky.has-sidebar #content-wrap.container {
		--cube-sidebar-top: 142px;
	}
}

/* Below desktop breakpoint, keep the theme's stacked/mobile layout. */

/* Sidebar search: solid pink focus border (theme default is dotted black outline). */
#secondary .widget_search input[type="search"]:focus,
#secondary .wp-block-search__input:focus {
	outline: none;
	border: 1px solid #f37e7e;
	box-shadow: none;
}

/* Single post footer: categories on first line, tags on the row below. */
.single .entry-footer-taxonomies {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.single .entry-footer-taxonomies .cat-links,
.single .entry-footer-taxonomies .tags-links {
	display: block;
}

.single .entry-footer-taxonomies .tags-links {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 10px;
}

@media screen and (min-width: 567px) {
	.single .blog-post-item .entry-footer .entry-footer-taxonomies {
		flex: 1 1 auto;
		min-width: 0;
	}
}
