/* HHH Events List – all selectors prefixed with "hhhev-" so nothing leaks into the theme. */

.hhhev-wrap {
	--hhhev-primary: #2a527b;      /* matches the site's brand blue */
	--hhhev-primary-dark: #1d3955;
	--hhhev-accent: #039db3;
	--hhhev-text: #1f2d3d;
	--hhhev-muted: #5b6b7c;
	--hhhev-card-bg: #ffffff;
	--hhhev-border: #e3eaf0;
	--hhhev-radius: 14px;
	--hhhev-ratio: 4/5;
	box-sizing: border-box;
	width: 100%;
	max-width: 1200px;
	margin: 0 auto;
	padding: 8px 0 24px;
	font-family: inherit;
	color: var(--hhhev-text);
}

.hhhev-wrap *,
.hhhev-wrap *::before,
.hhhev-wrap *::after {
	box-sizing: border-box;
}

.hhhev-autowrap {
	clear: both;
	padding: 24px 15px 0;
}

.hhhev-section + .hhhev-section {
	margin-top: 56px;
}

.hhhev-wrap .hhhev-heading {
	position: relative;
	margin: 0 0 28px;
	padding: 0 0 14px;
	font-family: inherit;
	font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
	font-weight: 600;
	line-height: 1.25;
	letter-spacing: -0.01em;
	color: var(--hhhev-primary);
	text-align: center;
}

.hhhev-wrap .hhhev-heading::after {
	content: "";
	position: absolute;
	left: 50%;
	bottom: 0;
	width: 56px;
	height: 3px;
	margin-left: -28px;
	border-radius: 3px;
	background: var(--hhhev-accent);
}

/* ---------- Grid: 3 / 2 / 1 columns ---------- */
.hhhev-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 28px;
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (max-width: 1024px) {
	.hhhev-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 22px;
	}
}

@media (max-width: 640px) {
	.hhhev-grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 20px;
	}
	.hhhev-autowrap {
		padding-left: 0;
		padding-right: 0;
	}
}

/* ---------- Card ---------- */
.hhhev-card {
	display: flex;
	flex-direction: column;
	height: 100%;               /* equal heights within a row */
	margin: 0;
	overflow: hidden;
	border: 1px solid var(--hhhev-border);
	border-radius: var(--hhhev-radius);
	background: var(--hhhev-card-bg);
	box-shadow: 0 2px 6px rgba(20, 45, 75, 0.06), 0 10px 24px rgba(20, 45, 75, 0.06);
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hhhev-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 6px 14px rgba(20, 45, 75, 0.08), 0 18px 40px rgba(20, 45, 75, 0.12);
}

/* ---------- Image frame (fixed ratio = consistent card heights, image never stretched) ---------- */
.hhhev-media {
	position: relative;
	width: 100%;
	aspect-ratio: var(--hhhev-ratio);
	overflow: hidden;
	background: #eef3f7;
	isolation: isolate;
}

@supports not (aspect-ratio: 1 / 1) {
	.hhhev-media {
		height: 0;
		padding-top: 125%; /* 4:5 fallback for very old Safari */
	}
}

/* Soft blurred copy of the image fills empty space when the whole poster is shown */
.hhhev-fit-contain .hhhev-media::before {
	content: "";
	position: absolute;
	inset: -24px;
	z-index: -1;
	background-image: var(--hhhev-bg, none);
	background-size: cover;
	background-position: center;
	filter: blur(18px) saturate(1.1);
	opacity: 0.55;
	transform: scale(1.1);
}

.hhhev-wrap .hhhev-media .hhhev-img {
	position: absolute;
	top: 0;
	left: 0;
	display: block;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	object-fit: contain;
	object-position: center;
	transition: transform 0.5s ease;
}

.hhhev-fit-cover .hhhev-media .hhhev-img {
	object-fit: cover;
}

.hhhev-card:hover .hhhev-img {
	transform: scale(1.04);
}

.hhhev-noimg {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #a9b8c6;
	background: linear-gradient(135deg, #eef3f7, #e2eaf1);
}

.hhhev-badge {
	position: absolute;
	top: 12px;
	left: 12px;
	padding: 5px 10px;
	border-radius: 999px;
	background: rgba(31, 45, 61, 0.82);
	color: #fff;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.04em;
	line-height: 1;
	text-transform: uppercase;
}

.hhhev-card--past .hhhev-img {
	filter: grayscale(0.35);
}

/* ---------- Body ---------- */
.hhhev-body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	padding: 20px 22px 22px;
}

.hhhev-wrap .hhhev-title {
	margin: 0 0 10px;
	padding: 0;
	font-family: inherit;
	font-size: 1.2rem;
	font-weight: 600;
	line-height: 1.35;
	letter-spacing: -0.005em;
	color: var(--hhhev-text);
	/* keep long titles tidy: max 2 lines */
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.hhhev-wrap .hhhev-date,
.hhhev-wrap .hhhev-venue {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin: 0 0 6px;
	padding: 0;
	font-size: 0.95rem;
	line-height: 1.45;
	color: var(--hhhev-muted);
}

.hhhev-wrap .hhhev-date {
	font-weight: 500;
	color: var(--hhhev-primary);
}

.hhhev-ico {
	flex: 0 0 auto;
	width: 16px;
	height: 16px;
	margin-top: 2px;
	color: var(--hhhev-accent);
}

.hhhev-time {
	color: var(--hhhev-muted);
	font-weight: 400;
}

.hhhev-wrap .hhhev-excerpt {
	margin: 6px 0 0;
	font-size: 0.93rem;
	line-height: 1.55;
	color: var(--hhhev-muted);
}

/* Button sits at the bottom of every card so buttons line up across a row */
.hhhev-actions {
	margin-top: auto;
	padding-top: 16px;
}

.hhhev-wrap .hhhev-btn,
.hhhev-wrap .hhhev-btn:visited {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 46px;
	margin: 0;
	padding: 12px 20px;
	border: 0;
	border-radius: 8px;
	background: var(--hhhev-primary);
	color: #fff !important;
	font-family: inherit;
	font-size: 0.9rem;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: 0.08em;
	text-align: center;
	text-decoration: none !important;
	text-transform: uppercase;
	box-shadow: 0 4px 12px rgba(42, 82, 123, 0.25);
	cursor: pointer;
	transition: background-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

/* Kalium adds an underline pseudo-element to links – remove it on our button */
.hhhev-wrap .hhhev-btn::after,
.hhhev-wrap .hhhev-btn::before {
	display: none !important;
	content: none !important;
}

.hhhev-wrap a.hhhev-btn:hover,
.hhhev-wrap a.hhhev-btn:focus-visible {
	background: var(--hhhev-primary-dark);
	color: #fff !important;
	transform: translateY(-1px);
	box-shadow: 0 8px 18px rgba(29, 57, 85, 0.32);
}

.hhhev-wrap a.hhhev-btn:focus-visible {
	outline: 3px solid var(--hhhev-accent);
	outline-offset: 2px;
}

.hhhev-wrap .hhhev-btn--disabled {
	background: #e6ecf1;
	color: #6b7b8b !important;
	box-shadow: none;
	cursor: default;
	letter-spacing: 0.04em;
}

/* ---------- Empty state ---------- */
.hhhev-empty {
	max-width: 560px;
	margin: 0 auto;
	padding: 40px 24px;
	border: 1px dashed #c9d6e2;
	border-radius: var(--hhhev-radius);
	background: #fff;
	text-align: center;
}

.hhhev-empty__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	margin-bottom: 12px;
	border-radius: 50%;
	background: #eaf3f8;
	color: var(--hhhev-primary);
}

.hhhev-wrap .hhhev-empty p {
	margin: 0;
	font-size: 1.05rem;
	color: var(--hhhev-muted);
}

@media (prefers-reduced-motion: reduce) {
	.hhhev-card,
	.hhhev-img,
	.hhhev-btn {
		transition: none !important;
	}
	.hhhev-card:hover,
	.hhhev-card:hover .hhhev-img {
		transform: none;
	}
}
