/* ========== CSS Variables ========== */

:root {
	--bg-light-override: #f2f2f7;
	--glyph-gray-secondary: #6e6e73;
	--glyph-gray-tertiary: #86868b;

	/* Purple Theme Colors */
	--purple-primary: 49, 32, 112;
	--purple-secondary: 155, 106, 209;
	--purple-light: 242, 235, 250;
	--purple-lighter: 220, 200, 247;

	/* Dark Purple Theme Colors */
	--purple-dark-primary: 18, 9, 49;
	--purple-dark-secondary: 38, 13, 64;
	--purple-dark-light: 21, 9, 35;

	/* Box Shadow Colors */
	--shadow-purple-1: 75, 61, 105;
	--shadow-purple-2: 155, 107, 211;
	--shadow-purple-3: 84, 60, 145;
}

.theme-dark {
	--glyph-gray-secondary: #86868b;
	--glyph-gray-tertiary: #6e6e73;
	--bg-light-override: #000000;
}

.bg-light {
	background-color: var(--bg-light-override) !important;
}

.copy-highlight {
	display: flex;
	justify-content: center;
	flex-direction: column;
	/* align-items: center; */
}

/* ========== Hero ========== */

.clp-hero-heading {
	color: #ffffff;
	white-space: nowrap;
	margin-bottom: 0.5em;
}

.clp-hero-phrase-track {
	display: inline-block;
	position: relative;
	vertical-align: top;
}

.clp-hero-phrase {
	position: absolute;
	top: 0;
	left: 0;
	white-space: nowrap;
	color: #ffffff;
	opacity: 0;
	clip-path: inset(0 100% 0 0);
}

.clp-hero-phrase:nth-child(1) {
	position: relative;
	animation:
		clp-headline-in 20s 0s 1 forwards,
		clp-headline-final 0.8s 20s 1 forwards;
}
.clp-hero-phrase:nth-child(2) {
	animation: clp-headline-in 20s 4s 1 forwards;
}
.clp-hero-phrase:nth-child(3) {
	animation: clp-headline-in 20s 8s 1 forwards;
}
.clp-hero-phrase:nth-child(4) {
	animation: clp-headline-in 20s 12s 1 forwards;
}
.clp-hero-phrase:nth-child(5) {
	animation: clp-headline-in 20s 16s 1 forwards;
}

@keyframes clp-headline-final {
	from {
		opacity: 0;
		clip-path: inset(0 100% 0 0);
		transform: translateY(6px);
	}
	to {
		opacity: 1;
		clip-path: inset(0 0% 0 0);
		transform: translateY(0);
	}
}

.section-clp-hero {
	background: radial-gradient(
		ellipse at top left,
		rgb(165 76 189) 0%,
		rgb(61 40 174) 65%,
		rgba(133, 51, 228, 1) 100%
	);
	position: relative;
	overflow: hidden;
}

/* ========== CTA Section ========== */

.clp-cta-title {
	margin-bottom: 0.7em;
}

/* ========== Mograph ========== */

.clp-mograph {
	display: flex;
	justify-content: center;
	padding: 2.5em 0;
}

.clp-mograph-inner {
	display: flex;
	align-items: center;
	gap: 2.5em;
	width: 100%;
}

.clp-mograph-icon {
	position: relative;
	width: 90px;
	height: 90px;
	flex-shrink: 0;
}

.clp-mograph-sf {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 80px;
	color: white;
	opacity: 0;
}

.clp-mograph-sf:nth-child(1) {
	animation: clp-icon-cycle 15s 0s infinite;
}
.clp-mograph-sf:nth-child(2) {
	animation: clp-icon-cycle 15s 3s infinite;
}
.clp-mograph-sf:nth-child(3) {
	animation: clp-icon-cycle 15s 6s infinite;
}
.clp-mograph-sf:nth-child(4) {
	animation: clp-icon-cycle 15s 9s infinite;
}
.clp-mograph-sf:nth-child(5) {
	animation: clp-icon-cycle 15s 12s infinite;
}

@keyframes clp-icon-cycle {
	0% {
		opacity: 0;
	}
	2% {
		opacity: 0;
	}
	6% {
		opacity: 1;
	}
	15% {
		opacity: 1;
	}
	19% {
		opacity: 0;
	}
	20% {
		opacity: 0;
	}
	100% {
		opacity: 0;
	}
}

.clp-mograph-text {
	display: flex;
	flex-direction: column;
	gap: 0.1em;
	width: 100%;
}

.clp-mograph-label {
	color: rgba(255, 255, 255, 0.5);
	line-height: 1.25;
	text-align: left;
}

.clp-headline-track {
	position: relative;
	height: 1.15em;
	overflow: hidden;
}

.clp-headline {
	position: absolute;
	top: 0;
	left: 0;
	color: #ffffff;
	white-space: nowrap;
	opacity: 0;
	clip-path: inset(0 100% 0 0);
}

.clp-headline:nth-child(1) {
	animation: clp-headline-in 15s 0s infinite;
}
.clp-headline:nth-child(2) {
	animation: clp-headline-in 15s 3s infinite;
}
.clp-headline:nth-child(3) {
	animation: clp-headline-in 15s 6s infinite;
}
.clp-headline:nth-child(4) {
	animation: clp-headline-in 15s 9s infinite;
}
.clp-headline:nth-child(5) {
	animation: clp-headline-in 15s 12s infinite;
}

@keyframes clp-headline-in {
	0% {
		opacity: 0;
		clip-path: inset(0 100% 0 0);
		transform: translateY(6px);
	}
	2% {
		opacity: 1;
		clip-path: inset(0 100% 0 0);
		transform: translateY(0);
	}
	8% {
		opacity: 1;
		clip-path: inset(0 0% 0 0);
		transform: translateY(0);
	}
	16% {
		opacity: 1;
		clip-path: inset(0 0% 0 0);
		transform: translateY(0);
	}
	19.5% {
		opacity: 0;
		clip-path: inset(0 0% 0 0);
		transform: translateY(-8px);
	}
	20% {
		opacity: 0;
		clip-path: inset(0 100% 0 0);
		transform: translateY(6px);
	}
	100% {
		opacity: 0;
		clip-path: inset(0 100% 0 0);
		transform: translateY(6px);
	}
}

/* ========== Member Tiles ========== */

.clp-members-grid {
	visibility: hidden;
}

.clp-grayscale img {
	filter: grayscale(100%);
	transition: filter 0.3s ease;
}

.clp-grayscale .tile-clp-member:hover img {
	filter: grayscale(0%);
}

.tile-clp-member {
	display: flex;
	flex-direction: column;
	padding: 0;
	position: relative;
	transition: box-shadow 0.2s ease-in-out;
}

.tile-clp-member:hover {
	box-shadow:
		0 0 0 1px rgba(0, 0, 0, 0.01),
		0 7px 14px 0 rgba(0, 0, 0, 0.1),
		0 3px 6px 0 rgba(0, 0, 0, 0.02);
}

.tile-clp-member .clp-member-photo {
	width: 100%;
	aspect-ratio: 1 / 1;
	border-radius: var(--sk-tile-border-radius, 12px) var(--sk-tile-border-radius, 12px) 0 0;
	margin: 0;
	flex-shrink: 0;
	overflow: hidden;
	min-height: 210px;
}

.tile-clp-member .tile-content {
	padding: 20px 24px 24px;
	flex: 1;
	display: flex;
	flex-direction: column;
}

/* ========== Member Photo (base) ========== */

.clp-member-photo {
	width: 120px;
	margin: 0 0 2em;
	overflow: hidden;
	background-color: #d2d2d7;
	background-size: cover;
	background-position: center;
	flex-shrink: 0;
}

/* Modal photo overrides base — must come after .clp-member-photo to win on width/margin */
.clp-modal-photo {
	width: 100%;
	aspect-ratio: 1 / 1;
	height: auto;
	border-radius: 18px;
	margin: 0 0 1.5em;
}

@media only screen and (min-width: 735px) {
	#modal-content > div {
		display: grid;
		grid-template-columns: 220px 1fr;
		grid-template-areas:
			"photo name"
			"photo country"
			"photo bio";
		column-gap: 2em;
		align-content: start;
	}

	#modal-content > div .clp-modal-photo {
		grid-area: photo;
		max-width: 100%;
		margin-bottom: 0;
	}

	#modal-content > div .typography-card-headline {
		grid-area: name;
		align-self: end;
	}

	#modal-content > div .clp-member-country {
		grid-area: country;
	}

	#modal-content > div .article-text-wrapper {
		grid-area: bio;
	}
}

.clp-member-photo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: top;
	display: block;
}

/* ========== Quote Tile ========== */

.tile-clp-quote {
	background-color: #fff;
	color: #1a1a1a;
	position: relative;
	overflow: hidden;
	display: flex;
	align-items: center;
}

.tile-clp-quote::before {
	content: "\201C";
	position: absolute;
	top: -20px;
	left: 16px;
	font-size: 160px;
	line-height: 1;
	color: rgba(var(--purple-secondary), 0.12);
	font-family: Georgia, serif;
	pointer-events: none;
	user-select: none;
}

.tile-clp-quote .typography-eyebrow {
	color: #1a1a1a;
	position: relative;
}

.tile-clp-quote .typography-eyebrow b {
	background: linear-gradient(
		135deg,
		rgb(165, 76, 189) 0%,
		rgb(61, 40, 174) 55%,
		rgb(133, 51, 228) 100%
	);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
}

.clp-quote-attribution {
	margin-top: 16px;
	color: rgba(26, 26, 26, 0.6);
}

body[data-color-scheme="dark"] .tile-clp-quote {
	background-color: #1a1a1a;
	color: #f5f5f7;
}

body[data-color-scheme="dark"] .tile-clp-quote::before {
	color: rgba(var(--purple-secondary), 0.15);
}

body[data-color-scheme="dark"] .tile-clp-quote .typography-eyebrow {
	color: #f5f5f7;
}

body[data-color-scheme="dark"] .tile-clp-quote .typography-eyebrow b {
	background: linear-gradient(135deg, rgb(165, 76, 189) 0%, rgb(133, 51, 228) 100%);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
}

body[data-color-scheme="dark"] .clp-quote-attribution {
	color: rgba(245, 245, 247, 0.6);
}

.hero-icon {
	margin-bottom: 0.5em;
	color: #fff;
}

/* ========== Community Events Tile ========== */
.tile-community-events {
	display: flex;
	flex-direction: row;
	min-height: 340px;
	overflow: hidden;
}

.tile-community-events-image {
	flex: 0 0 50%;
	background-image: url("/community/images/feature-community_2x.jpg");
	background-size: cover;
	background-position: center;
}

.tile-community-events-copy {
	flex: 1;
	padding: 2.5em 2.5em 2.5em 2em;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 0.5em;
}

.tile-community-events-copy h4 {
	margin-top: 0;
	margin-bottom: 0.4em;
}

.tile-community-events:hover .more {
	text-decoration: underline;
}

.clp-cta-link {
	margin-top: 1em;
	display: inline-block;
}

@media only screen and (max-width: 734px) {
	.tile-community-events {
		flex-direction: column;
	}

	.tile-community-events-image {
		flex: 0 0 auto;
		height: 240px;
		width: 100%;
	}

	.tile-community-events-copy {
		padding: 1.5em;
	}

	.clp-hero-heading {
		white-space: normal;
	}

	.clp-hero-phrase-track {
		display: block;
		width: fit-content;
		margin-inline: auto;
	}
}

/* ========== Icon Control (plus button) ========== */

.clp-photo-wrap {
	position: relative;
}

.clp-photo-wrap .iconcontrol {
	position: absolute;
	bottom: 10px;
	right: 10px;
	pointer-events: none;
	--sk-iconcontrol-scrim-color: rgb(232, 232, 237);
	--sk-iconcontrol-content-color: rgba(0, 0, 0, 0.56);
}

.theme-dark .clp-photo-wrap .iconcontrol,
body[data-color-scheme="dark"] .clp-photo-wrap .iconcontrol {
	--sk-iconcontrol-scrim-color: rgb(51, 51, 54);
	--sk-iconcontrol-content-color: rgba(255, 255, 255, 0.8);
}
