/*
 * Kininusa News — layout layer (Phase 5).
 *
 * Desktop: [primary | sidebar] two-column grid.
 * <=980px: single column; the sidebar stacks below the primary column
 * (it becomes a slide-in drawer in a later phase).
 */

.kn-container {
	width: 100%;
	max-width: var(--kn-container);
	margin-inline: auto;
	padding-inline: var(--kn-gutter);
}

.kn-content {
	display: grid;
	grid-template-columns: minmax(0, 1fr) var(--kn-sidebar-width);
	gap: var(--kn-space-6);
	padding-block: var(--kn-space-7);
}

.kn-primary {
	min-width: 0;
}

.kn-sidebar {
	min-width: 0;
}

/* Sticky sidebar (Sidebar → Sticky sidebar). The JS classifies the layout
   on desktop: a sidebar that fits pins its top; a taller one pins its
   bottom so it follows the scroll without being cut off. */
@media (min-width: 981px) {
	.kn-sidebar--sticky {
		position: sticky;
		top: 24px;
		align-self: start;
	}

	.kn-sidebar--sticky-tail {
		position: sticky;
		align-self: start;
		/* `top` is set inline by sidebar-sticky.js: viewportH − sidebarH − 24 */
	}
}

@media (max-width: 980px) {
	.kn-content {
		grid-template-columns: minmax(0, 1fr);
	}
}
