/* ─── Grid ──────────────────────────────────────────────────────────────── */

.wcirp-wrapper {
	width: 100%;
}

.wcirp-grid {
	display: grid;
	grid-template-columns: repeat(var(--wcirp-cols, 4), 1fr);
	column-gap: var(--wcirp-gap-col, 20px);
	row-gap: var(--wcirp-gap-row, 20px);
}

/* Masonry layout via column CSS (lightweight, no JS required for basic masonry) */
.wcirp-grid.wcirp-masonry {
	display: block;
	column-count: var(--wcirp-cols, 4);
	column-gap: var(--wcirp-gap-col, 20px);
}

.wcirp-grid.wcirp-masonry > * {
	break-inside: avoid;
	margin-bottom: var(--wcirp-gap-row, 20px);
}

/* Ensure loop template items fill their grid cell */
.wcirp-grid > * {
	min-width: 0;
}

/* ─── Pagination – shared ────────────────────────────────────────────────── */

.wcirp-pagination {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin-top: 30px;
	width: 100%;
}

/* ─── Load More button ───────────────────────────────────────────────────── */

.wcirp-load-more {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 28px;
	background-color: #2271b1;
	color: #fff;
	border: none;
	border-radius: 4px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
	line-height: 1.4;
}

.wcirp-load-more:hover {
	background-color: #135e96;
	color: #fff;
}

.wcirp-load-more:disabled,
.wcirp-load-more.wcirp-loading {
	opacity: 0.65;
	cursor: wait;
}

/* ─── Pagination numbers ─────────────────────────────────────────────────── */

.wcirp-pagination-numbers {
	gap: 6px;
}

.wcirp-page-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	height: 36px;
	padding: 0 8px;
	background-color: transparent;
	color: #333;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 14px;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.wcirp-page-btn:hover {
	background-color: #f0f0f0;
}

.wcirp-page-btn.wcirp-active {
	background-color: #2271b1;
	color: #fff;
	border-color: #2271b1;
	cursor: default;
}

/* ─── Spinner ────────────────────────────────────────────────────────────── */

.wcirp-spinner {
	display: inline-block;
	width: 20px;
	height: 20px;
	border: 3px solid rgba(0, 0, 0, 0.15);
	border-top-color: #2271b1;
	border-radius: 50%;
	animation: wcirp-spin 0.7s linear infinite;
	flex-shrink: 0;
}

@keyframes wcirp-spin {
	to { transform: rotate(360deg); }
}

/* ─── Infinite scroll sentinel ───────────────────────────────────────────── */

.wcirp-scroll-sentinel {
	display: block;
	height: 1px;
	width: 100%;
	pointer-events: none;
}

/* ─── No results ─────────────────────────────────────────────────────────── */

.wcirp-no-results {
	text-align: center;
	color: #888;
	font-size: 14px;
	padding: 20px 0;
}
