.goku-discover-feed {
	/* Single column by default; widened per breakpoint below so cards stay
	   card-sized instead of stretching across a tablet. Overridable via the
	   shortcode's max_width attribute. */
	--goku-feed-max: 560px;

	/* Inherit the host theme's brand tokens where they exist, so the feed
	   restyles itself automatically if the site is rebranded. Fallbacks keep
	   it sane on themes that don't define them. */
	--goku-brand: var( --thim-body-primary-color, #1cbcc0 );
	--goku-brand-hover: var( --thim-button-hover-color, #1e8b8d );
	--goku-on-brand: var( --thim-button-text-color, #fff );
	--goku-border: var( --thim-border-color, #e6e4df );
	--goku-price: var( --thim-course-price-color, #098ce9 );
	--goku-ink: #1f2430;
	--goku-muted: #7a8290;
	--goku-radius: 14px;

	width: 100%;
	max-width: var( --goku-feed-max );
	margin-left: auto;
	margin-right: auto;
	/* Centres correctly even when the theme wraps the shortcode in a flex container. */
	align-self: center;
	display: flex;
	flex-direction: column;
	padding: 12px 0 40px;
	/* Inherit the theme's typeface (Urbanist here) rather than imposing one. */
	font-family: inherit;
}

/* The host theme may not set border-box globally; scope it so padding never
   pushes cards past the viewport. */
.goku-discover-feed,
.goku-discover-feed *,
.goku-discover-feed *::before,
.goku-discover-feed *::after {
	box-sizing: border-box;
}

/* ---------- grid ---------- */

.goku-discover-list {
	display: grid;
	grid-template-columns: 1fr;
	gap: 22px;
}

.goku-discover-card {
	display: flex;
	flex-direction: column;
	height: 100%;
	border: 1px solid var( --goku-border );
	border-radius: var( --goku-radius );
	overflow: hidden;
	background: #fff;
	/* Long unbroken words (URLs in titles, etc.) must not widen the card. */
	overflow-wrap: break-word;
	word-wrap: break-word;
	box-shadow: 0 1px 2px rgba( 16, 24, 40, 0.04 );

	/* Scroll-in reveal: cards start offset and settle as they enter view.
	   JS adds .is-visible; see the reduced-motion block at the end. */
	opacity: 0;
	transform: translateY( 14px );
	transition:
		opacity 0.55s cubic-bezier( 0.22, 0.61, 0.36, 1 ),
		transform 0.55s cubic-bezier( 0.22, 0.61, 0.36, 1 ),
		box-shadow 0.2s ease;
}

.goku-discover-card.is-visible {
	opacity: 1;
	transform: none;
}

.goku-discover-card.is-visible:hover {
	box-shadow: 0 10px 28px rgba( 16, 24, 40, 0.1 );
	transform: translateY( -3px );
}

/* ---------- media ---------- */

.goku-discover-card__media {
	display: block;
	position: relative;
	background: #f4f5f7;
}

.goku-discover-card__media img {
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	display: block;
	/* Fades in on load so images don't snap into place mid-scroll. */
	opacity: 0;
	transition: opacity 0.4s ease;
}

.goku-discover-card__media img.is-loaded {
	opacity: 1;
}

.goku-discover-card__badge {
	position: absolute;
	top: 10px;
	left: 10px;
	z-index: 1;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	background: rgba( 255, 255, 255, 0.95 );
	color: var( --goku-ink );
	padding: 4px 9px;
	border-radius: 5px;
	line-height: 1.2;
}

/* ---------- body ---------- */

.goku-discover-card__body {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 14px 15px 15px;
	flex: 1;
}

.goku-discover-card__cats {
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
}

.goku-discover-card__cat {
	font-size: 10.5px;
	font-weight: 650;
	line-height: 1;
	color: var( --goku-brand );
	background: color-mix( in srgb, var( --goku-brand ) 11%, transparent );
	border-radius: 999px;
	padding: 4px 8px;
	white-space: nowrap;
}

.goku-discover-card__title {
	margin: 0;
	font-size: clamp( 14px, 1.1vw, 15.5px );
	font-weight: 700;
	line-height: 1.32;
	letter-spacing: -0.005em;
}

.goku-discover-card__title a {
	color: var( --goku-ink );
	text-decoration: none;
	/* Cap at two lines so every card in a row lines up. */
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.goku-discover-card__title a:hover {
	color: var( --goku-brand-hover );
}

.goku-discover-card__meta {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 7px;
	font-size: 12px;
	color: var( --goku-muted );
	font-variant-numeric: tabular-nums;
}

.goku-discover-card__meta i {
	width: 3px;
	height: 3px;
	border-radius: 50%;
	background: currentColor;
	opacity: 0.55;
	flex-shrink: 0;
}

.goku-discover-card__footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	flex-wrap: wrap;
	margin-top: auto;
	padding-top: 12px;
	border-top: 1px solid var( --goku-border );
}

.goku-discover-card__price {
	font-weight: 700;
	font-size: clamp( 15px, 1.2vw, 16px );
	color: var( --goku-price );
	font-variant-numeric: tabular-nums;
}

.goku-discover-card__cta {
	background: var( --goku-brand );
	color: var( --goku-on-brand ) !important;
	text-decoration: none;
	padding: 8px 16px;
	border-radius: 999px;
	font-size: 12.5px;
	font-weight: 700;
	line-height: 1.4;
	white-space: nowrap;
	transition: background-color 0.15s ease;
}

.goku-discover-card__cta:hover,
.goku-discover-card__cta:focus {
	background: var( --goku-brand-hover );
	color: var( --goku-on-brand ) !important;
}

.goku-discover-card__cta:focus-visible,
.goku-discover-card__title a:focus-visible {
	outline: 2px solid var( --goku-brand );
	outline-offset: 2px;
}

/* ---------- feed furniture ---------- */

.goku-discover-sentinel {
	height: 1px;
}

.goku-discover-status {
	text-align: center;
	color: var( --goku-muted );
	font-size: 13px;
	padding: 22px 0 0;
	margin: 0;
}

/* ---------- breakpoints ---------- */

/* Phones: edge-to-edge with a comfortable tap target. */
@media (max-width: 600px) {
	.goku-discover-feed {
		max-width: 100%;
		padding: 8px 12px 32px;
	}

	.goku-discover-list {
		gap: 18px;
	}

	.goku-discover-card {
		border-radius: 12px;
	}

	.goku-discover-card__cta {
		min-height: 44px;
		display: inline-flex;
		align-items: center;
		padding: 8px 18px;
	}
}

/* Very narrow phones: give the CTA its own row rather than cramping it. */
@media (max-width: 360px) {
	.goku-discover-card__cta {
		width: 100%;
		justify-content: center;
	}
}

/* Tablets and small laptops: two across. */
@media (min-width: 900px) {
	.goku-discover-feed {
		--goku-feed-max: 940px;
	}

	.goku-discover-list {
		grid-template-columns: repeat( 2, 1fr );
	}
}

/* Desktop: three across. */
@media (min-width: 1200px) {
	.goku-discover-feed {
		--goku-feed-max: 1200px;
	}

	.goku-discover-list {
		grid-template-columns: repeat( 3, 1fr );
		gap: 26px;
	}
}

/* ---------- motion opt-out ---------- */

@media (prefers-reduced-motion: reduce) {
	.goku-discover-card {
		opacity: 1;
		transform: none;
		transition: none;
	}

	.goku-discover-card.is-visible:hover {
		transform: none;
	}

	.goku-discover-card__media img {
		opacity: 1;
		transition: none;
	}

	.goku-discover-card__cta {
		transition: none;
	}
}
