/**
 * Fylo Posts Grid/List Styles
 * Simple, clean, modern design without gradients
 */

.fylo-posts-grid {
	width: 100%;
	margin: 0 auto;
}

.fylo-posts-grid--empty {
	text-align: center;
	padding: 60px 20px;
	color: #64748b;
	font-size: 18px;
}

/* ===============================================
   GRID LAYOUT STYLES
   =============================================== */

.fylo-posts-grid--grid {
	display: grid;
	gap: 30px;
}

.fylo-posts-grid--columns-1 {
	grid-template-columns: 1fr;
	max-width: 900px;
	margin: 0 auto;
}

.fylo-posts-grid--columns-2 {
	grid-template-columns: repeat(2, 1fr);
}

.fylo-posts-grid--columns-3 {
	grid-template-columns: repeat(3, 1fr);
}

.fylo-posts-grid--columns-4 {
	grid-template-columns: repeat(4, 1fr);
}

.fylo-posts-grid--columns-5 {
	grid-template-columns: repeat(5, 1fr);
}

.fylo-posts-grid--grid .fylo-posts-card {
	display: flex;
	flex-direction: column;
	background: #ffffff;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
	transition: all 0.3s ease;
	position: relative;
	height: 100%;
	border: 1px solid #e2e8f0;
}

.fylo-posts-grid--grid .fylo-posts-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
	border-color: #cbd5e1;
}

.fylo-posts-grid--grid .fylo-posts-card__image {
	position: relative;
	display: block;
	width: 100%;
	padding-bottom: 65%;
	overflow: hidden;
	background: #f1f5f9;
}

.fylo-posts-grid--grid .fylo-posts-card__image img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.fylo-posts-grid--grid .fylo-posts-card:hover .fylo-posts-card__image img {
	transform: scale(1.05);
}

.fylo-posts-grid--grid .fylo-posts-card__content {
	padding: 24px;
	display: flex;
	flex-direction: column;
	flex-grow: 1;
}

/* ===============================================
   LIST LAYOUT STYLES
   =============================================== */

.fylo-posts-grid--list {
	display: flex;
	flex-direction: column;
	gap: 24px;
}

.fylo-posts-grid--list .fylo-posts-card {
	display: grid;
	grid-template-columns: 320px 1fr;
	gap: 28px;
	background: #ffffff;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
	transition: all 0.3s ease;
	position: relative;
	border: 1px solid #e2e8f0;
}

.fylo-posts-grid--list .fylo-posts-card:hover {
	transform: translateX(4px);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
	border-color: #cbd5e1;
}

.fylo-posts-grid--list .fylo-posts-card__image {
	position: relative;
	display: block;
	width: 100%;
	height: 100%;
	min-height: 240px;
	overflow: hidden;
	background: #f1f5f9;
	flex-shrink: 0;
}

.fylo-posts-grid--list .fylo-posts-card__image img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.fylo-posts-grid--list .fylo-posts-card:hover .fylo-posts-card__image img {
	transform: scale(1.05);
}

.fylo-posts-grid--list .fylo-posts-card__content {
	padding: 32px 32px 32px 0;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

/* Image Position Right */
.fylo-posts-grid--list.fylo-posts-grid--image-right .fylo-posts-card {
	grid-template-columns: 1fr 320px;
}

.fylo-posts-grid--list.fylo-posts-grid--image-right .fylo-posts-card__content {
	padding: 32px 0 32px 32px;
	order: 1;
}

.fylo-posts-grid--list.fylo-posts-grid--image-right .fylo-posts-card__image {
	order: 2;
}

/* ===============================================
   SHARED CARD ELEMENTS
   =============================================== */

.fylo-posts-card__format-icon {
	position: absolute;
	bottom: 12px;
	right: 12px;
	width: 40px;
	height: 40px;
	background: rgba(255, 255, 255, 0.95);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
	transition: all 0.3s ease;
	z-index: 2;
	border: 2px solid #ff6b35;
}

.fylo-posts-card:hover .fylo-posts-card__format-icon {
	transform: scale(1.1);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.fylo-posts-card__format-icon svg {
	width: 20px;
	height: 20px;
	color: #ff6b35;
	fill: #ff6b35;
	display: block;
}

.fylo-posts-card__category {
	margin-bottom: 12px;
}

.fylo-posts-card__category a {
	display: inline-block;
	background-color: #ff6b35;
	color: #ffffff;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	padding: 6px 14px;
	border-radius: 4px;
	text-decoration: none;
	transition: all 0.3s ease;
}

.fylo-posts-card__category a:hover {
	opacity: 0.9;
	transform: translateY(-1px);
}

.fylo-posts-card__title {
	margin: 0 0 12px;
	font-size: 20px;
	font-weight: 700;
	line-height: 1.4;
}

.fylo-posts-card__title a {
	color: #1e293b;
	text-decoration: none;
	transition: color 0.3s ease;
}

.fylo-posts-card__title a:hover {
	color: #ff6b35;
}

.fylo-posts-card__meta {
	display: flex;
	align-items: center;
	gap: 6px;
	color: #64748b;
	font-size: 13px;
	margin-bottom: 14px;
}

.fylo-posts-card__meta svg {
	flex-shrink: 0;
	opacity: 0.7;
}

.fylo-posts-card__excerpt {
	color: #475569;
	font-size: 15px;
	line-height: 1.7;
	margin: 0 0 20px;
	flex-grow: 1;
}

.fylo-posts-card__button {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background-color: #ff6b35;
	color: #ffffff;
	font-size: 14px;
	font-weight: 600;
	padding: 10px 20px;
	border-radius: 6px;
	text-decoration: none;
	transition: all 0.3s ease;
	align-self: flex-start;
}

.fylo-posts-card__button:hover {
	opacity: 0.9;
	transform: translateX(2px);
}

.fylo-posts-card__button svg {
	width: 16px;
	height: 16px;
	transition: transform 0.3s ease;
}

.fylo-posts-card__button:hover svg {
	transform: translateX(3px);
}

/* List Layout Specific Adjustments */
.fylo-posts-grid--list .fylo-posts-card__title {
	font-size: 24px;
	margin-bottom: 14px;
}

.fylo-posts-grid--list .fylo-posts-card__excerpt {
	font-size: 16px;
	line-height: 1.8;
}

/* ===============================================
   PAGINATION STYLES
   =============================================== */

.fylo-posts-pagination {
	margin-top: 50px;
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 8px;
	width: 100%;
	grid-column: 1 / -1; /* Span all columns in grid layout */
	text-align: center;
}

/* Number Pagination */
.fylo-posts-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 12px;
	border: 2px solid #ff6b35;
	color: #ff6b35;
	background: transparent;
	border-radius: 6px;
	text-decoration: none;
	font-weight: 600;
	font-size: 14px;
	transition: all 0.3s ease;
}

.fylo-posts-pagination .page-numbers:hover {
	background-color: #ff6b35;
	color: #ffffff;
	transform: translateY(-2px);
}

.fylo-posts-pagination .page-numbers.current {
	background-color: #ff6b35;
	color: #ffffff;
	pointer-events: none;
}

.fylo-posts-pagination .page-numbers.dots {
	border: none;
	pointer-events: none;
}

.fylo-posts-pagination .page-numbers svg {
	display: block;
}

/* Load More Button */
.fylo-posts-pagination .load-more-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	background-color: #ff6b35;
	color: #ffffff;
	font-size: 15px;
	font-weight: 600;
	padding: 12px 32px;
	border-radius: 6px;
	text-decoration: none;
	transition: all 0.3s ease;
	border: none;
	cursor: pointer;
	min-width: 150px;
}

.fylo-posts-pagination .load-more-btn:hover:not(:disabled) {
	opacity: 0.9;
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.fylo-posts-pagination .load-more-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.fylo-posts-pagination .load-more-btn:disabled::after {
	content: '';
	display: inline-block;
	width: 14px;
	height: 14px;
	margin-left: 8px;
	border: 2px solid #ffffff;
	border-radius: 50%;
	border-top-color: transparent;
	animation: spin 0.6s linear infinite;
}

@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

/* Smooth appearance for newly loaded posts */
.fylo-posts-card {
	transition: opacity 0.4s ease;
}

/* Previous/Next Navigation */
.fylo-posts-pagination .prev-next-nav {
	display: flex;
	align-items: center;
	gap: 20px;
	justify-content: center;
	width: 100%;
}

.fylo-posts-pagination .nav-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background-color: #ff6b35;
	color: #ffffff;
	font-size: 14px;
	font-weight: 600;
	padding: 10px 20px;
	border-radius: 6px;
	text-decoration: none;
	transition: all 0.3s ease;
}

.fylo-posts-pagination .nav-btn:hover {
	opacity: 0.9;
	transform: translateY(-2px);
}

.fylo-posts-pagination .page-info {
	color: #64748b;
	font-size: 14px;
	font-weight: 500;
}

/* ===============================================
   RESPONSIVE DESIGN
   =============================================== */

@media (max-width: 1400px) {
	.fylo-posts-grid--columns-5 {
		grid-template-columns: repeat(4, 1fr);
	}
}

@media (max-width: 1200px) {
	.fylo-posts-grid--columns-4,
	.fylo-posts-grid--columns-5 {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (max-width: 1024px) {
	.fylo-posts-grid--columns-3,
	.fylo-posts-grid--columns-4,
	.fylo-posts-grid--columns-5 {
		grid-template-columns: repeat(2, 1fr);
	}

	.fylo-posts-grid--list .fylo-posts-card {
		grid-template-columns: 280px 1fr;
		gap: 24px;
	}

	.fylo-posts-grid--list.fylo-posts-grid--image-right .fylo-posts-card {
		grid-template-columns: 1fr 280px;
	}

	.fylo-posts-grid--list .fylo-posts-card__content {
		padding: 28px 28px 28px 0;
	}

	.fylo-posts-grid--list.fylo-posts-grid--image-right .fylo-posts-card__content {
		padding: 28px 0 28px 28px;
	}
}

@media (max-width: 768px) {
	.fylo-posts-grid--grid {
		gap: 24px;
	}

	.fylo-posts-grid--columns-2,
	.fylo-posts-grid--columns-3,
	.fylo-posts-grid--columns-4,
	.fylo-posts-grid--columns-5 {
		grid-template-columns: 1fr;
	}

	.fylo-posts-grid--list {
		gap: 20px;
	}

	.fylo-posts-grid--list .fylo-posts-card,
	.fylo-posts-grid--list.fylo-posts-grid--image-right .fylo-posts-card {
		grid-template-columns: 1fr;
		gap: 0;
		height: auto !important; /* Reset custom height on mobile */
	}

	.fylo-posts-grid--list .fylo-posts-card__image {
		min-height: 240px;
		padding-bottom: 60%;
		order: 1;
		height: auto !important; /* Reset custom height on mobile */
	}

	.fylo-posts-grid--list .fylo-posts-card__content,
	.fylo-posts-grid--list.fylo-posts-grid--image-right .fylo-posts-card__content {
		padding: 24px;
		order: 2;
	}

	.fylo-posts-grid--list .fylo-posts-card:hover {
		transform: translateY(-4px);
	}

	.fylo-posts-pagination {
		margin-top: 40px;
		flex-wrap: wrap;
	}

	.fylo-posts-pagination .prev-next-nav {
		flex-direction: column;
		gap: 12px;
	}

	.fylo-posts-pagination .page-info {
		order: -1;
	}

	.fylo-posts-card__title {
		font-size: 18px;
	}

	.fylo-posts-grid--list .fylo-posts-card__title {
		font-size: 20px;
	}

	.fylo-posts-card__excerpt {
		font-size: 14px;
		line-height: 1.6;
	}

	.fylo-posts-grid--list .fylo-posts-card__excerpt {
		font-size: 15px;
	}

	.fylo-posts-card__content {
		padding: 20px;
	}

	.fylo-posts-card__format-icon {
		width: 36px;
		height: 36px;
		bottom: 10px;
		right: 10px;
	}

	.fylo-posts-card__format-icon svg {
		width: 18px;
		height: 18px;
	}
}

@media (max-width: 480px) {
	.fylo-posts-grid--grid {
		gap: 20px;
	}

	.fylo-posts-card__title {
		font-size: 17px;
	}

	.fylo-posts-grid--list .fylo-posts-card__title {
		font-size: 19px;
	}

	.fylo-posts-card__excerpt {
		font-size: 14px;
		margin-bottom: 16px;
	}

	.fylo-posts-card__button {
		padding: 9px 18px;
		font-size: 13px;
	}

	.fylo-posts-card__format-icon {
		width: 34px;
		height: 34px;
	}

	.fylo-posts-card__format-icon svg {
		width: 16px;
		height: 16px;
	}
}
