/**
 * Blog Components Styles
 * Reusable styles for blog post cards and blog-related components
 */

/* ====================================
   BLOG POST CARD
   ==================================== */

.blog-post-card {
	transition: all var(--transition-speed);
	cursor: pointer;
	position: relative;
	overflow: hidden;
}

.blog-post-card:hover {
	transform: translateY(-8px);
	box-shadow: 
		0 20px 40px rgba(0, 0, 0, 0.12),
		0 10px 20px rgba(0, 0, 0, 0.08) !important;
}

.blog-post-card .card-img-top {
	transition: transform var(--transition-speed);
	overflow: hidden;
}

.blog-post-card:hover .card-img-top {
	transform: scale(1.08);
}

.blog-post-card .position-relative {
	overflow: hidden;
}

.blog-post-title {
	font-size: 1.1rem;
	font-weight: 600;
	line-height: 1.4;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	transition: color var(--transition-speed);
	position: relative;
	z-index: 1;
}

.blog-post-card:hover .blog-post-title {
	color: var(--primary-color) !important;
}

.blog-post-card .badge {
	font-size: 0.75rem;
	font-weight: 600;
	padding: 0.35rem 0.65rem;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.blog-post-card .card-footer {
	font-size: 0.85rem;
	background: transparent !important;
}

/* Gradient Background for Posts without Image */
.blog-post-card .bg-gradient {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	position: relative;
	overflow: hidden;
}

.blog-post-card .bg-gradient::before {
	content: '';
	position: absolute;
	inset: 0;
	background: radial-gradient(circle at 30% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 60%);
	pointer-events: none;
}

/* ====================================
   BLOG SECTION HEADER
   ==================================== */

.blog-section-header {
	margin-bottom: 3rem;
}

.blog-section-header .section-badge {
	display: inline-block;
	background: linear-gradient(135deg, 
		var(--primary-color), 
		var(--primary-light)
	);
	color: white;
	padding: 0.625rem 1.5rem;
	border-radius: 50px;
	font-size: 0.9rem;
	font-weight: 600;
	letter-spacing: 0.5px;
	box-shadow: 
		0 4px 12px rgba(37, 99, 235, 0.3),
		0 2px 6px rgba(37, 99, 235, 0.2);
	animation: fadeInDown 0.6s ease-out;
}

.blog-section-header .section-badge i {
	animation: pulse 2s ease-in-out infinite;
}

.blog-section-header h2 {
	font-size: 2rem;
	font-weight: 700;
	color: var(--text-dark);
	margin-top: 1rem;
	margin-bottom: 1rem;
}

.blog-section-header .lead {
	font-size: 1.1rem;
	color: var(--text-medium);
	line-height: 1.7;
}

/* ====================================
   BLOG GRID LAYOUT
   ==================================== */

.blog-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
	gap: 2rem;
}

@media (max-width: 767px) {
	.blog-grid {
		grid-template-columns: 1fr;
		gap: 1.5rem;
	}
}

/* ====================================
   BLOG POST BADGES
   ==================================== */

.badge-toplist {
	background: linear-gradient(135deg, 
		var(--warning-color), 
		var(--accent-light)
	);
	color: var(--text-dark);
}

.badge-review {
	background: linear-gradient(135deg, 
		var(--primary-color), 
		var(--primary-light)
	);
	color: white;
}

.badge-featured {
	background: linear-gradient(135deg, 
		var(--danger-color), 
		#dc2626
	);
	color: white;
}

/* ====================================
   BLOG CTA BUTTON
   ==================================== */

.blog-cta-button {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 1rem 2.5rem;
	font-size: 1.05rem;
	font-weight: 600;
	border-radius: var(--border-radius-lg);
	background: var(--primary-color);
	color: white;
	border: none;
	box-shadow: 
		0 4px 12px rgba(37, 99, 235, 0.3),
		0 2px 6px rgba(37, 99, 235, 0.2);
	transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
	text-decoration: none;
}

.blog-cta-button:hover {
	transform: translateY(-3px);
	box-shadow: 
		0 8px 20px rgba(37, 99, 235, 0.4),
		0 4px 12px rgba(37, 99, 235, 0.3);
	color: white;
}

.blog-cta-button i {
	transition: transform 0.3s ease;
}

.blog-cta-button:hover i {
	transform: translateX(5px);
}

/* ====================================
   SCROLL ANIMATIONS FOR BLOG CARDS
   ==================================== */

@media (prefers-reduced-motion: no-preference) {
	.blog-post-card {
		opacity: 0;
		animation: fadeInUp 0.6s ease-out forwards;
	}
	
	.blog-post-card:nth-child(1) { animation-delay: 0.1s; }
	.blog-post-card:nth-child(2) { animation-delay: 0.2s; }
	.blog-post-card:nth-child(3) { animation-delay: 0.3s; }
	.blog-post-card:nth-child(4) { animation-delay: 0.4s; }
	.blog-post-card:nth-child(5) { animation-delay: 0.5s; }
	.blog-post-card:nth-child(6) { animation-delay: 0.6s; }
	.blog-post-card:nth-child(7) { animation-delay: 0.7s; }
	.blog-post-card:nth-child(8) { animation-delay: 0.8s; }
	.blog-post-card:nth-child(9) { animation-delay: 0.9s; }
	
	@keyframes fadeInUp {
		from {
			opacity: 0;
			transform: translateY(30px);
		}
		to {
			opacity: 1;
			transform: translateY(0);
		}
	}
}

/* ====================================
   RESPONSIVE - BLOG COMPONENTS
   ==================================== */

@media (max-width: 991px) {
	.blog-post-title {
		font-size: 1.05rem;
	}
	
	.blog-section-header h2 {
		font-size: 1.75rem;
	}
	
	.blog-section-header .lead {
		font-size: 1rem;
	}
}

@media (max-width: 767px) {
	.blog-post-title {
		font-size: 1rem;
	}
	
	.blog-post-card .badge {
		font-size: 0.7rem;
		padding: 0.3rem 0.55rem;
	}
	
	.blog-section-header .section-badge {
		font-size: 0.85rem;
		padding: 0.5rem 1.25rem;
	}
	
	.blog-section-header h2 {
		font-size: 1.5rem;
	}
	
	.blog-section-header .lead {
		font-size: 0.95rem;
	}
	
	.blog-cta-button {
		width: 100%;
		justify-content: center;
		padding: 0.875rem 2rem;
	}
}

/* ====================================
   BLOG POST META INFO
   ==================================== */

.blog-post-meta {
	display: flex;
	align-items: center;
	gap: 1rem;
	font-size: 0.85rem;
	color: var(--text-muted);
}

.blog-post-meta-item {
	display: flex;
	align-items: center;
	gap: 0.35rem;
}

.blog-post-meta-item i {
	font-size: 0.9rem;
}

/* ====================================
   BLOG EXCERPT
   ==================================== */

.blog-excerpt {
	font-size: 0.95rem;
	line-height: 1.6;
	color: var(--text-medium);
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* ====================================
   PERFORMANCE OPTIMIZATIONS
   ==================================== */

.blog-post-card {
	will-change: transform, box-shadow;
}

.blog-post-card .card-img-top {
	will-change: transform;
}

/* Disable animations on reduced motion preference */
@media (prefers-reduced-motion: reduce) {
	.blog-post-card,
	.blog-post-card *,
	.blog-section-header .section-badge i {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}
