/* ==========================================================================
   News Grid Shortcode
   ========================================================================== */

/* ---------------------------------------------------------------------------
   Grid wrapper
--------------------------------------------------------------------------- */
.news-grid {
	width: 100%;
}

/* ---------------------------------------------------------------------------
   Row: Featured (3/4) + companion (1/4)
--------------------------------------------------------------------------- */
.news-grid__featured-row {
	display: grid;
	grid-template-columns: 3fr 1fr;
	gap: 20px;
	margin-bottom: 20px;
}

/* ---------------------------------------------------------------------------
   Row: 4 equal items (initial visible + more)
--------------------------------------------------------------------------- */
.news-grid__initial-row,
.news-grid__more-row {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 20px;
	margin-bottom: 20px;
}

/* More row is hidden by default — revealed by JS */
.news-grid__more-row {
	display: none;
}

.news-grid__more-row.is-visible {
	display: grid;
}

/* ---------------------------------------------------------------------------
   See More footer
--------------------------------------------------------------------------- */
.news-grid__footer {
	display: flex;
	justify-content: center;
	margin-top: 10px;
	padding-bottom: 20px;
}

/* ---------------------------------------------------------------------------
   News Item — base card
--------------------------------------------------------------------------- */
.news-item {
    padding: 15px;
    background: linear-gradient(101.89deg, #F1E7E4 1.29%, #E9F0F4 100%);
    border-radius: 6px;
    row-gap: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ---------------------------------------------------------------------------
   Featured item — row layout: text left, media right
--------------------------------------------------------------------------- */
.news-item--featured {
    flex-direction: row;
    align-items: stretch;
    border: 2px solid #A0604A;
}

.news-item--featured .news-item__body {
	flex: 1;
	order: 1;
}

.news-item--featured .news-item__thumb-wrap {
	order: 2;
	flex: 0 0 55%;
	width: 55%;
}



/* ---------------------------------------------------------------------------
   Thumbnail wrapper (image + video overlay)
--------------------------------------------------------------------------- */
.news-item__thumb-wrap {
	position: relative;
	width: 100%;
}

.news-item__thumb {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Featured: right-side image fills the full 427px card height — no 220px limit */
.news-item--featured .news-item__thumb-wrap {
	height: 100%;
	max-height: none;
	aspect-ratio: unset;
}


/* ---------------------------------------------------------------------------
   Play button overlay (video items)
--------------------------------------------------------------------------- */
.news-item__play-btn {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background-color: var(--e-global-color-primary, #82CC52);
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	transition: transform 0.2s ease, background-color 0.2s ease;
	z-index: 2;
	padding: unset;
	background-color: unset;
}

.news-item__play-btn:hover {
	transform: translate(-50%, -50%) scale(1.1);
	background-color: unset;
}

/* Featured item gets a larger play button */
.news-item--featured .news-item__play-btn {
	width: 72px;
	height: 72px;
	padding: unset;
}

.news-item--featured .news-item__play-btn svg {
	width: 100%;
	height: 100%;
}

/* ---------------------------------------------------------------------------
   Item body — text content
--------------------------------------------------------------------------- */
.news-item__body {
	display: flex;
	flex-direction: column;
	gap: 6px;
	flex: 1;
}

.news-item__title {
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.35;
	margin: 0;
	color: #1A231D;
}

.news-item--featured .news-item__title {
	font-size: 1.3rem;
}

.news-item__title a {
	color: inherit;
	text-decoration: none;
}

.news-item__title a:hover {
	text-decoration: underline;
}

.news-item__date {
    font-size: 0.9rem;
    color: #1A231D;
    display: block;
}

.news-item__excerpt {
    font-size: 1.0rem;
    line-height: 1.4;
    color: #1A231D;
    margin: 0;
}

/* ---------------------------------------------------------------------------
   Video Modal
--------------------------------------------------------------------------- */
.nvModal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.25s ease;
}

.nvModal.is-open {
	opacity: 1;
	pointer-events: all;
}

/* Semi-transparent backdrop */
.nvModal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.75);
}

/* Modal content box */
.nvModal__wrap {
	position: relative;
	z-index: 1;
	width: 90%;
	max-width: 900px;
	background: #000;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* 16:9 iframe container */
.nvModal__iframe-wrap {
	position: relative;
	padding-bottom: 56.25%;
	height: 0;
}

.nvModal__iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

/* Close (×) button */
.nvModal__close {
	position: absolute;
	top: -40px;
	right: 0;
	background: transparent;
	border: none;
	color: #fff;
	font-size: 2rem;
	line-height: 1;
	cursor: pointer;
	padding: 4px 8px;
	z-index: 2;
	transition: opacity 0.15s ease;
}

.nvModal__close:hover {
	opacity: 0.7;
}

/* Prevent body scroll while modal is open */
body.nvModal-open {
	overflow: hidden;
}

button.news-grid__see-more.customBtn span.customBtnText {
    color: #2C7193 !important;
}

button.news-grid__see-more.customBtn {
    border: unset !important;
    background-color: #F2F7F9;
}

/* ---------------------------------------------------------------------------
   Responsive
--------------------------------------------------------------------------- */
@media (max-width: 1024px) {
	.news-grid__featured-row {
		grid-template-columns: 1fr 1fr;
	}

	.news-grid__initial-row,
	.news-grid__more-row {
		grid-template-columns: repeat(2, 1fr);
	}

	.news-item--featured {
		border: unset;
		border-top: 2px solid #A0604A;
		border-bottom: 2px solid #A0604A;
		border-radius: unset;
	}
}

@media (max-width: 640px) {
	.news-grid__featured-row,
	.news-grid__initial-row,
	.news-grid__more-row {
		grid-template-columns: 1fr;
	}

	/* All cards: auto height on mobile — follow content */
	.news-item {
		height: auto;
	}

	.news-item__body {
		overflow-y: visible;
	}

	/* Featured reverts to column layout on mobile */
	.news-item--featured {
		flex-direction: column-reverse;
	}

	.news-grid__featured-row {
		gap: 30px;
	}
	.news-item:not(.news-item--featured) {
		margin: 0 20px;
	}

	.news-grid__initial-row {
		gap: 30px;
	}
	.news-item--featured .news-item__thumb-wrap {
		order: 1;
		flex: unset;
		width: 100%;
	}

	.news-item--featured .news-item__body {
		order: 2;
	}
}
