/**
 * Character Building page (page-character-building.php): a two-column grid
 * of tinted cards, text and photo alternating top/bottom - the card layout of
 * rushd.sch.id, in this site's tokens. Loaded on top of prestasi.css, which
 * supplies the #story-page tokens and container.
 */

#story-page .cb-section {
	padding: 72px 0 96px;
}

/* Narrower than the shared container (1200px / 90%), so the cards sit
   further in from the screen edges. */
#story-page .cb-section .pr-container {
	width: 1040px;
	max-width: 80%;
}

#story-page .cb-head {
	max-width: 640px;
	margin: 0 auto 40px;
	text-align: center;
}

#story-page .cb-head-title {
	margin: 0 0 10px;
	font-family: 'Inter', sans-serif;
	font-size: 1.9em;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -0.4px;
	color: var(--color-foreground);
}

#story-page .cb-head-sub {
	margin: 0;
	font-size: 0.95em;
	line-height: 1.6;
	color: var(--color-muted-foreground);
}

#story-page .cb-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 24px;
	align-items: stretch;
}

#story-page .cb-card {
	display: flex;
	flex-direction: column;
	gap: 24px;
	padding: 28px;
	border-radius: var(--radius-lg);
	background: linear-gradient(160deg, color-mix(in srgb, var(--color-primary) 12%, var(--color-surface)), var(--color-surface) 70%);
	box-shadow: var(--elevation-2);
}

/* Every second card puts its photo first, so the two columns zig-zag. */
#story-page .cb-card:nth-child(even) {
	flex-direction: column-reverse;
	justify-content: flex-end;
}

#story-page .cb-card-text {
	display: flex;
	flex-direction: column;
}

#story-page .cb-card-tag {
	margin: 0 0 10px;
	font-size: 0.85em;
	font-weight: 600;
	color: var(--color-primary-dark);
}

#story-page .cb-card-title {
	margin: 0 0 12px;
	font-family: 'Inter', sans-serif;
	font-size: 1.5em;
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: -0.3px;
	color: var(--color-foreground);
}

#story-page .cb-card-body {
	margin: 0;
	font-size: 1em;
	line-height: 1.7;
	color: var(--color-muted-foreground);
}

#story-page .cb-card-photo {
	margin: 0;
	border-radius: var(--radius-md);
	overflow: hidden;
	background: var(--color-surface-muted);
	aspect-ratio: 4 / 3;
}

#story-page .cb-card-photo img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* An odd number of cards: the last one spans both columns, text beside photo. */
#story-page .cb-card:last-child:nth-child(odd) {
	grid-column: 1 / -1;
	flex-direction: row;
	align-items: center;
	gap: 40px;
}

#story-page .cb-card:last-child:nth-child(odd) > * {
	flex: 1 1 0;
	min-width: 0;
}

@media (max-width: 800px) {
	#story-page .cb-section {
		padding: 48px 0 72px;
	}

	#story-page .cb-section .pr-container {
		max-width: 88%;
	}

	#story-page .cb-grid {
		grid-template-columns: minmax(0, 1fr);
	}

	#story-page .cb-card,
	#story-page .cb-card:nth-child(even),
	#story-page .cb-card:last-child:nth-child(odd) {
		flex-direction: column;
		align-items: stretch;
		gap: 24px;
		padding: 22px;
	}

	#story-page .cb-card-title {
		font-size: 1.3em;
	}
}
