/* Magazine Widgets for Elementor — uses logical properties, so RTL/LTR work without a separate file. */

[class*="elementor-widget-mwe-"] {
	--mwe-accent: #e11d48;
	--mwe-gap: 16px;
	--mwe-radius: 14px;
	--mwe-overlay: #000;
	--mwe-overlay-opacity: 0.75;
	--mwe-text: #1f2430;
	--mwe-muted: #6b7280;
	--mwe-line: #e8eaf0;
}

.mwe-title {
	margin: 0;
	font-size: 16px;
	line-height: 1.8;
	font-weight: 700;
	color: var(--mwe-text);
}
.mwe-title a {
	color: inherit;
	text-decoration: none;
	transition: color 0.2s;
}
.mwe-title a:hover,
.mwe-title a:focus-visible {
	color: var(--mwe-accent);
}
.mwe-excerpt {
	margin: 0;
	font-size: 13px;
	line-height: 1.9;
	color: var(--mwe-muted);
	text-align: justify;
}
.mwe-empty {
	padding: 20px;
	border: 1px dashed var(--mwe-line);
	text-align: center;
	color: var(--mwe-muted);
}

/* ---- Meta ---- */
.mwe-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 12px;
	font-size: 12px;
	color: var(--mwe-muted);
}
.mwe-meta__item {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	white-space: nowrap;
}
.mwe-meta svg {
	flex: none;
}

/* ---- Badge / noimg ---- */
.mwe-badge {
	position: absolute;
	inset-block-start: 10px;
	inset-inline-start: 10px;
	z-index: 2;
	padding: 2px 10px;
	border-radius: 6px;
	background: var(--mwe-accent);
	color: #fff;
	font-size: 11px;
	line-height: 1.9;
	font-weight: 600;
	pointer-events: none;
}
.mwe-noimg {
	display: block;
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, #e5e7eb, #f3f4f6);
}

/* ---- Heading ---- */
.mwe-heading {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}
.mwe-heading__main {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 6px 12px;
}
.mwe-heading__icon {
	display: inline-flex;
	color: var(--mwe-accent);
	font-size: 28px;
	line-height: 1;
}
.mwe-heading__icon svg {
	width: 1em;
	height: 1em;
	fill: currentColor;
}
.mwe-heading__title {
	margin: 0;
	font-size: 22px;
	font-weight: 800;
	line-height: 1.5;
	color: var(--mwe-text);
}
.mwe-heading__sub {
	font-size: 13px;
	color: var(--mwe-muted);
}
.mwe-heading__more {
	flex: none;
	font-size: 13px;
	color: var(--mwe-accent);
	text-decoration: none;
}
.mwe-heading__more:hover {
	text-decoration: underline;
}

/* ---- Post list ---- */
.mwe-list {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 0 24px;
}
.mwe-item {
	display: flex;
	align-items: flex-start;
	gap: 16px;
	padding-block: 16px;
}
.mwe-sep-yes .mwe-item {
	border-block-end: 1px solid var(--mwe-line);
}
.mwe-item__media {
	flex: none;
	width: 140px;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	border-radius: 6px;
	display: block;
}
.mwe-item__media img,
.mwe-card__media img,
.mwe-rank__thumb img,
.mwe-overlay > img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.mwe-item__body {
	display: flex;
	flex-direction: column;
	gap: 8px;
	min-width: 0;
	flex: 1;
}
.mwe-item .mwe-meta {
	margin-block-start: auto;
}

/* ---- Cards (grid + carousel) ---- */
.mwe-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: var(--mwe-gap);
}
.mwe-card {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 12px;
	height: 100%;
	padding: 14px;
	background: #fff;
	border-radius: var(--mwe-radius);
	box-shadow: 0 2px 14px rgba(20, 30, 60, 0.06);
	box-sizing: border-box;
	overflow: hidden;
}
.mwe-card__media {
	position: relative;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	border-radius: calc(var(--mwe-radius) - 4px);
}
.mwe-card__media a {
	display: block;
	width: 100%;
	height: 100%;
}
.mwe-card__body {
	display: flex;
	flex-direction: column;
	gap: 8px;
	flex: 1;
}
.mwe-card .mwe-title {
	padding-inline-start: 10px;
	border-inline-start: 3px solid #475a8a;
	font-size: 15px;
}
.mwe-card .mwe-title a::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}
.mwe-card__foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-block-start: auto;
	padding-block-start: 6px;
}
.mwe-readmore {
	padding: 2px 10px;
	border-radius: 6px;
	background: #eef1f8;
	color: #475a8a;
	font-size: 11px;
	line-height: 1.9;
}
.mwe-card:hover .mwe-readmore {
	background: var(--mwe-accent);
	color: #fff;
}

/* ---- Carousel ---- */
.mwe-nav {
	display: flex;
	gap: 8px;
	margin-block-start: 12px;
}
.mwe-nav__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--mwe-accent);
	color: #fff;
	cursor: pointer;
	transition: opacity 0.2s;
}
.mwe-nav__btn[hidden] {
	display: none;
}
.mwe-nav__btn.is-disabled,
.mwe-nav__btn:disabled {
	opacity: 0.4;
	cursor: default;
}

/* ---- Overlay cards (mosaic + video) ---- */
.mwe-mosaic {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--mwe-gap);
}
.mwe-overlay {
	position: relative;
	overflow: hidden;
	border-radius: var(--mwe-radius);
	background: #1b1f2a;
	isolation: isolate;
}
.mwe-overlay > img,
.mwe-overlay > .mwe-noimg {
	position: absolute;
	inset: 0;
	z-index: 0;
	transition: transform 0.5s;
}
.mwe-overlay:hover > img {
	transform: scale(1.04);
}
.mwe-overlay::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	background: linear-gradient(to top, var(--mwe-overlay) 0%, transparent 75%);
	opacity: var(--mwe-overlay-opacity);
	pointer-events: none;
}
.mwe-overlay__body {
	position: absolute;
	inset-inline: 0;
	inset-block-end: 0;
	z-index: 2;
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 16px 18px;
	color: #fff;
}
.mwe-overlay .mwe-title {
	color: #fff;
	text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
}
.mwe-overlay .mwe-title a {
	color: #fff;
}
.mwe-overlay .mwe-title a::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 3;
}
.mwe-overlay .mwe-meta {
	color: rgba(255, 255, 255, 0.85);
	justify-content: space-between;
}
.mwe-overlay--big {
	grid-column: 1 / -1;
	height: 390px;
}
.mwe-overlay--big .mwe-title {
	font-size: 22px;
}
.mwe-overlay--small {
	height: 200px;
}
.mwe-overlay--small .mwe-title {
	font-size: 14px;
}
.mwe-overlay .mwe-badge {
	z-index: 2;
}

/* ---- Video mosaic ---- */
.mwe-video {
	display: grid;
	gap: var(--mwe-gap);
	height: 420px;
}
.mwe-video--3 {
	grid-template-columns: 2fr 1fr;
	grid-template-rows: repeat(2, minmax(0, 1fr));
}
.mwe-video--5 {
	grid-template-columns: 2fr 1fr 1fr;
	grid-template-rows: repeat(2, minmax(0, 1fr));
}
.mwe-video .mwe-overlay {
	height: auto;
}
.mwe-video .mwe-overlay--big {
	grid-column: 1;
	grid-row: 1 / span 2;
}
.mwe-play {
	position: absolute;
	inset-block-start: 14px;
	inset-inline-start: 14px;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: #ff8a1f;
	color: #fff;
	pointer-events: none;
}
.mwe-overlay--big .mwe-play {
	width: 48px;
	height: 48px;
}

/* ---- Ticker ---- */
.mwe-ticker {
	display: flex;
	align-items: stretch;
	overflow: hidden;
	border-radius: 10px;
	background: #fff;
	box-shadow: 0 2px 14px rgba(20, 30, 60, 0.06);
}
.mwe-ticker__label {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	flex: none;
	padding: 10px 16px;
	background: var(--mwe-accent);
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	white-space: nowrap;
}
.mwe-ticker__list {
	position: relative;
	flex: 1;
	min-width: 0;
	margin: 0;
	padding: 0;
	list-style: none;
	min-height: 42px;
}
.mwe-ticker__item {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	gap: 12px;
	padding-inline: 16px;
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: opacity 0.4s, transform 0.4s, visibility 0.4s;
}
.mwe-ticker__item.is-active {
	opacity: 1;
	visibility: visible;
	transform: none;
}
.mwe-ticker__item a {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	color: var(--mwe-text);
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
}
.mwe-ticker__item a:hover {
	color: var(--mwe-accent);
}
.mwe-ticker__time {
	flex: none;
	font-size: 12px;
	color: var(--mwe-muted);
}

/* ---- Ranked list ---- */
.mwe-rank {
	margin: 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: var(--mwe-gap);
}
.mwe-rank__item {
	display: flex;
	align-items: center;
	gap: 12px;
}
.mwe-rank__num {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: var(--mwe-accent);
	color: #fff;
	font-size: 13px;
	font-weight: 700;
}
.mwe-rank__thumb {
	flex: none;
	width: 64px;
	height: 64px;
	overflow: hidden;
	border-radius: 8px;
	display: block;
}
.mwe-rank__body {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}
.mwe-rank .mwe-title {
	font-size: 14px;
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
	.mwe-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}
@media (max-width: 767px) {
	.mwe-grid,
	.mwe-mosaic {
		grid-template-columns: minmax(0, 1fr);
	}
	.mwe-overlay--big {
		height: 260px;
	}
	.mwe-video,
	.mwe-video--3,
	.mwe-video--5 {
		height: auto;
		grid-template-columns: minmax(0, 1fr);
		grid-template-rows: none;
	}
	.mwe-video .mwe-overlay,
	.mwe-video .mwe-overlay--big {
		grid-column: auto;
		grid-row: auto;
		height: 220px;
	}
	.mwe-item__media {
		width: 100px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.mwe-overlay > img,
	.mwe-ticker__item {
		transition: none;
	}
}

/* =====================================================================
 * Layout style variants (v1.1)
 * ================================================================== */

/* ---- Post list: boxed ---- */
.mwe-list--boxed {
	gap: var(--mwe-gap) 24px;
}
.mwe-list--boxed .mwe-item {
	padding: 14px;
	background: #fff;
	border-radius: var(--mwe-radius);
	box-shadow: 0 2px 14px rgba(20, 30, 60, 0.06);
	border-block-end: 0;
}
.mwe-list--boxed .mwe-item__media {
	border-radius: calc(var(--mwe-radius) - 4px);
}

/* ---- Post list: minimal (text only with accent dot) ---- */
.mwe-list--minimal .mwe-item {
	gap: 10px;
	padding-block: 12px;
	align-items: baseline;
}
.mwe-list--minimal .mwe-item::before {
	content: "";
	flex: none;
	width: 8px;
	height: 8px;
	margin-block-start: 0.85em;
	border-radius: 50%;
	background: var(--mwe-accent);
}
.mwe-list--minimal .mwe-item__body {
	gap: 4px;
}

/* ---- Post list: compact ---- */
.mwe-list--compact .mwe-item {
	gap: 12px;
	padding-block: 10px;
	align-items: center;
}
.mwe-list--compact .mwe-item__media {
	width: 84px;
	border-radius: 8px;
}
.mwe-list--compact .mwe-title {
	font-size: 14px;
}
.mwe-list--compact .mwe-item .mwe-meta {
	margin-block-start: 0;
}

/* ---- Post list: hero (first big) ---- */
.mwe-list--hero .mwe-item--hero {
	grid-column: 1 / -1;
	flex-direction: column;
	gap: 12px;
}
.mwe-list--hero .mwe-item--hero .mwe-item__media {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	border-radius: var(--mwe-radius);
}
.mwe-list--hero .mwe-item--hero .mwe-title {
	font-size: 20px;
}
.mwe-list--hero .mwe-item--hero .mwe-item__body {
	width: 100%;
}

/* thumbnail on the opposite side */
.mwe-list--thumb-end .mwe-item {
	flex-direction: row-reverse;
}
.mwe-list--thumb-end.mwe-list--hero .mwe-item--hero {
	flex-direction: column;
}

/* ---- Grid: overlay cards ---- */
.mwe-grid--overlay .mwe-overlay--card {
	height: 280px;
}
.mwe-overlay--card .mwe-title,
.mwe-overlay--slide .mwe-title {
	font-size: 16px;
}

/* ---- Grid: minimal ---- */
.mwe-grid--minimal .mwe-card {
	padding: 0;
	background: transparent;
	box-shadow: none;
	border-radius: 0;
	overflow: visible;
}
.mwe-grid--minimal .mwe-card__media,
.mwe-carousel--minimal .mwe-card__media {
	border-radius: var(--mwe-radius);
}
.mwe-carousel--minimal .mwe-card {
	padding: 0;
	background: transparent;
	box-shadow: none;
	border-radius: 0;
	overflow: visible;
}

/* ---- Grid: horizontal ---- */
.mwe-grid--horizontal .mwe-card {
	flex-direction: row;
	align-items: stretch;
}
.mwe-grid--horizontal .mwe-card__media {
	flex: none;
	width: 40%;
	aspect-ratio: auto;
	min-height: 150px;
}
.mwe-grid--horizontal .mwe-card__media a {
	position: absolute;
	inset: 0;
}
.mwe-grid--horizontal .mwe-card__body {
	min-width: 0;
}

/* ---- Grid: featured (first 2x2) ---- */
.mwe-grid--featured .mwe-overlay--feature {
	grid-column: span 2;
	grid-row: span 2;
	height: auto;
	min-height: 380px;
}
.mwe-grid--featured .mwe-overlay--feature .mwe-title {
	font-size: 22px;
}

/* ---- Carousel variants ---- */
/* ---- Native carousel (scroll-snap): horizontal by default, works without JS ---- */
.mwe-carousel {
	position: relative;
	container-type: inline-size;
}
.mwe-track {
	--mwe-n: 4;
	--mwe-space: 16px;
	--mwe-slide-w: calc((100% - (var(--mwe-n) - 1) * var(--mwe-space)) / var(--mwe-n));
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	gap: var(--mwe-space);
	margin: 0;
	padding: 6px 0;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	-ms-overflow-style: none;
	overscroll-behavior-x: contain;
	-webkit-overflow-scrolling: touch;
	outline-offset: 2px;
}
.mwe-track::-webkit-scrollbar {
	display: none;
}
.mwe-track.is-dragging {
	scroll-snap-type: none;
	cursor: grabbing;
	user-select: none;
}
.mwe-track.is-dragging a {
	pointer-events: none;
}
.mwe-slide {
	flex: 0 0 var(--mwe-slide-w);
	width: var(--mwe-slide-w);
	min-width: 0;
	scroll-snap-align: start;
	box-sizing: border-box;
}
.mwe-slide > * {
	height: 100%;
}
@container (max-width: 1024px) {
	.mwe-track { --mwe-n: 2; }
}
@container (max-width: 640px) {
	.mwe-track { --mwe-n: 1; }
}
/* Hardening against theme/Elementor img rules (height:auto) and tall source images:
   the image always fills the fixed-ratio frame instead of stretching the slide. */
.mwe-carousel .mwe-card__media {
	min-height: 0;
	max-height: 380px;
}
/* One long post must never make every slide (and the whole section) tall. */
.mwe-carousel .mwe-track { align-items: flex-start; }
.mwe-carousel .mwe-slide > * { height: auto; }
.mwe-carousel .mwe-card .mwe-title,
.mwe-carousel .mwe-card .mwe-excerpt {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.mwe-carousel .mwe-card .mwe-title { -webkit-line-clamp: 3; line-clamp: 3; }
.mwe-carousel .mwe-card .mwe-excerpt { -webkit-line-clamp: 4; line-clamp: 4; }
.mwe-carousel { max-width: 100%; overflow: hidden; }
.mwe-carousel--nav-sides { overflow: visible; }
.mwe-carousel .mwe-card__media img,
.mwe-carousel .mwe-overlay > img {
	position: absolute;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
	max-width: none;
	object-fit: cover;
}
.mwe-carousel .mwe-card__media a { position: absolute; inset: 0; }
@media (max-width: 767px) {
	.mwe-carousel .mwe-overlay--slide { height: 260px; }
	.mwe-carousel .mwe-overlay--hero { height: 300px; }
}
.mwe-carousel--hero .mwe-track {
	--mwe-n: 1 !important;
}
.mwe-carousel--centered .mwe-track {
	--mwe-slide-w: calc((100cqw - (var(--mwe-n) - 1) * var(--mwe-space)) / var(--mwe-n));
	padding-inline: calc((100cqw - var(--mwe-slide-w)) / 2);
}
.mwe-carousel--centered .mwe-slide {
	scroll-snap-align: center;
	opacity: 0.55;
	transform: scale(0.92);
	transition: opacity 0.35s, transform 0.35s;
}
.mwe-carousel--centered .mwe-slide.is-active {
	opacity: 1;
	transform: none;
}

/* pagination dots */
.mwe-dots {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 6px;
	margin-block-start: 14px;
}
.mwe-dot {
	width: 8px;
	height: 8px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: #c7cbd6;
	cursor: pointer;
	transition: width 0.25s, background-color 0.25s;
}
.mwe-dot.is-active {
	width: 22px;
	background: var(--mwe-accent);
}
.mwe-overlay--slide {
	height: 320px;
}
.mwe-overlay--hero {
	height: 420px;
}
.mwe-overlay--hero .mwe-title {
	font-size: 26px;
	max-width: 760px;
}
/* nav button placement */
.mwe-carousel--nav-bottom-center .mwe-nav {
	justify-content: center;
}
.mwe-carousel--nav-sides .mwe-nav {
	position: absolute;
	inset-inline: 8px;
	inset-block-start: 50%;
	z-index: 5;
	justify-content: space-between;
	margin: 0;
	transform: translateY(-50%);
	pointer-events: none;
}
.mwe-carousel--nav-sides .mwe-nav__btn {
	pointer-events: auto;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

/* ---- Responsive for the new variants ---- */
@media (max-width: 1024px) {
	.mwe-grid--featured .mwe-overlay--feature {
		grid-column: 1 / -1;
		grid-row: auto;
		min-height: 320px;
	}
}
@media (max-width: 767px) {
	.mwe-grid--horizontal .mwe-card__media {
		width: 34%;
	}
	.mwe-overlay--hero {
		height: 300px;
	}
	.mwe-overlay--hero .mwe-title {
		font-size: 19px;
	}
	.mwe-list--hero .mwe-item--hero .mwe-item__media {
		aspect-ratio: 4 / 3;
	}
}

/* ---- Grid pagination (archives): numbers / prev-next / load more / infinite ---- */
.mwe-pagination {
	margin-block-start: 28px;
}
.mwe-pagination .mwe-pg {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.mwe-pagination .mwe-pg li {
	margin: 0;
	padding: 0;
	list-style: none;
}
.mwe-pagination .mwe-pg li::before,
.mwe-pagination .mwe-pg li::after {
	content: none;
}
.mwe-pagination .page-numbers,
.mwe-more__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-width: 40px;
	height: 40px;
	padding: 0 14px;
	box-sizing: border-box;
	border: 1px solid var(--mwe-line);
	border-radius: 10px;
	background: #fff;
	color: var(--mwe-text);
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.mwe-pagination a.page-numbers:hover,
.mwe-pagination a.page-numbers:focus-visible,
.mwe-pagination .page-numbers.current,
.mwe-more__btn:hover,
.mwe-more__btn:focus-visible {
	background: var(--mwe-accent);
	border-color: var(--mwe-accent);
	color: #fff;
}
.mwe-pagination .page-numbers.dots {
	min-width: 0;
	padding: 0 4px;
	border-color: transparent;
	background: transparent;
	color: var(--mwe-muted);
}
.mwe-pagination .page-numbers.is-disabled {
	opacity: 0.45;
	cursor: not-allowed;
}
.mwe-pagination .mwe-pg__info {
	padding: 0 8px;
	font-size: 13px;
	color: var(--mwe-muted);
}
.mwe-pagination .page-numbers svg {
	flex: none;
}

.mwe-more {
	display: flex;
	justify-content: center;
	margin-block-start: 28px;
}
.mwe-more__btn {
	min-width: 180px;
	cursor: pointer;
}
.mwe-more.is-loading .mwe-more__btn {
	opacity: 0.6;
	pointer-events: none;
}

@media (max-width: 767px) {
	.mwe-pagination .page-numbers {
		min-width: 36px;
		height: 36px;
		padding: 0 10px;
	}
}
