/**
 * HBLAB Event Calendar — list page styles.
 *
 * Consumes design tokens + shared components from base.css (--hbec-*, .hbec-btn,
 * .hbec-heading, .hbec-container, .hbec-section, .hbec-chip). Scoped under `.hblab-ec`.
 *
 * Layout note: `.hbec-hero` and `.hbec-lead` are direct children of `.hblab-ec`
 * (outside `.hbec-container`) so they render full-bleed; their content is centred
 * by an inner `.hbec-container`.
 */

/* ------------------------------------------------------------------ *
 * Hero band — asymmetric split (navy field, mesh + blobs, kinetic title)
 * ------------------------------------------------------------------ */
.hbec-hero {
	position: relative;
	overflow: hidden;
	/* Seamless generated background image (dark navy -> amber glow, no seam).
	 * A left-to-right dark gradient is layered on top so the copy side stays
	 * readable while the amber glow shows through on the right. `--hbec-hero-bg`
	 * is set inline by header.php when the Hero Banner screen has a custom
	 * background image; otherwise this default applies. */
	background-color: #0b0f1a;
	background-image:
		linear-gradient(
			90deg,
			rgba(9, 13, 22, 0.94) 0%,
			rgba(9, 13, 22, 0.6) 32%,
			rgba(9, 13, 22, 0.12) 58%,
			rgba(9, 13, 22, 0) 78%
		),
		var(--hbec-hero-bg, url("../img/hero-bg.jpg"));
	background-size: cover, cover;
	background-position: center, center right;
	background-repeat: no-repeat, no-repeat;
	color: #fff;
}

/* Inner is a static container: the visual escapes it and bleeds to the
 * viewport's right edge (absolute to `.hbec-hero`). The copy reserves the
 * left track and stacks above the image. */
.hbec-hero__inner {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	align-items: center;
	gap: 40px;
	padding-top: 100px;
	padding-bottom: 120px;
}

.hbec-hero__copy {
	position: relative;
	z-index: var(--hbec-z-content);
}

.hbec-hero__eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	margin: 0 0 22px;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.28em;
	text-transform: uppercase;
	color: var(--hbec-yellow);
}

.hbec-hero__eyebrow::before {
	content: "";
	width: 30px;
	height: 2px;
	background: var(--hbec-yellow);
}

.hblab-ec .hbec-hero__title {
	color: #fff;
	font-size: clamp(2.5rem, 6.4vw, 4.75rem);
	font-weight: var(--hbec-fw-display);
	line-height: 1.08;
	letter-spacing: -0.015em;
	margin: 0 0 26px;
}

.hbec-hero__word {
	display: inline-block;
	/* Groups stay unbroken, but an over-long one (custom headline) still wraps
	 * instead of overflowing the hero. */
	overflow-wrap: anywhere;
}

.hbec-hero__lead {
	margin: 0 0 36px;
	max-width: 460px;
	color: rgba(255, 255, 255, 0.7);
	font-size: 1.0625rem;
	line-height: 1.95;
}

.hbec-hero__cta {
	display: inline-flex;
}

/* Pull the main content up so the filter bar overlaps the hero edge. */
.hbec-main {
	padding-top: 40px;
}

@media (max-width: 900px) {
	.hbec-hero__inner {
		grid-template-columns: 1fr;
		padding-top: 100px;
		padding-bottom: 48px;
		gap: 28px;
	}
}

/* ------------------------------------------------------------------ *
 * Filter bar — floating toolbar card lifted over the hero seam
 * ------------------------------------------------------------------ */
.hbec-filter-bar {
	padding: 0 0 40px;
	margin-top: -76px;
	position: relative;
	z-index: 2;
}

.hbec-filter-bar__row {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	background: var(--hbec-bg);
	border: 1px solid var(--hbec-border);
	border-radius: var(--hbec-radius-lg);
	padding: 18px;
	box-shadow: var(--hbec-shadow-lg);
}

.hbec-filter-bar__search {
	flex: 1 1 240px;
	position: relative;
}

.hbec-filter-bar__search::before {
	content: "";
	position: absolute;
	left: 14px;
	top: 50%;
	width: 18px;
	height: 18px;
	transform: translateY(-50%);
	background: no-repeat center / contain
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239CA3AF' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E");
	pointer-events: none;
}

.hbec-filter-bar__input {
	-webkit-appearance: none;
	appearance: none;
}

/* Remove native WebKit search decorations so they don't overlap the custom ::before icon. */
.hbec-filter-bar__input::-webkit-search-decoration,
.hbec-filter-bar__input::-webkit-search-cancel-button,
.hbec-filter-bar__input::-webkit-search-results-button,
.hbec-filter-bar__input::-webkit-search-results-decoration {
	-webkit-appearance: none;
	display: none;
}

.hbec-filter-bar__input,
.hbec-filter-bar__select {
	width: 100%;
	height: 48px;
	padding: 0 14px;
	border: 1px solid var(--hbec-border);
	border-radius: var(--hbec-radius);
	background: var(--hbec-bg);
	color: var(--hbec-text);
	font-family: var(--hbec-font);
	font-size: 0.9375rem;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

/* Reserve space for the search icon; must come after the shared padding rule above to win the cascade. */
.hbec-filter-bar__input {
	padding-left: 42px;
}

.hbec-filter-bar__select {
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	padding-right: 40px;
	cursor: pointer;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
	background-size: 18px;
}

.hbec-filter-bar__input:focus-visible,
.hbec-filter-bar__input:focus,
.hbec-filter-bar__select:focus-visible {
	outline: none;
	border-color: var(--hbec-yellow);
	box-shadow: 0 0 0 3px rgba(255, 195, 22, 0.35);
}

.hbec-filter-bar__selects {
	flex: 2 1 480px;
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
}

.hbec-filter-bar__field {
	flex: 1 1 150px;
	min-width: 150px;
}

/* ------------------------------------------------------------------ *
 * Featured hero card — spotlight bento tile (distinct family from the grid)
 * ------------------------------------------------------------------ */
.hbec-featured {
	padding-top: 8px;
}

.hbec-featured__inner {
	display: grid;
	grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
	gap: 0;
	background: var(--hbec-bg);
	border: 1px solid var(--hbec-border);
	border-radius: var(--hbec-radius-lg);
	overflow: hidden;
	box-shadow: var(--hbec-shadow-lg);
	transition: box-shadow var(--hbec-dur) var(--hbec-ease);
}

.hbec-featured__inner:hover {
	box-shadow: 0 20px 45px rgba(20, 27, 46, 0.18);
}

.hbec-featured__media {
	position: relative;
	min-height: 320px;
	background: var(--hbec-bg-soft);
}

.hbec-featured__media .hbec-featured__banner {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.hbec-featured__body {
	padding: 40px;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: center;
}

.hbec-featured__title {
	font-size: 1.625rem;
	line-height: 1.4;
	margin: 16px 0 14px;
}

.hbec-featured__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 18px;
}

.hbec-featured__meta {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin: 0 0 18px;
	width: 100%;
}

.hbec-featured__meta li {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	font-size: 0.9375rem;
	color: var(--hbec-text);
}

.hbec-featured__meta li span {
	min-width: 0;
	overflow-wrap: anywhere;
}

.hbec-featured__meta svg {
	flex: 0 0 auto;
	margin-top: 2px;
	color: var(--hbec-yellow);
}

.hbec-featured__excerpt {
	margin: 0 0 24px;
	font-size: 0.9375rem;
	color: var(--hbec-text);
	width: 100%;
}

/* ------------------------------------------------------------------ *
 * Event grid — image-forward cards
 *
 * Desktop: 6-column track, each card spans 2 (3-up). `grid-auto-flow: dense`
 * repacks around any `.is-hidden` (display:none) card from filters.js so no
 * empty cells are left for the current count.
 * ------------------------------------------------------------------ */
.hbec-events__grid {
	display: grid;
	grid-template-columns: repeat(6, 1fr);
	grid-auto-flow: row dense;
	gap: 28px;
}

.hbec-card {
	grid-column: span 2;
	display: flex;
	flex-direction: column;
	border: 1px solid rgba(20, 27, 46, 0.06);
	border-radius: var(--hbec-radius-lg);
	background: var(--hbec-bg);
	box-shadow: 0 6px 20px -12px rgba(20, 27, 46, 0.18);
	overflow: hidden;
	transition: transform var(--hbec-dur) var(--hbec-ease),
		box-shadow var(--hbec-dur) var(--hbec-ease);
}

.hbec-card:hover {
	transform: translateY(-6px);
	box-shadow: 0 24px 48px -20px rgba(20, 27, 46, 0.4);
	border-color: transparent;
}

.hbec-card__media {
	position: relative;
	display: block;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: var(--hbec-bg-soft);
}

.hbec-card__media .hbec-card__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.4s ease;
}

.hbec-card:hover .hbec-card__img {
	transform: scale(1.05);
}

.hbec-card__badge {
	position: absolute;
	top: 12px;
	left: 12px;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.hbec-card__format {
	position: absolute;
	bottom: 12px;
	left: 12px;
	padding: 3px 10px;
	border-radius: 6px;
	background: rgba(20, 27, 46, 0.82);
	color: #fff;
	font-size: 0.6875rem;
	font-weight: 600;
	letter-spacing: 0.02em;
}

.hbec-card__body {
	display: flex;
	flex-direction: column;
	padding: 20px;
	flex: 1;
}

.hbec-card__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 12px;
}

.hbec-card__title {
	font-size: 1.0625rem;
	line-height: 1.5;
	margin: 0 0 12px;
}

.hbec-card__title a {
	transition: color 0.15s ease;
}

.hbec-card__title a:hover {
	color: #b8890b;
}

.hbec-card__meta {
	display: flex;
	flex-direction: column;
	gap: 3px;
	margin: 0 0 12px;
	font-size: 0.8125rem;
	color: var(--hbec-muted);
}

.hbec-card__date,
.hbec-card__loc {
	font-weight: 600;
	color: #6B7280;
}

.hbec-card__excerpt {
	flex: 1;
	font-size: 0.875rem;
	line-height: 1.8;
	margin: 0 0 18px;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.hbec-card__link {
	align-self: flex-start;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 0.875rem;
	font-weight: 700;
	color: var(--hbec-heading);
	border-bottom: 2px solid var(--hbec-yellow);
	padding-bottom: 2px;
	transition: gap 0.15s ease, color 0.15s ease;
}

.hbec-card__link:hover {
	color: #b8890b;
	gap: 10px;
}

.hbec-card__arrow {
	transition: transform 0.15s ease;
}

/* Hide filtered-out cards / hero without reflowing the grid tracks. */
.is-hidden {
	display: none !important;
}

.hbec-events__empty {
	grid-column: 1 / -1;
	text-align: center;
	color: var(--hbec-muted);
	padding: 56px 0;
	margin: 0;
}

/* ------------------------------------------------------------------ *
 * Status badges
 * ------------------------------------------------------------------ */
.hbec-badge {
	display: inline-block;
	align-self: flex-start;
	padding: 4px 12px;
	border-radius: 999px;
	font-size: 0.75rem;
	font-weight: 700;
	line-height: 1.6;
}

.hbec-badge--upcoming {
	background: var(--hbec-yellow);
	color: var(--hbec-yellow-text);
}

.hbec-badge--ongoing {
	background: var(--hbec-green);
	color: #fff;
}

.hbec-badge--ended {
	background: var(--hbec-gray);
	color: #fff;
}

/* ------------------------------------------------------------------ *
 * Stats break-strip — distinct layout family between the grid and the lead
 * band; count-up numbers via the Phase 1 `[data-hbec-count]` primitive.
 * ------------------------------------------------------------------ */
.hbec-stats {
	margin-top: 24px;
	background: var(--hbec-bg-soft);
	border-top: 1px solid var(--hbec-border);
	border-bottom: 1px solid var(--hbec-border);
}

.hbec-stats__inner {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 32px;
	text-align: center;
}

.hbec-stats__num {
	margin: 0 0 8px;
	font-size: clamp(2rem, 4vw, 2.75rem);
	font-weight: 900;
	color: var(--hbec-heading);
	font-variant-numeric: tabular-nums;
}

.hbec-stats__num span {
	background: var(--hbec-grad-warm);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
}

.hbec-stats__label {
	margin: 0;
	font-size: 0.875rem;
	color: var(--hbec-text);
}

/* ------------------------------------------------------------------ *
 * Lead-capture CTA band (full-bleed yellow, HBLAB style)
 * ------------------------------------------------------------------ */
.hbec-lead {
	position: relative;
	overflow: hidden;
	margin-top: 72px;
	background: var(--hbec-yellow);
	background-image: linear-gradient(120deg, #FFCF3E 0%, var(--hbec-yellow) 55%, #F5B400 100%);
}

.hbec-lead__inner {
	position: relative;
	z-index: var(--hbec-z-content);
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 28px;
	padding-top: 48px;
	padding-bottom: 48px;
}

.hbec-lead__copy {
	flex: 1 1 380px;
}

.hbec-lead__title {
	color: var(--hbec-heading);
	font-size: 1.625rem;
	line-height: 1.4;
	margin: 0 0 10px;
}

.hbec-lead__desc {
	margin: 0;
	color: #5B4E20;
	font-size: 0.9375rem;
	line-height: 1.8;
}

.hbec-lead__form {
	flex: 1 1 360px;
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	max-width: 520px;
}

.hbec-lead__input {
	flex: 1 1 240px;
	height: 52px;
	padding: 0 18px;
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: var(--hbec-radius);
	background: #fff;
	font-family: var(--hbec-font);
	font-size: 0.9375rem;
}

.hbec-lead__input:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px rgba(20, 27, 46, 0.25);
}

.hbec-lead__submit {
	flex: 0 0 auto;
	height: 52px;
}

/* ------------------------------------------------------------------ *
 * Responsive breakpoints
 * ------------------------------------------------------------------ */
@media (max-width: 900px) {
	.hbec-featured__inner {
		grid-template-columns: minmax(0, 1fr);
	}

	.hbec-featured__media {
		min-height: 220px;
		aspect-ratio: 16 / 9;
	}

	.hbec-featured__body {
		padding: 28px;
	}
}

@media (max-width: 768px) {
	.hbec-events__grid {
		grid-template-columns: repeat(2, 1fr);
	}

	.hbec-card {
		grid-column: span 1;
	}

	.hbec-filter-bar__row {
		flex-direction: column;
	}

	/* flex-basis was tuned for the row layout's width; in the column
	 * layout above, flex-basis sets height instead, so it must be reset
	 * or these items stretch to their old width value as a height. */
	.hbec-filter-bar__search,
	.hbec-filter-bar__selects {
		flex: 1 1 auto;
	}

	.hbec-lead__inner {
		flex-direction: column;
		align-items: stretch;
		text-align: left;
	}
}

@media (max-width: 600px) {
	.hbec-stats__inner {
		grid-template-columns: 1fr;
		gap: 24px;
	}
}

@media (max-width: 480px) {
	.hbec-events__grid {
		grid-template-columns: 1fr;
	}

	.hbec-hero__title {
		font-size: 1.75rem;
	}

	.hbec-featured__body {
		padding: 22px;
	}

	.hbec-lead__form {
		flex-direction: column;
	}

	.hbec-lead__submit {
		width: 100%;
	}
}
