/**
 * Group page components — Central Square Music Boosters.
 *
 * Designed to sit BELOW the existing Astra header without competing with it.
 * The header is a tall white->burgundy gradient band and the footer is a solid
 * burgundy bar, so the content area stays mostly white with burgundy used for
 * structure (rules, date blocks, buttons) and one burgundy panel at the bottom
 * that answers the footer.
 *
 * Colors bind to Astra's global palette first, so changing the brand color in
 * Customizer carries through here. The literals are the live values.
 */

:root {
	--csmb-accent: var(--ast-global-color-0, #8b2332);
	--csmb-accent-dark: #641924;
	--csmb-accent-tint: #f3e9eb;
	--csmb-ink: var(--ast-global-color-6, #111111);
	--csmb-body: var(--ast-global-color-3, #333333);
	--csmb-muted: #6b6b6b;
	--csmb-line: #e4e4e4;
	--csmb-surface: var(--ast-global-color-7, #f5f5f5);
	--csmb-radius: 6px;

	/*
	 * Photo band, shared by the group hero and the home carousel.
	 * Change these two values and BOTH surfaces move together.
	 *   --csmb-band-width  how wide the band may get (height follows the ratio)
	 *   --csmb-band-ratio  2.194:1 gives 547px of height across the 1200px
	 *                      card — the band spans the full card width without
	 *                      being any taller than the 820px version it replaced
	 */
	--csmb-band-width: 100%;
	--csmb-band-ratio: 2.194 / 1;
	--csmb-section-gap: clamp(2.5rem, 5vw, 4rem);
}

/*
 * Paint our own surface rather than inheriting the container's.
 *
 * This site's Astra Customizer sets the container background to the brand
 * burgundy below 921px (--ast-global-color-4) while desktop stays white. Dark
 * body text on that burgundy measures 1.43:1, far under the 4.5:1 AA floor, so
 * the group content supplies its own white surface and stays readable whatever
 * the container is set to. On desktop this is white-on-white: no visual change.
 */
.csmb-group,
.csmb-home,
.csmb-page {
	color: var(--csmb-body);
	background: #fff;
}

@media (max-width: 921px) {
	.csmb-group,
	.csmb-home,
	.csmb-page {
		padding: 1.5rem 1.15rem;
		border-radius: var(--csmb-radius);
	}
}

.csmb-group h1,
.csmb-group h2,
.csmb-group h3,
.csmb-home h1,
.csmb-home h2,
.csmb-home h3,
.csmb-page h1,
.csmb-page h2,
.csmb-page h3 {
	color: var(--csmb-ink);
	letter-spacing: -0.01em;
}

/* ---------- Page title block ---------- */
/* Deliberately light: the header above is already a large visual statement. */

.csmb-pagehead {
	padding: 0 0 1.75rem;
	margin-bottom: var(--csmb-section-gap);
	border-bottom: 1px solid var(--csmb-line);
	position: relative;
}

/* Echoes the header's left-to-right white->burgundy gradient. */
.csmb-pagehead::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: -1px;
	width: min(320px, 45%);
	height: 3px;
	background: linear-gradient(90deg, var(--csmb-accent-tint) 0%, var(--csmb-accent) 100%);
}

.csmb-pagehead__season {
	display: inline-block;
	margin: 0 0 0.85rem;
	padding: 0.3rem 0.7rem;
	border-radius: 3px;
	background: var(--csmb-accent-tint);
	color: var(--csmb-accent-dark);
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.09em;
	text-transform: uppercase;
}

.csmb-pagehead__title {
	margin: 0;
	font-size: clamp(2rem, 4.4vw, 2.9rem);
	line-height: 1.15;
	font-weight: 700;
}

.csmb-pagehead__tagline {
	margin: 1rem 0 0;
	max-width: 62ch;
	font-size: clamp(1.02rem, 1.9vw, 1.16rem);
	line-height: 1.65;
	color: var(--csmb-body);
}

.csmb-pagehead__media {
	position: relative;
	margin: 0 0 1.75rem;
	border-radius: var(--csmb-radius);
	overflow: hidden;
	background: var(--csmb-surface);

	/*
	 * The photo band. The home carousel uses these same two values — they must
	 * match, or the same photo changes size when a visitor follows a slide to
	 * its group page.
	 *
	 * --csmb-band-width is the single control for how large the band is.
	 * --csmb-band-ratio is 3:2 because that is what cameras shoot, so the most
	 * common upload fills the band edge to edge with no bars at all.
	 *
	 * Never use max-height here: capping the height of a box that has an
	 * aspect-ratio shrinks its WIDTH to preserve the ratio, which is what once
	 * made the hero narrower than the carousel.
	 */
	width: min(100%, var(--csmb-band-width));
	aspect-ratio: var(--csmb-band-ratio);
	margin-inline: auto;
}

/* ---------- Photos ---------- */

/*
 * Photos are uploaded by board members and parents from whatever camera or
 * phone they own, so the band has to accept any shape. Every photo is fitted
 * WHOLE — object-fit: contain, never cover — so nothing is ever cropped out of
 * anyone's picture, whatever its ratio. The cost is bars beside or above a
 * photo whose shape differs from the band; those are filled with a blurred
 * enlargement of the photo itself so they read as deliberate.
 */
.csmb-photo {
	display: block;
	width: 100%;
	height: 100%;
	position: relative;
	z-index: 1;
}

/*
 * A band this wide cannot show a 3:2 photo whole, so photos near the band's
 * own proportions fill it and give up some top and bottom — about a third for
 * 3:2, which keeps roughly two thirds of the frame. Held above center because
 * faces sit in the upper half of a group photo.
 */
.csmb-photo--fill {
	object-fit: cover;
	object-position: center 40%;
}

/*
 * Squares and anything portrait are far taller than the band; cropping them to
 * fit would discard more than half the picture, so they are shown whole and
 * centered over the blurred fill instead. This is what lets a phone snapshot in
 * portrait be uploaded without the result looking broken.
 */
.csmb-photo--fit {
	object-fit: contain;
	object-position: center;
}

/* --csmb-photo-fill is set inline by csmb_image_fill_style(). With no value
   the ::before never paints, so a missing photo costs nothing. */
.csmb-pagehead__media::before,
.csmb-carousel__media::before {
	content: "";
	position: absolute;
	inset: 0;
	background-image: var(--csmb-photo-fill, none);
	background-size: cover;
	background-position: center;
	filter: blur(28px) saturate(1.15);
	/* Hides the soft edges the blur leaves at the boundary. */
	transform: scale(1.15);
	opacity: 0.55;
}

@media (max-width: 600px) {
	/* Overriding the token moves the hero and the carousel together. */
	:root {
		--csmb-band-ratio: 3 / 2;
	}
}

/* ---------- Sections ---------- */

.csmb-section {
	margin-bottom: var(--csmb-section-gap);
	scroll-margin-top: 90px;
}

.csmb-section:last-child {
	margin-bottom: 0;
}

.csmb-section__title {
	margin: 0 0 1.5rem;
	padding-left: 0.85rem;
	border-left: 4px solid var(--csmb-accent);
	font-size: clamp(1.3rem, 2.4vw, 1.6rem);
	font-weight: 700;
	line-height: 1.2;
}

.csmb-section__action {
	margin: 1.5rem 0 0;
}

.csmb-prose > :last-child {
	margin-bottom: 0;
}

.csmb-note {
	margin: 0;
	color: var(--csmb-muted);
}

/* Editor-only prompt; never shown to visitors. */
.csmb-empty {
	margin: 0.85rem 0 0;
	padding: 0.8rem 1rem;
	border-left: 3px solid var(--csmb-accent);
	border-radius: 0 var(--csmb-radius) var(--csmb-radius) 0;
	background: var(--csmb-surface);
	font-size: 0.9rem;
	color: var(--csmb-body);
}

/* ---------- Cards: staff & fundraisers ---------- */

.csmb-cards {
	display: grid;
	gap: 1.25rem;
	grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
	margin: 0;
	padding: 0;
	list-style: none;
}

.csmb-card {
	display: flex;
	flex-direction: column;
	padding: 1.4rem;
	border: 1px solid var(--csmb-line);
	border-radius: var(--csmb-radius);
	background: #fff;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.csmb-card:hover {
	border-color: #d2d2d2;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.csmb-card__name {
	margin: 0;
	font-size: 1.08rem;
	font-weight: 700;
}

.csmb-card__role {
	margin: 0.3rem 0 0;
	color: var(--csmb-accent);
	font-size: 0.76rem;
	font-weight: 700;
	letter-spacing: 0.07em;
	text-transform: uppercase;
}

.csmb-card__bio {
	margin: 0.85rem 0 0;
	font-size: 0.95rem;
	line-height: 1.6;
	color: var(--csmb-body);
}

.csmb-card__meta {
	margin: 1rem 0 0;
	padding-top: 0.85rem;
	border-top: 1px solid var(--csmb-line);
	font-size: 0.9rem;
	word-break: break-word;
}

/* Exclude buttons: this rule (0,2,0) would otherwise beat `.csmb-button`
   (0,1,0) and paint a button's label burgundy on a burgundy background. */
.csmb-card__meta a:not(.csmb-button) {
	color: var(--csmb-accent);
}

/* ---------- Achievements ---------- */

.csmb-timeline {
	margin: 0;
	padding: 0;
	list-style: none;
	border-top: 1px solid var(--csmb-line);
}

.csmb-timeline__item {
	display: grid;
	grid-template-columns: 7rem 1fr;
	gap: 1.25rem;
	padding: 1.15rem 0;
	border-bottom: 1px solid var(--csmb-line);
}

.csmb-timeline__year {
	color: var(--csmb-accent);
	font-weight: 700;
	font-size: 0.95rem;
	padding-top: 0.1rem;
	letter-spacing: 0.02em;
}

/* Pin the body to column 2 so a row with no year still aligns instead of being
   squeezed into the narrow year gutter. */
.csmb-timeline__body {
	grid-column: 2;
}

.csmb-timeline__title {
	margin: 0;
	font-size: 1.04rem;
	font-weight: 700;
}

.csmb-timeline__detail {
	margin: 0.35rem 0 0;
	font-size: 0.95rem;
	line-height: 1.6;
	color: var(--csmb-muted);
}

/* ---------- Events ---------- */

.csmb-events {
	margin: 0;
	padding: 0;
	list-style: none;
	display: grid;
	gap: 0.85rem;
}

.csmb-event {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 1.15rem;
	align-items: center;
	padding: 1rem 1.25rem;
	border: 1px solid var(--csmb-line);
	border-radius: var(--csmb-radius);
	background: #fff;
}

.csmb-event__date {
	min-width: 4.6rem;
	padding: 0.55rem 0.4rem;
	border-radius: var(--csmb-radius);
	background: var(--csmb-accent);
	color: #fff;
	text-align: center;
	line-height: 1.15;
}

.csmb-event__day {
	display: block;
	font-weight: 700;
	font-size: 0.98rem;
}

.csmb-event__year {
	display: block;
	font-size: 0.74rem;
	opacity: 0.85;
}

.csmb-event__title {
	margin: 0;
	font-size: 1.04rem;
	font-weight: 700;
}

.csmb-event__title a {
	color: var(--csmb-ink);
	text-decoration: none;
}

.csmb-event__title a:hover,
.csmb-event__title a:focus {
	color: var(--csmb-accent);
	text-decoration: underline;
}

.csmb-event__meta {
	margin: 0.3rem 0 0;
	color: var(--csmb-muted);
	font-size: 0.88rem;
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem 1rem;
}

.csmb-event__venue::before {
	content: "\00b7";
	margin-right: 0.75rem;
	color: var(--csmb-line);
}

/* ---------- Contact: burgundy panel answering the footer ---------- */

.csmb-section--contact .csmb-section__title {
	border-left-color: var(--csmb-accent);
}

.csmb-contact {
	display: grid;
	gap: 0;
	grid-template-columns: minmax(240px, 0.85fr) minmax(0, 1.15fr);
	border-radius: var(--csmb-radius);
	overflow: hidden;
	border: 1px solid var(--csmb-line);
}

/* No form shortcode: one full-width panel rather than an empty second column. */
.csmb-contact--solo {
	grid-template-columns: 1fr;
}

.csmb-contact__details {
	padding: 1.75rem;
	background: var(--csmb-accent);
	color: #fff;
}

.csmb-contact__details p {
	margin: 0 0 0.5rem;
}

.csmb-contact__details a:not(.csmb-button) {
	color: #fff;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.csmb-contact__name {
	font-weight: 700;
	font-size: 1.1rem;
}

.csmb-contact__role {
	font-size: 0.76rem;
	font-weight: 700;
	letter-spacing: 0.07em;
	text-transform: uppercase;
	opacity: 0.85;
}

.csmb-contact__note {
	margin: 1rem 0 0;
	padding-top: 1rem;
	border-top: 1px solid rgba(255, 255, 255, 0.25);
	max-width: 60ch;
	font-size: 0.95rem;
	opacity: 0.92;
}

.csmb-contact__details .csmb-button {
	margin-top: 1rem;
	background: #fff;
	color: var(--csmb-accent-dark);
}

.csmb-contact__details .csmb-button:hover,
.csmb-contact__details .csmb-button:focus {
	background: var(--csmb-accent-tint);
	color: var(--csmb-accent-dark);
}

.csmb-contact__form {
	padding: 1.75rem;
	background: #fff;
}

.csmb-contact__form .csmb-note {
	margin-bottom: 1rem;
}

/* ---------- Buttons ---------- */

.csmb-button {
	display: inline-block;
	padding: 0.68rem 1.3rem;
	border-radius: var(--csmb-radius);
	background: var(--csmb-accent);
	color: #fff;
	font-size: 0.9rem;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	transition: background 0.15s ease;
}

.csmb-button:hover,
.csmb-button:focus {
	background: var(--csmb-accent-dark);
	color: #fff;
}

.csmb-button--small {
	padding: 0.45rem 0.9rem;
	font-size: 0.84rem;
}

.csmb-card .csmb-button {
	align-self: flex-start;
}

/* ---------- Responsive ---------- */

@media (max-width: 921px) {
	.csmb-contact {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 600px) {
	.csmb-timeline__item {
		grid-template-columns: 1fr;
		gap: 0.3rem;
	}

	.csmb-timeline__body {
		grid-column: 1;
	}

	.csmb-event {
		grid-template-columns: 1fr;
		gap: 0.85rem;
	}

	.csmb-event__date {
		justify-self: start;
		min-width: 0;
		padding: 0.4rem 0.85rem;
	}
}

/* ==========================================================================
   Shared components, used by the home page and the content pages too.
   Defined once here so no template carries its own copy.
   ========================================================================== */

/* ---------- Support / donation band ---------- */

.csmb-support {
	margin-bottom: var(--csmb-section-gap);
	padding: clamp(2rem, 5vw, 3.25rem) clamp(1.25rem, 4vw, 3rem);
	border-radius: var(--csmb-radius);
	background: var(--csmb-accent);
	color: #fff;
	text-align: center;
}

.csmb-support__inner {
	max-width: 44rem;
	margin: 0 auto;
}

/* Specificity note: the heading rule sets `.csmb-home h2` / `.csmb-page h2`
   (0,1,1), which beats a lone class selector. Scoping to `.csmb-support` (0,2,0)
   wins everywhere this band is used, without !important. */
.csmb-support .csmb-support__title {
	margin: 0;
	color: #fff;
	font-size: clamp(1.5rem, 3.4vw, 2.1rem);
	font-weight: 700;
	line-height: 1.2;
}

.csmb-support__text {
	margin: 1rem 0 0;
	font-size: clamp(1rem, 2vw, 1.12rem);
	line-height: 1.65;
	opacity: 0.94;
}

.csmb-support__actions {
	margin: 1.75rem 0 0;
}

.csmb-support__note {
	margin: 1.15rem 0 0;
	font-size: 0.87rem;
	opacity: 0.85;
}

/* ---------- News ---------- */

.csmb-news {
	display: grid;
	gap: 1.5rem;
	grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
	margin: 0;
	padding: 0;
	list-style: none;
}

.csmb-news__item {
	padding-top: 1rem;
	border-top: 3px solid var(--csmb-accent);
}

.csmb-news__date {
	margin: 0;
	color: var(--csmb-accent);
	font-size: 0.74rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.csmb-news__title {
	margin: 0.5rem 0 0;
	font-size: 1.08rem;
	font-weight: 700;
	line-height: 1.35;
}

.csmb-news__title a {
	color: var(--csmb-ink);
	text-decoration: none;
}

.csmb-news__title a:hover,
.csmb-news__title a:focus {
	color: var(--csmb-accent);
	text-decoration: underline;
}

.csmb-news__text {
	margin: 0.6rem 0 0;
	font-size: 0.95rem;
	line-height: 1.65;
	color: var(--csmb-body);
}

/* ---------- Button variants ---------- */

.csmb-button--large {
	padding: 0.85rem 1.65rem;
	font-size: 0.98rem;
}

/* Outlined burgundy on a light background. */
.csmb-button--ghost {
	background: transparent;
	color: var(--csmb-accent-dark);
	box-shadow: inset 0 0 0 2px var(--csmb-accent);
}

.csmb-button--ghost:hover,
.csmb-button--ghost:focus {
	background: var(--csmb-accent);
	color: #fff;
}

/* White button for use on the burgundy band. */
.csmb-button--onburgundy {
	background: #fff;
	color: var(--csmb-accent-dark);
}

.csmb-button--onburgundy:hover,
.csmb-button--onburgundy:focus {
	background: var(--csmb-accent-tint);
	color: var(--csmb-accent-dark);
}

.csmb-textlink {
	color: var(--csmb-accent-dark);
	font-size: 0.93rem;
	font-weight: 600;
	text-underline-offset: 3px;
}


/* ---------- Breadcrumbs ---------- */

.csmb-crumbs {
	margin-bottom: 1.5rem;
}

.csmb-crumbs__list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.4rem 0.55rem;
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 0.83rem;
}

.csmb-crumbs__item {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	color: #646464;
}

.csmb-crumbs__item + .csmb-crumbs__item::before {
	content: "/";
	color: #bdbdbd;
}

.csmb-crumbs__item a {
	color: var(--csmb-accent-dark);
	text-decoration: none;
}

.csmb-crumbs__item a:hover,
.csmb-crumbs__item a:focus {
	text-decoration: underline;
}

.csmb-crumbs__item [aria-current="page"] {
	color: #646464;
}

