/**
 * Prime Academic Press — force layer v24.
 * Site index: do not hide #sidebar (Language Toggle and other blocks need to render).
 * pap-critical / custom.less used display:none on body.pap-site-index aside#sidebar.
 */

/* Show sidebar when OJS outputs blocks (overrides theme + v2) */
body.pap-site-index aside#sidebar,
body.pap-site-index .pkp_structure_content.container.pap-site-main-fluid aside#sidebar {
	display: block !important;
}

/* Two-column layout when a sidebar is present (desktop) */
@media (min-width: 992px) {
	body.pap-site-index .pkp_structure_content.container.pap-site-main-fluid:has(aside#sidebar) {
		display: flex !important;
		flex-direction: row !important;
		flex-wrap: nowrap !important;
		align-items: flex-start !important;
		gap: 1.5rem !important;
	}

	body.pap-site-index .pkp_structure_content.container.pap-site-main-fluid:has(aside#sidebar) .pkp_structure_main {
		flex: 1 1 auto !important;
		float: none !important;
		width: auto !important;
		max-width: none !important;
	}

	body.pap-site-index .pkp_structure_content.container.pap-site-main-fluid:has(aside#sidebar) aside#sidebar {
		flex: 0 0 280px !important;
		width: 280px !important;
		max-width: 280px !important;
	}
}

/* No :has(): stack below main; still visible */
@media (max-width: 991px) {
	body.pap-site-index .pkp_structure_content.container.pap-site-main-fluid aside#sidebar {
		width: 100% !important;
		max-width: 100% !important;
	}
}
