/**
 * Post Grid Display - Frontend Styles
 *
 * @package Post_Grid_Display
 */

/* Grid Container */
.pgd-grid {
	display: grid;
	width: 100%;
	box-sizing: border-box;
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Post Item */
.pgd-post-item {
	display: flex;
	flex-direction: column;
	box-sizing: border-box;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
	height: 100%;
}

.pgd-post-item:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Post Image - Fully Responsive, No Cropping */
.pgd-post-image {
	width: 100%;
	overflow: hidden;
}

.pgd-post-image a {
	display: block;
	width: 100%;
}

/* Responsive Images - Width 100%, Height Auto, No Cropping */
.pgd-post-image img,
.pgd-responsive-image {
	width: 100% !important;
	height: auto !important;
	display: block;
	object-fit: contain;
	max-width: 100%;
}

/* Post Content */
.pgd-post-content {
	flex: 1;
	display: flex;
	flex-direction: column;
}

/* Post Title */
.pgd-post-title {
	margin: 0;
	line-height: 1.4;
	font-weight: 600;
	word-break: break-word;
}

.pgd-post-title a {
	text-decoration: none;
	color: inherit;
	transition: color 0.2s ease;
}

.pgd-post-title a:hover {
	text-decoration: underline;
}

.pgd-post-title a:focus {
	outline: 2px solid #4f46e5;
	outline-offset: 2px;
}

/* Post Date */
.pgd-post-date {
	margin: 0;
	line-height: 1.5;
	word-break: break-word;
}

/* Carousel Styles */
.pgd-carousel {
	width: 100%;
	overflow: hidden;
	position: relative;
	padding: 20px 0;
}

.pgd-carousel .swiper-slide {
	height: auto;
}

.pgd-carousel .pgd-post-item {
	height: 100%;
}

.pgd-carousel .pgd-post-image {
	width: 100%;
}

/* Carousel Images - Fully Responsive, No Cropping */
.pgd-carousel .pgd-post-image img,
.pgd-carousel .pgd-responsive-image {
	width: 100% !important;
	height: auto !important;
	display: block;
	object-fit: contain;
	max-width: 100%;
}

/* Swiper Navigation */
.pgd-carousel .swiper-button-next,
.pgd-carousel .swiper-button-prev {
	color: #333;
	background: rgba(255, 255, 255, 0.9);
	width: 44px;
	height: 44px;
	border-radius: 50%;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
	top: 50%;
	transform: translateY(-50%);
	transition: background-color 0.3s ease;
}

.pgd-carousel .swiper-button-next:after,
.pgd-carousel .swiper-button-prev:after {
	font-size: 18px;
	font-weight: bold;
}

.pgd-carousel .swiper-button-next:hover,
.pgd-carousel .swiper-button-prev:hover {
	background: #fff;
}

/* Swiper Pagination */
.pgd-carousel .swiper-pagination {
	position: relative;
	margin-top: 15px;
	bottom: 0;
}

.pgd-carousel .swiper-pagination-bullet {
	width: 10px;
	height: 10px;
	background: #ccc;
	opacity: 1;
	transition: opacity 0.3s ease;
}

.pgd-carousel .swiper-pagination-bullet-active {
	background: #333;
}

/* No Posts Message */
.pgd-no-posts {
	text-align: center;
	padding: 40px 20px;
	color: #666;
	font-size: 16px;
}

/* Responsive Breakpoints */
@media (max-width: 767px) {
	.pgd-carousel .swiper-button-next,
	.pgd-carousel .swiper-button-prev {
		width: 36px;
		height: 36px;
	}

	.pgd-carousel .swiper-button-next:after,
	.pgd-carousel .swiper-button-prev:after {
		font-size: 14px;
	}

	.pgd-carousel {
		padding: 15px 0;
	}
}

@media (max-width: 480px) {
	.pgd-carousel .swiper-button-next,
	.pgd-carousel .swiper-button-prev {
		width: 32px;
		height: 32px;
	}

	.pgd-carousel .swiper-button-next:after,
	.pgd-carousel .swiper-button-prev:after {
		font-size: 12px;
	}
}

/* Accessibility */
.pgd-post-title a:focus {
	outline: 2px solid #4f46e5;
	outline-offset: 2px;
}

/* Print Styles */
@media print {
	.pgd-grid {
		display: block;
	}

	.pgd-post-item {
		page-break-inside: avoid;
		margin-bottom: 20px;
	}

	.pgd-carousel .swiper-button-next,
	.pgd-carousel .swiper-button-prev,
	.pgd-carousel .swiper-pagination {
		display: none;
	}
}
