/* ==========================================================================
   Post Grid Manager – Frontend Styles
   ========================================================================== */

/* Wrapper */
.pgm-grid-wrap {
	width: 100%;
	margin: 24px 0;
}

/* ------------------------------------------------------------------
   Navigation bar
   ------------------------------------------------------------------ */
.pgm-navigation {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 24px;
	justify-content: center;
}

.pgm-nav-btn {
	padding: 10px 20px;
	background: #f0f0f0;
	border-radius: 30px;
	cursor: pointer;
	font-size: 18px;
	line-height: 1.4;
    transition: unset;
	/* transition: background 0.2s, color 0.2s, border-color 0.2s; */
}

.pgm-nav-btn:hover,
.pgm-nav-btn.pgm-nav-active {
	background: #ff1fa9;
	color: #fff;
}

/* ------------------------------------------------------------------
   Grid container
   ------------------------------------------------------------------ */
.pgm-grid-content {
	position: relative;
	min-height: 80px;
}

.pgm-grid {
	display: grid;
	grid-template-columns: repeat( var(--pgm-columns, 3), 1fr );
	gap: var(--pgm-gap, 20px);
}

/* ------------------------------------------------------------------
   Grid item
   ------------------------------------------------------------------ */
.pgm-item {
	background: #fff;
	border: 1px solid #e5e5e5;
	border-radius: 6px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	/* transition: box-shadow 0.2s, transform 0.2s; */
}

.pgm-item:hover {
	/* box-shadow: 0 4px 18px rgba( 0, 0, 0, 0.12 ); */
	/* transform: translateY(-2px); */
}

/* Image */
.pgm-item-image {
	overflow: hidden;
	flex-shrink: 0;
}


.pgm-item-image a {
	display: block;
	line-height: 0;
	position: relative;
}

/* hover layer effect - add position: relative in a */
.pgm-item-image a::after {
	content: '';
	position: absolute;
	inset: 0;
	background: rgba(174, 236, 244, 0.5);
	opacity: 0;
	transition: opacity 0.35s ease;
}

.pgm-item-image a:hover::after {
	opacity: 1;
}
/* end hover layer effect */

.pgm-item-image img {
	width: 100%;
	height: 220px;
	object-fit: cover;
	display: block;
	transition: transform 0.35s ease;
}

.pgm-item-image a:hover img {
	/* transform: scale(1.05); */
}

/* Body */
.pgm-item-body {
	padding: 16px;
	flex: 1;
	display: flex;
	flex-direction: column;
}

/* Title */
.pgm-item-title {
	margin: 0px;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.4;
}

.pgm-item-title a {
	color: inherit;
	text-decoration: none;
    width: fit-content;
}

.pgm-item-title a:hover {
	color: #ff1fa9;
}

/* Meta (date, author) */
.pgm-meta {
	font-size: 13px;
	color: #888;
	margin: 0px;
}

.pgm-sep {
	margin: 0 3px;
}

/* Excerpt */
.pgm-excerpt {
	font-size: 14px;
	color: #555;
	line-height: 1.65;
	margin: 0 0 14px;
	flex: 1;
}

/* Categories & Tags */
.pgm-categories,
.pgm-tags {
	font-size: 12px;
	color: #777;
	margin: 0 0 8px;
}

.pgm-categories a,
.pgm-tags a {
	color: #0073aa;
	text-decoration: none;
}

.pgm-categories a:hover,
.pgm-tags a:hover {
	text-decoration: underline;
}

/* Read More */
.pgm-read-more {
	display: inline-block;
	padding: 7px 16px;
	background: #0073aa;
	color: #fff;
	border-radius: 4px;
	text-decoration: none;
	font-size: 13px;
	margin-top: auto;
	align-self: flex-start;
	transition: background 0.2s;
}

.pgm-read-more:hover {
	background: #005177;
	color: #fff;
}

/* ------------------------------------------------------------------
   Pagination
   ------------------------------------------------------------------ */
.pgm-pagination {
	margin-top: 28px;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	justify-content: center;
}

.pgm-page-btn {
	min-width: 36px;
	padding: 7px 12px;
	background: #f0f0f0;
	border-radius: 4px;
	cursor: pointer;
	font-size: 14px;
    transition: unset;
	/* transition: background 0.2s, color 0.2s, border-color 0.2s; */
}

.pgm-page-btn:hover,
.pgm-page-btn.pgm-page-active {
	background: #ff1fa9;
	color: #fff;
}

.pgm-page-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.pgm-page-info {
	font-size: 14px;
	color: #666;
	padding: 0 6px;
}

.pgm-ellipsis {
	font-size: 14px;
	color: #999;
	padding: 0 4px;
	user-select: none;
}

/* Load More */
.pgm-load-more {
	display: block;
	width: 100%;
	padding: 12px 20px;
	background: #f0f0f0;
	border: 1px solid #d0d0d0;
	border-radius: 4px;
	cursor: pointer;
	font-size: 15px;
	text-align: center;
	transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.pgm-load-more:hover {
	background: #0073aa;
	color: #fff;
	border-color: #0073aa;
}

.pgm-load-more:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* ------------------------------------------------------------------
   Loading overlay
   ------------------------------------------------------------------ */
.pgm-loading {
	position: absolute;
	inset: 0;
	background: rgba( 255, 255, 255, 0.82 );
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 10;
	font-size: 14px;
	color: #666;
	gap: 10px;
}

.pgm-loading::after {
	content: '';
	width: 24px;
	height: 24px;
	border: 3px solid #ddd;
	border-top-color: #0073aa;
	border-radius: 50%;
	animation: pgm-spin 0.7s linear infinite;
	flex-shrink: 0;
}

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

/* No posts */
.pgm-no-posts {
	grid-column: 1 / -1;
	padding: 32px 20px;
	text-align: center;
	color: #888;
	font-size: 15px;
}

/* Error */
.pgm-error {
	color: #cc0000;
	font-size: 14px;
}

/* ------------------------------------------------------------------
   Responsive breakpoints
   ------------------------------------------------------------------ */
@media ( max-width: 900px ) {
	.pgm-grid {
		grid-template-columns: repeat( min( var(--pgm-columns, 3), 2 ), 1fr );
	}
}

@media ( max-width: 540px ) {
	.pgm-grid {
		grid-template-columns: 1fr;
	}

	.pgm-navigation {
		gap: 6px;
	}

	.pgm-nav-btn {
		padding: 6px 12px;
		font-size: 13px;
	}
}