/**
 * Prime Academic Press — force layer v22.
 * Footer link columns (Quick / Resources / Legal): evenly distribute vertical space between items
 * so row height matches brand column — four columns equal height, flush top & bottom.
 */

@media (min-width: 992px) {
	.footer.pap-footer .pap-footer-grid {
		align-items: stretch !important;
	}

	.footer.pap-footer .pap-footer-col--brand {
		align-self: stretch !important;
		height: auto !important;
		min-height: 100% !important;
	}

	/* Column: title pinned top; list fills remaining height */
	.footer.pap-footer .pap-footer-col:not(.pap-footer-col--brand) {
		justify-content: flex-start !important;
		height: 100% !important;
		min-height: 100% !important;
	}

	.footer.pap-footer .pap-footer-col:not(.pap-footer-col--brand) h4 {
		flex: 0 0 auto !important;
		margin-bottom: 0 !important;
		padding-bottom: 0 !important;
	}

	/*
	 * List grows to match tallest column; space-between divides slack evenly
	 * between the four links (equal gaps, first link under title band, last on baseline).
	 */
	.footer.pap-footer .pap-footer-col:not(.pap-footer-col--brand) ul {
		flex: 1 1 auto !important;
		min-height: 0 !important;
		display: flex !important;
		flex-direction: column !important;
		justify-content: space-between !important;
		align-items: flex-start !important;
		gap: 0 !important;
		margin: 0 !important;
		padding: 10px 0 0 !important;
		list-style: none !important;
	}

	.footer.pap-footer .pap-footer-col:not(.pap-footer-col--brand) ul > li {
		flex: 0 0 auto !important;
		margin: 0 !important;
		padding: 0 !important;
		display: block !important;
		width: 100% !important;
	}

	.footer.pap-footer .pap-footer-col:not(.pap-footer-col--brand) ul > li > a {
		display: inline-block !important;
		padding: 2px 0 !important;
	}
}

@media (max-width: 991px) {
	.footer.pap-footer .pap-footer-col:not(.pap-footer-col--brand) ul {
		flex: none !important;
		display: block !important;
		justify-content: flex-start !important;
		min-height: 0 !important;
		padding-top: 8px !important;
		gap: 0 !important;
	}

	.footer.pap-footer .pap-footer-col:not(.pap-footer-col--brand) ul > li {
		margin-bottom: 6px !important;
	}

	.footer.pap-footer .pap-footer-col:not(.pap-footer-col--brand) ul > li:last-child {
		margin-bottom: 0 !important;
	}
}
