/**
 * Magazine Grid for Elementor — base styles.
 *
 * These are sensible defaults. Most colours, spacing and typography can be
 * overridden from the widget's Style tab (Elementor selectors win via specificity).
 */

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

.mge-grid {
	display: flex;
	flex-direction: row;
	gap: 24px;
	align-items: stretch;
}

/* ----------------------------------------------------------------------
 * Featured
 * -------------------------------------------------------------------- */

.mge-featured {
	position: relative;
	display: flex;
	flex-direction: column;
	flex: 0 0 58%;
	max-width: 58%;
	overflow: hidden;
}

.mge-featured__thumb {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
}

.mge-featured__body {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 18px 4px 0;
}

.mge-featured--overlay {
	justify-content: flex-end;
}

.mge-featured--overlay .mge-featured__thumb {
	position: absolute;
	inset: 0;
	height: 100%;
}

.mge-featured--overlay .mge-featured__body {
	position: relative;
	z-index: 1;
	padding: 24px;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.75) 0%, transparent 100%);
}

.mge-featured__title {
	margin: 0;
	font-size: 28px;
	line-height: 1.2;
	font-weight: 700;
}

.mge-featured__title a,
.mge-side-item__title a {
	color: inherit;
	text-decoration: none;
	transition: color 0.2s ease;
}

.mge-featured__excerpt {
	margin: 0;
	opacity: 0.85;
}

.mge-featured__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	font-size: 13px;
	opacity: 0.7;
}

.mge-featured__meta > span:not(:last-child)::after {
	content: "•";
	margin-left: 12px;
	opacity: 0.6;
}

/* ----------------------------------------------------------------------
 * Side list
 * -------------------------------------------------------------------- */

.mge-side {
	display: flex;
	flex-direction: column;
	gap: 16px;
	flex: 1 1 0;
	min-width: 0;
}

.mge-side-item {
	display: flex;
	flex-direction: row-reverse;
	gap: 16px;
	align-items: center;
	transition: background-color 0.2s ease;
	overflow: hidden;
}

.mge-side-item__thumb {
	display: block;
	flex: 0 0 34%;
	width: 34%;
	aspect-ratio: 16 / 9;
}

/* Thumbnail sizing modes (class on the .mge-side wrapper) */
.mge-side--stretch .mge-side-item {
	align-items: stretch;
}

.mge-side--stretch .mge-side-item__thumb {
	align-self: stretch;
	height: auto;
	aspect-ratio: auto;
}

.mge-side-item__body {
	display: flex;
	flex-direction: column;
	gap: 8px;
	min-width: 0;
	flex: 1 1 auto;
}

.mge-side-item__title {
	margin: 0;
	font-size: 16px;
	line-height: 1.3;
	font-weight: 600;
}

.mge-side-item__date {
	font-size: 12px;
	opacity: 0.6;
}

/* ----------------------------------------------------------------------
 * Thumbnail layers + hover effects
 * -------------------------------------------------------------------- */

.mge-thumb {
	position: relative;
	display: block;
	overflow: hidden;
}

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

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

/* Overlay fades in whenever the card is hovered */
.mge-featured:hover .mge-thumb__overlay,
.mge-side-item:hover .mge-thumb__overlay {
	opacity: 1;
}

/* Zoom In: image grows on hover */
.mge-hover-zoom-in:hover .mge-thumb__img {
	transform: scale(var(--mge-zoom, 1.08));
}

/* Zoom Out: image starts enlarged and settles on hover */
.mge-hover-zoom-out .mge-thumb__img {
	transform: scale(var(--mge-zoom, 1.08));
}

.mge-hover-zoom-out:hover .mge-thumb__img {
	transform: scale(1);
}

/* Grayscale → Color */
.mge-hover-grayscale .mge-thumb__img {
	filter: grayscale(1);
}

.mge-hover-grayscale:hover .mge-thumb__img {
	filter: grayscale(0);
}

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

.mge-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-decoration: none;
	color: inherit;
	opacity: 0.9;
}

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

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

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

@media (max-width: 1024px) {
	.mge-grid--stack-tablet {
		flex-direction: column !important;
	}

	.mge-grid--stack-tablet .mge-featured {
		flex: 1 1 100% !important;
		max-width: 100% !important;
	}
}

@media (max-width: 767px) {
	.mge-grid--stack-mobile,
	.mge-grid--stack-tablet {
		flex-direction: column !important;
	}

	.mge-grid--stack-mobile .mge-featured,
	.mge-grid--stack-tablet .mge-featured {
		flex: 1 1 100% !important;
		max-width: 100% !important;
	}
}
