/**
 * Saving Grace Education Community — component styles.
 *
 * Mobile first throughout. Parents reach this community from phones far more
 * often than from desktops, so every layout starts as a single column and only
 * becomes a table at 768px and above.
 *
 * Design tokens (--sgeg-*) are defined once in style.css. This file consumes
 * them and never redefines them, so there is a single source of truth for the
 * palette. Each var() still carries a hex fallback so that a component pasted
 * into another context degrades to the correct brand colour.
 */

/* ---------------------------------------------------------------------------
   Badges
   ------------------------------------------------------------------------ */

.sgeg-badge {
	display: inline-block;
	padding: 0.15em 0.6em;
	border-radius: 100px;
	font-family: var( --sgeg-font-heading );
	font-size: 0.6875rem;
	font-weight: 600;
	line-height: 1.6;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	white-space: nowrap;
	vertical-align: middle;
}

.sgeg-badge--official {
	background: var( --sgeg-blue );
	color: var( --sgeg-white );
}

.sgeg-badge--moderator {
	background: var( --sgeg-navy );
	color: var( --sgeg-white );
}

.sgeg-badge--verified {
	background: var( --sgeg-teal-tint );
	color: var( --sgeg-teal );
}

.sgeg-badge--new {
	background: var( --sgeg-yellow );
	color: var( --sgeg-ink );
}

.sgeg-badge--member {
	background: var( --sgeg-surface );
	color: var( --sgeg-body );
}

.sgeg-badge--private {
	background: var( --sgeg-surface );
	color: var( --sgeg-blue );
	border: 1px solid var( --sgeg-hairline );
}

.sgeg-badge--helper {
	background: var( --sgeg-cyan );
	color: var( --sgeg-white );
}

/* ---------------------------------------------------------------------------
   Official Saving Grace Response
   The single most important visual distinction in the community: parents must
   be able to tell school policy from a neighbour's opinion at a glance.
   ------------------------------------------------------------------------ */

.sgeg-official-response {
	position: relative;
	background: var( --sgeg-teal-tint );
	border: 1px solid var( --sgeg-cyan );
	border-left: 4px solid var( --sgeg-blue );
	border-radius: var( --sgeg-radius );
	padding: 1.25rem 1.25rem 1.25rem 1.5rem;
	margin: 1rem 0;
}

.sgeg-official-response__label {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-family: var( --sgeg-font-heading );
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var( --sgeg-blue );
	margin-bottom: 0.75rem;
}

.sgeg-official-response__label::before {
	content: "";
	display: inline-block;
	width: 1rem;
	height: 1rem;
	flex: 0 0 auto;
	background-color: var( --sgeg-blue );
	-webkit-mask: var( --sgeg-check-mask ) center / contain no-repeat;
	mask: var( --sgeg-check-mask ) center / contain no-repeat;
	--sgeg-check-mask: url( "data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 1.5 2.5 4.8v5c0 4.3 3.2 8.3 7.5 9.2 4.3-.9 7.5-4.9 7.5-9.2v-5L10 1.5Zm3.9 6.4-4.7 4.7a.9.9 0 0 1-1.3 0L5.8 10.5a.9.9 0 1 1 1.3-1.3l1.5 1.5 4-4a.9.9 0 0 1 1.3 1.3Z'/%3E%3C/svg%3E" );
}

/* ---------------------------------------------------------------------------
   bbPress — general reset toward the Saving Grace look
   ------------------------------------------------------------------------ */

#bbpress-forums {
	font-family: var( --sgeg-font-body );
	font-size: 1rem;
	color: var( --sgeg-body );
}

#bbpress-forums div.bbp-forum-title h3,
#bbpress-forums div.bbp-topic-title h3,
#bbpress-forums h1,
#bbpress-forums h2,
#bbpress-forums h3 {
	font-family: var( --sgeg-font-heading );
	color: var( --sgeg-ink );
	letter-spacing: -0.015em;
}

#bbpress-forums a {
	color: var( --sgeg-blue );
	text-decoration: none;
}

#bbpress-forums a:hover,
#bbpress-forums a:focus-visible {
	color: var( --sgeg-red );
	text-decoration: underline;
}

/* Forum and topic lists become cards on mobile, tables on desktop. */

#bbpress-forums ul.bbp-forums,
#bbpress-forums ul.bbp-topics,
#bbpress-forums ul.bbp-replies,
#bbpress-forums ul.bbp-lead-topic {
	background: var( --sgeg-white );
	border: 1px solid var( --sgeg-hairline );
	border-radius: var( --sgeg-radius );
	box-shadow: var( --sgeg-shadow );
	overflow: hidden;
	margin-bottom: 1.5rem;
}

#bbpress-forums li.bbp-header,
#bbpress-forums li.bbp-footer {
	background: var( --sgeg-surface );
	border-bottom: 1px solid var( --sgeg-hairline );
	font-family: var( --sgeg-font-heading );
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var( --sgeg-teal );
	padding: 0.75rem 1rem;
}

#bbpress-forums li.bbp-footer {
	border-bottom: 0;
	border-top: 1px solid var( --sgeg-hairline );
}

#bbpress-forums li.bbp-body ul.forum,
#bbpress-forums li.bbp-body ul.topic {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	padding: 1rem;
	border-bottom: 1px solid var( --sgeg-hairline );
}

#bbpress-forums li.bbp-body ul.forum:last-child,
#bbpress-forums li.bbp-body ul.topic:last-child {
	border-bottom: 0;
}

#bbpress-forums li.bbp-body ul.forum:hover,
#bbpress-forums li.bbp-body ul.topic:hover {
	background: var( --sgeg-teal-tint );
}

#bbpress-forums li.bbp-forum-info,
#bbpress-forums li.bbp-topic-title {
	width: 100%;
	float: none;
}

#bbpress-forums li.bbp-forum-info a.bbp-forum-title,
#bbpress-forums li.bbp-topic-title a.bbp-topic-permalink {
	font-family: var( --sgeg-font-heading );
	font-size: 1.0625rem;
	font-weight: 600;
	color: var( --sgeg-ink );
	line-height: 1.35;
}

#bbpress-forums li.bbp-forum-info a.bbp-forum-title:hover,
#bbpress-forums li.bbp-topic-title a.bbp-topic-permalink:hover {
	color: var( --sgeg-blue );
}

#bbpress-forums div.bbp-forum-content,
#bbpress-forums p.bbp-topic-meta {
	font-size: 0.875rem;
	color: var( --sgeg-body );
	margin: 0.25rem 0 0;
}

/* Counts and freshness read as metadata on mobile, columns on desktop. */

#bbpress-forums li.bbp-forum-topic-count,
#bbpress-forums li.bbp-forum-reply-count,
#bbpress-forums li.bbp-topic-voice-count,
#bbpress-forums li.bbp-topic-reply-count,
#bbpress-forums li.bbp-forum-freshness,
#bbpress-forums li.bbp-topic-freshness {
	width: auto;
	float: none;
	display: inline-block;
	font-size: 0.8125rem;
	color: var( --sgeg-body );
	text-align: left;
	margin-right: 1rem;
}

@media ( min-width: 768px ) {

	#bbpress-forums li.bbp-body ul.forum,
	#bbpress-forums li.bbp-body ul.topic,
	#bbpress-forums li.bbp-header ul {
		display: grid;
		grid-template-columns: minmax( 0, 1fr ) 5.5rem 5.5rem 11rem;
		align-items: center;
		gap: 1rem;
	}

	#bbpress-forums li.bbp-forum-info,
	#bbpress-forums li.bbp-topic-title {
		grid-column: 1;
	}

	#bbpress-forums li.bbp-forum-topic-count,
	#bbpress-forums li.bbp-topic-voice-count {
		grid-column: 2;
		text-align: center;
		margin-right: 0;
	}

	#bbpress-forums li.bbp-forum-reply-count,
	#bbpress-forums li.bbp-topic-reply-count {
		grid-column: 3;
		text-align: center;
		margin-right: 0;
	}

	#bbpress-forums li.bbp-forum-freshness,
	#bbpress-forums li.bbp-topic-freshness {
		grid-column: 4;
		text-align: right;
		margin-right: 0;
	}
}

/* Replies */

#bbpress-forums div.bbp-reply-header,
#bbpress-forums div.bbp-topic-header {
	background: var( --sgeg-surface );
	border-bottom: 1px solid var( --sgeg-hairline );
	padding: 0.6rem 1rem;
	font-size: 0.8125rem;
}

#bbpress-forums div.bbp-reply-author,
#bbpress-forums div.bbp-topic-author {
	width: 100%;
	float: none;
	display: flex;
	align-items: center;
	gap: 0.75rem;
	flex-wrap: wrap;
	padding: 1rem 1rem 0;
	text-align: left;
}

#bbpress-forums div.bbp-reply-author img.avatar,
#bbpress-forums div.bbp-topic-author img.avatar {
	position: static;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	margin: 0;
	flex: 0 0 auto;
}

#bbpress-forums div.bbp-reply-author .bbp-author-name,
#bbpress-forums div.bbp-topic-author .bbp-author-name {
	font-family: var( --sgeg-font-heading );
	font-weight: 600;
	color: var( --sgeg-ink );
}

#bbpress-forums div.bbp-reply-content,
#bbpress-forums div.bbp-topic-content {
	margin-left: 0;
	padding: 0.75rem 1rem 1.25rem;
	line-height: 1.7;
}

@media ( min-width: 768px ) {

	#bbpress-forums div.bbp-reply-author,
	#bbpress-forums div.bbp-topic-author {
		width: 150px;
		float: left;
		flex-direction: column;
		align-items: center;
		text-align: center;
		padding: 1.25rem 1rem;
	}

	#bbpress-forums div.bbp-reply-author img.avatar,
	#bbpress-forums div.bbp-topic-author img.avatar {
		width: 64px;
		height: 64px;
	}

	#bbpress-forums div.bbp-reply-content,
	#bbpress-forums div.bbp-topic-content {
		margin-left: 150px;
		padding: 1.25rem 1.5rem;
	}
}

/* Forms and buttons */

#bbpress-forums input[type="text"],
#bbpress-forums input[type="password"],
#bbpress-forums input[type="email"],
#bbpress-forums select,
#bbpress-forums textarea,
#bbpress-forums .wp-editor-container {
	width: 100%;
	border: 1px solid var( --sgeg-hairline );
	border-radius: var( --sgeg-radius-sm );
	padding: 0.7rem 0.9rem;
	font-family: var( --sgeg-font-body );
	font-size: 1rem;
	color: var( --sgeg-ink );
	background: var( --sgeg-white );
	box-sizing: border-box;
}

#bbpress-forums input[type="text"]:focus,
#bbpress-forums select:focus,
#bbpress-forums textarea:focus {
	outline: 2px solid var( --sgeg-cyan );
	outline-offset: 1px;
	border-color: var( --sgeg-cyan );
}

#bbpress-forums button,
#bbpress-forums input[type="submit"],
#bbpress-forums .bbp-submit-wrapper button {
	background: var( --sgeg-blue );
	color: var( --sgeg-white );
	font-family: var( --sgeg-font-heading );
	font-size: 0.9375rem;
	font-weight: 600;
	border: 0;
	border-radius: var( --sgeg-radius-sm );
	padding: 0.85rem 1.5rem;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

#bbpress-forums button:hover,
#bbpress-forums input[type="submit"]:hover {
	background: var( --sgeg-navy );
}

#bbpress-forums button:focus-visible,
#bbpress-forums input[type="submit"]:focus-visible {
	outline: 3px solid var( --sgeg-yellow );
	outline-offset: 2px;
}

/* Sticky and closed topics */

#bbpress-forums li.bbp-body ul.topic.sticky,
#bbpress-forums li.bbp-body ul.topic.super-sticky {
	background: color-mix( in srgb, var( --sgeg-yellow ) 12%, var( --sgeg-white ) );
	border-left: 3px solid var( --sgeg-yellow );
}

#bbpress-forums li.bbp-body ul.topic.status-closed a.bbp-topic-permalink {
	color: var( --sgeg-body );
}

/* Notices */

#bbpress-forums div.bbp-template-notice {
	border-radius: var( --sgeg-radius-sm );
	border: 1px solid var( --sgeg-hairline );
	border-left: 4px solid var( --sgeg-cyan );
	background: var( --sgeg-teal-tint );
	color: var( --sgeg-ink );
	padding: 0.9rem 1.1rem;
	margin: 1rem 0;
}

#bbpress-forums div.bbp-template-notice.error {
	border-left-color: var( --sgeg-red );
	background: color-mix( in srgb, var( --sgeg-red ) 8%, var( --sgeg-white ) );
}

/* Pagination */

#bbpress-forums .bbp-pagination-links a,
#bbpress-forums .bbp-pagination-links span.current {
	display: inline-block;
	min-width: 2.25rem;
	padding: 0.4rem 0.6rem;
	margin: 0 0.15rem;
	text-align: center;
	border-radius: var( --sgeg-radius-sm );
	border: 1px solid var( --sgeg-hairline );
	font-size: 0.875rem;
}

#bbpress-forums .bbp-pagination-links span.current {
	background: var( --sgeg-blue );
	border-color: var( --sgeg-blue );
	color: var( --sgeg-white );
	font-weight: 600;
}

/* Breadcrumbs */

#bbpress-forums div.bbp-breadcrumb {
	font-size: 0.8125rem;
	color: var( --sgeg-body );
	margin-bottom: 1rem;
}

#bbpress-forums div.bbp-breadcrumb a {
	color: var( --sgeg-teal );
}

/* ---------------------------------------------------------------------------
   Accessibility
   ------------------------------------------------------------------------ */

.sgeg-community a:focus-visible,
.sgeg-community button:focus-visible {
	outline: 3px solid var( --sgeg-yellow );
	outline-offset: 2px;
	border-radius: 3px;
}

@media ( prefers-reduced-motion: reduce ) {

	.sgeg-community *,
	.sgeg-community *::before,
	.sgeg-community *::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

/* Wide content must scroll inside itself, never break the page. */

.sgeg-community table,
.sgeg-community pre {
	max-width: 100%;
	overflow-x: auto;
	display: block;
}

/* ===========================================================================
   Brand page headers
   The navy band with the yellow-over-teal stripe is the community's signature
   device. It appears on the homepage hero, on every forum page and on search,
   so the whole site reads as one property.
   =========================================================================== */

.sgeg-forum-head,
.sgeg-search-head,
.sgeg-page-head--brand {
	position: relative;
	background: var( --sgeg-blue, #26358C );
	color: #fff;
	padding-block: clamp( 1.75rem, 1.2rem + 2.4vw, 3rem );
	overflow: hidden;
}

/* The stripe: yellow above teal, full bleed. */
.sgeg-forum-head::after,
.sgeg-search-head::after,
.sgeg-page-head--brand::after {
	content: "";
	position: absolute;
	inset-inline: 0;
	bottom: 0;
	height: 10px;
	background: linear-gradient(
		to bottom,
		var( --sgeg-yellow, #F9BE00 ) 0 50%,
		var( --sgeg-cyan, #26BBC1 ) 50% 100%
	);
}

/* Soft brand geometry, echoing the identity artwork. */
.sgeg-forum-head::before,
.sgeg-search-head::before {
	content: "";
	position: absolute;
	width: 190px;
	height: 190px;
	border-radius: 50%;
	background: var( --sgeg-cyan, #26BBC1 );
	opacity: .2;
	top: -70px;
	right: -40px;
	pointer-events: none;
}

.sgeg-forum-head > *,
.sgeg-search-head > * {
	position: relative;
	z-index: 1;
}

.sgeg-forum-head__title,
.sgeg-search-head h1 {
	color: #fff;
	margin: 0;
	font-size: clamp( 1.6rem, 1.2rem + 1.7vw, 2.5rem );
	font-weight: 700;
	letter-spacing: -.02em;
}

.sgeg-forum-head__note {
	margin: .9rem 0 0;
	color: rgba( 255,255,255,.85 );
	font-size: .93rem;
	display: flex;
	align-items: center;
	gap: .6rem;
	flex-wrap: wrap;
}

.sgeg-search-head .sgeg-search { margin-top: 1.5rem; margin-bottom: 0; }

/* Breadcrumbs sitting on the navy band. */
.sgeg-forum-head__crumbs {
	margin-bottom: .75rem;
	font-size: .82rem;
	color: rgba( 255,255,255,.7 );
}

.sgeg-forum-head__crumbs a { color: var( --sgeg-cyan, #26BBC1 ); text-decoration: none; }
.sgeg-forum-head__crumbs a:hover { color: #fff; text-decoration: underline; }
.sgeg-forum-head__crumbs .bbp-breadcrumb-sep { opacity: .5; padding-inline: .3rem; }
.sgeg-forum-head__crumbs #bbpress-forums { margin: 0; }

/* bbPress floats its breadcrumb left. Left unchecked that pulls the page
   heading up alongside it and the two overlap, so the float is cancelled and
   the heading cleared. */
.sgeg-forum-head__crumbs div.bbp-breadcrumb {
	margin: 0;
	float: none;
	clear: both;
	font-size: inherit;
	color: inherit;
}

.sgeg-forum-head__crumbs div.bbp-breadcrumb p { margin: 0; }

.sgeg-forum-head__title { clear: both; }

/* The "Parents only" badge is appended to the forum title by a filter, which
   means it also rides along inside the breadcrumb trail. One badge per page is
   the signal; three is noise. */
.sgeg-forum-head__crumbs .sgeg-badge { display: none; }

/* The "Parents only" badge reads on navy, not just on white. */
.sgeg-forum-head .sgeg-badge--private {
	background: rgba( 255,255,255,.16 );
	border-color: rgba( 255,255,255,.4 );
	color: #fff;
}

/* Hide bbPress's own breadcrumb inside the content area — the branded one in
   the navy header already tells the reader where they are. bbPress emits it as
   a direct child of .bbpress-wrapper, NOT of #bbpress-forums, which is why an
   earlier selector aimed at #bbpress-forums missed it entirely. */
.sgeg-primary .bbpress-wrapper > div.bbp-breadcrumb,
.sgeg-primary > div.bbp-breadcrumb {
	display: none;
}

/* ===========================================================================
   Page headings and search results
   =========================================================================== */

.sgeg-page-head { margin-bottom: 2rem; }
.sgeg-page-head h1 { margin-bottom: .35rem; }
.sgeg-page-head__desc { color: var( --sgeg-body, #4B4F72 ); }

.sgeg-results { display: grid; gap: 1rem; margin-top: 1.25rem; }

.sgeg-result {
	background: #fff;
	border: 1px solid var( --sgeg-hairline, #EEEEF2 );
	border-left: 3px solid var( --sgeg-cyan, #26BBC1 );
	border-radius: var( --sgeg-radius, 12px );
	padding: 1.15rem 1.25rem;
	box-shadow: var( --sgeg-shadow, 0 1px 2px rgba(16,18,46,.04) );
}

.sgeg-result__label {
	font-family: var( --sgeg-font-heading, Poppins, sans-serif );
	font-size: .68rem;
	font-weight: 600;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var( --sgeg-teal, #49989E );
	margin-bottom: .35rem;
}

.sgeg-result__title { font-size: 1.12rem; margin: 0 0 .35rem; }
.sgeg-result__title a { text-decoration: none; }
.sgeg-result__excerpt { margin: 0 0 .5rem; font-size: .93rem; }
.sgeg-result__meta { margin: 0; font-size: .82rem; color: var( --sgeg-body, #4B4F72 ); }

/* ===========================================================================
   Call-to-action band
   =========================================================================== */

.sgeg-cta-band {
	display: grid;
	gap: 1.5rem;
	align-items: center;
	background: var( --sgeg-teal-tint, #E1F1F3 );
	border: 1px solid var( --sgeg-cyan, #26BBC1 );
	border-radius: var( --sgeg-radius, 12px );
	padding: clamp( 1.5rem, 1rem + 2vw, 2.5rem );
}

@media ( min-width: 860px ) {
	.sgeg-cta-band { grid-template-columns: 1.6fr 1fr; }
}

.sgeg-cta-band h2 { margin-bottom: .5rem; }
.sgeg-cta-band p { margin: 0; }

.sgeg-cta-band__actions { display: flex; flex-wrap: wrap; gap: .6rem; }

/* ===========================================================================
   Comments
   =========================================================================== */

.sgeg-comments { margin-top: 3rem; }
.sgeg-comment-list { list-style: none; margin: 0 0 2rem; padding: 0; }
.sgeg-comment-list ol.children { list-style: none; padding-left: 1.25rem; }

.sgeg-comment-list li.comment {
	border: 1px solid var( --sgeg-hairline, #EEEEF2 );
	border-radius: var( --sgeg-radius, 12px );
	padding: 1rem 1.15rem;
	margin-bottom: .85rem;
	background: #fff;
}

/* ===========================================================================
   Widen the forum tables to the branded container
   =========================================================================== */

.sgeg-primary #bbpress-forums { margin-bottom: 0; }
.sgeg-primary #bbpress-forums fieldset.bbp-form { border-radius: var( --sgeg-radius, 12px ); border-color: var( --sgeg-hairline, #EEEEF2 ); }


/* ---------------------------------------------------------------------------
   Official response — supporting parts
   ------------------------------------------------------------------------ */

.sgeg-official-response__body > *:first-child { margin-top: 0; }
.sgeg-official-response__body > *:last-child { margin-bottom: 0; }

.sgeg-official-response__meta {
	margin: 0.9rem 0 0;
	padding-top: 0.75rem;
	border-top: 1px solid var( --sgeg-cyan, #26BBC1 );
	font-size: 0.8rem;
	color: var( --sgeg-teal, #49989E );
}

/* The marking control, shown only to staff who hold the capability. */
.sgeg-official-toggle {
	font-weight: 600;
	color: var( --sgeg-blue, #26358C ) !important;
}

.sgeg-official-toggle:hover,
.sgeg-official-toggle:focus-visible {
	color: var( --sgeg-red, #E31A51 ) !important;
}

/* A reply carrying an official response should not also be wrapped in the
   ordinary reply padding twice over. */
#bbpress-forums div.bbp-reply-content .sgeg-official-response { margin: 0; }

/* On a narrow screen the panel keeps its left rule but loses the extra inset,
   because 1.5rem of padding on a 360px phone costs a lot of reading width. */
@media ( max-width: 600px ) {
	.sgeg-official-response {
		padding: 1rem 0.9rem 1rem 1.1rem;
	}
}


/* ---------------------------------------------------------------------------
   Feedback form — "Tell Us How We're Doing"
   ------------------------------------------------------------------------ */

.sgeg-feedback-form {
	max-width: 640px;
	background: #fff;
	border: 1px solid var( --sgeg-hairline, #EEEEF2 );
	border-radius: var( --sgeg-radius, 12px );
	padding: 1.75rem;
	box-shadow: var( --sgeg-shadow, 0 1px 2px rgba(16,18,46,.04) );
}

.sgeg-feedback-form label {
	display: block;
	margin-bottom: 0.4rem;
	font-size: 0.95rem;
}

.sgeg-feedback-form input[type="text"],
.sgeg-feedback-form input[type="email"],
.sgeg-feedback-form select,
.sgeg-feedback-form textarea {
	width: 100%;
	padding: 0.7rem 0.9rem;
	border: 1px solid var( --sgeg-hairline, #EEEEF2 );
	border-radius: var( --sgeg-radius-sm, 8px );
	font-family: var( --sgeg-font-body, Inter, sans-serif );
	font-size: 1rem;
	color: var( --sgeg-ink, #10122E );
	background: #fff;
	box-sizing: border-box;
}

.sgeg-feedback-form textarea { resize: vertical; min-height: 9rem; }

.sgeg-feedback-form input:focus,
.sgeg-feedback-form select:focus,
.sgeg-feedback-form textarea:focus {
	outline: 3px solid var( --sgeg-yellow, #F9BE00 );
	outline-offset: 1px;
	border-color: var( --sgeg-cyan, #26BBC1 );
}

.sgeg-feedback-form__who {
	font-size: 0.9rem;
	color: var( --sgeg-body, #4B4F72 );
}

/* The privacy promise is part of the form, not fine print beneath it. */
.sgeg-feedback-form__privacy {
	background: var( --sgeg-teal-tint, #E1F1F3 );
	border-left: 3px solid var( --sgeg-cyan, #26BBC1 );
	border-radius: var( --sgeg-radius-sm, 8px );
	padding: 0.9rem 1rem;
	font-size: 0.9rem;
	color: var( --sgeg-ink, #10122E );
}

/* =====================================================================
   KNOWLEDGE BASE
   ---------------------------------------------------------------------
   The article page has a deliberate reading order: answer, then
   explanation, then "did that help", then a way out to a human. The
   styling reinforces it — the answer panel is the loudest thing on the
   page, and the escape hatch is the last.
   ================================================================== */

.sgeg-page-head--kb {
	background: linear-gradient( 135deg, var( --sgeg-blue, #26358C ) 0%, var( --sgeg-navy, #293587 ) 62%, #1B2A78 100% );
	color: #fff;
	padding: 2.6rem 0 2.9rem;
	position: relative;
	overflow: hidden;
}

.sgeg-page-head--kb::after {
	content: "";
	position: absolute;
	right: -80px;
	top: -60px;
	width: 320px;
	height: 320px;
	border-radius: 50%;
	background: rgba( 38, 187, 193, .18 );
	pointer-events: none;
}

.sgeg-page-head--kb h1 {
	color: #fff;
	margin: .4rem 0 .5rem;
	font-size: clamp( 2rem, 4.2vw, 3rem );
	line-height: 1.1;
	position: relative;
}

.sgeg-page-head--kb .sgeg-crumbs,
.sgeg-page-head--kb .sgeg-crumbs a,
.sgeg-page-head--kb .sgeg-page-head__meta {
	color: rgba( 255, 255, 255, .82 );
	font-size: .88rem;
	position: relative;
}

.sgeg-page-head--kb .sgeg-crumbs a:hover { color: var( --sgeg-yellow, #F9BE00 ); }

.sgeg-page-head--kb .sgeg-page-head__lead {
	max-width: 60ch;
	color: rgba( 255, 255, 255, .93 );
	font-size: 1.06rem;
	line-height: 1.6;
	margin: 0 0 .2rem;
	position: relative;
}

.sgeg-page-head__search { margin-top: 1.4rem; max-width: 620px; position: relative; }

/* The short answer. */
.sgeg-answer {
	background: var( --sgeg-teal-tint, #E1F1F3 );
	border-left: 5px solid var( --sgeg-cyan, #26BBC1 );
	border-radius: var( --sgeg-radius, 12px );
	padding: 1.2rem 1.4rem;
	margin: 0 0 1.8rem;
}

.sgeg-answer__label {
	margin: 0 0 .35rem;
	font-family: var( --sgeg-font-heading, Poppins, sans-serif );
	font-size: .74rem;
	font-weight: 700;
	letter-spacing: .09em;
	text-transform: uppercase;
	color: #1A8185;
}

.sgeg-answer__text {
	margin: 0;
	font-size: 1.14rem;
	line-height: 1.55;
	color: var( --sgeg-ink, #10122E );
}

.sgeg-article__image { margin: 0 0 1.6rem; }
.sgeg-article__image img { border-radius: var( --sgeg-radius, 12px ); width: 100%; height: auto; }

.sgeg-article__source {
	margin-top: 1.6rem;
	padding-top: 1rem;
	border-top: 1px solid var( --sgeg-hairline, #EEEEF2 );
	font-size: .92rem;
	color: var( --sgeg-body, #4B4F72 );
}

/* Was this helpful? */
.sgeg-helpful {
	margin: 2.2rem 0 0;
	padding: 1.3rem 1.4rem;
	background: var( --sgeg-surface, #F2F2F2 );
	border-radius: var( --sgeg-radius, 12px );
}

.sgeg-helpful__q { margin: 0 0 .8rem; color: var( --sgeg-ink, #10122E ); }

.sgeg-helpful__actions {
	display: flex;
	flex-wrap: wrap;
	gap: .6rem;
	margin: 0 0 .9rem;
}

.sgeg-helpful__thanks {
	margin: 0 0 .6rem;
	font-weight: 600;
	color: #1A8185;
}

.sgeg-helpful__ask {
	margin: 0;
	font-size: .92rem;
	color: var( --sgeg-body, #4B4F72 );
}

.sgeg-btn--ghost {
	background: #fff;
	color: var( --sgeg-blue, #26358C );
	border: 2px solid var( --sgeg-blue, #26358C );
}

.sgeg-btn--ghost:hover {
	background: var( --sgeg-blue, #26358C );
	color: #fff;
}

/* Lists of articles. */
.sgeg-kb-list { list-style: none; margin: 0; padding: 0; }

.sgeg-kb-list li {
	padding: .7rem 0;
	border-bottom: 1px solid var( --sgeg-hairline, #EEEEF2 );
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: wrap;
}

.sgeg-kb-list li:last-child { border-bottom: 0; }

.sgeg-kb-list__date {
	font-size: .82rem;
	color: var( --sgeg-body, #4B4F72 );
	white-space: nowrap;
}

.sgeg-related { margin-top: 2.4rem; }
.sgeg-related h2 { font-size: 1.3rem; margin-bottom: .6rem; }

.sgeg-card__count {
	display: block;
	margin-top: .7rem;
	font-size: .8rem;
	font-weight: 600;
	color: var( --sgeg-body, #4B4F72 );
}

.sgeg-sidebar .is-current > a {
	font-weight: 700;
	color: var( --sgeg-blue, #26358C );
}

.sgeg-section { margin-bottom: 2.8rem; }

.sgeg-section__title {
	font-size: 1.45rem;
	margin: 0 0 1rem;
	color: var( --sgeg-ink, #10122E );
}

@media ( max-width: 640px ) {
	.sgeg-helpful__actions .sgeg-btn { flex: 1 1 auto; text-align: center; }
}

/* =====================================================================
   MEMBER STANDING
   ---------------------------------------------------------------------
   Role badges are solid and loud: whether you are reading the school or
   another parent is the most important thing about a reply. Contribution
   tiers are quiet outlines — recognition, not a scoreboard.
   ================================================================== */

.sgeg-badges {
	display: inline-flex;
	flex-wrap: wrap;
	gap: .35rem;
	vertical-align: middle;
}

.sgeg-badge--staff {
	background: var( --sgeg-blue, #26358C );
	color: #fff;
}

.sgeg-badge--contributor,
.sgeg-badge--regular,
.sgeg-badge--pillar {
	background: transparent;
	border: 1px solid currentColor;
	font-weight: 600;
}

.sgeg-badge--contributor { color: #3D7E83; }
.sgeg-badge--regular     { color: #1A8185; }
.sgeg-badge--pillar      { color: var( --sgeg-red, #E31A51 ); }

/* The profile summary. */
.sgeg-profile-head {
	background: var( --sgeg-surface, #F2F2F2 );
	border-radius: var( --sgeg-radius, 12px );
	padding: 1.4rem 1.5rem;
	margin: 0 0 1.8rem;
	display: flex;
	flex-wrap: wrap;
	gap: 1.6rem;
	align-items: center;
	justify-content: space-between;
}

.sgeg-profile-head__who {
	display: flex;
	align-items: center;
	gap: 1rem;
	min-width: 0;
}

.sgeg-profile-head__who img {
	border-radius: 50%;
	flex: 0 0 auto;
}

.sgeg-profile-head__name {
	margin: 0 0 .35rem;
	font-size: 1.4rem;
	line-height: 1.2;
}

.sgeg-profile-head__joined {
	margin: .5rem 0 0;
	font-size: .85rem;
	color: var( --sgeg-body, #4B4F72 );
}

.sgeg-profile-head__stats {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 1.8rem;
}

.sgeg-profile-head__stats strong {
	display: block;
	font-family: var( --sgeg-font-heading, Poppins, sans-serif );
	font-size: 1.6rem;
	line-height: 1.1;
	color: var( --sgeg-blue, #26358C );
}

.sgeg-profile-head__stats span {
	font-size: .78rem;
	text-transform: uppercase;
	letter-spacing: .06em;
	color: var( --sgeg-body, #4B4F72 );
}

/* Parents who answer parents. */
.sgeg-contributors { list-style: none; margin: 0; padding: 0; }

.sgeg-contributor {
	display: flex;
	align-items: center;
	gap: .75rem;
	padding: .6rem 0;
	border-bottom: 1px solid var( --sgeg-hairline, #EEEEF2 );
}

.sgeg-contributor:last-child { border-bottom: 0; }
.sgeg-contributor img { border-radius: 50%; flex: 0 0 auto; }

.sgeg-contributor__name {
	font-weight: 600;
	color: var( --sgeg-ink, #10122E );
	flex: 1 1 auto;
	min-width: 0;
}

.sgeg-contributor__count {
	font-size: .8rem;
	color: var( --sgeg-body, #4B4F72 );
	white-space: nowrap;
}

@media ( max-width: 640px ) {
	.sgeg-profile-head { flex-direction: column; align-items: flex-start; }
	.sgeg-profile-head__stats { gap: 1.2rem; }
	.sgeg-profile-head__stats strong { font-size: 1.3rem; }
}

/* Fee tables and similar inside an article: give them a header band and a
   scroll container, so a five-column table on a phone scrolls rather than
   squeezing the page sideways. */
.sgeg-entry__content table {
	margin: 0 0 1.4rem;
	border: 1px solid var( --sgeg-hairline, #EEEEF2 );
	border-radius: var( --sgeg-radius-sm, 8px );
	width: 100%;
	min-width: 22rem;
}

/* The scroll container the_content wraps around every table. Without it a
   three-column fee table is clipped on a phone rather than scrollable. */
.sgeg-table-scroll {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	margin: 0 0 1.4rem;
	border-radius: var( --sgeg-radius-sm, 8px );
}

.sgeg-table-scroll:focus-visible {
	outline: 3px solid var( --sgeg-yellow, #F9BE00 );
	outline-offset: 2px;
}

.sgeg-table-scroll table { margin-bottom: 0; }

.sgeg-entry__content table th {
	background: var( --sgeg-surface, #F2F2F2 );
	font-size: .82rem;
	text-transform: uppercase;
	letter-spacing: .04em;
}

.sgeg-entry__content table tr:last-child td { border-bottom: 0; }

.sgeg-entry__content table td:not(:first-child),
.sgeg-entry__content table th:not(:first-child) {
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

@media ( max-width: 560px ) {
	.sgeg-entry__content table { font-size: .88rem; }
	.sgeg-entry__content th,
	.sgeg-entry__content td { padding: .5rem .55rem; }
}

/* Legal links in the footer bar. */
.sgeg-footer__legal {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 1.1rem;
}

.sgeg-footer__legal a {
	color: rgba( 255, 255, 255, .82 );
	text-decoration: underline;
	text-underline-offset: 2px;
}

.sgeg-footer__legal a:hover,
.sgeg-footer__legal a:focus-visible {
	color: var( --sgeg-yellow, #F9BE00 );
}

/* Social links in the footer. Icons only, with the name carried in
   screen-reader text — an icon alone tells assistive technology nothing. */
.sgeg-social {
	display: flex;
	flex-wrap: wrap;
	gap: .55rem;
	list-style: none;
	margin: 1.1rem 0 0;
	padding: 0;
}

.sgeg-social a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.35rem;
	height: 2.35rem;
	border-radius: 50%;
	background: rgba( 255, 255, 255, .10 );
	color: rgba( 255, 255, 255, .88 );
	transition: background .18s ease, color .18s ease, transform .18s ease;
}

.sgeg-social svg {
	width: 1.15rem;
	height: 1.15rem;
	fill: currentColor;
}

.sgeg-social a:hover,
.sgeg-social a:focus-visible {
	background: var( --sgeg-yellow, #F9BE00 );
	color: var( --sgeg-ink, #10122E );
	transform: translateY( -1px );
}

.sgeg-social a:focus-visible {
	outline: 3px solid var( --sgeg-yellow, #F9BE00 );
	outline-offset: 2px;
}

@media ( prefers-reduced-motion: reduce ) {
	.sgeg-social a { transition: none; }
	.sgeg-social a:hover { transform: none; }
}
