.cp-bento-outer {
    padding: 22px 20px;
}
.cp-bento-outer--contained {
	max-width: 100%;
	width: 100%;
	margin-left: auto;
	margin-right: auto;
	padding-left: 20px;
	padding-right: 20px;
	box-sizing: border-box;
}

.cp-bento-outer--full {
	width: 100%;
}

.cp-bento-section {
	width: 100%;
}

/* Section header */
.cp-bento-header {
	margin-bottom: 16px;
}
.cp-bento-header h2 {
	margin: 0;
	font-size: 1.4em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.02em;
}
.cp-bento-header h2 a {
	color: inherit;
	text-decoration: none;
}

/* Grid container */
.cp-bento-grid {
	display: grid;
	gap: var(--cp-bento-gap, 8px);
}

/* Grid items */
.cp-bento-item {
	position: relative;
	overflow: hidden;
	min-height: 0;
}

.cp-bento-link {
	display: block;
	position: absolute;
	inset: 0;
	text-decoration: none;
	cursor: pointer;
}

.cp-bento-item img {
	display: block;
	width: 100%;
	height: 100%;
	position: relative;
	z-index: 1;
}

/* Hover effect */
.cp-bento-item img {
	transition: transform 0.35s ease;
}
.cp-bento-item:hover img {
	transform: scale(1.04);
}

/* Label */
.cp-bento-label {
	position: absolute;
	bottom: 20px;
	left: 20px;
    right: 20px;
	z-index: 2;
	display: inline-block;
	padding: 8px 14px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	line-height: 1.2;
	background: var(--fs-color-primary);
	color: #fff;
    border-radius: 8px;
    width: fit-content;
    text-decoration: none;
}

/* Builder-only placeholders — visible only when item has no image/bg in AJAX preview */
.cp-bento-item--placeholder {
	background: repeating-linear-gradient(
		45deg,
		#f5f5f5,
		#f5f5f5 12px,
		#ececec 12px,
		#ececec 24px
	);
	border: 2px dashed #c4c4c4;
}
.cp-bento-placeholder-label {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 2;
	color: #777;
	font-size: 13px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	pointer-events: none;
	text-align: center;
	padding: 12px;
}
.cp-bento-placeholder-label--featured {
	font-size: 16px;
}

/* Featured item: overlay holding heading + text + buttons */
.cp-bento-overlay {
	position: absolute;
	bottom: 20px;
	left: 20px;
	right: 20px;
	z-index: 3;
}

/* Hero mode: overlay covers full card area with diagonal gradient,
   content (children) constrained to 66% to keep right side visible */
.cp-bento-featured--hero .cp-bento-overlay {
	inset: 0;
	right: auto;
	bottom: auto;
	width: 100%;
	max-width: 100%;
	height: 100%;
	padding: 20px;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	background: linear-gradient(
		32.18deg,
		rgba(0, 0, 0, 0.55) 51.86%,
		rgba(0, 0, 0, 0) 92.53%
	);
	border-radius: inherit;
}
.cp-bento-featured--hero .cp-bento-overlay > * {
	max-width: 66%;
}
.cp-bento-heading {
	margin: 0 0 14px;
	font-family: 'agentsans-ultra', 'agentsans-bold', sans-serif;
	font-size: clamp(1.6em, 2.8vw + 0.4em, 2.8em);
	font-weight: 800;
	line-height: 1.05;
	color: #ffffff;
	text-transform: uppercase;
	letter-spacing: 0.01em;
	text-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
	text-wrap: balance;
}

/* Inline color highlights — usable inside featured_heading / featured_text */
.cp-bento-overlay .cp-text-yellow,
.cp-bento-overlay mark.yellow {
	color: #fef100;
	background: transparent;
}
.cp-bento-text {
	margin: 0 0 24px;
	font-size: clamp(0.95em, 0.5vw + 0.85em, 1.15em);
	line-height: 1.4;
	color: #ffffff;
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
	max-width: 90%;
}
.cp-bento-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}
.cp-bento-footnote {
	display: block;
	margin: 14px 0 0;
	font-size: 0.9em;
	font-weight: 700;
	line-height: 1.3;
	color: #ffffff;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
.cp-bento-footnote a {
	color: inherit;
	text-decoration: underline;
}
.cp-bento-footnote a:hover {
	text-decoration: none;
	opacity: 0.85;
}
/* Block-level footnote link — entire area is clickable */
a.cp-bento-footnote--link {
	color: #ffffff;
	text-decoration: none;
	cursor: pointer;
	transition: text-decoration 0.2s ease;
}
a.cp-bento-footnote--link:hover,
a.cp-bento-footnote--link:focus {
	color: #ffffff;
	text-decoration: underline;
}
.cp-bento-actions .cp-bento-label {
	position: static;
	right: auto;
	left: auto;
	bottom: auto;
}
/* Touch / no-hover devices — enforce a comfortable tap target width */
@media (hover: none) {
	.cp-bento-label {
		min-width: 210px;
		text-align: center;
		justify-content: center;
	}
}
.cp-bento-btn-secondary {
	background: #fff !important;
	color: #222 !important;
	border: 1px solid rgba(0, 0, 0, 0.12);
}
.cp-bento-btn-secondary:hover {
	background: #f5f5f5 !important;
}

@media (max-width: 640px) {
	.cp-bento-featured--hero .cp-bento-overlay {
		width: 100%;
		max-width: 100%;
		padding: 16px;
		background: linear-gradient(
			32.18deg,
			rgba(0, 0, 0, 0.65) 51.86%,
			rgba(0, 0, 0, 0) 92.53%
		);
	}
	.cp-bento-featured--hero .cp-bento-overlay > * {
		max-width: 100%;
	}
	.cp-bento-heading {
		font-size: 1.5em;
		margin-bottom: 10px;
	}
	.cp-bento-text {
		font-size: 0.95em;
		margin-bottom: 16px;
	}
}

/* Narrow mobile: stretch both buttons to full width so they're equal size */
@media (max-width: 420px) {
	.cp-bento-actions .cp-bento-label {
		width: 100%;
		box-sizing: border-box;
		text-align: center;
		justify-content: center;
	}
}

@media (min-width: 641px) {
	.cp-bento-featured {
		grid-row: span 2;
	}
}

@media (min-width: 981px) {
	.cp-bento-grid {
		grid-template-columns: 3fr 1fr 1fr;
		grid-template-rows: 220px 220px;
	}

	.cp-bento-item:not(.cp-bento-featured) {
		aspect-ratio: unset;
	}

	.cp-bento-progress {
		display: none;
	}
}
.cp-bento-featured img,
.cp-bento-item {
    border-radius: 8px;
}
@media (min-width: 641px) and (max-width: 980px) {
	.cp-bento-outer {
		padding-top: 20px;
		padding-bottom: 20px;
	}

	.cp-bento-grid {
		grid-template-columns: 1fr 1fr;
		grid-auto-rows: 200px;
	}

	.cp-bento-item:not(.cp-bento-featured) {
		aspect-ratio: unset;
	}

	.cp-bento-progress {
		display: none;
	}
}

@media (max-width: 640px) {
	.cp-bento-grid {
		display: flex;
		overflow-x: auto;
		overflow-y: hidden;
		scroll-snap-type: x mandatory;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
		-ms-overflow-style: none;
		padding-bottom: 2px;
	}
    .cp-bento-featured {
        border-radius: 8px;
    }

    .cp-bento-grid::-webkit-scrollbar {
		display: none;
	}

	.cp-bento-item {
		flex: 0 0 83%;
		scroll-snap-align: start;
		aspect-ratio: 1 / 1;
	}

	.cp-bento-progress {
		position: relative;
		height: 4px;
		background: rgba(0, 0, 0, 0.12);
		border-radius: 2px;
		margin-top: 10px;
	}
	.cp-bento-progress-bar {
		position: absolute;
		top: 0;
		left: 0;
		height: 100%;
		background: var(--fs-color-primary);
		border-radius: 2px;
		width: 0;
		transform: translateX(0);
		transition: transform 80ms linear, width 80ms linear;
		will-change: transform, width;
	}
}

@media (min-width: 641px) {
	.cp-bento-progress {
		display: none;
	}
}