/* CPT Grid and AJAX Pagination Styling - CashFlow Theme */
.cpt-grid {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	gap: 24px;
	justify-content: center;
	align-items: stretch;
	min-height: 200px;
	overflow: visible;
	padding-top: 10px;
	margin-top: -10px;
}

.cpt-grid-item {
	padding: 16px;
	transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
	width: calc(33.333% - 16px);
	border-radius: 16px;
	background: rgba(255, 255, 255, 0.02);
	border: 1px solid rgba(255, 255, 255, 0.08);
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	height: auto;
}

.cpt-grid-item:hover {
	transform: translateY(-4px);
	border-color: rgba(255, 255, 255, 0.18);
	box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

.cpt-grid-item a {
	text-decoration: none;
	color: inherit;
	display: flex;
	flex-direction: column;
	flex: 1;
	height: 100%;
	align-items: stretch;
}

.cpt-grid-item:focus,
.cpt-grid-item a:focus {
	border: none;
	outline-style: none;
}

.cpt-grid-item a p,
.cpt-grid-item p {
	width: 100%;
	word-break: break-word;
	flex: 1;
}

.cpt-grid-item a h3,
.cpt-grid-item h3 {
	width: 100%;
	font-size: 1.15rem;
	margin-top: 10px;
}

.cpt-grid-item img {
	width: 100%;
	height: 240px;
	object-fit: cover;
	display: block;
	margin-bottom: 12px;
	border-radius: 12px;
	transition: transform 0.4s ease;
}

.cpt-grid-item:hover img {
	transform: scale(1.03);
}

/* AJAX States & Spinner Animation */
.cpt-loading,
.cpt-error,
.cpt-no-results {
	width: 100%;
	text-align: center;
	padding: 40px 20px;
	color: #ffffff;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
}

.cpt-loading::after {
	content: "";
	width: 32px;
	height: 32px;
	border: 3px solid rgba(255, 255, 255, 0.15);
	border-top-color: #ffffff;
	border-radius: 50%;
	animation: cpt-spinner 0.8s linear infinite;
}

@keyframes cpt-spinner {
	to {
		transform: rotate(360deg);
	}
}

.cpt-error {
	color: #ef5350;
}

#load-more,
.cpt-load-more {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin: 30px auto;
	padding: 12px 28px;
	cursor: pointer;
	background-color: #000000 !important;
	background: #000000 !important;
	color: #ffffff !important;
	border: 1px solid #ffffff !important;
	border-radius: 10px;
	font-weight: 600;
	transition: all 0.25s ease-in-out;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

#load-more:hover,
.cpt-load-more:hover {
	background-color: #ffffff !important;
	background: #ffffff !important;
	color: #000000 !important;
	border-color: #ffffff !important;
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(255, 255, 255, 0.25);
}

/* Pagination Standard (4 States) */
#cpt-pagination {
	position: relative;
	margin-top: 35px;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	height: 36px;
}

/* 4. Non-current, WITHOUT hover */
#cpt-pagination span.pagination-number,
#cpt-pagination span.pagination-nav {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: 24px !important;
	height: 24px !important;
	min-width: 24px !important;
	border-radius: 50% !important;
	background-color: #111111 !important;
	background: #111111 !important;
	color: #ffffff !important;
	border: 1px solid rgba(255, 255, 255, 0.3) !important;
	opacity: 1 !important;
	box-shadow: none !important;
	font-size: 12px !important;
	font-weight: 700 !important;
	line-height: 1 !important;
	cursor: pointer !important;
	transition: all 0.2s ease-in-out !important;
	padding: 0 !important;
	margin: 0 3px !important;
	box-sizing: border-box !important;
}

#cpt-pagination .pagination-dots {
	cursor: default;
	background: transparent !important;
	border: none !important;
	color: #ffffff !important;
	opacity: 1 !important;
}

/* 3. Non-current, WITH hover */
#cpt-pagination span.pagination-number:hover,
#cpt-pagination span.pagination-nav:hover {
	background-color: #ffffff !important;
	background: #ffffff !important;
	color: #000000 !important;
	border: 1px solid #ffffff !important;
	border-radius: 50% !important;
	width: 24px !important;
	height: 24px !important;
	box-shadow: none !important;
	opacity: 1 !important;
	transform: scale(1.05) !important;
}

/* 2. Current (Active), WITHOUT hover */
#cpt-pagination span.pagination-number.active {
	width: 36px !important;
	height: 24px !important;
	min-width: 36px !important;
	border-radius: 9999px !important;
	background-color: #f02a2a !important;
	background: #f02a2a !important;
	color: #000000 !important;
	border: 1px solid #f02a2a !important;
	opacity: 1 !important;
	box-shadow: 0 0 12px rgba(240, 42, 42, 0.75) !important;
	transform: none !important;
}

#cpt-pagination span.pagination-number.active span {
	color: #000000 !important;
}

/* 1. Current (Active), WITH hover */
#cpt-pagination span.pagination-number.active:hover {
	width: 36px !important;
	height: 24px !important;
	min-width: 36px !important;
	border-radius: 9999px !important;
	background-color: #ffffff !important;
	background: #ffffff !important;
	color: #000000 !important;
	border: 2px solid #000000 !important;
	opacity: 1 !important;
	box-shadow: 0 0 14px 2px rgba(240, 42, 42, 0.9), 0 0 4px rgba(240, 42, 42, 0.6) !important;
	transform: none !important;
}

/* Responsive Grid Breakpoints */
@media (max-width: 940px) {
	.cpt-grid-item {
		width: calc(50% - 16px);
	}
}

@media (max-width: 600px) {
	.cpt-grid-item {
		width: 100%;
	}

	.cpt-grid-item img {
		height: 200px;
	}
}
