/* ─── Ecto Blog Posts Widget ─── */

.ecto-bp-wrap {
	--ecto-bp-gap: 32px;
	--ecto-bp-image-bg: #2f6af7;
	--ecto-bp-img-blend: screen;
	--ecto-bp-badge-bg: #2f6af7;
	--ecto-bp-badge-color: #ffffff;
	--ecto-bp-title-color: #18181b;
	--ecto-bp-title-hover-color: #2f6af7;
	--ecto-bp-excerpt-color: #717179;
	--ecto-bp-author-color: #52525a;
	--ecto-bp-meta-color: #717179;
	--ecto-bp-featured-height: 322px;
	--ecto-bp-featured-radius: 16px;
	--ecto-bp-thumb-width: 176px;
	--ecto-bp-thumb-height: 150px;
	--ecto-bp-thumb-radius: 16px;
	--ecto-bp-card-image-height: 220px;
	--ecto-bp-card-radius: 16px;
	--ecto-bp-cols: 3;
	--ecto-bp-featured-avatar-size: 48px;
	--ecto-bp-avatar-size: 32px;
	--ecto-bp-avatar-radius: 50%;
	--ecto-bp-title-hover-decoration: none;
}

/* ────────────────────────────────────────
   Featured + List Layout
   ──────────────────────────────────────── */

.ecto-bp--featured-list .ecto-bp-cols {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--ecto-bp-gap);
	align-items: start;
}

.ecto-bp--featured-list.ecto-bp--featured-right .ecto-bp-cols {
	direction: rtl;
}
.ecto-bp--featured-list.ecto-bp--featured-right .ecto-bp-cols > * {
	direction: ltr;
}

/* Featured post */
.ecto-bp-featured {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 24px;
}

.ecto-bp-featured__image {
	position: relative;
	height: var(--ecto-bp-featured-height);
	border-radius: var(--ecto-bp-featured-radius);
	overflow: hidden;
	background-color: var(--ecto-bp-image-bg);
	flex-shrink: 0;
}

.ecto-bp-featured__content {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

/* List column */
.ecto-bp-list-col {
	display: flex;
	flex-direction: column;
	gap: var(--ecto-bp-gap);
	justify-content: center;
}

/* List item */
.ecto-bp-item {
	display: flex;
	gap: 24px;
	align-items: flex-start;
	position: relative;
}

.ecto-bp-item__thumb {
	flex-shrink: 0;
	width: var(--ecto-bp-thumb-width);
	height: var(--ecto-bp-thumb-height);
	border-radius: var(--ecto-bp-thumb-radius);
	overflow: hidden;
	background-color: var(--ecto-bp-image-bg);
	position: relative;
}

.ecto-bp-item__content {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 16px;
	justify-content: center;
}

/* ────────────────────────────────────────
   Grid Layout
   ──────────────────────────────────────── */

.ecto-bp--grid .ecto-bp-grid {
	display: grid;
	grid-template-columns: repeat(var(--ecto-bp-cols), 1fr);
	gap: var(--ecto-bp-gap);
}

.ecto-bp-card {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.ecto-bp-card__image {
	width: 100%;
	height: var(--ecto-bp-card-image-height);
	border-radius: var(--ecto-bp-card-radius);
	overflow: hidden;
	background-color: var(--ecto-bp-image-bg);
	position: relative;
	flex-shrink: 0;
}

.ecto-bp-card__content {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

/* ────────────────────────────────────────
   List Layout (all horizontal)
   ──────────────────────────────────────── */

.ecto-bp--list .ecto-bp-list {
	display: flex;
	flex-direction: column;
	gap: var(--ecto-bp-gap);
}

/* ────────────────────────────────────────
   Image (shared)
   ──────────────────────────────────────── */

.ecto-bp-wrap .ecto-bp-img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	mix-blend-mode: var(--ecto-bp-img-blend, normal);
	display: block;
}

/* Image hover zoom */
.ecto-bp-wrap .ecto-bp-img {
	transition: transform 0.4s ease;
}

.ecto-bp-featured:hover .ecto-bp-img,
.ecto-bp-item:hover .ecto-bp-img,
.ecto-bp-card:hover .ecto-bp-img {
	transform: scale(1.06);
}

/* ────────────────────────────────────────
   Overlay link
   ──────────────────────────────────────── */

.ecto-bp-link {
	position: absolute;
	inset: 0;
	z-index: 2;
	border-radius: inherit;
}

/* ────────────────────────────────────────
   Badge
   ──────────────────────────────────────── */

.ecto-bp-wrap .ecto-bp-badge {
	position: relative;
	z-index: 3;
	display: inline-flex;
	align-items: center;
	padding: 6px 16px;
	border-radius: 999px;
	background-color: var(--ecto-bp-badge-bg);
	color: var(--ecto-bp-badge-color);
	font-size: 14px;
	font-weight: 500;
	line-height: 20px;
	text-decoration: none;
	white-space: nowrap;
	align-self: flex-start;
}

/* ────────────────────────────────────────
   Title
   ──────────────────────────────────────── */

.ecto-bp-title {
	font-size: 24px;
	font-weight: 500;
	line-height: 32px;
	color: var(--ecto-bp-title-color);
	margin: 0;
	display: block;
	position: relative;
	z-index: 3;
}

.ecto-bp-wrap .ecto-bp-title-link {
	color: inherit;
	text-decoration: none;
	transition: color 0.2s ease, text-decoration-color 0.2s ease;
	display: block;
}

.ecto-bp-wrap .ecto-bp-title-link:hover {
	color: var(--ecto-bp-title-hover-color);
	text-decoration: var(--ecto-bp-title-hover-decoration, none);
}

.ecto-bp-item .ecto-bp-title,
.ecto-bp-card .ecto-bp-title {
	font-size: 20px;
	line-height: 28px;
}

/* ────────────────────────────────────────
   Excerpt
   ──────────────────────────────────────── */

.ecto-bp-excerpt {
	font-size: 14px;
	font-weight: 400;
	line-height: 24px;
	color: var(--ecto-bp-excerpt-color);
	margin: 0;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* ────────────────────────────────────────
   Meta (author + date)
   ──────────────────────────────────────── */

.ecto-bp-meta {
	display: flex;
	align-items: center;
	gap: 12px;
	position: relative;
	z-index: 3;
}

.ecto-bp-wrap .ecto-bp-avatar {
	width: var(--ecto-bp-featured-avatar-size, 48px);
	height: var(--ecto-bp-featured-avatar-size, 48px);
	border-radius: var(--ecto-bp-avatar-radius, 50%);
	overflow: hidden;
	object-fit: cover;
	flex-shrink: 0;
	display: block;
}

.ecto-bp-wrap .ecto-bp-item .ecto-bp-avatar,
.ecto-bp-wrap .ecto-bp-card .ecto-bp-avatar {
	width: var(--ecto-bp-avatar-size, 32px);
	height: var(--ecto-bp-avatar-size, 32px);
}

.ecto-bp-meta-text {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.ecto-bp-wrap .ecto-bp-author-link {
	display: inline-flex;
	align-items: center;
	text-decoration: none;
	flex-shrink: 0;
	position: relative;
	z-index: 4;
}

.ecto-bp-wrap .ecto-bp-author-link:hover .ecto-bp-author {
	text-decoration: underline;
}

.ecto-bp-author {
	font-size: 14px;
	font-weight: 600;
	line-height: 24px;
	color: var(--ecto-bp-author-color);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ecto-bp-datetime {
	font-size: 12px;
	font-weight: 400;
	line-height: 16px;
	color: var(--ecto-bp-meta-color);
}

/* ────────────────────────────────────────
   Read more
   ──────────────────────────────────────── */

.ecto-bp-read-more {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 14px;
	font-weight: 500;
	color: #2f6af7;
	text-decoration: none;
	position: relative;
	z-index: 3;
	transition: opacity 0.2s ease;
}

.ecto-bp-read-more:hover {
	opacity: 0.8;
}

/* ────────────────────────────────────────
   Category count badge
   ──────────────────────────────────────── */

.ecto-bp-wrap {
	--ecto-bp-cat-count-color: #52525a;
	--ecto-bp-cat-count-bg: transparent;
}

.ecto-bp-cat-count {
	display: inline-flex;
	align-items: center;
	font-size: 12px;
	font-weight: 500;
	line-height: 16px;
	color: var(--ecto-bp-cat-count-color);
	background-color: var(--ecto-bp-cat-count-bg);
	position: relative;
	z-index: 3;
}

/* ────────────────────────────────────────
   Empty state
   ──────────────────────────────────────── */

.ecto-bp-empty {
	font-size: 14px;
	color: #717179;
	padding: 24px 0;
	text-align: center;
}

/* ────────────────────────────────────────
   Responsive
   ──────────────────────────────────────── */

@media (max-width: 1024px) {
	.ecto-bp--grid .ecto-bp-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 767px) {
	.ecto-bp--featured-list .ecto-bp-cols,
	.ecto-bp--grid .ecto-bp-grid {
		grid-template-columns: 1fr;
	}

	.ecto-bp-item {
		flex-direction: column;
	}

	.ecto-bp-item__thumb {
		width: 100%;
		height: 200px;
	}

	.ecto-bp--featured-list.ecto-bp--featured-right .ecto-bp-cols {
		direction: ltr;
	}
}
