/**
 * Library card grid — modern preview surfaces.
 */

.joc-blockora-morph-app .bm-lib-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1.75rem;
}

@media (min-width: 640px) {
	.joc-blockora-morph-app .bm-lib-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 1024px) {
	.joc-blockora-morph-app .bm-lib-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 1.85rem;
	}
}

.joc-blockora-morph-app .bm-bento.bm-lib-card,
.joc-blockora-morph-app .bento-card.bm-lib-card {
	position: relative;
	isolation: isolate;
	border-radius: 1.35rem;
	border: 1px solid color-mix(in srgb, var(--bm-color-outline-variant) 42%, transparent);
	background:
		linear-gradient(180deg, #ffffff 0%, #faf8ff 100%);
	box-shadow:
		0 1px 0 rgba(255, 255, 255, 0.9) inset,
		0 1px 2px rgba(53, 37, 205, 0.04),
		0 18px 40px -28px rgba(53, 37, 205, 0.28);
	transition:
		transform 0.35s cubic-bezier(0.2, 0, 0, 1),
		box-shadow 0.35s ease,
		border-color 0.35s ease;
}

.joc-blockora-morph-app .bm-bento.bm-lib-card:hover,
.joc-blockora-morph-app .bento-card.bm-lib-card:hover {
	transform: translateY(-6px);
	border-color: color-mix(in srgb, var(--bm-color-primary) 28%, transparent);
	box-shadow:
		0 1px 0 rgba(255, 255, 255, 0.95) inset,
		0 12px 28px -12px rgba(53, 37, 205, 0.18),
		0 28px 56px -28px rgba(53, 37, 205, 0.32);
}

.joc-blockora-morph-app .bm-lib-card__media {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	border-radius: 1.35rem 1.35rem 0 0;
	background: #fff;
}

.joc-blockora-morph-app .bm-lib-thumb {
	position: absolute;
	inset: 0;
	z-index: 1;
	overflow: hidden;
	border-radius: 0;
	background: #fff;
	box-shadow: none;
	transition:
		transform 0.45s cubic-bezier(0.2, 0, 0, 1),
		box-shadow 0.45s ease;
}

.joc-blockora-morph-app .bm-lib-card:hover .bm-lib-thumb {
	transform: scale(1.03);
	box-shadow: none;
}

.joc-blockora-morph-app .bm-lib-thumb__chrome {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	z-index: 2;
	display: flex;
	align-items: center;
	gap: 0.4rem;
	height: 1.35rem;
	padding: 0 0.7rem;
	background: linear-gradient(180deg, #f4f7fb 0%, #e8eef6 100%);
	border-bottom: 1px solid rgba(53, 37, 205, 0.08);
}

.joc-blockora-morph-app .bm-lib-thumb__dot {
	width: 0.4rem;
	height: 0.4rem;
	border-radius: 50%;
	background: #c7c4d8;
}

.joc-blockora-morph-app .bm-lib-thumb__dot:nth-child(1) {
	background: #f87171;
}

.joc-blockora-morph-app .bm-lib-thumb__dot:nth-child(2) {
	background: #fbbf24;
}

.joc-blockora-morph-app .bm-lib-thumb__dot:nth-child(3) {
	background: #34d399;
}

.joc-blockora-morph-app .bm-lib-thumb__viewport {
	position: absolute;
	inset: 1.35rem 0 0;
	overflow: hidden;
	background: #fff;
}

.joc-blockora-morph-app .bm-lib-thumb__frame-wrap {
	position: absolute;
	inset: 1.35rem 0 0;
}

.joc-blockora-morph-app .bm-lib-thumb__slide .bm-lib-thumb__frame-wrap {
	inset: 0;
}

.joc-blockora-morph-app .bm-lib-thumb__frame-wrap .bm-lib-thumb__viewport {
	inset: 0;
}

.joc-blockora-morph-app .bm-lib-thumb__carousel-viewport {
	position: absolute;
	inset: 1.35rem 0 0;
	overflow: hidden;
	background: #fff;
}

.joc-blockora-morph-app .bm-lib-thumb__track {
	display: flex;
	height: 100%;
	transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
	will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
	.joc-blockora-morph-app .bm-lib-thumb__track {
		transition: none;
	}
}

.joc-blockora-morph-app .bm-lib-thumb__slide {
	position: relative;
	flex: 0 0 auto;
	height: 100%;
	overflow: hidden;
}

.joc-blockora-morph-app .bm-lib-thumb__slide-placeholder {
	position: absolute;
	inset: 0;
	background: #fff;
}

.joc-blockora-morph-app .bm-lib-thumb__pips {
	position: absolute;
	right: 0.55rem;
	bottom: 0.45rem;
	z-index: 3;
	display: flex;
	align-items: center;
	gap: 0.28rem;
	padding: 0.2rem 0.35rem;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.82);
	box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
	pointer-events: none;
}

.joc-blockora-morph-app .bm-lib-thumb__pip {
	width: 0.35rem;
	height: 0.35rem;
	border-radius: 50%;
	background: rgba(53, 37, 205, 0.28);
	transition:
		background 0.2s ease,
		transform 0.2s ease;
}

.joc-blockora-morph-app .bm-lib-thumb__pip.is-active {
	background: var(--bm-color-primary, #3525cd);
	transform: scale(1.15);
}

.joc-blockora-morph-app .bm-lib-thumb__scaler {
	position: absolute;
	top: 0;
	left: 0;
	width: 1280px;
	height: 800px;
	transform-origin: top left;
	/* Fit ~card width: scale is refined by JS; CSS is first-paint only */
	transform: scale(0.28);
	pointer-events: none;
	/* `will-change` here pins a composited layer and softens the preview;
	   the thumbnail promotes itself only while auto-scrolling. */
}

/* Buttons use a 520px design canvas — larger first-paint scale. */
.joc-blockora-morph-app .bm-lib-thumb--button .bm-lib-thumb__scaler {
	width: 520px;
	height: 320px;
	transform: scale(0.68);
}

/* Non-hero/banner sections: slightly zoomed first paint (~1.4×). */
.joc-blockora-morph-app .bm-lib-thumb--other .bm-lib-thumb__scaler {
	transform: scale(0.39);
}

.joc-blockora-morph-app .bm-lib-thumb__frame {
	display: block;
	width: 1280px;
	min-height: 800px;
	height: 800px;
	border: 0;
	background: #fff;
	pointer-events: none;
}

.joc-blockora-morph-app .bm-lib-thumb--button .bm-lib-thumb__frame {
	width: 520px;
	min-height: 320px;
	height: 320px;
}

/* Responsive scale approximations for common card widths */
@media (min-width: 1024px) {
	.joc-blockora-morph-app .bm-lib-thumb__scaler {
		transform: scale(0.255);
	}

	.joc-blockora-morph-app .bm-lib-thumb--button .bm-lib-thumb__scaler {
		transform: scale(0.62);
	}

	.joc-blockora-morph-app .bm-lib-thumb--other .bm-lib-thumb__scaler {
		transform: scale(0.36);
	}
}

@media (max-width: 639px) {
	.joc-blockora-morph-app .bm-lib-thumb__scaler {
		transform: scale(0.42);
	}

	.joc-blockora-morph-app .bm-lib-thumb--button .bm-lib-thumb__scaler {
		transform: scale(0.85);
	}

	.joc-blockora-morph-app .bm-lib-thumb--other .bm-lib-thumb__scaler {
		transform: scale(0.58);
	}
}

.joc-blockora-morph-app .bm-lib-card__scrim {
	position: absolute;
	inset: 0;
	z-index: 2;
	pointer-events: none;
	background: linear-gradient(
		180deg,
		rgba(0, 40, 72, 0.08) 0%,
		transparent 35%,
		transparent 62%,
		rgba(0, 40, 72, 0.12) 100%
	);
	opacity: 0.65;
	transition: opacity 0.3s ease;
}

.joc-blockora-morph-app .bm-lib-card:hover .bm-lib-card__scrim {
	opacity: 1;
	background: linear-gradient(
		180deg,
		rgba(0, 40, 72, 0.18) 0%,
		rgba(53, 37, 205, 0.28) 48%,
		rgba(0, 40, 72, 0.42) 100%
	);
}

.joc-blockora-morph-app .bm-lib-card__overlay {
	position: absolute;
	inset: 0;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transform: translateY(6px);
	transition:
		opacity 0.3s cubic-bezier(0.2, 0, 0, 1),
		transform 0.3s cubic-bezier(0.2, 0, 0, 1);
}

.joc-blockora-morph-app .bm-lib-card:hover .bm-lib-card__overlay {
	opacity: 1;
	transform: translateY(0);
}

.joc-blockora-morph-app .bm-lib-card__preview-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	padding: 0.7rem 1.15rem;
	border-radius: 999px;
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	color: #3525cd;
	background: rgba(255, 255, 255, 0.94);
	box-shadow:
		0 1px 0 rgba(255, 255, 255, 0.8) inset,
		0 12px 28px -10px rgba(0, 24, 48, 0.45);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	transition: transform 0.2s ease, background 0.2s ease;
}

.joc-blockora-morph-app .bm-lib-card:hover .bm-lib-card__preview-btn {
	transform: scale(1.03);
}

.joc-blockora-morph-app .bm-lib-card__preview-btn .dashicons {
	font-size: 1rem;
	width: 1rem;
	height: 1rem;
}

.joc-blockora-morph-app .bm-lib-card__badge {
	position: absolute;
	z-index: 4;
	bottom: 0.85rem;
	left: 0.85rem;
	top: auto;
	padding: 0.28rem 0.55rem;
	border-radius: 999px;
	font-size: 0.62rem;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #fff;
	background: rgba(53, 37, 205, 0.82);
	box-shadow: 0 6px 16px -8px rgba(0, 24, 48, 0.5);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
}

.joc-blockora-morph-app .bm-lib-card__badge.is-primary {
	background: rgba(53, 37, 205, 0.88);
}

.joc-blockora-morph-app .bm-lib-card__badge.is-success {
	background: rgba(22, 163, 74, 0.9);
}

.joc-blockora-morph-app .bm-lib-card__badge.is-secondary {
	background: rgba(70, 72, 212, 0.9);
}

.joc-blockora-morph-app .bm-lib-card__badge.is-warning {
	background: rgba(234, 88, 12, 0.9);
}

.joc-blockora-morph-app .bm-lib-card__badge.is-tertiary {
	background: rgba(62, 62, 62, 0.88);
}

.joc-blockora-morph-app .bm-lib-card__badge.is-muted {
	background: rgba(71, 70, 71, 0.88);
}

.joc-blockora-morph-app .bm-lib-card__pro {
	position: absolute;
	z-index: 4;
	top: 1.05rem;
	right: 1.05rem;
	padding: 0.28rem 0.55rem;
	border-radius: 999px;
	font-size: 0.62rem;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #fff;
	background: linear-gradient(135deg, #4f46e5 0%, #3525cd 100%);
	box-shadow: 0 6px 16px -8px rgba(0, 24, 48, 0.55);
}

.joc-blockora-morph-app .bm-lib-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	padding: 1.15rem 1.25rem 1.25rem;
}

.joc-blockora-morph-app .bm-lib-card__title {
	margin: 0 0 0.4rem;
	font-size: 1.05rem;
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: 1.3;
	color: var(--bm-color-on-background);
}

.joc-blockora-morph-app .bm-lib-card__desc {
	margin: 0 0 1.1rem;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	font-size: 0.875rem;
	line-height: 1.5;
	color: var(--bm-color-on-surface-variant);
}

.joc-blockora-morph-app .bm-lib-card__meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	margin-top: auto;
	padding-top: 0.9rem;
	border-top: 1px solid color-mix(in srgb, var(--bm-color-outline-variant) 35%, transparent);
}

.joc-blockora-morph-app .bm-lib-card__variant {
	font-size: 0.65rem;
	font-weight: 800;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--bm-color-outline);
}

.joc-blockora-morph-app .bm-lib-card__status {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	font-size: 0.65rem;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.joc-blockora-morph-app .bm-lib-card__status.is-ready {
	color: var(--bm-color-success);
}

.joc-blockora-morph-app .bm-lib-card__status.is-locked {
	color: var(--bm-color-outline);
}

.joc-blockora-morph-app .bm-lib-card__status .dashicons {
	font-size: 0.85rem;
	width: 0.85rem;
	height: 0.85rem;
}

.joc-blockora-morph-app .bm-lib-card__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
	margin-top: 0.85rem;
	padding-top: 0.9rem;
	border-top: 1px solid color-mix(in srgb, var(--bm-color-outline-variant) 35%, transparent);
}

@media (prefers-reduced-motion: reduce) {
	.joc-blockora-morph-app .bm-bento.bm-lib-card,
	.joc-blockora-morph-app .bm-lib-thumb,
	.joc-blockora-morph-app .bm-lib-card__overlay,
	.joc-blockora-morph-app .bm-lib-card__preview-btn {
		transition: none;
	}

	.joc-blockora-morph-app .bm-bento.bm-lib-card:hover {
		transform: none;
	}

	.joc-blockora-morph-app .bm-lib-card:hover .bm-lib-thumb {
		transform: none;
	}
}
