/*
 * Pagination under the index, archive and search lists. Rounded buttons in the design system style, the same
 * 12px radius and colors as the header buttons, with the right caret from the Poparide mobile app
 * (.chevron in base.css, mirrored for "previous").
 * Markup: readable_pagination() in inc/helpers.php. Replaces the legacy .pagination / .page-numbers rules in main.css.
 */

.pagination {
	/* Design system tokens (poparide-client globals.css) */
	--ds-action: #d23f00;         /* orange-600 */
	--ds-primary: #183154;        /* navy-500 */
	--ds-text: #466682;           /* navy-400 */
	--ds-tint: #f1faff;           /* blue-100 */
	--ds-subtle: #e0f5fc;         /* blue-200 */
	--ds-border: #d7e6ed;         /* navy-200 */
	--ds-radius: 12px;            /* radius-md */
	--ds-size: 44px;
	--ds-gap: 8px;

	margin-bottom: 45px;
}

/* All the buttons sit in one wrapping row, centered. The inner wrapper only exists for the legacy markup. */
.pagination .row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: var(--ds-gap);
	margin: 0;
}

.pagination .row::before,
.pagination .row::after {
	display: none;
}

.pagination__page-numbers {
	display: contents;
}

.pagination .page-numbers {
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: var(--ds-size);
	height: var(--ds-size);
	margin: 0;
	padding: 0 12px;
	border: 1.5px solid var(--ds-border);
	border-radius: var(--ds-radius);
	background: #fff;
	font-family: "proxima-soft", system-ui, sans-serif;
	font-size: 16px;
	font-weight: 600;
	line-height: 1;
	color: var(--ds-text);
	text-decoration: none;
	transition: background 0.15s, color 0.15s;
}

.pagination a.page-numbers:hover,
.pagination a.page-numbers:focus-visible {
	background: var(--ds-tint);
	color: var(--ds-primary);
}

.pagination a.page-numbers:active {
	background: var(--ds-subtle);
}

/* Current page: the filled action button, like "Sign in" in the header. */
.pagination .page-numbers.current {
	border-color: var(--ds-action);
	background: var(--ds-action);
	color: #fff;
}

/* The "…" between page numbers is not a button. */
.pagination .page-numbers.dots {
	min-width: 0;
	padding: 0 4px;
	border-color: transparent;
	background: transparent;
	color: var(--ds-text);
}

/* Previous / next arrow: smaller than the shared .chevron (10x15), which looked too big inside the square button. */
.pagination .chevron {
	width: 7px;
	height: 10px;
}

@media (max-width: 575px) {
	.pagination {
		--ds-size: 40px;
		--ds-gap: 6px;
	}

	.pagination .page-numbers {
		padding: 0 10px;
	}
}

/* Narrow phones: prev, 1 … 4 5 6 … 9, next has to fit in ~345px. */
@media (max-width: 419px) {
	.pagination {
		--ds-size: 36px;
		--ds-gap: 4px;
	}

	.pagination .page-numbers {
		padding: 0 8px;
	}
}
