/* furnica pagination — @rtthemes/builder üretir; elle düzenlemeyin. */
/*
 * Pagination for query loops (core/query-pagination).
 * numbers: 55px squares with a 1px border and a 5px gap; the current page and the previous/next chevrons are filled
 * black. The numbers wrapper uses display: contents so every square sits in one flex row.
 * load-more: only the next link, drawn as a wide button; outlined, or filled black with the dark tone.
 */
.rt-pagination {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--wp--custom--pagination--gap);
	padding-block-start: var(--wp--custom--pagination--offset);
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--rt-pagination-font-size, 1.125rem);
	font-weight: var(--wp--custom--font--weight--bold);
	line-height: 1;
}

.rt-pagination__numbers {
	display: contents;
}

.rt-pagination .page-numbers,
.rt-pagination__previous,
.rt-pagination__next {
	display: inline-flex;
	box-sizing: border-box;
	align-items: center;
	justify-content: center;
	min-width: var(--wp--custom--pagination--size);
	height: var(--wp--custom--pagination--size);
	padding-inline: var(--wp--preset--spacing--20);
	border: 1px solid var(--wp--custom--pagination--border);
	color: var(--rt-color-contrast, var(--wp--preset--color--contrast));
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.rt-pagination .dots {
	align-items: flex-end;
	min-width: 1.875rem;
	padding: 0 0 0.25rem;
	border: 0;
}

.rt-pagination .current,
.rt-pagination a.page-numbers:hover,
.rt-pagination a.page-numbers:focus-visible {
	background-color: var(--wp--custom--pagination--active-bg);
	color: var(--wp--custom--pagination--active-color);
}

/* Previous and next: filled squares with a chevron; core's arrow glyph is replaced by a mask icon. */
.rt-pagination--numbers .rt-pagination__previous,
.rt-pagination--numbers .rt-pagination__next {
	width: var(--wp--custom--pagination--size);
	padding: 0;
	background-color: var(--wp--custom--pagination--active-bg);
	color: var(--wp--custom--pagination--active-color);
	font-size: 0;
}

.rt-pagination--numbers .rt-pagination__previous {
	order: -1;
}

.rt-pagination--numbers .rt-pagination__previous::before,
.rt-pagination--numbers .rt-pagination__next::before {
	content: "";
	width: 0.5rem;
	height: 0.875rem;
	background-color: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 14'%3E%3Cpath d='M1 1l6 6-6 6' fill='none' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 14'%3E%3Cpath d='M1 1l6 6-6 6' fill='none' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E") center / contain no-repeat;
	transition: translate 0.2s ease;
}

.rt-pagination--numbers .rt-pagination__previous::before {
	scale: -1 1;
}

.rt-pagination--numbers .rt-pagination__next:hover::before {
	translate: 0.1875rem 0;
}

.rt-pagination--numbers .rt-pagination__previous:hover::before {
	translate: -0.1875rem 0;
}

/* Load more: a wide button; numbers and previous are hidden when the editor switches an existing pagination over. */
.rt-pagination--load-more {
	justify-content: center;
}

.rt-pagination--load-more .rt-pagination__numbers,
.rt-pagination--load-more .rt-pagination__previous {
	display: none;
}

.rt-pagination--load-more .rt-pagination__next {
	width: min(100%, var(--wp--custom--pagination--button-width));
	padding-inline: var(--wp--preset--spacing--30);
}

.rt-pagination--load-more .rt-pagination__next:hover,
.rt-pagination--load-more .rt-pagination__next:focus-visible {
	background-color: var(--wp--custom--pagination--active-bg);
	color: var(--wp--custom--pagination--active-color);
}

.rt-pagination--tone-dark .rt-pagination__next {
	background-color: var(--wp--custom--pagination--active-bg);
	color: var(--wp--custom--pagination--active-color);
}

.rt-pagination--tone-dark .rt-pagination__next:hover,
.rt-pagination--tone-dark .rt-pagination__next:focus-visible {
	border-color: var(--rt-color-accent, var(--wp--preset--color--accent));
	background-color: var(--rt-color-accent, var(--wp--preset--color--accent));
	color: var(--wp--preset--color--on-accent);
}

/* While the next page loads (aria-busy from the load more behaviour). */
.rt-pagination[aria-busy="true"] .rt-pagination__next {
	cursor: progress;
	opacity: 0.6;
}

@media (max-width: 64rem) {
	.rt-pagination {
		--wp--custom--pagination--offset: var(--wp--custom--spacing--50);
	}
}

@media (max-width: 37.5rem) {
	.rt-pagination {
		--wp--custom--pagination--size: 2.75rem;
		--rt-pagination-font-size: var(--wp--preset--font-size--base);
	}
}

@media (prefers-reduced-motion: reduce) {
	.rt-pagination .page-numbers,
	.rt-pagination__previous,
	.rt-pagination__next,
	.rt-pagination--numbers .rt-pagination__previous::before,
	.rt-pagination--numbers .rt-pagination__next::before {
		transition: none;
	}
}
