/**
 * Blog Posts Carousel Styles
 * Horizontal scrollable blog post cards
 */

/* Query block wrapper */
.blog-carousel-query {
	width: 100%;
}

.blog-carousel-wrapper {
	width: 100%;
	position: relative;
	margin-right: 0;
	padding-left: 0;
	padding-right: 0;
}

/* Heading inside wrapper needs padding to align with content */
.blog-carousel-wrapper > .wp-block-heading {
	padding-left: 30px;
	padding-right: 30px;
	margin-bottom: var(--wp--preset--spacing--small, 1rem);
}

/* Horizontal scrolling container */
.blog-carousel-container {
	display: flex !important;
	flex-wrap: nowrap !important;
	gap: 1rem;
	padding-left: 30px;
	padding-right: 30px;
	margin: 0;
	overflow: auto hidden;
	width: 100%;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	list-style: none;
}

/* Hide scrollbar but keep functionality */
.blog-carousel-container::-webkit-scrollbar {
	display: none;
}

.blog-carousel-container {
	scrollbar-width: none; /* Firefox */
	-ms-overflow-style: none; /* IE and Edge */
}

/* Remove default list item styling */
.blog-carousel-container > li {
	list-style: none;
	margin: 0 !important;
	padding: 0 !important;
}

/* Individual blog post card */
.blog-post-card {
	flex-shrink: 0;
	width: 360px;
	background: #fff;
	border-radius: 12px;
	overflow: hidden;
	transition: box-shadow 0.2s ease, transform 0.2s ease;
	display: flex;
	flex-direction: column;
}

.blog-post-card:hover {
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
	transform: translateY(-2px);
}

/* Featured image */
.blog-post-card .wp-block-post-featured-image {
	width: 360px;
	height: 196px;
	margin: 0;
	overflow: hidden;
}

.blog-post-card .wp-block-post-featured-image img {
	width: 100%;
	height: 196px;
	object-fit: cover;
	display: block;
	transition: transform 0.3s ease;
	border-radius: 10px;
}

/* Content wrapper */
.blog-post-card > .wp-block-group {
	display: flex;
	flex-direction: column;
	flex-grow: 1;
}

/* Post title */
.blog-post-card .wp-block-post-title {
	font-size: 1.25rem;
	font-weight: 600;
	line-height: 1.4;
	margin: 0 0 0.5rem 0;
}

.blog-post-card .wp-block-post-title a {
	text-decoration: none;
	color: inherit;
	transition: color 0.2s ease;
}
/* Post excerpt */
.blog-post-card .wp-block-post-excerpt {
	margin: 0 0 1rem 0;
	flex-grow: 1;
}

.blog-post-card .wp-block-post-excerpt p {
	color: #666;
	line-height: 1.6;
	font-size: 0.9375rem;
	margin: 0;
}

/* Read More button */
.blog-post-card .wp-block-buttons {
	margin: 0;
}

.blog-post-card .wp-block-button {
	margin: 0;
}

.blog-post-card .wp-block-button__link {
	padding: 0.75rem 1.5rem;
	font-size: 0.9375rem;
	font-weight: 500;
	text-decoration: none;
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.blog-post-card .wp-block-button__link:hover {
	opacity: 0.9;
	transform: scale(1.02);
}

/* Editor overrides */
.editor-styles-wrapper .blog-carousel-container > li {
	margin-block-start: 0 !important;
	margin-block-end: 0 !important;
}

/* Responsive adjustments */
@media (max-width: 599px) {
	.blog-carousel-wrapper {
		margin-left: 0;
		margin-right: 0;
	}
	
	.blog-carousel-wrapper > .wp-block-heading {
		padding-left: var(--wp--preset--spacing--medium, 1rem);
		padding-right: var(--wp--preset--spacing--medium, 1rem);
	}
	
	.blog-carousel-container {
		padding-left: var(--wp--preset--spacing--medium, 1rem);
		padding-right: var(--wp--preset--spacing--medium, 1rem);
	}
	
	.blog-post-card,
	.blog-post-card .wp-block-post-featured-image {
		width: 280px;
	}
	
	.blog-post-card .wp-block-post-featured-image img {
		width: 100%;
		height: 153px; /* Maintain aspect ratio */
	}
}

