/*
 * MTLS Pages: the main site on the MTLS Issues theme, in the old main site's look (the Vancouver
 * theme): Montserrat and Raleway, the dark toolbar, the red top bar, the beige MTLS Pages band, the
 * group cards, the Share box and the near-black footer. Sizes and colours are the old site's, as
 * measured on www.mtls.ca/groups/ at 1280px wide (14 October 2026).
 *
 * The fonts and the recurring colours and sizes come from theme.json (settings.custom.pages and the
 * font families), as the variables WordPress makes of them; a colour or size used once, as measured,
 * is written out. The same file styles the editors (inc/assets.php), so a page's text, which is
 * matched there too (the post editor's root container has no class of the template's), looks as on
 * the site. About and Donate's own look is in plain-page.css.
 */

.mtls-pages-icon {
	width: auto;
	height: 1em;
	fill: currentcolor;
	vertical-align: -0.125em;
}

/* The toolbar BuddyPress shows visitors: dark on the main site (the issues' is red). */
#wpadminbar {
	background: var(--wp--custom--pages--color--toolbar);
}

/* Header: the red top bar (ISSN, social links, account), the white bar (the latest issue's pages,
   search), the MTLS Pages band. */
.mtls-pages-header__top {
	padding-block: 7px;
	background: var(--wp--custom--pages--color--red);
	color: var(--wp--preset--color--surface);
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--custom--pages--font-size--base);
	line-height: 21px;
}

.mtls-pages-header__top a {
	color: var(--wp--preset--color--surface);
	text-decoration: none;
}

.mtls-pages-header__top a:hover,
.mtls-pages-header__top a:focus-visible {
	color: var(--wp--custom--pages--color--band);
}

.mtls-pages-header__row {
	gap: 8px 24px;
	align-items: center;
}

.mtls-pages-header__identity {
	gap: 0;
	align-items: center;
}

.mtls-pages-header__issn {
	margin: 0;
	padding-right: 15px;
	font-size: var(--wp--custom--pages--font-size--base);
	line-height: 21px;
}

/* A Social Icons block in the old glyphs (inc/social.php): white, 14px, 15px apart; none of core's
   brand colours, circles or spacing. */
.mtls-pages-header__top .mtls-pages-header__social {
	gap: 0;
	margin: 0;
	padding: 0;
	font-size: inherit;
}

.mtls-pages-header__social .wp-social-link.wp-social-link {
	padding: 0 15px 0 0;
	border-radius: 0;
	background: none;
	color: inherit;
}

.mtls-pages-header__social .wp-block-social-link-anchor {
	display: inline-block;
	padding: 0;
	font-size: var(--wp--custom--pages--font-size--base);
	line-height: 21px;
}

.mtls-pages-header__social .wp-block-social-link-anchor svg {
	width: auto;
	height: 1em;
	fill: currentcolor;
	vertical-align: -0.125em;
}

.mtls-pages-header__account,
.mtls-pages-header__issue {
	display: flex;
	flex-wrap: wrap;
	margin: 0;
	padding: 0;
	list-style: none;
}

.mtls-pages-header__account {
	gap: 0 19px;
	font-size: var(--wp--custom--pages--font-size--base);
	line-height: 21px;
}

/* "MTLS" was a menu of its own, set apart from Login and Register. */
.mtls-pages-header__account li:first-child {
	margin-right: 15px;
}

.mtls-pages-header__bar {
	padding-block: 0;
	background: var(--wp--preset--color--surface);
}

/* On the BuddyPress screens the menu bar had 16px above and below it. */
body.buddypress .mtls-pages-header__bar {
	padding-block: 16px;
}

.mtls-pages-header__bar .mtls-pages-header__row {
	min-height: 60px;
}

.mtls-pages-header__issue {
	gap: 0 40px;
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--custom--pages--font-size--medium);
	font-weight: 500;
	line-height: 60px;
	text-transform: capitalize;
}

.mtls-pages-header__issue a {
	color: var(--wp--custom--pages--color--text);
	text-decoration: none;
}

.mtls-pages-header__issue a:hover,
.mtls-pages-header__issue a:focus-visible {
	color: var(--wp--custom--pages--color--red);
}

/* The menu search: a round field with the magnifier inside, as the old one. */
.mtls-pages-header__search {
	width: 270px;
	margin: 0;
}

.mtls-pages-header__search .wp-block-search__inside-wrapper {
	box-sizing: border-box;
	height: 43px;
	padding: 0;
	border: 1px solid var(--wp--custom--pages--color--line);
	border-radius: 30px;
	background: var(--wp--preset--color--surface);
}

.mtls-pages-header__search .wp-block-search__input {
	min-width: 0;
	padding: 0 0 0 15px;
	border: 0;
	border-radius: 30px;
	background: transparent;
	color: var(--wp--custom--pages--color--text);
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--custom--pages--font-size--base);
}

.mtls-pages-header__search .wp-block-search__button {
	margin: 0;
	padding: 0 18px 0 8px;
	border: 0;
	background: none;
	color: var(--wp--preset--color--ink);
}

.mtls-pages-header__search .wp-block-search__button svg {
	width: 28px;
	height: 28px;
	fill: currentcolor;
	transform: scaleX(-1); /* the handle to the lower right, as the old magnifier */
}

.mtls-pages-header__band {
	padding: 55px 20px;
	background: var(--wp--custom--pages--color--band);
	text-align: center;
}

.mtls-pages-header__logo {
	max-width: 1000px;
	margin: 0 auto 8px;
}

.mtls-pages-header__logo img {
	width: 100% !important; /* over the block's own width attribute */
	height: auto;
}

.mtls-pages-header__band .mtls-pages-header__title {
	margin: 0;
	padding: 30px 0;
	color: var(--wp--custom--pages--color--band-text);
	font-family: var(--wp--preset--font-family--title);
	font-size: 48px;
	font-weight: 800;
	line-height: 72px;
	text-transform: uppercase;
}

.mtls-pages-header__group-search {
	display: none; /* only the directories had it, see below */
	position: relative;
	box-sizing: border-box;
	max-width: 520px;
	height: 60px;
	margin: 0 auto;
	border: 2px solid var(--wp--preset--color--surface);
	border-radius: 50px;
	background: var(--wp--preset--color--surface);
}

.mtls-pages-header__group-search input {
	box-sizing: border-box;
	width: 100%;
	height: 100%;
	padding: 0 160px 0 25px;
	border: 0;
	border-radius: 50px;
	background: transparent;
	color: var(--wp--custom--pages--color--text);
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--custom--pages--font-size--large);
}

.mtls-pages-header__group-search button {
	position: absolute;
	top: 3px;
	right: 3px;
	height: 50px;
	padding: 0 35px;
	border: 0;
	border-radius: 50px;
	background: var(--wp--custom--pages--color--red);
	color: var(--wp--preset--color--surface);
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--custom--pages--font-size--large);
	font-weight: 600;
	text-transform: uppercase;
	cursor: pointer;
}

@media (max-width: 767px) {

	.mtls-pages-header__band {
		padding: 30px 16px;
	}

	.mtls-pages-header__band .mtls-pages-header__title {
		padding: 20px 0;
		font-size: 32px;
		line-height: 1.3;
	}

	.mtls-pages-header__search {
		width: 100%;
	}

	.mtls-pages-header__group-search input {
		padding-right: 120px;
		font-size: var(--wp--custom--pages--font-size--medium);
	}

	.mtls-pages-header__group-search button {
		padding: 0 18px;
		font-size: var(--wp--custom--pages--font-size--medium);
	}
}

body.directory .mtls-pages-header__group-search {
	display: block;
}

/* The old pages showed no title band. */
.mtls-post-header {
	display: none;
}

/* The members blocks print a plain widget title of their own; the sidebar's title bar above each one
   already names it. */
.mtls-sidebar h2.widget-title {
	display: none;
}

/* BuddyPress screens: Montserrat 14px in black, links red. */
#buddypress.buddypress-wrap {
	position: relative;
	color: var(--wp--custom--pages--color--text);
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--custom--pages--font-size--base);
	line-height: 1.7;
}

#buddypress.buddypress-wrap a {
	color: var(--wp--custom--pages--color--red);
}

/* The directory tabs: "All Groups 10" in bold, a thin line under them, "Viewing 1 - 10 of 10 groups"
   at their right (the list's own count, moved up), no search and order bar, no count at the end. */
#buddypress.buddypress-wrap .bp-navs.dir-navs {
	margin: 0 0 20px;
	padding: 9px 10px;
	border: 0;
	border-bottom: 1px solid var(--wp--custom--pages--color--line-light);
	background: var(--wp--preset--color--surface);
}

#buddypress.buddypress-wrap .bp-navs li.selected a,
#buddypress.buddypress-wrap .bp-navs li.current a {
	padding: 7px 9px;
	background: none;
	color: var(--wp--custom--pages--color--text);
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--custom--pages--font-size--base);
	font-weight: 700;
	line-height: 23.8px;
}

#buddypress.buddypress-wrap .bp-navs li a .count {
	margin-left: 2px;
	padding: 3px 6px;
	border: 0;
	border-radius: 50%;
	background: var(--wp--preset--color--surface);
	color: var(--wp--custom--pages--color--text);
	font-size: var(--wp--custom--pages--font-size--base);
	font-weight: 700;
}

body.directory.groups #buddypress #subnav-filters,
body.directory.groups #buddypress .bp-pagination.bottom {
	display: none;
}

body.directory.groups #buddypress .bp-pagination.top {
	position: absolute;
	top: 0;
	right: 0;
	left: auto;
	width: auto;
	margin: 0;
	padding: 0;
	border: 0;
}

body.directory.groups #buddypress .bp-pagination.top .pag-count,
body.directory.groups #buddypress .bp-pagination.top .pag-data {
	float: none;
	width: auto;
	margin: 0;
	padding: 8px 10px;
	text-align: right;
	color: var(--wp--custom--pages--color--text);
	font-size: var(--wp--custom--pages--font-size--base);
	line-height: 24px;
}

/* Groups directory: cards with the group's cover photo and its round icon on top. */
#buddypress ul.mtls-group-cards {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 25px 20px;
	margin: 0;
	padding: 7px 10px 0;
	border: 0;
	list-style: none;
}

/* Nouveau's clearfix pseudo-elements would take the grid's first and last cells. */
#buddypress ul.mtls-group-cards::before,
#buddypress ul.mtls-group-cards::after {
	display: none;
}

@media (max-width: 960px) {

	#buddypress ul.mtls-group-cards {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 600px) {

	#buddypress ul.mtls-group-cards {
		grid-template-columns: 1fr;
	}
}

#buddypress ul.mtls-group-cards > li.mtls-group-card {
	position: relative;
	float: none;
	width: auto;
	margin: 0;
	padding: 0;
	border: 1px solid var(--wp--custom--pages--color--line);
	border-radius: 2px;
	background: var(--wp--preset--color--surface);
	box-shadow: 0 6px 22px rgba(225, 223, 223, 0.65);
	text-align: center;
}

#buddypress .mtls-group-card__cover {
	display: block;
	height: 170px;
	border-radius: 2px;
	background: var(--wp--custom--pages--color--line-light) center / cover no-repeat;
}

#buddypress .mtls-group-card__avatar {
	position: relative;
	display: block;
	box-sizing: border-box;
	width: 105px;
	height: 105px;
	margin: -55px auto 0;
	padding: 15px;
	border: 2px solid var(--wp--custom--pages--color--red);
	border-radius: 50%;
	background: var(--wp--preset--color--surface);
}

#buddypress .mtls-group-card__avatar img {
	display: block;
	width: 71px;
	height: 71px;
	border-radius: 150px;
	object-fit: cover;
}

#buddypress .mtls-group-card__title {
	margin: 10px 10px 0;
	color: var(--wp--preset--color--ink);
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--custom--pages--font-size--medium);
	font-weight: 600;
	letter-spacing: 1px;
	line-height: 19.2px;
	text-align: center;
}

#buddypress.buddypress-wrap .mtls-group-card__title a {
	color: var(--wp--custom--pages--color--text);
	font-family: var(--wp--preset--font-family--title);
	text-decoration: none;
}

#buddypress .mtls-group-card__meta,
#buddypress .mtls-group-card__active {
	margin: 0 10px;
	color: var(--wp--custom--pages--color--muted);
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--custom--pages--font-size--base);
	line-height: 24px;
	text-align: center;
}

#buddypress .mtls-group-card__meta {
	margin-bottom: 14px;
}

#buddypress .mtls-group-card__meta .mtls-pages-icon {
	margin-right: 6px;
}

#buddypress .mtls-group-card__active {
	padding-bottom: 15px;
}

#buddypress .mtls-group-card__links {
	display: flex;
	justify-content: center;
	gap: 11px;
	margin: 0 0 14px;
}

#buddypress.buddypress-wrap .mtls-group-card__links a {
	display: inline-flex;
	box-sizing: border-box;
	width: 38px;
	height: 38px;
	align-items: center;
	justify-content: center;
	border-radius: 5px;
	color: var(--wp--preset--color--surface);
	font-size: var(--wp--custom--pages--font-size--base);
}

#buddypress .mtls-group-card__view {
	background: var(--wp--custom--pages--color--red);
}

#buddypress .mtls-group-card__members {
	background: var(--wp--custom--pages--color--tan);
}

/* The Share box under the page. */
.mtls-pages-share {
	box-sizing: border-box;
	max-width: 1130px;
	margin: 36px auto 0;
	padding: 18px 30px;
	border: 1px solid var(--wp--custom--pages--color--border);
	background: var(--wp--preset--color--surface);
	text-align: center;
}

.mtls-pages-share__title {
	display: inline-block;
	margin-right: 6px;
	color: var(--wp--custom--pages--color--text);
	font-family: var(--wp--preset--font-family--heading); /* Oswald, as the old box */
	font-size: var(--wp--custom--pages--font-size--x-large);
	line-height: 30px;
	text-transform: uppercase;
	vertical-align: middle;
}

.mtls-pages-share__links {
	display: inline-block;
	vertical-align: middle;
}

.mtls-pages-share a {
	display: inline-flex;
	box-sizing: border-box;
	width: 45px;
	height: 45px;
	margin-left: 10px;
	align-items: center;
	justify-content: center;
	border: 2px solid var(--wp--custom--pages--color--red);
	border-radius: 45px;
	background: var(--wp--preset--color--surface);
	color: var(--wp--custom--pages--color--red);
	font-size: 22px;
	text-decoration: none;
}

.mtls-pages-share a:hover,
.mtls-pages-share a:focus-visible {
	background: var(--wp--custom--pages--color--red);
	color: var(--wp--preset--color--surface);
}

/* Footer: the site's own footer text on the old near-black band, no copyright line. */
footer.mtls-footer {
	margin: 0;
	padding: 0;
	background: var(--wp--custom--pages--color--footer);
}

.mtls-pages-footer {
	padding: 50px 20px 20px;
	color: var(--wp--preset--color--surface);
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--custom--pages--font-size--base);
	line-height: 24px;
}

.mtls-pages-footer__inner.alignwide {
	max-width: 1100px;
}

.mtls-pages-footer p {
	max-width: 1007px;
	margin: 0;
	opacity: 0.7; /* the old footer's dimmed text, and its logo dimmed again below */
	text-align: center;
}

.mtls-pages-footer p:has(> img:only-child) {
	width: 300px;
}

.mtls-pages-footer img {
	display: block;
	max-width: 100%;
	height: auto;
	opacity: 0.5;
}

#buddypress.buddypress-wrap .button,
#buddypress.buddypress-wrap button:not(.mtls-pages-header__group-search button),
#buddypress.buddypress-wrap input[type="submit"] {
	border-color: var(--wp--custom--pages--color--red);
	border-radius: 3px;
	background: var(--wp--custom--pages--color--red);
	color: var(--wp--preset--color--surface);
}

#buddypress.buddypress-wrap .button:hover,
#buddypress.buddypress-wrap button:hover,
#buddypress.buddypress-wrap input[type="submit"]:hover {
	border-color: var(--wp--custom--pages--color--red-dark);
	background: var(--wp--custom--pages--color--red-dark);
}

/* Group page header: the cover photo on a tall band, the round icon over its lower edge, the name and
   status under it, the administrators on the right, the description below. */
#buddypress #item-header.groups-header {
	position: relative;
	padding: 0;
	text-align: center;
}

#buddypress .mtls-group-header__cover {
	height: 380px;
	background: var(--wp--custom--pages--color--line-light) center / cover no-repeat;
}

#buddypress #item-header #item-header-avatar {
	position: relative;
	float: none;
	width: 150px;
	margin: -75px auto 10px;
}

#buddypress #item-header #item-header-avatar a {
	display: block;
}

/* Nouveau floats the icon, which would let the name and description rise beside it. */
#buddypress #item-header #item-header-avatar img {
	display: block;
	float: none;
	width: 150px;
	height: 150px;
	margin: 0 auto;
	border: 3px solid var(--wp--custom--pages--color--red);
	border-radius: 50%;
	background: var(--wp--preset--color--surface);
}

#buddypress #item-header #item-header-content {
	float: none;
	width: auto;
	margin: 0;
	padding: 0;
	text-align: center;
}

#buddypress .mtls-group-header__name {
	margin: 0;
	color: var(--wp--custom--pages--color--text);
	font-family: var(--wp--preset--font-family--title);
	font-size: var(--wp--custom--pages--font-size--x-large);
	font-weight: 700;
}

#buddypress #item-header .group-status {
	margin: 0 0 10px;
	color: var(--wp--custom--pages--color--muted);
	font-size: var(--wp--custom--pages--font-size--small);
}

#buddypress #item-header #item-actions {
	position: absolute;
	top: 395px;
	right: 0;
	float: none;
}

#buddypress .group-description {
	max-width: 1170px;
	margin: 15px auto;
	padding: 15px 20px;
	border: 1px solid var(--wp--custom--border--rule);
	color: var(--wp--custom--pages--color--muted);
	font-size: var(--wp--custom--pages--font-size--base);
	text-align: left;
}

@media (max-width: 767px) {

	#buddypress .mtls-group-header__cover {
		height: 180px;
	}

	#buddypress #item-header #item-header-avatar {
		width: 100px;
		margin-top: -50px;
	}

	#buddypress #item-header #item-header-avatar img {
		width: 100px;
		height: 100px;
	}

	#buddypress #item-header #item-actions {
		position: static;
	}
}

/*
 * The other pages, as the old ones (measured on the reference copy, 14 October 2026). The pages sit
 * on a light blue-grey ground, the directories on white; a page's text is in a white box 1170px wide,
 * 40px under the band, except on the pages with the sidebar.
 */
body {
	background: var(--wp--custom--pages--color--ground);
}

body.directory {
	background: var(--wp--preset--color--surface);
}

.mtls-main {
	padding: 40px 0 61px;
}

.mtls-pages-panel {
	box-sizing: border-box;
	width: 100%;
	max-width: 1170px;
	margin-inline: auto;
	padding: 40px 20px;
	background: var(--wp--preset--color--surface);
}

.mtls-pages-panel > .wp-block-post-content {
	margin-block-end: 0;
}

/* The directories' Share box sat 88px under the last card. */
body.directory .mtls-pages-share {
	margin-top: 88px;
}

/* The pages with the sidebar: 15px under the band, text 870px and sidebar 270px with 30px between. */
body.page-template-page-sidebar .mtls-main {
	padding: 15px 0 60px;
}

@media (min-width: 961px) {

	body .wp-block-columns.mtls-columns > .mtls-columns__content {
		flex-basis: 76.923%;
		padding-inline-end: 30px;
	}

	body .wp-block-columns.mtls-columns > .mtls-columns__sidebar {
		flex-basis: 23.077%;
	}
}

/* The sidebar's beige boxes with their red titles. */
.mtls-sidebar .mtls-widget {
	margin: 0 0 20px;
	padding: 15px 22px;
	background: var(--wp--custom--pages--color--box);
}

.mtls-sidebar .mtls-widget .wp-block-heading,
.mtls-sidebar .mtls-widget .is-style-mtls-title-bar {
	--wp--preset--font-family--heading: var(--wp--preset--font-family--title); /* the block's font class is !important */
	margin: 0;
	padding: 4px 0 17px;
	border: 0;
	background: none;
	color: var(--wp--custom--pages--color--red);
	font-family: var(--wp--preset--font-family--title);
	font-size: var(--wp--custom--pages--font-size--large);
	font-weight: 800;
	letter-spacing: 0;
	line-height: 21.6px;
	text-align: left;
	text-transform: uppercase;
}

.mtls-sidebar .mtls-widget .is-style-mtls-title-bar::before,
.mtls-sidebar .mtls-widget .is-style-mtls-title-bar::after {
	display: none;
}

.mtls-sidebar .mtls-widget p {
	margin: 0 0 16px;
	color: var(--wp--custom--pages--color--text);
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--custom--pages--font-size--base);
	font-style: italic;
	font-weight: 500;
	line-height: 24px;
	text-align: left;
}

.mtls-sidebar .mtls-widget a {
	color: var(--wp--custom--pages--color--text);
}

.mtls-sidebar .mtls-search .wp-block-search__input {
	box-sizing: border-box;
	height: 51px;
	padding: 14px;
	border: 1px solid var(--wp--custom--border--input);
	border-radius: 0;
	background: var(--wp--preset--color--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='10' cy='10' r='6.5' fill='none' stroke='%239e9e9e' stroke-width='2'/%3E%3Cpath d='M15 15l6 6' stroke='%239e9e9e' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 14px center / 13px;
	color: var(--wp--custom--text--subtle);
	font-family: var(--wp--preset--font-family--oswald); /* as the old field */
	font-size: var(--wp--custom--pages--font-size--base);
	font-weight: 300;
	letter-spacing: 2px;
}

/* A page's text: Montserrat, headings regular with 1px tracking, links blue. On the site the text is
   the post content block (.mtls-entry); in the post editor, its root container, which carries no class
   of the template's (inside :where(), so the selectors keep the weight of the one class). */
:is(.mtls-entry, :where(.is-root-container.wp-block-post-content)) {
	color: var(--wp--custom--pages--color--text);
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--custom--pages--font-size--base);
	line-height: 23.8px;
}

:is(.mtls-entry, :where(.is-root-container.wp-block-post-content)) p,
:is(.mtls-entry, :where(.is-root-container.wp-block-post-content)) li {
	color: var(--wp--custom--pages--color--text);
	font-size: var(--wp--custom--pages--font-size--base);
	text-align: left;
}

:is(.mtls-entry, :where(.is-root-container.wp-block-post-content)) p {
	margin: 0 0 22px;
	line-height: 24px;
}

:is(.mtls-entry, :where(.is-root-container.wp-block-post-content)) :is(h1, h2, h3, h4, h5, h6) {
	margin: 0 0 22px;
	color: var(--wp--preset--color--ink);
	font-family: var(--wp--preset--font-family--body);
	font-weight: 400;
	letter-spacing: 1px;
	line-height: 1.2;
	text-transform: none;
}

:is(.mtls-entry, :where(.is-root-container.wp-block-post-content)) h1 {
	font-size: 30px;
}

:is(.mtls-entry, :where(.is-root-container.wp-block-post-content)) h2 {
	font-size: 28px;
}

:is(.mtls-entry, :where(.is-root-container.wp-block-post-content)) h3 {
	font-size: 26px;
}

:is(.mtls-entry, :where(.is-root-container.wp-block-post-content)) h4 {
	font-size: 22px;
}

:is(.mtls-entry, :where(.is-root-container.wp-block-post-content)) h5 {
	font-size: var(--wp--custom--pages--font-size--large);
}

:is(.mtls-entry, :where(.is-root-container.wp-block-post-content)) h6 {
	font-size: var(--wp--custom--pages--font-size--medium);
}

:is(.mtls-entry, :where(.is-root-container.wp-block-post-content)) a {
	color: var(--wp--custom--pages--color--link);
}

/* In the post editor the text has no white box around it: the canvas is white instead of the ground. */
body:has(.is-root-container.wp-block-post-content) {
	background: var(--wp--preset--color--surface);
}

/* A group's page: the cover 400px high, a bordered bar under it with the icon over the cover's edge,
   the name and status under the icon, the tabs at the left and the administrators at the right. */
body.single-item.groups #buddypress .mtls-group-header__cover {
	height: 400px;
	border-radius: 2px;
}

body.single-item.groups #buddypress .bp-wrap {
	position: static;
}

.mtls-group-header__bar {
	position: relative;
	box-sizing: border-box;
	height: 108px;
	border: 1px solid var(--wp--custom--pages--color--border);
	border-radius: 2px;
	background: var(--wp--preset--color--surface);
}

body.single-item.groups #buddypress #item-header #item-header-avatar {
	position: absolute;
	top: -84px;
	left: 50%;
	width: 150px;
	margin: 0;
	transform: translateX(-50%);
}

/* The icon in a white circle with a 4px red ring, 150px in all. */
body.single-item.groups #buddypress #item-header #item-header-avatar a {
	display: block;
	box-sizing: border-box;
	width: 150px;
	height: 150px;
	overflow: hidden;
	border: 4px solid var(--wp--custom--pages--color--red);
	border-radius: 50%;
	background: var(--wp--preset--color--surface);
}

body.single-item.groups #buddypress #item-header #item-header-avatar img {
	width: 142px;
	height: 142px;
	margin: 0;
	border: 0;
	border-radius: 0;
	background: none;
}

body.single-item.groups #buddypress #item-header #item-header-content {
	position: absolute;
	top: 71px;
	right: 0;
	left: 0;
}

body.single-item.groups #buddypress .mtls-group-header__name {
	margin: 0;
	color: var(--wp--preset--color--ink);
	font-family: var(--wp--preset--font-family--body);
	font-size: 17px;
	font-weight: 600;
	line-height: 20.4px;
}

body.single-item.groups #buddypress #item-header .group-status {
	display: block;
	margin: 0;
	padding: 0;
	background: none;
	text-align: center;
	color: var(--wp--custom--pages--color--subtle);
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--custom--pages--font-size--small);
	line-height: 24px;
}

body.single-item.groups #buddypress #item-header #item-actions {
	position: absolute;
	top: 34px;
	right: 25px;
	z-index: 1;
}

body.single-item.groups #buddypress #item-actions .moderators-lists {
	display: flex;
	flex-direction: row-reverse;
	align-items: center;
	gap: 6px;
	margin: 0;
}

body.single-item.groups #buddypress #item-actions .moderators-title {
	margin: 0;
	color: var(--wp--custom--pages--color--text);
	font-size: var(--wp--custom--pages--font-size--base);
	font-weight: 700;
}

body.single-item.groups #buddypress #item-actions .user-list {
	margin: 0;
}

body.single-item.groups #buddypress #item-actions .user-list ul {
	display: flex;
	gap: 4px;
	margin: 0;
	padding: 0;
}

body.single-item.groups #buddypress #item-actions .user-list li {
	margin: 0;
	padding: 0;
}

body.single-item.groups #buddypress #item-actions .user-list img {
	width: 30px;
	height: 30px;
}

body.single-item.groups #buddypress #object-nav {
	position: absolute;
	top: 431px; /* 31px into the bar under the 400px cover */
	left: 16px;
	width: 300px; /* room for both tabs, or Nouveau folds them into a "more" menu */
	z-index: 1;
	margin: 0;
	padding: 13px 10px 8px;
	border: 0;
	background: none;
	box-shadow: none;
}

/* As wide as its tabs: Nouveau folds a list wider than the nav into a "more" menu. */
body.single-item.groups #buddypress #object-nav ul {
	display: inline-flex;
	gap: 0 39px;
	margin: 0;
	padding: 0;
}

body.single-item.groups #buddypress #object-nav li a {
	padding: 0;
	background: none;
	color: var(--wp--custom--pages--color--text);
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--custom--pages--font-size--base);
	font-weight: 600;
	line-height: 23.8px;
}

body.single-item.groups #buddypress #object-nav li.selected a,
body.single-item.groups #buddypress #object-nav li.current a {
	color: var(--wp--custom--pages--color--red);
}

/* The tabs' counts in a red circle, on a group and on the members directory. */
body.single-item.groups #buddypress #object-nav li a .count,
body.directory.members #buddypress.buddypress-wrap .bp-navs li a .count {
	display: inline-block;
	box-sizing: border-box;
	min-width: 25px;
	height: 25px;
	margin-left: 2px;
	padding: 0 4px;
	border: 1px solid var(--wp--custom--pages--color--red);
	border-radius: 30px;
	background: var(--wp--custom--pages--color--red);
	color: var(--wp--preset--color--surface);
	font-size: var(--wp--custom--pages--font-size--x-small);
	font-weight: 600;
	line-height: 23px;
	text-align: center;
}

body.single-item.groups #buddypress .group-description {
	max-width: none;
	margin: 20px 0 0;
	padding: 15px;
	border: 1px solid var(--wp--custom--pages--color--border);
	border-radius: 2px;
	background: var(--wp--preset--color--surface);
}

body.single-item.groups #buddypress .group-description p {
	margin: 0;
	color: var(--wp--custom--pages--color--subtle);
	font-size: var(--wp--custom--pages--font-size--base);
	line-height: 24px;
}

#buddypress #item-body h2.bp-screen-title {
	margin: 28px 0;
	color: var(--wp--preset--color--ink);
	font-family: var(--wp--preset--font-family--body);
	font-size: 28px;
	font-weight: 400;
	letter-spacing: 1px;
	line-height: 33.6px;
}

/* The search and filter bars in a light box. */
body.single-item.groups #buddypress #item-body .subnav-filters,
body.directory.members #buddypress #subnav-filters {
	box-sizing: border-box;
	margin: 20px 0;
	padding: 15px;
	border: 1px solid var(--wp--custom--pages--color--border);
	border-radius: 2px;
	background: var(--wp--preset--color--surface);
}

/* The activity: a light grey list of white boxes, the pictures 130px, the names bold and black, the
   quoted post on grey with a red edge. */
#buddypress #activity-stream {
	padding-top: 0;
}

#buddypress #activity-stream ul.activity-list {
	margin: 0;
	padding: 15px;
	border: 1px solid var(--wp--custom--pages--color--line-light);
	background: var(--wp--preset--color--surface-muted);
}

#buddypress #activity-stream li.activity-item {
	margin: 0 0 20px;
	padding: 14px 14px 14px 0;
	border: 1px solid var(--wp--custom--pages--color--line);
	border-radius: 2px;
	background: var(--wp--preset--color--surface);
	box-shadow: none;
}

#buddypress #activity-stream li.activity-item .activity-avatar {
	float: left;
	width: 162px;
	margin: 0;
}

#buddypress #activity-stream li.activity-item .activity-avatar img {
	width: 130px;
	max-width: none;
	height: 130px;
	border-radius: 0;
}

#buddypress #activity-stream li.activity-item .activity-content {
	margin-left: 184px;
}

#buddypress #activity-stream .activity-header {
	color: #767676;
	font-size: var(--wp--custom--pages--font-size--base);
	line-height: 23.8px;
}

#buddypress.buddypress-wrap #activity-stream .activity-header a {
	color: var(--wp--custom--pages--color--text);
	font-weight: 700;
}

#buddypress #activity-stream .activity-inner {
	margin: 15px 0 10px;
	padding: 15px;
	border-left: 3px solid var(--wp--custom--pages--color--red);
	border-radius: 2px;
	background: #f3f3f3;
}

/* Members directory: the tab centred with its count, "Viewing ..." under it on the right, two
   members to a row with 150px pictures and bold names. */
body.directory.members #buddypress.buddypress-wrap .bp-navs.dir-navs {
	padding-bottom: 55px;
	text-align: center;
}

body.directory.members #buddypress.buddypress-wrap .bp-navs.dir-navs ul {
	display: flex;
	justify-content: center;
}

body.directory.members #buddypress.buddypress-wrap .bp-navs.dir-navs li {
	float: none;
}

body.directory.members #buddypress .bp-pagination.top {
	position: absolute;
	top: 47px;
	right: 0;
	left: auto;
	width: auto;
	margin: 0;
	padding: 0;
	border: 0;
}

body.directory.members #buddypress .bp-pagination.top .pag-count,
body.directory.members #buddypress .bp-pagination.top .pag-data {
	float: none;
	width: auto;
	margin: 0;
	padding: 0 10px;
	color: var(--wp--custom--pages--color--text);
	font-size: var(--wp--custom--pages--font-size--base);
	line-height: 24px;
	text-align: right;
}

body.directory.members #buddypress .bp-pagination.top .bp-pagination-links {
	display: none;
}

#buddypress ul#members-list {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 10px 30px;
	padding: 7px 0;
}

/* Nouveau's clearfix pseudo-elements would take places in the grid. */
#buddypress ul#members-list::before,
#buddypress ul#members-list::after {
	display: none;
}

#buddypress ul#members-list > li {
	float: none;
	width: auto;
	margin: 0;
	padding: 7px 0;
	border: 0;
	border-bottom: 1px solid var(--wp--custom--pages--color--line-soft);
}

#buddypress ul#members-list .list-wrap {
	display: flex;
	gap: 31px;
	align-items: flex-start;
}

#buddypress ul#members-list .item-avatar {
	flex: 0 0 150px;
	margin: 0;
}

#buddypress ul#members-list .item-avatar img {
	width: 150px;
	max-width: none;
	height: 150px;
}

#buddypress ul#members-list .item {
	flex: 1 1 auto;
	float: none;
	width: auto;
	min-width: 0;
	margin: 0;
	text-align: left;
}

#buddypress ul#members-list .item .item-block {
	float: none;
	width: auto;
}

#buddypress.buddypress-wrap ul#members-list .list-title,
#buddypress.buddypress-wrap ul#members-list .member-name {
	margin: 0;
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--custom--pages--font-size--base);
	line-height: 28.6px;
}

#buddypress.buddypress-wrap ul#members-list .item-meta {
	margin: 10px 0;
	color: #737373;
	font-size: var(--wp--custom--pages--font-size--x-small);
	line-height: 24px;
}

#buddypress.buddypress-wrap ul#members-list .list-title a,
#buddypress.buddypress-wrap ul#members-list .member-name a {
	color: var(--wp--custom--pages--color--text);
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--custom--pages--font-size--base);
	font-weight: 700;
	letter-spacing: 1px;
}

@media (max-width: 767px) {

	#buddypress ul#members-list {
		grid-template-columns: 1fr;
	}

	body.single-item.groups #buddypress .mtls-group-header__cover {
		height: 180px;
	}

	.mtls-group-header__bar {
		height: auto;
		padding: 70px 10px 10px;
	}

	body.single-item.groups #buddypress #item-header #item-header-avatar {
		top: -60px;
		width: 100px;
	}

	body.single-item.groups #buddypress #item-header #item-header-avatar img {
		width: 100px;
		height: 100px;
	}

	body.single-item.groups #buddypress #item-header #item-header-content,
	body.single-item.groups #buddypress #item-header #item-actions,
	body.single-item.groups #buddypress #object-nav {
		position: static;
	}
}

/* The theme's diamond bullets are for a page's own lists, not BuddyPress's. */
.mtls-entry #buddypress ul:not([class]) > li {
	margin-block-end: 0;
	padding-inline-start: 0;
}

.mtls-entry #buddypress ul:not([class]) > li::before {
	display: none;
}

body.single-item.groups #buddypress #item-body {
	margin-top: 0;
	padding-top: 0;
}

body.single-item.groups #buddypress #item-header {
	margin-bottom: 0;
}

/* Nouveau's clearfix pseudo-elements would take places in the row. */
body.single-item.groups #buddypress #item-body .subnav-filters::before,
body.single-item.groups #buddypress #item-body .subnav-filters::after {
	display: none;
}

/* The activity filters: the feed icon, the search field with its magnifier inside, "Show" at the
   right. */
body.single-item.groups #buddypress #item-body .subnav-filters {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 72px;
}

body.single-item.groups #buddypress #item-body .subnav-filters > ul {
	display: flex;
	align-items: flex-start;
	margin: 0;
	padding: 0;
}

body.single-item.groups #buddypress #item-body .subnav-filters li.feed {
	margin-right: 15px;
	padding-top: 6px;
}

body.single-item.groups #buddypress #item-body .subnav-filters li.feed a {
	color: var(--wp--custom--pages--color--text);
}

body.single-item.groups #buddypress #item-body .subnav-filters li.group-act-search {
	padding-left: 18px;
}

#buddypress .subnav-filters .bp-search,
#buddypress .subnav-filters .dir-search form {
	display: flex;
	box-sizing: border-box;
	width: 248px;
	height: 40px;
	border: 1px solid var(--wp--custom--pages--color--line-soft);
	border-radius: 2px;
	background: var(--wp--preset--color--surface);
}

#buddypress .subnav-filters input[type="search"] {
	flex: 1;
	min-width: 0;
	height: 38px;
	padding: 3px 10px;
	border: 0;
	background: none;
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--custom--pages--font-size--medium);
}

#buddypress.buddypress-wrap .subnav-filters button.nouveau-search-submit {
	padding: 3px 10px;
	border: 0;
	background: none;
	color: #555;
}

#buddypress .subnav-filters select {
	height: 38px;
	padding: 6px 25px 6px 10px;
	border: 1px solid var(--wp--custom--pages--color--line-soft);
	border-radius: 2px;
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--custom--pages--font-size--base);
}

@media (max-width: 767px) {

	body.single-item.groups #buddypress #item-body .subnav-filters {
		flex-wrap: wrap;
		gap: 10px;
	}

	#buddypress .subnav-filters select {
		max-width: 100%;
	}

	#buddypress #activity-stream ul.activity-list {
		padding: 8px;
	}

	#buddypress #activity-stream li.activity-item .activity-avatar {
		float: none;
		width: auto;
		margin: 0 0 10px 14px;
	}

	#buddypress #activity-stream li.activity-item .activity-avatar img {
		width: 80px;
		height: 80px;
	}

	#buddypress #activity-stream li.activity-item .activity-content {
		margin-left: 14px;
	}
}

/* A group has two tabs, which always fit: the empty "more" menu of Nouveau's priority nav stays out. */
body.single-item.groups #buddypress #object-nav .primary-nav-more {
	display: none;
}
