/* Events (Tabs) – NHCE */
.nhce-ev {
	--nhce-ev-accent: #1d5fa8;
	--nhce-ev-title: var(--nhce-ev-accent);
	--nhce-ev-text: #4a5160;
	--nhce-ev-muted: #7b8494;
	--nhce-ev-line: #e2e6ed;
	--nhce-ev-tab-bg: #eef1f5;
	--nhce-ev-now: #1f8a4c;
	--nhce-ev-poster: 260px;
	color: var(--nhce-ev-text);
	font-family: inherit;
	line-height: 1.6;
}
.nhce-ev *, .nhce-ev *::before, .nhce-ev *::after { box-sizing: border-box; }

/* ---------- Tabs ---------- */
.nhce-ev__tabs {
	display: grid;
	grid-template-columns: repeat(var(--nhce-ev-tabs, 3), minmax(0, 1fr));
	gap: 6px;
	padding: 6px;
	margin: 0 0 8px;
	background: var(--nhce-ev-tab-bg);
	border-radius: 12px;
}
.nhce-ev__tab {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 52px;
	padding: 10px 16px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: var(--nhce-ev-text);
	font: inherit;
	font-size: 17px;
	font-weight: 500;
	line-height: 1.2;
	cursor: pointer;
	transition: background-color .2s ease, color .2s ease;
}
.nhce-ev__tab:hover { background: rgba(255, 255, 255, .7); color: var(--nhce-ev-accent); }
.nhce-ev__tab.is-active,
.nhce-ev__tab.is-active:hover { background: var(--nhce-ev-accent); color: #fff; }
.nhce-ev__tab:focus-visible { outline: 3px solid var(--nhce-ev-accent); outline-offset: 2px; }
.nhce-ev__count {
	min-width: 26px;
	padding: 2px 8px;
	border-radius: 20px;
	background: rgba(0, 0, 0, .07);
	font-size: 13px;
	font-weight: 600;
	text-align: center;
}
.nhce-ev__tab.is-active .nhce-ev__count { background: rgba(255, 255, 255, .22); }

/* ---------- Panel / loading ---------- */
.nhce-ev__panel { position: relative; min-height: 120px; }
.nhce-ev__panel[aria-busy="true"] > * { opacity: .4; pointer-events: none; transition: opacity .15s; }
.nhce-ev__panel[aria-busy="true"]::after {
	content: "";
	position: absolute;
	top: 60px;
	left: 50%;
	width: 32px;
	height: 32px;
	margin-left: -16px;
	border: 3px solid var(--nhce-ev-line);
	border-top-color: var(--nhce-ev-accent);
	border-radius: 50%;
	animation: nhce-ev-spin .8s linear infinite;
}
@keyframes nhce-ev-spin { to { transform: rotate(360deg); } }

.nhce-ev__empty,
.nhce-ev__error {
	margin: 24px 0;
	padding: 40px 20px;
	border: 1px dashed var(--nhce-ev-line);
	border-radius: 12px;
	color: var(--nhce-ev-muted);
	text-align: center;
}

/* ---------- Event item ---------- */
.nhce-ev__item {
	display: grid;
	grid-template-columns: 76px minmax(0, 1fr);
	grid-template-areas: "when body";
	gap: 24px;
	padding: 32px 0;
	border-bottom: 1px solid var(--nhce-ev-line);
}
.nhce-ev__item.has-image {
	grid-template-columns: 76px minmax(0, 1fr) var(--nhce-ev-poster);
	grid-template-areas: "when body poster";
}
.nhce-ev__item:last-child { border-bottom: 0; }

/* Tear-off calendar date */
.nhce-ev__when {
	grid-area: when;
	align-self: start;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid var(--nhce-ev-line);
	border-radius: 10px;
	background: #fff;
	text-align: center;
	line-height: 1;
}
.nhce-ev__month {
	order: -1;
	padding: 6px 0;
	background: var(--nhce-ev-accent);
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: .02em;
}
.nhce-ev__day {
	padding: 10px 0 2px;
	color: #1c2330;
	font-size: 30px;
	font-weight: 700;
}
.nhce-ev__year { padding: 0 0 9px; color: var(--nhce-ev-muted); font-size: 12px; }
.nhce-ev__item.is-happening .nhce-ev__month { background: var(--nhce-ev-now); }
.nhce-ev__item.is-expired .nhce-ev__month { background: #8a93a3; }

.nhce-ev__body { grid-area: body; min-width: 0; }
.nhce-ev .nhce-ev__title {
	margin: 0 0 10px;
	padding: 0;
	color: var(--nhce-ev-title);
	font-size: 24px;
	font-weight: 500;
	line-height: 1.3;
}
.nhce-ev .nhce-ev__title a { color: inherit; text-decoration: none; }
.nhce-ev .nhce-ev__title a:hover { text-decoration: underline; text-underline-offset: 4px; }

.nhce-ev__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 20px;
	margin: 0 0 14px;
	padding: 0;
	list-style: none;
	color: #2b3340;
	font-size: 15px;
}
.nhce-ev__meta li { display: flex; align-items: center; gap: 7px; margin: 0; padding: 0; }
.nhce-ev__meta li::before { content: none; }
.nhce-ev__icon { flex: none; color: var(--nhce-ev-accent); }
.nhce-ev__item.is-happening .nhce-ev__meta li:first-child::after {
	content: "On now";
	margin-left: 4px;
	padding: 1px 8px;
	border-radius: 20px;
	background: #e3f4ea;
	color: var(--nhce-ev-now);
	font-size: 12px;
	font-weight: 600;
}

.nhce-ev__text { font-size: 15.5px; }
.nhce-ev__text p { margin: 0 0 10px; }
.nhce-ev__text p:last-child { margin-bottom: 0; }

.nhce-ev__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 14px; }
.nhce-ev a.nhce-ev__more {
	color: var(--nhce-ev-accent);
	font-weight: 500;
	text-decoration: none;
	border-bottom: 1px solid currentColor;
}
.nhce-ev a.nhce-ev__more:hover { border-bottom-width: 2px; }
.nhce-ev a.nhce-ev__link,
.nhce-ev-single a.nhce-ev__link {
	display: inline-block;
	padding: 8px 18px;
	border-radius: 8px;
	background: var(--nhce-ev-accent, #1d5fa8);
	color: #fff;
	font-weight: 500;
	text-decoration: none;
}
.nhce-ev a.nhce-ev__link:hover { filter: brightness(1.1); }

.nhce-ev__poster { grid-area: poster; align-self: start; display: block; }
.nhce-ev__poster img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 10px;
	box-shadow: 0 1px 2px rgba(20, 30, 50, .08), 0 8px 24px -12px rgba(20, 30, 50, .25);
}
.nhce-ev__item.is-expired .nhce-ev__poster img { filter: saturate(.85); }

/* ---------- Pagination ---------- */
.nhce-ev__pager {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-top: 8px;
	padding-top: 20px;
	border-top: 1px solid var(--nhce-ev-line);
}
.nhce-ev__range { margin: 0; color: var(--nhce-ev-muted); font-size: 14px; }
.nhce-ev__pages { display: flex; flex-wrap: wrap; gap: 6px; }
.nhce-ev__page {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 12px;
	border: 1px solid var(--nhce-ev-line);
	border-radius: 8px;
	background: #fff;
	color: var(--nhce-ev-text);
	font-size: 15px;
	text-decoration: none;
	line-height: 1;
}
.nhce-ev a.nhce-ev__page:hover { border-color: var(--nhce-ev-accent); color: var(--nhce-ev-accent); }
.nhce-ev__page.is-current { background: var(--nhce-ev-accent); border-color: var(--nhce-ev-accent); color: #fff; font-weight: 600; }
.nhce-ev__page--gap { border-color: transparent; background: transparent; min-width: 24px; padding: 0; }
.nhce-ev__page:focus-visible { outline: 3px solid var(--nhce-ev-accent); outline-offset: 2px; }

/* ---------- Single event details box ---------- */
.nhce-ev-single {
	margin: 0 0 28px;
	padding: 20px 22px;
	border: 1px solid #e2e6ed;
	border-left: 4px solid #1d5fa8;
	border-radius: 10px;
	background: #f7f9fc;
}
.nhce-ev-single.is-happening { border-left-color: #1f8a4c; }
.nhce-ev-single.is-expired { border-left-color: #8a93a3; }
.nhce-ev-single__status { margin: 0 0 10px; font-weight: 600; color: #1c2330; }
.nhce-ev-single .nhce-ev__meta { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 0 0 4px; padding: 0; list-style: none; }
.nhce-ev-single .nhce-ev__meta li { display: flex; align-items: center; gap: 7px; margin: 0; }
.nhce-ev-single .nhce-ev__icon { color: #1d5fa8; }
.nhce-ev-single .nhce-ev__link { margin-top: 12px; }

/* ---------- Tablet & mobile ---------- */
@media (max-width: 1024px) {
	.nhce-ev { --nhce-ev-poster: 200px; }
	.nhce-ev .nhce-ev__title { font-size: 21px; }
}
@media (max-width: 720px) {
	.nhce-ev__tabs { gap: 4px; padding: 4px; }
	.nhce-ev__tab { flex-direction: column; min-height: 56px; padding: 8px 4px; font-size: 14px; gap: 4px; }
	.nhce-ev__count { min-width: 22px; padding: 1px 6px; font-size: 12px; }
	.nhce-ev__item,
	.nhce-ev__item.has-image {
		grid-template-columns: 58px minmax(0, 1fr);
		grid-template-areas: "when body" "poster poster";
		gap: 16px;
		padding: 24px 0;
	}
	.nhce-ev__poster { max-width: 420px; }
	.nhce-ev__day { font-size: 24px; }
	.nhce-ev__month { font-size: 12px; }
	.nhce-ev .nhce-ev__title { font-size: 19px; }
	.nhce-ev__meta { flex-direction: column; font-size: 14px; }
	.nhce-ev__text { font-size: 15px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 5; overflow: hidden; }
	.nhce-ev__pager { justify-content: center; text-align: center; }
	.nhce-ev__range { width: 100%; }
	.nhce-ev__page { min-width: 38px; height: 38px; padding: 0 10px; }
}
@media (prefers-reduced-motion: reduce) {
	.nhce-ev *, .nhce-ev__panel::after { transition: none !important; animation-duration: 2s !important; }
}
