/* ============================================================
   BP: Sidebar
   Widget area layout helpers.
   ============================================================ */

/* Breathing room between stacked widgets. */
.widget {
	margin-bottom: var(--bp-space-8);
}

.widget:last-child {
	margin-bottom: 0;
}

/* Sticky sidebars, smart mode (see modules/sticky-sidebar.js).
   The toggle in Pengaturan Tema > Sidebar only marks a sidebar as
   sticky (.bp-sidebar--sticky, added by the sidebar templates via
   bp_sidebar_sticky_enabled()); the script then picks one of three
   modes per sidebar from real heights. Without JS, every sticky
   sidebar falls back to the plain whole-area behaviour.
   - Short sidebar (fits in the viewport below the header offset):
     the whole area sticks. align-self: start is required: grid
     items stretch by default, and a stretched item has no room
     to stick.
   - Tall sidebar: only its last widget sticks
     (.bp-sidebar--sticky-last). The area itself goes back to
     static + stretched, so the last widget has the full content
     column height to stick within — it stays visible while the
     article is read. The child combinator (>) keeps nested
     .widget elements inside a widget's own content from matching.
   - Last widget taller than the viewport: nothing sticks
     (.bp-sidebar--sticky-off), so every widget stays reachable by
     normal scrolling instead of trapping content out of reach.
   - Desktop only: the 2-column grid only exists at >= 992px; on
     smaller screens the sidebar stacks below the content.
   - --bp-sticky-top is measured from the real header height by
     modules/sticky-sidebar.js; the fallback covers no-JS. */
@media (min-width: 992px) {
	.widget-area.bp-sidebar--sticky {
		position: sticky;
		top: var(--bp-sticky-top, 96px);
		align-self: start;
	}

	.widget-area.bp-sidebar--sticky.bp-sidebar--sticky-last {
		position: static;
		align-self: stretch;
	}

	.widget-area.bp-sidebar--sticky.bp-sidebar--sticky-last > .widget:last-child {
		position: sticky;
		top: var(--bp-sticky-top, 96px);
	}

	.widget-area.bp-sidebar--sticky.bp-sidebar--sticky-off {
		position: static;
	}
}
