/*
 * Groups.
 *
 * Loaded only on the groups page and the profile Groups tab, the same rule the
 * resources sheet follows: a directory nobody is looking at has no business in
 * the site-wide bundle. Everything here builds on mpmp-front.css -- cards,
 * buttons, inputs and tokens come from there, so this file is layout and the
 * handful of pieces that have no equivalent elsewhere.
 */

.mpmp-groups-header {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 1.25rem;
}

.mpmp-groups-header .mpmp-card-intro {
	margin: 0;
	max-width: 62ch;
}

.mpmp-groups-upsell {
	margin-bottom: 1.25rem;
	padding: 0.85rem 1rem;
}

.mpmp-groups-upsell p {
	margin: 0;
}

.mpmp-groups-toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 1.25rem;
}

.mpmp-groups-search {
	flex: 1 1 16rem;
	min-width: 0;
}

.mpmp-groups-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
}

.mpmp-groups-filter {
	border: 1px solid var(--mpmp-border, #d9dee5);
	background: transparent;
	color: inherit;
	border-radius: 999px;
	padding: 0.35rem 0.85rem;
	font-size: 0.875rem;
	line-height: 1.4;
	cursor: pointer;
}

.mpmp-groups-filter:hover,
.mpmp-groups-filter:focus-visible {
	border-color: var(--mpmp-primary, #7a2ff2);
}

.mpmp-groups-filter.is-active {
	background: var(--mpmp-primary, #7a2ff2);
	border-color: var(--mpmp-primary, #7a2ff2);
	color: #fff;
}

/* Directory ------------------------------------------------------------- */

.mpmp-groups-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
	gap: 1.25rem;
}

.mpmp-group-card {
	display: flex;
	flex-direction: column;
	border: 1px solid var(--mpmp-border, #d9dee5);
	border-radius: var(--mpmp-radius, 0.75rem);
	overflow: hidden;
	background: var(--mpmp-surface, #fff);
}

.mpmp-group-card-cover {
	display: block;
	aspect-ratio: 16 / 9;
	width: 100%;
	object-fit: cover;
	background: var(--mpmp-muted-bg, #eef1f5);
}

.mpmp-group-card-cover--empty {
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 2rem;
	font-weight: 700;
	color: var(--mpmp-muted, #6b7280);
	text-transform: uppercase;
}

.mpmp-group-card-body {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	padding: 1rem;
	flex: 1 1 auto;
}

.mpmp-group-card-title {
	margin: 0;
	font-size: 1.05rem;
	line-height: 1.3;
}

.mpmp-group-card-title a {
	color: inherit;
	text-decoration: none;
}

.mpmp-group-card-title a:hover {
	text-decoration: underline;
}

.mpmp-group-card-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: center;
	font-size: 0.8125rem;
	color: var(--mpmp-muted, #6b7280);
}

.mpmp-group-card-excerpt {
	margin: 0;
	font-size: 0.9rem;
	line-height: 1.5;
	/* Three lines, so cards in a row stay the same height whatever the blurb. */
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	line-clamp: 3;
	overflow: hidden;
}

.mpmp-group-card-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: auto;
	padding-top: 0.35rem;
}

.mpmp-group-badge {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	border-radius: 999px;
	padding: 0.1rem 0.55rem;
	font-size: 0.75rem;
	font-weight: 600;
	background: var(--mpmp-muted-bg, #eef1f5);
	color: var(--mpmp-muted, #4b5563);
}

.mpmp-group-badge--private {
	background: #fdf0d5;
	color: #7a5200;
}

.mpmp-group-badge--admin {
	background: #e7defd;
	color: #4b1fa8;
}

.mpmp-group-badge--pending {
	background: #e3edff;
	color: #12428f;
}

.mpmp-group-badge--archived {
	background: #f1f2f4;
	color: #6b7280;
}

.mpmp-groups-more {
	display: flex;
	justify-content: center;
	margin-top: 1.5rem;
}

/* Single group ---------------------------------------------------------- */

.mpmp-group-hero {
	position: relative;
	border-radius: var(--mpmp-radius, 0.75rem);
	overflow: hidden;
	margin-bottom: 1.25rem;
	background: var(--mpmp-muted-bg, #eef1f5);
}

.mpmp-group-hero img {
	display: block;
	width: 100%;
	aspect-ratio: 3 / 1;
	object-fit: cover;
}

.mpmp-group-headline {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	align-items: flex-start;
	justify-content: space-between;
	margin-bottom: 1rem;
}

.mpmp-group-headline h1 {
	margin: 0 0 0.35rem;
	font-size: 1.5rem;
	line-height: 1.25;
}

.mpmp-group-headline-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.mpmp-group-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 1.25rem;
}

@media (min-width: 62rem) {
	.mpmp-group-layout {
		grid-template-columns: minmax(0, 1fr) 20rem;
		align-items: start;
	}
}

.mpmp-group-sidebar {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.mpmp-group-locked {
	text-align: center;
	padding: 2.5rem 1.25rem;
}

.mpmp-group-locked h2 {
	margin-top: 0;
}

/* Composer and feed ----------------------------------------------------- */

.mpmp-group-composer {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	margin-bottom: 1.25rem;
}

.mpmp-group-composer textarea {
	min-height: 5.5rem;
	resize: vertical;
}

.mpmp-group-composer-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	align-items: center;
	justify-content: space-between;
}

.mpmp-group-posts {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.mpmp-group-post {
	display: flex;
	gap: 0.85rem;
	padding: 1rem;
}

.mpmp-group-post.is-pending {
	border-left: 3px solid #d99a00;
}

.mpmp-group-post-avatar {
	width: 2.75rem;
	height: 2.75rem;
	border-radius: 50%;
	object-fit: cover;
	flex: none;
}

.mpmp-group-post-body {
	flex: 1 1 auto;
	min-width: 0;
}

.mpmp-group-post-head {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: baseline;
	margin-bottom: 0.35rem;
}

.mpmp-group-post-author {
	font-weight: 600;
	color: inherit;
	text-decoration: none;
}

.mpmp-group-post-time {
	font-size: 0.8125rem;
	color: var(--mpmp-muted, #6b7280);
}

.mpmp-group-post-content {
	margin: 0 0 0.5rem;
	line-height: 1.55;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}

.mpmp-group-post-photo {
	display: block;
	max-width: 100%;
	border-radius: 0.5rem;
	margin-bottom: 0.5rem;
}

.mpmp-group-post-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

/* Roster and requests --------------------------------------------------- */

.mpmp-group-people {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.mpmp-group-person {
	display: flex;
	gap: 0.65rem;
	align-items: center;
}

.mpmp-group-person img {
	width: 2.25rem;
	height: 2.25rem;
	border-radius: 50%;
	object-fit: cover;
	flex: none;
}

.mpmp-group-person-name {
	flex: 1 1 auto;
	min-width: 0;
	font-size: 0.9rem;
	color: inherit;
	text-decoration: none;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.mpmp-group-person-actions {
	display: flex;
	gap: 0.35rem;
	flex: none;
}

.mpmp-group-person-actions .mpmp-btn {
	padding: 0.2rem 0.6rem;
	font-size: 0.8125rem;
}

/* Form ------------------------------------------------------------------ */

.mpmp-group-form-fieldset {
	border: 1px solid var(--mpmp-border, #d9dee5);
	border-radius: var(--mpmp-radius, 0.75rem);
	padding: 0.85rem 1rem;
}

.mpmp-group-form-fieldset legend {
	padding: 0 0.35rem;
	font-weight: 600;
	font-size: 0.9rem;
}

.mpmp-group-form .mpmp-radio,
.mpmp-group-form .mpmp-checkbox {
	display: flex;
	gap: 0.6rem;
	align-items: flex-start;
	padding: 0.35rem 0;
	line-height: 1.45;
}

.mpmp-group-form .mpmp-radio strong {
	display: block;
}

.mpmp-form-message.is-error {
	color: #b3261e;
}

.mpmp-form-message.is-success {
	color: #146c43;
}

/* Profile tab ----------------------------------------------------------- */

.mpmp-profile-groups {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.mpmp-profile-groups-header {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	align-items: center;
	justify-content: space-between;
}

.mpmp-profile-groups-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.65rem;
}

.mpmp-profile-groups-list li {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: center;
	justify-content: space-between;
	padding: 0.6rem 0;
	border-bottom: 1px solid var(--mpmp-border, #e5e7eb);
}

.mpmp-profile-groups-list li:last-child {
	border-bottom: 0;
}

.mpmp-profile-groups-list a {
	font-weight: 600;
	color: inherit;
	text-decoration: none;
}

.mpmp-profile-groups-list a:hover {
	text-decoration: underline;
}
