/**
 * Post Blog Grid — base styles.
 * Overridable from the widget's Style tab.
 */

.mge-blog {
	width: 100%;
	margin-left: auto;
	margin-right: auto;
}

.mge-blog__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	column-gap: 40px;
	row-gap: 56px;
}

/* The featured hero spans the full width as the first grid item. */
.mge-blog-card--featured {
	grid-column: 1 / -1;
}

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

.mge-blog-card {
	display: flex;
	flex-direction: column;
	gap: 18px;
	min-width: 0;
}

.mge-blog-card__media {
	position: relative;
	display: block;
	overflow: hidden;
	aspect-ratio: 16 / 9;
	border-radius: 4px;
}

.mge-blog-card__img {
	position: absolute;
	inset: 0;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	transition: transform 0.5s ease;
	will-change: transform;
}

.mge-blog-card__overlay {
	position: absolute;
	inset: 0;
	background-color: transparent;
	opacity: 0;
	transition: opacity 0.35s ease;
	pointer-events: none;
}

.mge-blog-card:hover .mge-blog-card__overlay {
	opacity: 1;
}

.mge-blog-card__icon {
	position: absolute;
	top: 16px;
	left: 16px;
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background-color: #fff;
	color: #e8412c;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.mge-blog-card__icon svg {
	width: 45%;
	height: 45%;
}

/* ----------------------------------------------------------------------
 * Body: vertical date beside the content
 * -------------------------------------------------------------------- */

.mge-blog-card__body {
	display: flex;
	flex-direction: row;
	gap: 16px;
	align-items: flex-start;
}

.mge-blog-card__date {
	flex: 0 0 auto;
	writing-mode: vertical-rl;
	transform: rotate(180deg);
	white-space: nowrap;
	font-size: 12px;
	letter-spacing: 0.04em;
	opacity: 0.55;
}

.mge-blog--flatdate .mge-blog-card__date {
	writing-mode: horizontal-tb;
	transform: none;
}

.mge-blog-card__content {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 12px;
	min-width: 0;
	flex: 1 1 auto;
}

.mge-blog-card__title {
	margin: 0;
	font-size: 20px;
	line-height: 1.25;
	font-weight: 700;
}

.mge-blog-card--featured .mge-blog-card__title {
	font-size: 32px;
}

.mge-blog-card__title a {
	color: inherit;
	text-decoration: none;
	transition: color 0.2s ease;
}

.mge-blog-card__excerpt {
	margin: 0;
	opacity: 0.7;
	line-height: 1.5;
}

/* ----------------------------------------------------------------------
 * Category badge
 * -------------------------------------------------------------------- */

.mge-blog .mge-badge {
	display: inline-flex;
	align-items: center;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	text-decoration: none;
	color: #fff;
	background-color: #e8412c;
	padding: 4px 8px;
}

/* ----------------------------------------------------------------------
 * Load More
 * -------------------------------------------------------------------- */

.mge-blog__more-wrap {
	display: flex;
	justify-content: center;
	margin-top: 48px;
}

.mge-blog__more {
	cursor: pointer;
	border: 1px solid currentColor;
	background: transparent;
	color: inherit;
	padding: 14px 32px;
	border-radius: 50px;
	font-weight: 600;
	transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.mge-blog__more.is-loading {
	opacity: 0.6;
	pointer-events: none;
}

/* ----------------------------------------------------------------------
 * Editor empty state
 * -------------------------------------------------------------------- */

.mge-empty {
	padding: 40px;
	text-align: center;
	border: 1px dashed currentColor;
	opacity: 0.6;
	border-radius: 6px;
}
