/* Communities listing page — mirrors join-study layout */

.eh-communities-platform {
	font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
	color: #0a0a0a;
	background: #fff;
	min-height: 100vh;
}

body.eh-communities-platform-page .eh-pub-main--landing {
	padding: 0;
	margin: 0;
	max-width: none;
	width: 100%;
}

/* ── Hero (match join-study) ─────────────────────────────────── */

.eh-cm-hero {
	position: relative;
	background: linear-gradient(135deg, #062118 0%, #0c3545 45%, #062d1e 100%);
	padding: 46px 22px 50px;
	text-align: center;
	overflow: hidden;
}

.eh-cm-hero__bg {
	position: absolute;
	inset: 0;
	pointer-events: none;
}

.eh-cm-hero__stars-svg {
	width: 100%;
	height: 100%;
	display: block;
	opacity: 0.7;
}

.eh-cm-hero__content {
	position: relative;
	z-index: 1;
	max-width: 680px;
	margin: 0 auto;
}

.eh-communities-platform .eh-cm-hero .eh-cm-hero__eyebrow {
	font-size: 10px;
	font-weight: 800;
	letter-spacing: 3px;
	text-transform: uppercase;
	color: #2e7c7e;
	margin: 0 0 14px;
}

.eh-communities-platform .eh-cm-hero .eh-cm-hero__h1,
.eh-communities-platform .eh-cm-hero h1.eh-cm-hero__h1 {
	font-size: clamp(30px, 6vw, 48px);
	font-weight: 800;
	color: #fff;
	letter-spacing: -2px;
	line-height: 1.05;
	margin: 0 0 6px;
	padding: 0;
}

.eh-communities-platform .eh-cm-hero .eh-cm-hero__h1g {
	font-size: clamp(24px, 5vw, 38px);
	font-weight: 800;
	color: #2e7c7e;
	letter-spacing: -1.5px;
	line-height: 1.05;
	margin: 0 0 26px;
	padding: 0;
}

.eh-cm-hero__search {
	display: flex;
	align-items: center;
	gap: 10px;
	background: #fff;
	border-radius: 3px;
	padding: 5px 5px 5px 18px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
	margin: 0 0 10px;
	text-align: left;
}

.eh-cm-hero__search-icon {
	font-size: 15px;
	color: #8e8e8e;
	flex-shrink: 0;
	line-height: 1;
}

.eh-cm-hero__search-input {
	flex: 1;
	min-width: 0;
	font-size: 14px;
	padding: 11px 0;
	color: #0a0a0a;
	background: transparent;
	border: none;
	outline: none;
	font-family: inherit;
}

.eh-cm-hero__search-input::placeholder {
	color: #8e8e8e;
}

.eh-cm-hero__search-input::-webkit-search-cancel-button,
.eh-cm-hero__search-input::-webkit-search-decoration {
	-webkit-appearance: none;
	appearance: none;
}

.eh-cm-hero__search-btn {
	background: #2e7c7e;
	color: #fff;
	border: none;
	border-radius: 3px;
	padding: 10px 18px;
	font-size: 13px;
	font-weight: 700;
	cursor: pointer;
	font-family: inherit;
	white-space: nowrap;
	flex-shrink: 0;
}

.eh-cm-hero__filters {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin: 0 0 14px;
}

.eh-cm-hero__filter-select,
.eh-cm-hero__filter-input {
	font-size: 12px;
	padding: 8px 12px;
	border: 1px solid rgba(255, 255, 255, 0.22);
	border-radius: 3px;
	background: rgba(255, 255, 255, 0.1);
	color: #fff;
	font-family: inherit;
	min-width: 0;
}

.eh-cm-hero__filter-select {
	max-width: 160px;
	cursor: pointer;
}

.eh-cm-hero__filter-select option {
	color: #0a0a0a;
	background: #fff;
}

.eh-cm-hero__filter-input {
	width: 140px;
}

.eh-cm-hero__filter-input::placeholder {
	color: rgba(255, 255, 255, 0.55);
}

.eh-cm-hero__filter-btn {
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	border: 1px solid rgba(255, 255, 255, 0.28);
	border-radius: 3px;
	padding: 8px 14px;
	font-size: 12px;
	font-weight: 700;
	cursor: pointer;
	font-family: inherit;
	transition: border-color 0.15s ease, background 0.15s ease;
}

.eh-cm-hero__filter-btn:hover,
.eh-cm-hero__filter-btn:focus {
	border-color: #5fc9c2;
	background: rgba(95, 201, 194, 0.15);
}

.eh-cm-hero__chips {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 6px;
	margin: 0 0 18px;
}

.eh-communities-platform .eh-cm-hero .eh-cm-hero__chips-label {
	font-size: 10px;
	font-weight: 400;
	color: rgba(255, 255, 255, 0.5);
	margin-right: 4px;
}

.eh-communities-platform .eh-cm-hero .eh-cm-hero__chip {
	font-size: 11px;
	font-weight: 400;
	color: rgba(255, 255, 255, 0.88);
	border: 1px solid rgba(255, 255, 255, 0.25);
	border-radius: 2px;
	padding: 4px 11px;
	line-height: 1.2;
	background: rgba(255, 255, 255, 0.08);
	text-decoration: none;
	font-family: inherit;
	transition: border-color 0.15s ease, color 0.15s ease, font-weight 0.15s ease;
}

.eh-communities-platform .eh-cm-hero .eh-cm-hero__chip:hover {
	border-color: rgba(255, 255, 255, 0.45);
	color: #fff;
}

.eh-communities-platform .eh-cm-hero .eh-cm-hero__chip--active {
	border-color: #5fc9c2;
	color: #5fc9c2;
	font-weight: 700;
}

.eh-cm-hero__actions {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	margin-top: 4px;
}

.eh-cm-hero__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 22px;
	border-radius: 3px;
	font-size: 14px;
	font-weight: 700;
	text-decoration: none;
	color: #062118;
	background: #fff;
	border: 2px solid #fff;
	box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
	transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.eh-cm-hero__cta:hover,
.eh-cm-hero__cta:focus {
	transform: translateY(-1px);
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.32);
	background: #5fc9c2;
	border-color: #5fc9c2;
	color: #062118;
}

.eh-cm-hero__cta-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #2e7c7e;
	color: #fff;
	font-size: 15px;
	font-weight: 800;
	line-height: 1;
}

.eh-cm-hero__cta:hover .eh-cm-hero__cta-icon,
.eh-cm-hero__cta:focus .eh-cm-hero__cta-icon {
	background: #062118;
	color: #5fc9c2;
}

.eh-communities-platform .eh-cm-hero .eh-cm-hero__note {
	font-size: 11px;
	font-weight: 400;
	color: rgba(255, 255, 255, 0.58);
	margin: 0;
	max-width: 420px;
	line-height: 1.45;
}

/* ── Stats row ───────────────────────────────────────────────── */

.eh-communities-platform .eh-cm-stats.stats-row {
	border-top: none;
	background: #fff;
	width: 100%;
}

/* ── Community grid (match join-study cards) ─────────────────── */

.eh-cm-list {
	padding-bottom: 48px;
}

.eh-communities-platform .eh-cm-community-grid {
	margin-top: 20px;
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 10px;
	align-items: stretch;
}

.eh-communities-platform .eh-cm-community-card {
	display: grid !important;
	grid-template-rows: 12px 20px 40px auto auto;
	row-gap: 5px;
	height: 205px !important;
	min-height: 205px !important;
	max-height: 205px !important;
	padding: 10px;
	background: #f2f8f6;
	border: 1px solid rgba(15, 20, 25, 0.12);
	border-radius: 3px;
	overflow: hidden;
	color: inherit;
	transition: border-color 0.15s ease, transform 0.15s ease;
	box-sizing: border-box;
}

.eh-communities-platform .eh-cm-community-card:hover {
	border-color: #2e7c7e !important;
	transform: translateY(-1px);
}

.eh-communities-platform .eh-cm-community-card__category {
	grid-row: 1;
	font-size: 10px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 1px;
	color: #2e7c7e;
	margin: 0;
	padding: 0;
	line-height: 12px;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.eh-communities-platform .eh-cm-community-card__title {
	grid-row: 2;
	font-size: 15px;
	font-weight: 800;
	color: #0a0a0a;
	margin: 0 !important;
	padding: 0 !important;
	line-height: 20px;
	height: 20px;
	max-height: 20px;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.eh-communities-platform .eh-cm-community-card__desc {
	grid-row: 3;
	font-size: 14px;
	color: #5b656d;
	margin: 0 !important;
	padding: 0 !important;
	line-height: 20px;
	height: 40px;
	max-height: 40px;
	overflow: hidden;
	word-break: break-word;
	display: -webkit-box !important;
	-webkit-box-orient: vertical !important;
	-webkit-line-clamp: 2 !important;
	line-clamp: 2 !important;
}

.eh-communities-platform .eh-cm-community-card__meta {
	grid-row: 4;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0;
	min-height: 0;
	align-items: center;
}

.eh-cm-community-card__pill {
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	padding: 3px 8px;
	border-radius: 99px;
	background: #e6efdf;
	color: #2e7c7e;
}

.eh-communities-platform .eh-cm-community-card__actions {
	grid-row: 5;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	align-items: center;
	margin: 0;
	padding: 0;
}

.eh-communities-platform .eh-cm-community-card__btn {
	font-size: 11px;
	font-weight: 700;
	text-decoration: none;
	border-radius: 3px;
	padding: 6px 10px;
	line-height: 1.2;
	transition: border-color 0.15s ease, background 0.15s ease;
}

.eh-communities-platform .eh-cm-community-card__btn--primary {
	color: #fff;
	background: #2e7c7e;
	border: 1px solid #2e7c7e;
}

.eh-communities-platform .eh-cm-community-card__btn--primary:hover,
.eh-communities-platform .eh-cm-community-card__btn--primary:focus {
	background: #256566;
	border-color: #256566;
}

.eh-cm-empty {
	font-size: 14px;
	font-weight: 600;
	color: #5b656d;
	margin-top: 16px;
	padding: 24px 16px;
	background: #f2f8f6;
	border: 1px dashed rgba(15, 20, 25, 0.12);
	border-radius: 3px;
	text-align: center;
}

.eh-cm-empty p {
	margin: 0 0 14px;
	font-weight: 400;
}

.eh-cm-empty__btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 11px 20px;
	border-radius: 3px;
	font-size: 13px;
	font-weight: 700;
	text-decoration: none;
	color: #fff;
	background: #2e7c7e;
	border: 1px solid #2e7c7e;
	transition: background 0.15s ease;
}

.eh-cm-empty__btn:hover,
.eh-cm-empty__btn:focus {
	background: #256566;
}

.eh-cm-pager {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	margin: 20px 0 0;
}

.eh-cm-pager__btn {
	font-size: 12px;
	font-weight: 700;
	color: #2e7c7e;
	text-decoration: none;
	padding: 8px 14px;
	border: 1px solid rgba(15, 20, 25, 0.12);
	border-radius: 3px;
	background: #fff;
}

.eh-cm-pager__label {
	font-size: 12px;
	color: #8e8e8e;
}

.eh-cm-disclaimer {
	font-size: 11px;
	color: #8e8e8e;
	line-height: 1.5;
	margin: 18px 0 0;
}

@media (max-width: 960px) {
	.eh-communities-platform .eh-cm-community-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 640px) {
	.eh-cm-hero {
		padding: 44px 18px 40px;
	}

	.eh-cm-hero__h1g {
		margin-bottom: 22px;
	}

	.eh-cm-hero__search {
		flex-wrap: wrap;
		padding: 8px 10px 8px 14px;
	}

	.eh-cm-hero__search-btn {
		width: 100%;
		margin-top: 4px;
	}

	.eh-cm-hero__filters {
		flex-direction: column;
		align-items: stretch;
	}

	.eh-cm-hero__filter-select,
	.eh-cm-hero__filter-input,
	.eh-cm-hero__filter-btn {
		width: 100%;
		max-width: none;
	}

	.eh-cm-hero__chip {
		font-size: 10px;
		padding: 5px 10px;
	}

	.eh-communities-platform .eh-cm-community-grid {
		grid-template-columns: 1fr;
	}
}

@media (min-width: 961px) {
	.eh-communities-platform .eh-cm-community-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}
