/* ==========================================================================
   Extrican Blog Grid
   Design tokens live on the root so every piece can be tuned in one place.
   Elementor style controls always win (they carry a higher specificity).
   ========================================================================== */
.exc-ess-bg {
	--exc-ess-bg-ease: cubic-bezier(0.65, 0, 0.35, 1);
	--exc-ess-bg-hover-scale: 1.04;
	--exc-ess-bg-radius: 12px;
	--exc-ess-bg-dir: 1; /* flips to -1 in RTL (arrows) */
	--exc-ess-bg-muted: color-mix(in srgb, currentColor 68%, transparent);
	--exc-ess-bg-hairline: color-mix(in srgb, currentColor 14%, transparent);
	--exc-ess-bg-tint: color-mix(in srgb, currentColor 7%, transparent);
	position: relative;
	width: 100%;
}

/* Direction hooks: separate rules so an unsupported selector can't drop the other. */
:is([dir="rtl"], .rtl) .exc-ess-bg {
	--exc-ess-bg-dir: -1;
}

.exc-ess-bg:dir(rtl) {
	--exc-ess-bg-dir: -1;
}

/* ---------------- Grid ---------------- */
.exc-ess-bg__grid {
	list-style: none;
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	column-gap: 24px;
	row-gap: 32px;
	margin: 0;
	padding: 0;
	transition: opacity 0.2s ease;
}

/* Safe fallbacks: the Columns control (higher specificity) overrides these. */
@media (max-width: 1024px) {
	.exc-ess-bg__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 767px) {
	.exc-ess-bg__grid {
		grid-template-columns: minmax(0, 1fr);
	}
}

.exc-ess-bg__grid.is-loading {
	opacity: 0.45;
	pointer-events: none;
}

.exc-ess-bg__grid--equal-heights {
	align-items: stretch;
}

.exc-ess-bg__grid--equal-heights .exc-ess-bg__card {
	height: 100%;
}

.exc-ess-bg__grid--fit-rows {
	align-items: start;
}

.exc-ess-bg__grid--fit-rows .exc-ess-bg__card {
	height: auto;
}

.exc-ess-bg__empty {
	grid-column: 1 / -1;
	text-align: center;
	padding: 56px 16px;
	color: var(--global--color-body-contrast-8, #6b6b6b);
	font-size: var(--global--font-size-body-sm, 15px);
	list-style: none;
}

/* ---------------- Card ---------------- */
.exc-ess-bg__card {
	position: relative;
	display: flex;
	flex-direction: column;
	min-width: 0;
	background: transparent;
}

.exc-ess-bg__media,
.exc-ess-bg__image-link {
	display: block;
	width: 100%;
	text-decoration: none;
	color: inherit;
}

.exc-ess-bg__image-wrap {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: 3 / 2;
	border-radius: var(--exc-ess-bg-radius);
	overflow: hidden;
	isolation: isolate; /* keeps the zoomed image under the radius in every browser */
	background: var(--exc-ess-bg-tint);
}

.exc-ess-bg__image-wrap img.exc-ess-bg__image,
.exc-ess-bg__image:not(.exc-ess-bg__image--placeholder) {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	object-fit: cover;
	object-position: center;
	transition: transform 0.6s var(--exc-ess-bg-ease);
	will-change: transform;
}

.exc-ess-bg__image--placeholder {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	background: var(--exc-ess-bg-tint);
	color: color-mix(in srgb, currentColor 28%, transparent);
}

.exc-ess-bg__image--placeholder svg {
	width: 25%;
	height: 25%;
	max-width: 64px;
	max-height: 64px;
}

/* Hover zoom is opt-in through the "Image Hover Zoom" switcher. */
@media (hover: hover) {
	.exc-ess-bg--hover-zoom .exc-ess-bg__card:hover .exc-ess-bg__image,
	.exc-ess-bg--hover-zoom .exc-ess-bg__compact:hover .exc-ess-bg__image {
		transform: scale(var(--exc-ess-bg-hover-scale, 1.04));
	}
}

/* ---------------- Keyboard focus ---------------- */
.exc-ess-bg a:focus-visible,
.exc-ess-bg button:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
	border-radius: 4px;
}

.exc-ess-bg__image-link:focus-visible .exc-ess-bg__image-wrap,
.exc-ess-bg__compact-thumb:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

.exc-ess-bg__image-link:focus-visible,
.exc-ess-bg__compact-thumb:focus-visible {
	outline: 0;
}

/* ---------------- Body (eyebrow / title / excerpt / meta) ---------------- */
.exc-ess-bg__body,
.exc-ess-bg__content {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-width: 0;
	padding: 1.125rem 0 0;
	background: transparent;
}

/* ---------------- Eyebrow: category + date ---------------- */
.exc-ess-bg__footer {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 10px;
	margin: 0 0 0.625rem;
	font-size: var(--global--font-size-sm, 0.8125rem);
	line-height: 1.4;
}

.exc-ess-bg__categories {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
}

.exc-ess-bg__category {
	display: inline-flex;
	align-items: center;
	padding: 0.2em 0.75em;
	border-radius: 999px;
	background: var(--exc-ess-bg-tint);
	color: inherit;
	font-size: 0.92em;
	font-weight: 600;
	line-height: 1.5;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color 0.2s ease, color 0.2s ease;
}

a.exc-ess-bg__category:hover {
	background: color-mix(in srgb, currentColor 14%, transparent);
}

.exc-ess-bg__date {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	font-size: inherit;
	font-weight: 400;
	letter-spacing: 0;
	line-height: 1.4;
	color: var(--exc-ess-bg-muted);
}

/* Dot separator between category and date (pure CSS, RTL-safe). */
.exc-ess-bg__categories + .exc-ess-bg__date::before {
	content: "";
	width: 3px;
	height: 3px;
	border-radius: 50%;
	background: currentColor;
	opacity: 0.6;
}

/* ---------------- Title ---------------- */
.exc-ess-bg__title {
	margin: 0 0 0.625rem;
	font-size: var(--heading--font-size-h3, 1.375rem);
	line-height: var(--heading--line-height-h3, 1.45);
	font-weight: 700;
	letter-spacing: -0.005em;
	color: inherit;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
	overflow-wrap: break-word;
	text-wrap: balance;
}

.exc-ess-bg__title a {
	color: inherit;
	text-decoration: underline;
	text-decoration-color: transparent;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
	transition: text-decoration-color 0.25s ease, color 0.2s ease;
}

.exc-ess-bg__card:hover .exc-ess-bg__title a,
.exc-ess-bg__title a:hover {
	text-decoration-color: currentColor;
}

/* ---------------- Excerpt ---------------- */
.exc-ess-bg__excerpt {
	margin: 0 0 1rem;
	font-size: var(--global--font-size-body, 1rem);
	line-height: var(--global--line-height-body, 1.7);
	color: var(--exc-ess-bg-muted);
	overflow-wrap: break-word;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	overflow: hidden;
}

/* ---------------- Meta (author / comments) + learn more sit at the bottom ---------------- */
.exc-ess-bg__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 8px;
	margin-top: auto;
	padding-top: 0.875rem;
	border-top: 1px solid var(--exc-ess-bg-hairline);
	font-size: var(--global--font-size-sm, 0.875rem);
	color: var(--exc-ess-bg-muted);
}

.exc-ess-bg__author a {
	color: inherit;
	font-weight: 600;
	text-decoration: underline;
	text-decoration-color: transparent;
	text-underline-offset: 3px;
	transition: text-decoration-color 0.2s ease;
}

.exc-ess-bg__author a:hover {
	text-decoration-color: currentColor;
}

.exc-ess-bg__meta-sep {
	opacity: 0.6;
}

.exc-ess-bg__learn-more {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	width: fit-content;
	margin-top: auto;
	font-size: var(--global--font-size-sm, 0.875rem);
	font-weight: 700;
	color: inherit;
	text-decoration: none;
	transition: opacity 0.2s ease, color 0.2s ease;
}

.exc-ess-bg__meta + .exc-ess-bg__learn-more {
	margin-top: 0.75rem;
}

.exc-ess-bg__learn-more i {
	font-size: 0.75em;
	line-height: 1;
	flex-shrink: 0;
	display: inline-block;
	transform: scaleX(var(--exc-ess-bg-dir, 1));
	transition: transform 0.25s var(--exc-ess-bg-ease);
}

.exc-ess-bg__learn-more:hover {
	opacity: 0.75;
}

.exc-ess-bg__learn-more:hover i {
	transform: translateX(calc(4px * var(--exc-ess-bg-dir, 1))) scaleX(var(--exc-ess-bg-dir, 1));
}

/* ---------------- Pagination ---------------- */
.exc-ess-bg__pagination-wrap {
	margin-top: 48px;
	display: flex;
	justify-content: center;
}

.exc-ess-bg__pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 0.375rem;
}

.exc-ess-bg__page-btn {
	min-width: 2.5rem;
	min-height: 2.5rem;
	padding: 0 0.5rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	color: inherit;
	border: 1px solid var(--exc-ess-bg-hairline);
	border-radius: 999px;
	font-size: inherit;
	font-family: inherit;
	font-variant-numeric: tabular-nums;
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.exc-ess-bg__page-btn i {
	display: inline-block;
	font-size: 0.875rem;
	line-height: 1;
	transform: scaleX(var(--exc-ess-bg-dir, 1));
}

.exc-ess-bg__page-btn--prev,
.exc-ess-bg__page-btn--next {
	min-width: 2.5rem;
}

@media (hover: hover) {
	.exc-ess-bg__page-btn:hover:not([disabled], .is-active) {
		border-color: currentColor;
	}
}

.exc-ess-bg__page-btn.is-active {
	background: var(--global--color-font, currentColor);
	border-color: var(--global--color-font, currentColor);
	color: var(--global--color-body, #fff);
	font-weight: 700;
	cursor: default;
}

.exc-ess-bg__page-btn[disabled] {
	opacity: 0.35;
	cursor: not-allowed;
}

.exc-ess-bg__page-ellipsis {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 1.75rem;
	min-height: 2.5rem;
	color: inherit;
	opacity: 0.55;
}

.exc-ess-bg__load-more-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: var(--label-buttons--height, 2.75rem);
	padding: var(--label-buttons--padding, 0.375rem 1.75rem);
	background: var(--label-buttons--background-color, transparent);
	color: inherit;
	border: 1px solid var(--label-buttons--border-color, currentColor);
	border-radius: 999px;
	font-family: inherit;
	font-size: var(--label-buttons--font-size, var(--global--font-size-sm, 0.875rem));
	font-weight: 600;
	cursor: pointer;
	transition: opacity 0.2s ease, border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

@media (hover: hover) {
	.exc-ess-bg__load-more-btn:hover {
		background: var(--label-buttons--background-contrast-color, var(--global--color-font, currentColor));
		border-color: var(--label-buttons--border-contrast-color, var(--global--color-font, currentColor));
		color: var(--global--color-body, #fff);
	}
}

.exc-ess-bg__load-more-btn.is-loading {
	pointer-events: none;
	opacity: 0.75;
}

.exc-ess-bg__pagination--infinite {
	display: flex;
	justify-content: center;
	padding: 12px 0;
	width: 100%;
}

.exc-ess-bg__spinner {
	width: 22px;
	height: 22px;
	border: 2px solid color-mix(in srgb, currentColor 20%, transparent);
	border-top-color: currentColor;
	border-radius: 50%;
	animation: exc-ess-bg-spin 0.7s linear infinite;
}

.exc-ess-bg__load-more-btn .exc-ess-bg__spinner {
	display: none;
	width: 14px;
	height: 14px;
}

.exc-ess-bg__load-more-btn.is-loading .exc-ess-bg__spinner {
	display: inline-block;
}

.exc-ess-bg__load-more-btn.is-loading .exc-ess-bg__load-more-text {
	opacity: 0.6;
}

@keyframes exc-ess-bg-spin {
	to {
		transform: rotate(360deg);
	}
}

/* ---------------- Layout: Hero Featured ---------------- */
.exc-ess-bg__grid--layout-hero .exc-ess-bg__card--featured-hero {
	grid-column: 1 / -1;
}

.exc-ess-bg__card--featured-hero .exc-ess-bg__image-wrap--featured {
	aspect-ratio: 16 / 9;
}

.exc-ess-bg__card--featured .exc-ess-bg__title {
	font-size: var(--heading--font-size-h2, 1.75rem);
	-webkit-line-clamp: 3;
}

.exc-ess-bg__excerpt--featured {
	-webkit-line-clamp: 4;
	max-width: 48rem;
}

/* Wide screens: image and copy side by side. */
@media (min-width: 900px) {
	.exc-ess-bg__grid--layout-hero > .exc-ess-bg__card--featured-hero {
		display: grid;
		grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
		column-gap: 40px;
		align-items: center;
	}

	.exc-ess-bg__card--featured-hero .exc-ess-bg__image-wrap--featured {
		aspect-ratio: 4 / 3;
	}

	.exc-ess-bg__card--featured-hero .exc-ess-bg__body {
		padding-top: 0;
		justify-content: center;
	}

	.exc-ess-bg__card--featured-hero .exc-ess-bg__meta,
	.exc-ess-bg__card--featured-hero .exc-ess-bg__learn-more {
		margin-top: 0.5rem;
	}
}

/* Hero: appended pages stay in the same grid under the featured card */
.exc-ess-bg__grid--layout-hero > .exc-ess-bg__card:not(.exc-ess-bg__card--featured) {
	min-width: 0;
}

/* ---------------- Layout: Magazine ---------------- */
/* Flex, not CSS Grid: Elementor Columns (repeat(1, 1fr) + overflow:hidden)
   used to park the sidebar in an implicit column 2 and clip it. */
.exc-ess-bg__grid--layout-magazine {
	display: flex !important;
	flex-direction: row;
	flex-wrap: wrap;
	align-items: flex-start;
	column-gap: 40px;
	grid-template-columns: none !important;
	grid-template-rows: none !important;
}

.exc-ess-bg__grid--layout-magazine > .exc-ess-bg__card--featured-magazine {
	flex: 1 1 54%;
	width: auto;
	max-width: 100%;
	min-width: min(100%, 280px);
	grid-column: auto;
	grid-row: auto;
}

.exc-ess-bg__grid--layout-magazine .exc-ess-bg__card--featured-magazine .exc-ess-bg__image-wrap--featured {
	aspect-ratio: 3 / 2;
}

.exc-ess-bg__magazine-list {
	list-style: none;
	display: flex !important;
	flex: 1 1 280px;
	flex-direction: column;
	width: auto;
	max-width: 100%;
	min-width: min(100%, 240px);
	margin: 0;
	padding: 0;
	grid-column: auto;
	grid-row: auto;
	visibility: visible;
	opacity: 1;
	height: auto;
	overflow: visible;
}

.exc-ess-bg__magazine-items {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex !important;
	flex-direction: column;
	gap: 0;
	width: 100%;
	min-width: 0;
	visibility: visible;
	opacity: 1;
	height: auto;
	overflow: visible;
}

.exc-ess-bg__compact {
	display: grid;
	grid-template-columns: clamp(96px, 30%, 148px) minmax(0, 1fr);
	gap: 16px;
	align-items: center;
	background: transparent;
	border-radius: 0;
	overflow: visible;
	padding: 18px 0;
	min-width: 0;
	visibility: visible;
	opacity: 1;
	height: auto;
}

.exc-ess-bg__compact:first-child {
	padding-top: 0;
}

.exc-ess-bg__compact + .exc-ess-bg__compact {
	border-top: 1px solid var(--exc-ess-bg-hairline);
}

.exc-ess-bg__compact:last-child {
	padding-bottom: 0;
}

.exc-ess-bg__compact-thumb {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	border-radius: calc(var(--exc-ess-bg-radius) * 0.75);
	overflow: hidden;
	isolation: isolate;
	background: var(--exc-ess-bg-tint);
}

.exc-ess-bg__compact-thumb .exc-ess-bg__image,
.exc-ess-bg__compact-thumb img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	object-fit: cover;
	display: block;
	transition: transform 0.6s var(--exc-ess-bg-ease);
}

.exc-ess-bg__compact-body {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}

.exc-ess-bg__compact-title {
	color: inherit;
	font-size: var(--heading--font-size-h5, 1.0625rem);
	font-weight: 700;
	line-height: 1.45;
	text-decoration: underline;
	text-decoration-color: transparent;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
	transition: text-decoration-color 0.25s ease, color 0.2s ease;
	overflow-wrap: break-word;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
}

.exc-ess-bg__compact:hover .exc-ess-bg__compact-title,
.exc-ess-bg__compact-title:hover {
	text-decoration-color: currentColor;
}

.exc-ess-bg__compact .exc-ess-bg__footer {
	margin: 0;
}

.exc-ess-bg__compact .exc-ess-bg__categories {
	margin: 0;
}

/* ---------------- Toast ---------------- */
.exc-ess-bg__toast {
	position: fixed;
	left: 50%;
	bottom: 28px;
	transform: translate(-50%, 12px);
	max-width: calc(100vw - 32px);
	background: var(--global--color-font, #111111);
	color: var(--global--color-body, #ffffff);
	font-size: var(--global--font-size-sm, 0.875rem);
	padding: 12px 20px;
	border-radius: 8px;
	z-index: 99999;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.25s ease, transform 0.25s ease;
}

.exc-ess-bg__toast.is-visible {
	opacity: 1;
	transform: translate(-50%, 0);
}

.exc-ess-bg__toast.is-error {
	background: #a1281f;
	color: #fff;
}

/* ---------------- Responsive ---------------- */
@media (max-width: 1024px) {
	.exc-ess-bg__grid--layout-magazine {
		flex-direction: column;
		flex-wrap: nowrap;
		grid-template-columns: none !important;
		row-gap: 32px;
	}

	.exc-ess-bg__grid--layout-magazine > .exc-ess-bg__card--featured-magazine,
	.exc-ess-bg__magazine-list {
		flex: 0 0 auto;
		width: 100%;
		min-width: 0;
		grid-column: auto;
		grid-row: auto;
	}

	.exc-ess-bg__grid--layout-magazine .exc-ess-bg__card--featured-magazine .exc-ess-bg__image-wrap--featured {
		aspect-ratio: 3 / 2;
	}
}

@media (max-width: 767px) {
	.exc-ess-bg__title {
		font-size: var(--heading--font-size-h5, 1.125rem);
	}

	.exc-ess-bg__card--featured .exc-ess-bg__title {
		font-size: var(--heading--font-size-h3, 1.375rem);
	}

	.exc-ess-bg__compact {
		grid-template-columns: 96px minmax(0, 1fr);
		gap: 12px;
	}

	.exc-ess-bg__pagination-wrap {
		margin-top: 36px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.exc-ess-bg__image,
	.exc-ess-bg__title a,
	.exc-ess-bg__compact-title,
	.exc-ess-bg__category,
	.exc-ess-bg__learn-more i {
		transition: none;
	}

	.exc-ess-bg--hover-zoom .exc-ess-bg__card:hover .exc-ess-bg__image,
	.exc-ess-bg--hover-zoom .exc-ess-bg__compact:hover .exc-ess-bg__image {
		transform: none;
	}

	.exc-ess-bg__spinner {
		animation-duration: 1.6s;
	}
}
