/**
 * DDN Blog Showcase
 * Every rule is scoped under .ddn-bs — nothing here can leak into the theme.
 */

.ddn-bs {
	--ddn-bs-col-gap: 32px;
	--ddn-bs-row-gap: 32px;
	position: relative;
}

/* ---------- Grid ---------- */

.ddn-bs__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	column-gap: var(--ddn-bs-col-gap);
	row-gap: var(--ddn-bs-row-gap);
	align-items: stretch;
}

.ddn-bs__item {
	min-width: 0;
	height: auto;
}

/* ---------- Card ---------- */

.ddn-bs__card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background-color: #fff;
	border-radius: 18px;
	transition: box-shadow .3s ease, transform .3s ease;
}

.ddn-bs--equal .ddn-bs__card {
	height: 100%;
}

.ddn-bs__body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	padding: 20px;
}

/* ---------- Media ---------- */

.ddn-bs__media {
	position: relative;
	display: block;
	overflow: hidden;
	aspect-ratio: 3 / 2;
	background-color: #eef1f4;
	line-height: 0;
}

.ddn-bs__media::after {
	content: "";
	position: absolute;
	inset: 0;
	opacity: 0;
	pointer-events: none;
	transition: opacity .3s ease;
}

.ddn-bs__img,
.ddn-bs__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center 35%;
	display: block;
	transition: transform .6s cubic-bezier(.22, .61, .36, 1);
}

.ddn-bs--zoom .ddn-bs__card:hover .ddn-bs__img {
	transform: scale(1.05);
}

/* ---------- Badge ---------- */

.ddn-bs__badge {
	position: absolute;
	left: 14px;
	bottom: 14px;
	z-index: 2;
	display: inline-block;
	padding: 6px 14px;
	font-size: 12px;
	line-height: 1.2;
	letter-spacing: .02em;
	color: #fff;
	background-color: rgba(0, 0, 0, .55);
	border-radius: 999px;
	backdrop-filter: blur(4px);
}

/* ---------- Text ---------- */

.ddn-bs__meta {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 10px;
	font-size: 13px;
	color: #7a8290;
}

.ddn-bs__title {
	margin: 0 0 10px;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.ddn-bs__title a {
	color: inherit;
	text-decoration: none;
	transition: color .25s ease;
}

.ddn-bs__excerpt {
	margin: 0 0 16px;
	color: #5a6472;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* Pins the link to the bottom so every card in a row lines up */
.ddn-bs__link {
	margin-top: auto;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	text-decoration: none;
	transition: color .25s ease, gap .25s ease;
}

.ddn-bs__link:hover {
	gap: 12px;
}

.ddn-bs__arrow-icon {
	flex: 0 0 auto;
}

/* ---------- Carousel ---------- */

.ddn-bs__swiper {
	overflow: hidden;
	width: 100%;
}

.ddn-bs--carousel .swiper-slide {
	height: auto;
}

.ddn-bs--equal.ddn-bs--carousel .swiper-wrapper {
	align-items: stretch;
}

.ddn-bs__arrow {
	position: absolute;
	top: 50%;
	z-index: 5;
	transform: translateY(-50%);
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background-color: #fff;
	box-shadow: 0 6px 20px rgba(16, 24, 40, .14);
	cursor: pointer;
	transition: transform .25s ease, opacity .25s ease;
}

.ddn-bs__arrow:hover {
	transform: translateY(-50%) scale(1.08);
}

.ddn-bs__arrow:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

.ddn-bs__arrow--prev { left: -18px; }
.ddn-bs__arrow--next { right: -18px; }

.ddn-bs__arrow.swiper-button-disabled {
	opacity: .35;
	cursor: default;
}

.ddn-bs__pagination {
	position: static;
	margin-top: 22px;
	text-align: center;
}

.ddn-bs__pagination .swiper-pagination-bullet {
	width: 8px;
	height: 8px;
	opacity: .35;
	transition: opacity .25s ease, width .25s ease;
}

.ddn-bs__pagination .swiper-pagination-bullet-active {
	opacity: 1;
	width: 22px;
	border-radius: 999px;
}

/* ---------- Responsive ---------- */

@media (max-width: 1200px) {
	.ddn-bs__arrow--prev { left: 4px; }
	.ddn-bs__arrow--next { right: 4px; }
}

@media (max-width: 767px) {
	.ddn-bs__grid {
		grid-template-columns: 1fr;
	}
}

/* ---------- Accessibility ---------- */

@media (prefers-reduced-motion: reduce) {
	.ddn-bs__card,
	.ddn-bs__img,
	.ddn-bs__link,
	.ddn-bs__arrow {
		transition: none !important;
	}
	.ddn-bs--zoom .ddn-bs__card:hover .ddn-bs__img {
		transform: none;
	}
}
