/* ==========================================================================
   Posts showcase — dark staggered-grid news section
   Layout pattern: 4 columns with thin dividers, alternating image/text
   stacking, "Know more" line-dot links, paging dots top-right.
   Purple accent to match the site brand.
   ========================================================================== */

.jcu-posts {
	--jcup-accent: #c084e0;
	--jcup-bg: #14101a;
	background:
		radial-gradient(900px 420px at 85% -10%, rgba(104, 38, 126, 0.25), transparent),
		var(--jcup-bg);
	color: #fff;
	padding: 4.5rem 0 5rem;
}

/* "Background glow" toggled off in the widget settings */
.jcu-posts--flat {
	background-image: none;
}

.jcu-posts__inner {
	max-width: 1400px;
	margin: 0 auto;
	padding: 0 1.5rem;
}

/* Header row: kicker + title left, dots right */

.jcu-posts__head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 2rem;
	margin-bottom: 3rem;
}

.jcu-posts__kicker {
	display: block;
	color: var(--jcup-accent);
	font-size: 0.82rem;
	font-weight: 700;
	letter-spacing: 0.28em;
	text-transform: uppercase;
	margin-bottom: 0.6rem;
}

.jcu-posts__title {
	margin: 0;
	font-size: clamp(1.9rem, 4vw, 3rem);
	font-weight: 800;
	line-height: 1.1;
	color: #fff;
}

/* Paging dots — active one gets a ring */

.jcu-posts__dots {
	display: flex;
	align-items: center;
	gap: 1.1rem;
	padding-bottom: 0.6rem;
}

.jcu-posts__dots button {
	position: relative;
	width: 9px;
	height: 9px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.55);
	cursor: pointer;
	transition: background 0.2s;
}

.jcu-posts__dots button:hover {
	background: #fff;
}

.jcu-posts__dots button.is-active {
	background: var(--jcup-accent);
}

.jcu-posts__dots button.is-active::after {
	content: "";
	position: absolute;
	inset: -8px;
	border: 1px solid var(--jcup-accent);
	border-radius: 50%;
}

/* Pages */

.jcu-posts__page {
	display: none;
	grid-template-columns: repeat(4, 1fr);
}

.jcu-posts__page.is-active {
	display: grid;
	animation: jcu-posts-fade 0.45s ease;
}

@keyframes jcu-posts-fade {
	from {
		opacity: 0;
		transform: translateY(10px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

/* Cards with thin dividers between columns */

.jcu-posts__card {
	display: flex;
	flex-direction: column;
	gap: 1.6rem;
	padding: 0 1.8rem;
}

.jcu-posts__card:first-child {
	padding-left: 0;
}

.jcu-posts__card:last-child {
	padding-right: 0;
}

.jcu-posts__card + .jcu-posts__card {
	border-left: 1px solid rgba(255, 255, 255, 0.16);
}

/* Alternating stack: even cards show text first, image below */

.jcu-posts__card--alt .jcu-posts__thumb {
	order: 2;
}

.jcu-posts__card--alt .jcu-posts__body {
	order: 1;
}

.jcu-posts__thumb {
	display: block;
	line-height: 0;
}

.jcu-posts__thumb img {
	width: 100%;
	aspect-ratio: 16 / 10;
	object-fit: cover;
	display: block;
	transition: opacity 0.2s;
}

.jcu-posts__thumb:hover img {
	opacity: 0.85;
}

.jcu-posts__card-title {
	margin: 0 0 0.8rem;
	font-size: 1.45rem;
	font-weight: 800;
	line-height: 1.2;
}

.jcu-posts__card-title a {
	color: #fff !important;
	text-decoration: none;
}

.jcu-posts__card-title a:hover {
	color: var(--jcup-accent) !important;
}

.jcu-posts__excerpt {
	margin: 0 0 1.3rem;
	font-size: 0.95rem;
	font-weight: 300;
	line-height: 1.7;
	color: rgba(255, 255, 255, 0.88);
}

/* "Know more" — line, dot, label */

.jcu-posts__more {
	display: inline-flex;
	align-items: center;
	gap: 0.55rem;
	color: #fff !important;
	font-size: 0.92rem;
	font-weight: 600;
	text-decoration: none;
}

.jcu-posts__more-line {
	width: 34px;
	height: 1px;
	background: rgba(255, 255, 255, 0.7);
	transition: width 0.2s;
}

.jcu-posts__more-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--jcup-accent);
}

.jcu-posts__more:hover .jcu-posts__more-line {
	width: 48px;
}

.jcu-posts__more:hover {
	color: var(--jcup-accent) !important;
}

/* --- Responsive --------------------------------------------------------- */

@media (max-width: 1100px) {
	.jcu-posts__page.is-active {
		grid-template-columns: repeat(2, 1fr) !important;
		row-gap: 3rem;
	}

	.jcu-posts__card {
		padding: 0 1.4rem;
	}

	.jcu-posts__card:nth-child(odd) {
		padding-left: 0;
		border-left: 0;
	}

	.jcu-posts__card:nth-child(even) {
		padding-right: 0;
	}
}

@media (max-width: 640px) {
	.jcu-posts {
		padding: 3rem 0 3.5rem;
	}

	.jcu-posts__head {
		flex-direction: column;
		align-items: flex-start;
		gap: 1.2rem;
		margin-bottom: 2rem;
	}

	.jcu-posts__page.is-active {
		grid-template-columns: 1fr !important;
		row-gap: 2.5rem;
	}

	.jcu-posts__card {
		padding: 0;
		border-left: 0 !important;
	}

	/* On phones, keep a consistent image-first stack */
	.jcu-posts__card--alt .jcu-posts__thumb {
		order: 0;
	}

	.jcu-posts__card--alt .jcu-posts__body {
		order: 1;
	}
}
