/* [cd_category_articles] shortcode styles */

/* Two results at two fifths each, advert slot at one fifth. */
.cd-ca-grid {
	display: grid;
	grid-template-columns: 2fr 2fr 1fr;
	align-items: start;
	gap: 22px;
}

/* No advert available: the two articles take the full width instead of
   leaving a visibly empty third column. */
.cd-ca-grid-no-ad {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* The advert fills the slot's height, matching the 504px cards beside it. */
.cd-ca-ad .cd-ad,
.cd-ca-ad .cd-ad-link,
.cd-ca-ad .cd-ad-picture {
	height: 100%;
}

.cd-ca-ad .cd-ad {
	aspect-ratio: auto;
	border-radius: 0;
	background: transparent;
}

.cd-ca-card,
.cd-ca-ad {
	box-sizing: border-box;
	/* 252px image + 250px body + the 1px border top and bottom. */
	height: 504px;
	border: 1px solid #E0E0E0;
	border-radius: 18px;
	background: #fff;
}

.cd-ca-card {
	display: flex;
	flex-direction: column;
	/* Clips the image to the card's top corners. */
	overflow: hidden;
	text-decoration: none;
	color: inherit;
}

.cd-ca-card:hover,
.cd-ca-card:focus {
	text-decoration: none;
	color: inherit;
}

/* Featured images vary in size, and themes commonly force img height to auto,
   so the 252px box is locked down here. */
.cd-ca-image {
	display: block;
	flex: 0 0 252px;
	width: 100% !important;
	max-width: 100% !important;
	height: 252px !important;
	min-height: 252px !important;
	max-height: 252px !important;
	object-fit: cover !important;
	object-position: center center !important;
	/* One less than the card radius, to sit inside the 1px border. */
	border-top-left-radius: 17px;
	border-top-right-radius: 17px;
	border-bottom-left-radius: 0;
	border-bottom-right-radius: 0;
	border: 0;
	margin: 0;
	padding: 0;
}

.cd-ca-image-placeholder {
	background: #EFE7E1;
}

.cd-ca-body {
	display: flex;
	flex-direction: column;
	box-sizing: border-box;
	flex: 1 1 auto;
	min-height: 0;
	background: #FDF7F3;
	padding: 21px 21px 29px 21px;
}

.cd-ca-category {
	display: block;
	font-family: 'Outfit', sans-serif !important;
	font-weight: 400 !important;
	font-size: 14px !important;
	line-height: 100% !important;
	letter-spacing: 0.29em;
	text-transform: uppercase;
	color: #4B2FC5;
}

/* Two lines, not three: the 250px body cannot fit a third at this height. */
.cd-ca-title {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	margin-top: 15px;
	font-family: 'Playfair Display', serif !important;
	font-weight: 400 !important;
	font-size: 28px !important;
	line-height: 100% !important;
	letter-spacing: 0;
	color: #0B0B0B;
}

.cd-ca-rule {
	display: block;
	flex: 0 0 1px;
	width: 36px;
	height: 1px;
	margin-top: 22px;
	background: #F6599C;
}

.cd-ca-excerpt {
	display: -webkit-box;
	-webkit-line-clamp: 1;
	-webkit-box-orient: vertical;
	overflow: hidden;
	margin-top: 16px;
	font-family: 'Outfit', sans-serif !important;
	font-weight: 400 !important;
	font-size: 17px !important;
	line-height: 26px !important;
	letter-spacing: 0;
	color: #1E1E1EB2;
}

/* margin-top:auto floats this flush to the bottom padding edge. */
.cd-ca-more {
	display: block;
	box-sizing: border-box;
	width: 159px;
	max-width: 100%;
	margin-top: auto;
	padding-bottom: 12px;
	border-bottom: 1px solid #4B2FC5;
	border-radius: 0;
}

.cd-ca-more-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.cd-ca-more-text {
	font-family: 'Outfit', sans-serif !important;
	font-weight: 400 !important;
	font-size: 14px !important;
	line-height: 100% !important;
	letter-spacing: 0.25em;
	text-transform: uppercase;
	color: #4B2FC5;
}

.cd-ca-more-arrow {
	display: block;
	flex: 0 0 19px;
	width: 19px !important;
	height: 11px !important;
	border: 0 !important;
	border-radius: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	box-shadow: none !important;
}

/* Advert slot — a plain bordered box until advert handling is built. */
.cd-ca-ad {
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.cd-ca-empty {
	font-family: 'Outfit', sans-serif;
	font-size: 15px;
	color: #666;
}

/* --- Responsive -------------------------------------------------------- */

/* Tablet: two results side by side, advert across the full width below. */
@media (max-width: 1024px) {
	.cd-ca-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.cd-ca-ad {
		grid-column: 1 / -1;
		height: 280px;
	}

	/* Already two columns here, so the no-advert case needs no change beyond
	   not reserving the row. */
	.cd-ca-grid-no-ad {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* Mobile: one card per row. */
@media (max-width: 600px) {
	.cd-ca-grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.cd-ca-ad {
		grid-column: auto;
	}
}
