/* Post-nav pagination */

.ast-pagination .navigation.pagination .page-numbers,
.ast-pagination .navigation.pagination .page-numbers:hover,
.ast-pagination .navigation.pagination .page-numbers:focus,
.ast-pagination .navigation.pagination .page-numbers:active {
    display: inline-block !important;
    width: auto !important;
    max-width: max-content !important;
}

.ast-pagination .page-numbers.current {
	padding: 0.4em 0.6em;  /* top/bottom, left/right */
	border-radius: calc(var(--br1) * 0.5);
	display: inline-block;
}

.post-navigation .nav-links {
	display: flex;
	align-items: stretch;
	justify-content: space-between;
	
	font-family: var(--dso-meta-font);
}

.post-navigation .nav-previous::after {
	all: unset;
}

.post-navigation .nav-previous,
.post-navigation .nav-next {
	position: relative;
	flex: 0 0 calc(50% - 0.5px);  /* What? */
}

.post-navigation .nav-previous + .nav-next::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	height: 100%;
	width: 1px;
	background-color: var(--dso-cool-gray-80-15p);
}

/* Replace SVG arrows */

.nav-links .nav-previous .ahfb-svg-iconset,
.nav-links .nav-next .ahfb-svg-iconset {
	display: none;
}

.nav-links .ast-post-nav::before,
.nav-links .ast-post-nav::after {
	position: relative;
	font-size: 0.6rem;
	bottom: 0.1rem;
}

.nav-links .nav-previous .ast-post-nav::before {
	content: '\25C0 \00A0';
}

.nav-links .nav-next .ast-post-nav::after {
	content: '\00A0 \25B6';
}

/* ==================
 * === PAGINATION ===
 * ================== */

.ast-pagination {
	margin-top: 0;
	padding-top: 1.6rem;
	border-top: 1px solid var(--dso-cool-gray-80-25p);
}

.ast-pagination .page-numbers.current {
  background-color: var(--dso-cool-gray-80-10p);
  color: var(--dso-cool-gray-80-75p);
}

.prev.page-numbers,
.next.page-numbers {
	margin: 0 !important;
	padding: 0 !important;
}

/* Normalize pagination item sizing */

.ast-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1rem;
	padding: 0.6rem 0.4rem;
	height: auto;
	font-family: var(--dso-meta-font);
	font-weight: var(--dso-meta-weight);
	font-size: 1.0rem;
	border-radius: var(--br1);
}

/* Fix the Prev/Next arrows */

.ast-pagination .page-numbers.prev,
.ast-pagination .page-numbers.next {
	gap: 0.4em;  /* Space between arrow + text */
}

.ast-pagination .page-numbers .ast-left-arrow,
.ast-pagination .page-numbers .ast-right-arrow {
  display: inline-flex;
  align-items: center;
  line-height: 1;
  font-size: 1em;
  position: relative;
  top: 0;  /* Counteract any built-in vertical offset */
}

/* Pagination fixes */

.navigation.pagination {
	position: relative;
	text-align: center;
}

/* Main link group */

.navigation.pagination .nav-links {
	position: relative;
	box-sizing: border-box;

	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;

	padding: 0 4rem;  /* Reserve horizontal space for Prev/Next buttons */
	width: 100%;
}

/* Page numbers (the centered group) */

.navigation.pagination .page-numbers:not(.prev):not(.next) {
	display: inline-block;
	padding: 0.4rem 0.8rem;
	border-radius: 0.4rem;
	white-space: nowrap;
}

/* Prev / Next pinned to edges */

.navigation.pagination .prev,
.navigation.pagination .next {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);

	white-space: nowrap;

	width: max-content;

	z-index: 2;
}

.navigation.pagination .prev {
	left: 0;
}

.navigation.pagination .next {
	right: 0;
}

/* Keep the outer container neat */

.ast-pagination {
	text-align: center;
	padding: 1.6rem 0 0;
}

/* Hide the actual arrows */

.ast-left-arrow,
.ast-right-arrow {
	display: none !important;
}

.prev.page-numbers::before,
.next.page-numbers::after {
	position: relative;
	bottom: 0.1rem;
	font-size: 0.6rem;
}

.prev.page-numbers::before {
	content: '\25C0 \00A0';
}

.next.page-numbers::after {
	content: '\00A0 \25B6';
}