/* =========================================
   YoGrid Widget - BSS-Plus
   ========================================= */

/* --- Grid Layout --- */
.bsw-yogrid__grid {
	--bsw-yogrid-columns: 3;
	--bsw-yogrid-gap: 2rem;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: var(--bsw-yogrid-gap);
}

/* --- Card --- */
.bsw-yogrid__card {
	width: calc((100% - (var(--bsw-yogrid-columns) - 1) * var(--bsw-yogrid-gap)) / var(--bsw-yogrid-columns));
	background: #ffffff;
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.bsw-yogrid__card:hover {
	transform: translateY(-8px);
	box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* --- Card Image --- */
.bsw-yogrid__card-image {
	position: relative;
	height: 250px;
	overflow: hidden;
}

.bsw-yogrid__card-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.5s ease;
}

.bsw-yogrid__card:hover .bsw-yogrid__card-image img {
	transform: scale(1.05);
}

/* --- Overlay --- */
.bsw-yogrid__overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.4);
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.bsw-yogrid__card:hover .bsw-yogrid__overlay {
	opacity: 1;
}

.bsw-yogrid__overlay-btn {
	background: #ffffff;
	color: #1f2937;
	padding: 0.8rem 1.5rem;
	border-radius: 50px;
	font-weight: 700;
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	text-decoration: none;
	font-size: 0.95rem;
	transition: transform 0.2s ease;
}

.bsw-yogrid__overlay-btn:hover {
	transform: scale(1.05);
	color: #1f2937;
}

/* --- Card Content --- */
.bsw-yogrid__card-content {
	padding: 1.5rem;
}

/* --- Tags --- */
.bsw-yogrid__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-bottom: 0.8rem;
}

.bsw-yogrid__tag {
	font-size: 0.75rem;
	background: #e0f2fe;
	color: #004a94;
	padding: 0.2rem 0.6rem;
	border-radius: 4px;
	font-weight: 600;
	display: inline-block;
	line-height: 1.4;
}

/* --- Title --- */
.bsw-yogrid__title {
	font-size: 1.4rem;
	font-weight: 700;
	margin-bottom: 0.5rem;
	color: #1A1A2E;
	line-height: 1.3;
}

.bsw-yogrid__title a {
	color: inherit;
	text-decoration: none;
	transition: color 0.3s ease;
}

.bsw-yogrid__title a:hover {
	color: #0066CC;
}

/* --- Excerpt --- */
.bsw-yogrid__excerpt {
	color: #6b7280;
	font-size: 0.95rem;
	line-height: 1.6;
	margin: 0;
}

/* --- Filter Buttons --- */
.bsw-yogrid__filters {
	display: flex;
	justify-content: center;
	gap: 1rem;
	margin-bottom: 3rem;
	flex-wrap: wrap;
}

.bsw-yogrid__filter-btn {
	background: transparent;
	border: 1px solid #e5e7eb;
	padding: 0.6rem 1.5rem;
	border-radius: 50px;
	cursor: pointer;
	font-weight: 600;
	color: #6b7280;
	transition: all 0.3s ease;
	font-family: inherit;
	font-size: 0.95rem;
	line-height: 1.4;
}

.bsw-yogrid__filter-btn:hover,
.bsw-yogrid__filter-btn--active {
	background: #0066CC;
	color: #ffffff;
	border-color: #0066CC;
}

/* --- Pagination (Numbered) --- */
.bsw-yogrid__pagination {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 0.5rem;
	margin-top: 3rem;
}

.bsw-yogrid__page-numbers {
	display: flex;
	gap: 0.5rem;
}

.bsw-yogrid__page-btn {
	width: 40px;
	height: 40px;
	border: 1px solid #e5e7eb;
	background: #ffffff;
	border-radius: 8px;
	cursor: pointer;
	font-weight: 600;
	font-size: 0.9rem;
	color: #1f2937;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.3s ease;
	font-family: inherit;
	padding: 0;
}

.bsw-yogrid__page-btn:hover:not(:disabled) {
	background: #0066CC;
	color: #ffffff;
	border-color: #0066CC;
}

.bsw-yogrid__page-btn--active {
	background: #0066CC;
	color: #ffffff;
	border-color: #0066CC;
}

.bsw-yogrid__page-btn:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

/* --- Load More --- */
.bsw-yogrid__load-more-wrap {
	display: flex;
	justify-content: center;
	margin-top: 3rem;
}

.bsw-yogrid__load-more-btn {
	background: #0066CC;
	color: #ffffff;
	border: none;
	padding: 0.8rem 2.5rem;
	border-radius: 50px;
	font-weight: 600;
	font-size: 1rem;
	cursor: pointer;
	transition: all 0.3s ease;
	font-family: inherit;
}

.bsw-yogrid__load-more-btn:hover {
	background: #004a94;
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

.bsw-yogrid__load-more-btn--loading {
	opacity: 0.7;
	pointer-events: none;
}

/* --- Animations --- */
.bsw-yogrid__card--animate-in {
	animation: bswYogridFadeIn 0.5s ease-in-out both;
}

@keyframes bswYogridFadeIn {
	from {
		opacity: 0;
		transform: translateY(20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Staggered animation delays */
.bsw-yogrid__card--animate-in:nth-child(1)  { animation-delay: 0s; }
.bsw-yogrid__card--animate-in:nth-child(2)  { animation-delay: 0.05s; }
.bsw-yogrid__card--animate-in:nth-child(3)  { animation-delay: 0.1s; }
.bsw-yogrid__card--animate-in:nth-child(4)  { animation-delay: 0.15s; }
.bsw-yogrid__card--animate-in:nth-child(5)  { animation-delay: 0.2s; }
.bsw-yogrid__card--animate-in:nth-child(6)  { animation-delay: 0.25s; }
.bsw-yogrid__card--animate-in:nth-child(7)  { animation-delay: 0.3s; }
.bsw-yogrid__card--animate-in:nth-child(8)  { animation-delay: 0.35s; }
.bsw-yogrid__card--animate-in:nth-child(9)  { animation-delay: 0.4s; }
.bsw-yogrid__card--animate-in:nth-child(10) { animation-delay: 0.45s; }
.bsw-yogrid__card--animate-in:nth-child(11) { animation-delay: 0.5s; }
.bsw-yogrid__card--animate-in:nth-child(12) { animation-delay: 0.55s; }

/* --- Loading State --- */
.bsw-yogrid__grid--loading {
	opacity: 0.5;
	pointer-events: none;
	transition: opacity 0.2s ease;
}

/* --- No Results --- */
.bsw-yogrid__no-results {
	text-align: center;
	padding: 3rem 1rem;
	color: #6b7280;
	font-size: 1.1rem;
	width: 100%;
}

/* --- Responsive Fallbacks --- */
@media (max-width: 1024px) {
	.bsw-yogrid__grid {
		--bsw-yogrid-columns: 2;
	}
}

@media (max-width: 767px) {
	.bsw-yogrid__grid {
		--bsw-yogrid-columns: 1;
	}

	.bsw-yogrid__filters {
		gap: 0.5rem;
	}

	.bsw-yogrid__filter-btn {
		padding: 0.5rem 1rem;
		font-size: 0.85rem;
	}
}
