/**
 * Latest News Widget Styles
 * Uses global design tokens from globals.css only.
 * Desktop = grid · Mobile = Swiper 1.5 + dots
 *
 * @package HelloElementorChild
 */

.hec-news {
	width: 100%;
	max-width: var(--container-max);
	margin-inline: auto;
	padding-inline: 1.5rem;
	box-sizing: border-box;
	font-family: var(--font-body);
	color: var(--color-ink);
}

.hec-news__heading {
	margin: 0 0 2rem;
	font-family: var(--font-heading);
	font-size: clamp(1.75rem, 3vw, 2.25rem);
	font-weight: var(--font-weight-bold);
	line-height: 1.2;
	color: var(--color-ink);
}

/* Desktop / tablet: CSS grid (Swiper destroyed / inactive) */
.hec-news__swiper {
	overflow: visible;
}

.hec-news__wrapper {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 2.5rem 3rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

@media (min-width: 641px) {
	.hec-news__wrapper {
		transform: none !important;
	}

	.hec-news__slide {
		width: auto !important;
		margin-right: 0 !important;
	}
}

.hec-news__pagination {
	display: none;
}

.hec-news__card {
	display: grid;
	grid-template-columns: minmax(110px, 38%) 1fr;
	gap: 1.25rem 1.5rem;
	align-items: stretch;
	text-decoration: none;
	color: inherit;
	height: 100%;
}

.hec-news__media {
	position: relative;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	border-radius: var(--radius-md);
	background: var(--color-frost);
}

.hec-news__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform var(--transition-slow);
}

.hec-news__card:hover .hec-news__media img {
	transform: scale(1.04);
}

.hec-news__body {
	display: flex;
	flex-direction: column;
	min-width: 0;
	padding-top: 0.15rem;
}

.hec-news__accent {
	display: block;
	width: 100%;
	height: 2px;
	margin: 0 0 0.85rem;
	background: var(--color-gold);
	border: 0;
	flex-shrink: 0;
}

.hec-news__title {
	margin: 0;
	font-family: var(--font-heading);
	font-size: clamp(1rem, 1.4vw, 1.25rem);
	font-weight: var(--font-weight-bold);
	line-height: 1.35;
	color: var(--color-ink);
	transition: color var(--transition-fast);
}

.hec-news__card:hover .hec-news__title {
	color: var(--color-sea);
}

.hec-news__meta {
	margin: 0.65rem 0 0;
	font-family: var(--font-body);
	font-size: 0.875rem;
	font-weight: var(--font-weight-medium);
	line-height: 1.4;
	color: var(--color-muted-foreground);
}

.hec-news__more {
	margin-top: auto;
	padding-top: 1rem;
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	font-family: var(--font-body);
	font-size: 0.75rem;
	font-weight: var(--font-weight-bold);
	letter-spacing: 0.06em;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--color-ink);
	transition: color var(--transition-fast), gap var(--transition-fast);
}

.hec-news__card:hover .hec-news__more {
	color: var(--color-sea);
	gap: 0.55rem;
}

.hec-news__more-icon {
	width: 0.85rem;
	height: 0.85rem;
	stroke: currentColor;
	fill: none;
	stroke-width: 2.5;
	stroke-linecap: round;
	stroke-linejoin: round;
	flex-shrink: 0;
}

.hec-news__footer {
	margin-top: 2.5rem;
}

.hec-news__view-all {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	font-family: var(--font-body);
	font-size: 0.8125rem;
	font-weight: var(--font-weight-bold);
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--color-ink);
	transition: color var(--transition-fast), gap var(--transition-fast);
}

.hec-news__view-all:hover {
	color: var(--color-sea);
	gap: 0.6rem;
}

.hec-news__view-all-icon {
	width: 0.95rem;
	height: 0.95rem;
	stroke: currentColor;
	fill: none;
	stroke-width: 2.5;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.hec-news__empty {
	margin: 0;
	padding: 1.5rem;
	font-family: var(--font-body);
	color: var(--color-muted-foreground);
	background: var(--color-frost);
	border-radius: var(--radius-md);
}

@media (max-width: 900px) {
	.hec-news__wrapper {
		gap: 2rem 1.5rem;
	}

	.hec-news__card {
		grid-template-columns: minmax(100px, 34%) 1fr;
		gap: 1rem;
	}
}

/* Mobile: Swiper auto-width full cards + dots — vertical cards (image on top) */
@media (max-width: 640px) {
	.hec-news {
		padding: 0;
	}

	.hec-news__footer {
		padding-left: 20px;
	}

	.hec-news h2.hec-news__heading {
		padding-left: 20px;
		margin-bottom: 1.25rem;
	}

	.hec-news__swiper {
		overflow: hidden;
		margin-inline: 0;
	}

	.hec-news--swiper .hec-news__wrapper {
		display: flex !important;
		grid-template-columns: none !important;
		gap: 0 !important;
	}

	.hec-news--swiper .hec-news__slide {
		width: calc(100% - 40px) !important;
		max-width: calc(100% - 40px);
		height: auto;
		box-sizing: border-box;
	}

	/* Before JS / single item fallback */
	.hec-news:not(.hec-news--swiper) .hec-news__wrapper {
		display: flex;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		gap: 1rem;
		padding-inline: 20px;
		-webkit-overflow-scrolling: touch;
	}

	.hec-news:not(.hec-news--swiper) .hec-news__slide {
		flex: 0 0 100%;
		scroll-snap-align: start;
		width: 100% !important;
	}

	.hec-news__article {
		height: 100%;
	}

	/* Stack: image top, text below */
	.hec-news__card {
		display: flex;
		flex-direction: column;
		grid-template-columns: none;
		gap: 0.75rem;
		height: 100%;
	}

	.hec-news__media {
		width: 100%;
        max-width: none;
        aspect-ratio: 1 / 1;
        max-height: 250px;
        border-radius: var(--radius-md);
        flex-shrink: 0;
	}

	.hec-news__body {
		padding-top: 0;
		flex: 1;
	}

	.hec-news__accent {
		margin-bottom: 0.6rem;
	}

	.hec-news__title {
		font-size: 0.9375rem;
		line-height: 1.35;
		display: -webkit-box;
		-webkit-line-clamp: 3;
		-webkit-box-orient: vertical;
		overflow: hidden;
	}

	.hec-news__meta {
		margin-top: 0.45rem;
		font-size: 0.75rem;
	}

	.hec-news__more {
		padding-top: 0.65rem;
		font-size: 0.6875rem;
	}

	.hec-news__pagination {
		display: flex;
		align-items: center;
		justify-content: center;
		gap: 0.4rem;
		margin-top: 1.25rem;
		position: static !important;
	}

	.hec-news__pagination .swiper-pagination-bullet {
		width: 8px;
		height: 8px;
		margin: 0 !important;
		background: var(--color-border);
		opacity: 1;
		border-radius: var(--radius-pill);
		transition: width var(--transition-base), background var(--transition-base);
	}

	.hec-news__pagination .swiper-pagination-bullet-active {
		width: 22px;
		background: var(--color-sea);
	}

	.hec-news__footer {
		margin-top: 1.75rem;
	}
}
