/**
 * Calendar WP – Event cards.
 *
 * Layout is handled by Splide (MIT, https://splidejs.com). This file
 * only styles the cards themselves and overrides Splide's default
 * arrow buttons to match the plugin's visual identity.
 *
 * All card rules are scoped under `.cwp-event-cards` to keep
 * specificity above heavy page-builder themes (Divi, Elementor) whose
 * default styles target generic <p>, <h3> and <a> elements.
 */

/* --- 1. Carousel container --- */
/*
 * Cap the width so the carousel does not balloon when placed inside a
 * full-bleed page-builder section (e.g. a Divi row with 100vw width).
 * Without this cap, perPage:3 produces ~600px cards on wide viewports.
 */
.cwp-event-cards {
	margin: 20px auto;
	padding: 0 60px;
	max-width: 1200px;
	box-sizing: border-box;
}

/* --- 2. Slides stretch so cards in a row share the tallest height --- */
.cwp-event-cards .splide__list {
	align-items: stretch;
}

.cwp-event-cards .splide__slide {
	display: flex;
	height: auto;
}

/* --- 3. Card shell --- */
/*
 * The bare `.cwp-event-card` selector is also used by the overview
 * shortcode (see overview.css), so we reset the leaking properties
 * explicitly: align-items, hover bg, cursor.
 */
.cwp-event-cards .cwp-event-card {
	background-color: #fff;
	border-radius: 40px 0 40px 0;
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	width: 100%;
	cursor: default;
	color: inherit;
	transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.cwp-event-cards .cwp-event-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 15px rgba(0, 0, 0, 0.12);
	background-color: #fff;
}

/* --- 4. Image --- */
.cwp-event-cards .cwp-event-card-image {
	height: 240px;
	overflow: hidden;
	border-radius: 40px 0 0 0;
	flex-shrink: 0;
}

.cwp-event-cards .cwp-event-card-image img {
	display: block;
	width: 100%;
	max-width: 100%;
	height: 240px;
	object-fit: cover;
	object-position: center top;
	border-radius: 0;
	margin: 0;
	padding: 0;
}

/*
 * Spacer rendered for cards without a featured image when another card
 * in the same carousel has one. Keeps the textual block aligned across
 * mixed cards.
 */
.cwp-event-cards .cwp-event-card-image-placeholder {
	height: 240px;
	flex-shrink: 0;
	background: transparent;
}

/* --- 5. Content area --- */
.cwp-event-cards .cwp-event-card-content {
	padding: 25px 30px;
	background-color: #fff;
	border-radius: 0 0 40px 0;
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	text-align: left;
	min-height: 0;
}

/* --- 6. Typography --- */
.cwp-event-cards .cwp-event-card-date {
	font-family: 'Open Sans', Arial, sans-serif;
	font-size: 14px;
	color: #8a8a8a;
	margin: 0 0 5px 0;
	padding: 0;
	line-height: 1.4;
}

.cwp-event-cards .cwp-event-card-title {
	font-family: 'Open Sans', Arial, sans-serif;
	font-size: 24px;
	font-weight: 700;
	color: #555c4a;
	margin: 0 0 10px 0;
	padding: 0;
	line-height: 1.2;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	min-height: calc(2 * 1.2em);
}

.cwp-event-cards .cwp-event-card-title-link {
	color: inherit;
	text-decoration: none;
	transition: color 0.2s ease;
}

.cwp-event-cards .cwp-event-card-title-link:hover,
.cwp-event-cards .cwp-event-card-title-link:focus {
	color: #4a7e4e;
	text-decoration: none;
}

.cwp-event-cards .cwp-event-card-excerpt {
	margin: 0 0 20px 0;
	padding: 0;
}

.cwp-event-cards .cwp-event-card-excerpt p {
	font-family: 'Open Sans', Arial, sans-serif;
	font-size: 15px;
	line-height: 1.6;
	color: #6a6a6a;
	margin: 0;
	padding: 0;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* --- 7. Read more link --- */
.cwp-event-cards .cwp-event-card-link {
	font-family: 'Open Sans', Arial, sans-serif;
	font-size: 14px;
	color: #4a7e4e;
	font-weight: 600;
	text-decoration: none;
	display: block;
	text-align: right;
	margin-top: auto;
	padding: 0;
}

.cwp-event-cards .cwp-event-card-link:hover {
	text-decoration: underline;
	color: #3a6a3e;
}

/* --- 8. Splide arrow overrides --- */
.cwp-event-cards .splide__arrow {
	background: #4a7e4e;
	opacity: 1;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	transition: background-color 0.2s ease;
}

.cwp-event-cards .splide__arrow svg {
	fill: #fff;
	width: 18px;
	height: 18px;
}

.cwp-event-cards .splide__arrow:hover:not(:disabled) {
	background: #3a6a3e;
	opacity: 1;
}

.cwp-event-cards .splide__arrow:disabled {
	background: #ccc;
	opacity: 1;
	cursor: default;
}

.cwp-event-cards .splide__arrow--prev {
	left: 0;
}

.cwp-event-cards .splide__arrow--next {
	right: 0;
}

/* --- 9. Pagination dots --- */
.cwp-event-cards .splide__pagination {
	position: static;
	bottom: auto;
	padding: 0;
	margin: 20px 0 0 0;
	gap: 8px;
}

.cwp-event-cards .splide__pagination__page {
	width: 10px;
	height: 10px;
	margin: 0;
	background: #d4d4d4;
	opacity: 1;
	border-radius: 50%;
	border: none;
	padding: 0;
	transition: background-color 0.2s ease, transform 0.2s ease;
}

.cwp-event-cards .splide__pagination__page:hover {
	background: #a8a8a8;
}

.cwp-event-cards .splide__pagination__page.is-active {
	background: #4a7e4e;
	transform: scale(1.2);
}

/* --- 10. Mobile: arrows replaced by swipe --- */
@media (max-width: 767px) {
	.cwp-event-cards {
		padding: 0;
	}

	.cwp-event-cards .splide__arrow {
		display: none;
	}
}

/* --- 11. Empty state --- */
.cwp-event-cards-empty {
	text-align: center;
	padding: 60px 20px;
	color: #555c4a;
	font-size: 24px;
	font-weight: 600;
}
