/**
 * Frontend styles for [mini-banner-categories] shortcode.
 *
 * @package MochabunMiniBannerCategories
 */

/* Wrapper strictly respects Elementor container/column width */
.mmbc-wrap {
	width: 100% !important;
	max-width: 100% !important;
	margin: 0 !important;
	padding: 0 !important;
	box-sizing: border-box;
	container-type: inline-size;
	container-name: mmbc;
}

.mmbc-wrap * {
	box-sizing: border-box;
}

/* Row of 5 columns, filling the container width evenly */
.mmbc-row {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: clamp(8px, 1.2vw, 18px);
	width: 100%;
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

/* Individual Category Banner Column (Proportional aspect ratio 282:139) */
.mmbc-banner {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: flex-start;
	width: 100%;
	min-width: 0;
	aspect-ratio: 282 / 139;
	border-radius: 16px;
	overflow: hidden;
	text-decoration: none !important;
	color: #1a1715 !important;
	background-color: #f4eee9;
	box-sizing: border-box;
	box-shadow: 0 2px 8px rgba(40, 28, 20, 0.04);
	transition: transform 0.28s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.28s ease;
}

.mmbc-banner:hover {
	transform: translateY(-2px);
	box-shadow: 0 10px 25px rgba(40, 28, 20, 0.12);
}

/* Background image filling the entire column (fill-cover, center-center) */
.mmbc-banner__bg {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	overflow: hidden;
	z-index: 1;
	pointer-events: none;
	background-color: #f4eee9;
	background-size: cover;
	background-position: center center;
	background-repeat: no-repeat;
}

.mmbc-banner__bg img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center center;
	transform: scale(1);
	transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
	will-change: transform;
}

/* Hover simple zoom animation */
.mmbc-banner:hover .mmbc-banner__bg img {
	transform: scale(1.08);
}

/* Placeholder icon when no image uploaded */
.mmbc-banner__placeholder {
	display: grid;
	width: 100%;
	height: 100%;
	place-items: center;
	color: #c9bfb8;
}

.mmbc-banner__placeholder svg {
	width: 36px;
	height: 36px;
	fill: currentColor;
	opacity: 0.65;
}

/* Text Content Overlay on Banner */
.mmbc-banner__content {
	position: relative;
	z-index: 2;
	display: flex;
	align-items: center;
	width: 100%;
	height: 100%;
	padding: 10px;
	pointer-events: none;
}

.mmbc-banner__title {
	font-family: 'Nanum Square Neo';
	font-size: 12pt;
	font-weight: 700;
	letter-spacing: 0em;
	text-shadow: none;
	line-height: 1.25;
	color: #1a1715;
	word-break: break-word;
	max-width: 85%;
}

/* Responsive for mobile screens / swipeable touch experience */
@media (max-width: 767px) {
	.mmbc-row {
		display: flex;
		flex-wrap: nowrap;
		overflow-x: auto;
		overflow-y: hidden;
		gap: 12px;
		padding: 4px 2px 14px;
		scroll-snap-type: x mandatory;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: thin;
		scrollbar-color: #d1c8c2 transparent;
	}

	.mmbc-row::-webkit-scrollbar {
		height: 5px;
	}

	.mmbc-row::-webkit-scrollbar-thumb {
		background: #d1c8c2;
		border-radius: 99px;
	}

	.mmbc-banner {
		flex: 0 0 clamp(200px, 62vw, 260px);
		max-width: 80vw;
		aspect-ratio: 282 / 139;
		scroll-snap-align: start;
	}
}

/* Container query for when shortcode is placed in a narrow Elementor column */
@container mmbc (max-width: 580px) {
	.mmbc-row {
		display: flex;
		flex-wrap: nowrap;
		overflow-x: auto;
		overflow-y: hidden;
		gap: 12px;
		padding: 4px 2px 14px;
		scroll-snap-type: x mandatory;
		-webkit-overflow-scrolling: touch;
	}

	.mmbc-banner {
		flex: 0 0 clamp(200px, 62cqi, 260px);
		max-width: 80cqi;
		aspect-ratio: 282 / 139;
		scroll-snap-align: start;
	}
}
