/* Shared design tokens and primitives for every Community Pro block. */

:root {
	--cp-accent: #1877f2;
	--cp-accent-strong: #0f5fd0;
	--cp-accent-soft: #e8f1fe;
	--cp-ink: #0b1220;
	--cp-ink-soft: #5a6474;
	--cp-line: #e4e9f0;
	--cp-surface: #ffffff;
	--cp-surface-soft: #f5f8fc;
	--cp-dark: #0b1220;
	--cp-dark-soft: rgba( 255, 255, 255, 0.66 );
	--cp-dark-line: rgba( 255, 255, 255, 0.12 );
	--cp-radius: 18px;
	--cp-radius-sm: 12px;
	--cp-shadow-sm: 0 1px 2px rgba( 11, 18, 32, 0.06 );
	--cp-shadow-md: 0 2px 4px rgba( 11, 18, 32, 0.04 ), 0 12px 28px -14px rgba( 11, 18, 32, 0.2 );
	--cp-shadow-lg: 0 24px 60px -24px rgba( 11, 18, 32, 0.35 ), 0 4px 12px rgba( 11, 18, 32, 0.06 );
	--cp-max: 1180px;
	--cp-gutter: clamp( 1.25rem, 5vw, 2.5rem );
}

.communitypro-container {
	box-sizing: border-box;
	width: 100%;
	max-width: var( --cp-max );
	margin-inline: auto;
	padding-inline: var( --cp-gutter );
}

.communitypro-section {
	position: relative;
	padding-block: clamp( 4rem, 9vw, 7.5rem );
	color: var( --cp-ink );
	background: var( --cp-surface );
}

.communitypro-section--tight {
	padding-block: clamp( 2.5rem, 5vw, 4rem );
}

.communitypro-section--alt {
	background: var( --cp-surface-soft );
}

.communitypro-section--dark {
	color: #ffffff;
	background:
		radial-gradient( 58rem 30rem at 50% -8%, rgba( 24, 119, 242, 0.5 ), transparent 68% ),
		radial-gradient( 34rem 22rem at 12% 12%, rgba( 124, 92, 255, 0.28 ), transparent 65% ),
		radial-gradient( 34rem 22rem at 90% 6%, rgba( 12, 190, 210, 0.16 ), transparent 65% ),
		var( --cp-dark );
}

/* Section header ---------------------------------------------------------- */

.communitypro-section-header {
	display: grid;
	gap: 1rem;
	max-width: 44rem;
}

.communitypro-section-header.is-center {
	margin-inline: auto;
	text-align: center;
	justify-items: center;
}

.communitypro-section-header__title {
	margin: 0;
	font-size: clamp( 1.85rem, 3.4vw, 2.85rem );
	font-weight: 700;
	line-height: 1.12;
	letter-spacing: -0.025em;
	text-wrap: balance;
}

.communitypro-section-header__text {
	margin: 0;
	max-width: 42rem;
	color: var( --cp-ink-soft );
	font-size: clamp( 1rem, 1.3vw, 1.125rem );
	line-height: 1.65;
}

.communitypro-section--dark .communitypro-section-header__text {
	color: var( --cp-dark-soft );
}

/* Eyebrow badge ----------------------------------------------------------- */

.communitypro-eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	margin: 0;
	padding: 0.35rem 0.85rem;
	border-radius: 999px;
	background: var( --cp-accent-soft );
	color: var( --cp-accent-strong );
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	line-height: 1.4;
	width: fit-content;
}

.communitypro-eyebrow:empty {
	display: none;
}

.communitypro-section--dark .communitypro-eyebrow {
	background: rgba( 255, 255, 255, 0.1 );
	color: #ffffff;
}

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

.communitypro-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 0.8rem 1.5rem;
	border-radius: 999px;
	border: 1px solid transparent;
	font-size: 0.975rem;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease,
		border-color 0.18s ease, color 0.18s ease;
}

.communitypro-button--primary {
	background: var( --cp-accent );
	color: #ffffff;
	box-shadow: 0 10px 24px -12px rgba( 24, 119, 242, 0.9 );
}

.communitypro-button--secondary {
	background: var( --cp-surface );
	border-color: var( --cp-line );
	color: var( --cp-ink );
	box-shadow: var( --cp-shadow-sm );
}

.communitypro-button:focus-visible {
	outline: 2px solid var( --cp-accent );
	outline-offset: 3px;
}

.communitypro-section--dark .communitypro-button--secondary {
	background: rgba( 255, 255, 255, 0.08 );
	border-color: var( --cp-dark-line );
	color: #ffffff;
	box-shadow: none;
}

.communitypro-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
}

/* Icons ------------------------------------------------------------------- */

.communitypro-icon {
	width: 1.25rem;
	height: 1.25rem;
	display: block;
}

.communitypro-icon-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	border-radius: 14px;
	background: var( --cp-accent-soft );
	color: var( --cp-accent-strong );
	transition: transform 0.18s ease, background-color 0.18s ease;
}

.communitypro-icon-badge .communitypro-icon {
	width: 1.35rem;
	height: 1.35rem;
}

.communitypro-section--dark .communitypro-icon-badge {
	background: rgba( 255, 255, 255, 0.1 );
	color: #ffffff;
}

/* Screenshot frame -------------------------------------------------------- */

.communitypro-frame {
	position: relative;
	border-radius: var( --cp-radius );
	background: var( --cp-surface );
	border: 1px solid var( --cp-line );
	box-shadow: var( --cp-shadow-lg );
	overflow: hidden;
}

.communitypro-frame::before {
	content: "";
	display: block;
	height: 2.25rem;
	background: linear-gradient( var( --cp-surface-soft ), var( --cp-surface-soft ) ) padding-box;
	border-bottom: 1px solid var( --cp-line );
}

.communitypro-frame::after {
	content: "";
	position: absolute;
	top: 0.9rem;
	left: 1rem;
	width: 0.5rem;
	height: 0.5rem;
	border-radius: 50%;
	background: #ff5f57;
	box-shadow: 0.85rem 0 0 #febc2e, 1.7rem 0 0 #28c840;
}

.communitypro-frame img {
	display: block;
	width: 100%;
	height: auto;
}

.communitypro-section--dark .communitypro-frame {
	border-color: rgba( 255, 255, 255, 0.14 );
	background: #101a2c;
}

.communitypro-section--dark .communitypro-frame::before {
	background: #16223a;
	border-bottom-color: rgba( 255, 255, 255, 0.1 );
}

.communitypro-no-results {
	margin: 0;
	color: var( --cp-ink-soft );
}

/* Editor helpers ---------------------------------------------------------- */

.wp-block[data-type^="communitypro/"] .communitypro-section {
	padding-block: clamp( 2.5rem, 5vw, 4rem );
}

.communitypro-repeater-item {
	padding: 0.75rem;
	margin-bottom: 0.75rem;
	border: 1px solid #e0e0e0;
	border-radius: 4px;
}
