/* CEC Members Directory - front-end styles */

/* ---- Grid / cards (shortcode listing) ---- */

.cecm-grid {
	--cecm-columns: 3;
	--cecm-columns-tablet: 2;
	--cecm-columns-mobile: 1;
	--cecm-gap: 24px;
	display: grid;
	grid-template-columns: repeat( var( --cecm-columns ), 1fr );
	gap: var( --cecm-gap );
	margin: 24px 0;
}

/* ---- List layout (alternative to the card grid) ---- */

.cecm-list {
	--cecm-gap: 16px;
	display: flex;
	flex-direction: column;
	gap: var( --cecm-gap );
	margin: 24px 0;
}

.cecm-list .cecm-card {
	flex-direction: row;
	text-align: left;
	align-items: center;
}

.cecm-list .cecm-photo-link {
	flex: 0 0 96px;
	width: 96px;
}

.cecm-list .cecm-photo {
	aspect-ratio: 1 / 1;
	width: 96px;
	border-radius: 8px;
}

.cecm-list .cecm-photo-placeholder {
	font-size: 24px;
}

.cecm-list .cecm-info {
	padding: 12px 18px;
}

.cecm-list .cecm-position {
	flex-grow: 0;
}

.cecm-card {
	background: #fff;
	border: 1px solid #e5e5e5;
	border-radius: 10px;
	overflow: hidden;
	text-align: center;
	box-shadow: 0 2px 8px rgba( 0, 0, 0, 0.06 );
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	display: flex;
	flex-direction: column;
}

.cecm-card:hover {
	transform: translateY( -4px );
	box-shadow: 0 8px 20px rgba( 0, 0, 0, 0.1 );
}

.cecm-photo-link {
	display: block;
}

.cecm-photo {
	width: 100%;
	aspect-ratio: 4 / 5;
	overflow: hidden;
	background: #f2f2f2;
	display: flex;
	align-items: center;
	justify-content: center;
}

.cecm-photo img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	object-position: center top;
	display: block;
}

.cecm-photo-placeholder {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 42px;
	font-weight: 700;
	color: #888;
	background: linear-gradient( 135deg, #e9ecf2, #dfe3ea );
}

.cecm-info {
	padding: 16px 14px 20px;
	display: flex;
	flex-direction: column;
	flex-grow: 1;
}

.cecm-name {
	margin: 0 0 6px;
	font-size: 17px;
	line-height: 1.3;
}

.cecm-name a {
	color: inherit;
	text-decoration: none;
}

.cecm-name a:hover {
	text-decoration: underline;
}

.cecm-position {
	margin: 0;
	font-size: 13.5px;
	color: #555;
	line-height: 1.5;
	flex-grow: 1;
}

.cecm-readmore {
	display: inline-block;
	margin-top: 14px;
	font-size: 13.5px;
	font-weight: 600;
	color: #2271b1;
	text-decoration: none;
}

.cecm-readmore:hover {
	color: #135e96;
	text-decoration: underline;
}

.cecm-empty {
	font-style: italic;
	color: #777;
}

@media ( max-width: 900px ) {
	.cecm-grid {
		grid-template-columns: repeat( var( --cecm-columns-tablet ), 1fr );
	}
}

@media ( max-width: 560px ) {
	.cecm-grid {
		grid-template-columns: repeat( var( --cecm-columns-mobile ), 1fr );
	}

	.cecm-list .cecm-card {
		flex-direction: column;
		text-align: center;
	}

	.cecm-list .cecm-photo-link,
	.cecm-list .cecm-photo {
		width: 120px;
		flex-basis: auto;
	}
}

/* ---- Pagination ---- */

.cecm-pagination {
	margin: 28px 0;
}

.cecm-pagination ul {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.cecm-pagination a,
.cecm-pagination span {
	display: inline-block;
	padding: 6px 12px;
	border: 1px solid #e0e0e0;
	border-radius: 6px;
	font-size: 14px;
	text-decoration: none;
	color: #2271b1;
}

.cecm-pagination .current {
	background: #2271b1;
	border-color: #2271b1;
	color: #fff;
}

.cecm-pagination a:hover {
	background: #f2f2f2;
}

/* ---- Archive page header ---- */

.cecm-archive-wrap {
	max-width: 1100px;
	margin: 40px auto;
	padding: 0 20px;
}

.cecm-archive-header {
	margin-bottom: 12px;
}

.cecm-archive-title {
	font-size: 28px;
	margin: 0 0 24px;
}

/* ---- Single profile page ---- */

.cecm-profile-wrap {
	max-width: 800px;
	margin: 40px auto;
	padding: 0 20px;
}

.cecm-back-link {
	margin-bottom: 20px;
}

.cecm-back-link a {
	font-size: 14px;
	text-decoration: none;
	color: #2271b1;
}

.cecm-back-link a:hover {
	text-decoration: underline;
}

.cecm-profile-header {
	display: flex;
	gap: 28px;
	align-items: flex-start;
	flex-wrap: wrap;
	margin-bottom: 30px;
}

.cecm-profile-photo {
	width: 200px;
	flex: 0 0 200px;
	aspect-ratio: 4 / 5;
	background: #f2f2f2;
	border-radius: 10px;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}

.cecm-profile-photo img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	object-position: center top;
	display: block;
}

.cecm-photo-placeholder-lg {
	width: 100%;
	height: 100%;
	font-size: 64px;
}

.cecm-profile-heading {
	flex: 1 1 300px;
}

.cecm-profile-name {
	margin: 0 0 8px;
	font-size: 28px;
	line-height: 1.25;
}

.cecm-profile-position {
	margin: 0 0 16px;
	font-size: 16px;
	color: #555;
	line-height: 1.5;
}

.cecm-profile-contact {
	list-style: none;
	margin: 0;
	padding: 0;
	font-size: 14px;
	color: #333;
}

.cecm-profile-contact li {
	margin-bottom: 4px;
}

.cecm-contact-label {
	font-weight: 600;
	margin-right: 4px;
}

.cecm-profile-bio {
	font-size: 15.5px;
	line-height: 1.75;
	color: #333;
}

.cecm-no-bio {
	font-style: italic;
	color: #777;
}

@media ( max-width: 560px ) {
	.cecm-profile-header {
		flex-direction: column;
		align-items: center;
		text-align: center;
	}

	.cecm-profile-photo {
		width: 60%;
		flex-basis: auto;
	}
}
