/**
 * Base layer — reset, typography and layout primitives.
 *
 * IMPORTANT: everything here is scoped under .sc-page.
 *
 * The parent BuddyBoss stylesheets still render every page that has not been
 * redesigned yet (all 35 legacy pages and 803 posts). A global reset would
 * break them, so the redesigned templates opt in by wrapping their markup in
 * <div class="sc-page">. Once every template is migrated this scope can be
 * lifted to :root.
 */

/* ------------------------------------------------------------------ reset */
.sc-page,
.sc-page *,
.sc-page *::before,
.sc-page *::after {
	box-sizing: border-box;
}

.sc-page {
	margin: 0;
	color: var(--sc-text);
	background: var(--sc-surface);
	font-family: var(--sc-font-body);
	font-size: var(--sc-fs-base);
	line-height: var(--sc-lh-normal);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

.sc-page img,
.sc-page picture,
.sc-page video,
.sc-page svg {
	display: block;
	max-width: 100%;
	height: auto;
}

.sc-page ul,
.sc-page ol {
	margin: 0;
	padding: 0;
	list-style: none;
}

/* -------------------------------------------------------------- typography */
.sc-page h1,
.sc-page h2,
.sc-page h3,
.sc-page h4 {
	margin: 0 0 var(--sc-space-4);
	font-family: var(--sc-font-heading);
	font-weight: var(--sc-fw-bold);
	line-height: var(--sc-lh-tight);
	color: var(--sc-text);
}

.sc-page h1 { font-size: var(--sc-fs-4xl); }
.sc-page h2 { font-size: var(--sc-fs-3xl); }
.sc-page h3 { font-size: var(--sc-fs-2xl); }
.sc-page h4 { font-size: var(--sc-fs-xl); }

.sc-page p {
	margin: 0 0 var(--sc-space-4);
}

.sc-page a {
	color: var(--sc-brand);
	text-decoration: none;
	transition: color var(--sc-transition);
}

.sc-page a:hover,
.sc-page a:focus-visible {
	color: var(--sc-brand-dark);
	text-decoration: underline;
}

/* Visible keyboard focus — never remove this. */
.sc-page :focus-visible {
	outline: 2px solid var(--sc-focus);
	outline-offset: 2px;
	border-radius: var(--sc-radius-sm);
}

.sc-muted { color: var(--sc-text-muted); }

/* ------------------------------------------------------------------ layout */
.sc-container {
	width: 100%;
	max-width: var(--sc-container);
	margin-inline: auto;
	padding-inline: var(--sc-gutter);
}

.sc-container--narrow {
	max-width: var(--sc-container-narrow);
}

.sc-section {
	padding-block: var(--sc-space-9);
}

.sc-section--tight {
	padding-block: var(--sc-space-7);
}

.sc-section--alt {
	background: var(--sc-surface-alt);
}

/* Auto-fitting card grid — no per-breakpoint column juggling needed. */
.sc-grid {
	display: grid;
	gap: var(--sc-space-5);
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.sc-stack > * + * {
	margin-top: var(--sc-space-4);
}

/* ----------------------------------------------------------------- buttons */
.sc-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--sc-space-2);
	padding: var(--sc-space-3) var(--sc-space-5);
	border: 1px solid transparent;
	border-radius: var(--sc-radius-pill);
	background: var(--sc-brand);
	color: var(--sc-text-invert);
	font-size: var(--sc-fs-sm);
	font-weight: var(--sc-fw-medium);
	line-height: 1;
	cursor: pointer;
	transition: background var(--sc-transition), color var(--sc-transition), border-color var(--sc-transition);
}

.sc-btn:hover,
.sc-btn:focus-visible {
	background: var(--sc-brand-dark);
	color: var(--sc-text-invert);
	text-decoration: none;
}

.sc-btn--outline {
	background: transparent;
	border-color: var(--sc-border);
	color: var(--sc-text);
}

.sc-btn--outline:hover,
.sc-btn--outline:focus-visible {
	background: var(--sc-brand-light);
	border-color: var(--sc-brand);
	color: var(--sc-brand-dark);
}

/* ------------------------------------------------------------------- cards */
.sc-card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: var(--sc-surface);
	border: 1px solid var(--sc-border);
	border-radius: var(--sc-radius);
	box-shadow: var(--sc-shadow-sm);
	transition: box-shadow var(--sc-transition), transform var(--sc-transition);
}

.sc-card:hover {
	box-shadow: var(--sc-shadow);
	transform: translateY(-2px);
}

.sc-card__body {
	padding: var(--sc-space-5);
}

/* -------------------------------------------------------------- utilities */
/* Hidden visually but still read by screen readers. */
.sc-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ------------------------------------------------------------ breakpoints */
@media (max-width: 1024px) {
	.sc-page h1 { font-size: var(--sc-fs-3xl); }
	.sc-page h2 { font-size: var(--sc-fs-2xl); }
	.sc-section { padding-block: var(--sc-space-7); }
}

@media (max-width: 768px) {
	.sc-page h1 { font-size: var(--sc-fs-2xl); }
	.sc-section { padding-block: var(--sc-space-6); }
	.sc-grid { gap: var(--sc-space-4); }
}

@media (max-width: 575px) {
	:root { --sc-gutter: 1rem; }
	.sc-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
	.sc-page *,
	.sc-page *::before,
	.sc-page *::after {
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
	}
}
