/**
 * Dining Carousel — frontend styles.
 * Self-contained (no framework needed). Heights are driven by CSS variables
 * set inline per instance: --dc-desktop-h, --dc-mobile-h, --dc-accent.
 */

.dining-carousel {
	--dc-desktop-h: 256px;
	--dc-mobile-h: 220px;
	--dc-accent: #2563eb;
	--dc-title-size: 17px;
	--dc-title-color: #2563eb;
	--dc-radius: 6px;

	position: relative;
	width: 100%;
	background: #fff;
	border: 1px solid #f0f1f3;
	border-radius: var(--dc-radius);
	box-shadow: 0 1px 2px rgba( 0, 0, 0, 0.05 );
	overflow: hidden;
	box-sizing: border-box;
}

.dining-carousel *,
.dining-carousel *::before,
.dining-carousel *::after {
	box-sizing: border-box;
}

/* Header / title bar */
.dining-carousel__header {
	padding: 12px 14px;
	border-bottom: 1px solid #f0f1f3;
	background: #f9fafb;
}

.dining-carousel__title {
	margin: 0;
	font-size: var( --dc-title-size );
	font-weight: 700;
	line-height: 1.2;
	text-transform: uppercase;
	letter-spacing: -0.01em;
	color: var( --dc-title-color );
}

/* Viewport + track */
.dining-carousel__viewport {
	position: relative;
	height: var( --dc-mobile-h );
	overflow: hidden;
}

.dining-carousel__track {
	position: relative;
	height: 100%;
}

/* Slides fade in/out and are stacked */
.dining-carousel__slide {
	position: absolute;
	inset: 0;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.7s ease;
}

.dining-carousel__slide.is-active {
	opacity: 1;
	visibility: visible;
}

/* Images always fit the frame regardless of source size */
.dining-carousel__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
}

.dining-carousel__img--placeholder {
	background: linear-gradient( 135deg, #e5e7eb 0%, #cbd5e1 100% );
}

/* Gradient overlay + text */
.dining-carousel__overlay {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: flex-end;
	padding: 16px;
	background: linear-gradient( to top, rgba( 0, 0, 0, 0.72 ) 0%, rgba( 0, 0, 0, 0.15 ) 55%, transparent 100% );
}

.dining-carousel__info {
	display: flex;
	flex-direction: column;
	gap: 2px;
	max-width: 100%;
}

.dining-carousel__name {
	margin: 0;
	color: #fff;
	font-size: 1.125rem;
	font-weight: 700;
	line-height: 1.15;
	text-shadow: 0 1px 2px rgba( 0, 0, 0, 0.4 );
}

.dining-carousel__address {
	margin: 2px 0 0;
	color: rgba( 255, 255, 255, 0.9 );
	font-size: 0.72rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	line-height: 1.3;
}

.dining-carousel__link,
.dining-carousel__email {
	margin-top: 3px;
	font-size: 0.72rem;
	font-weight: 600;
	color: var( --dc-accent );
	text-decoration: none;
	word-break: break-word;
}

.dining-carousel__link:hover,
.dining-carousel__email:hover {
	text-decoration: underline;
}

.dining-carousel__email {
	color: rgba( 255, 255, 255, 0.85 );
}

/* Navigation arrows */
.dining-carousel__arrow {
	position: absolute;
	top: 50%;
	transform: translateY( -50% );
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: rgba( 255, 255, 255, 0.22 );
	color: #fff;
	cursor: pointer;
	transition: background 0.2s ease;
	-webkit-appearance: none;
	appearance: none;
}

.dining-carousel__arrow:hover,
.dining-carousel__arrow:focus-visible {
	background: rgba( 255, 255, 255, 0.45 );
	outline: none;
}

.dining-carousel__arrow--prev {
	left: 8px;
}

.dining-carousel__arrow--next {
	right: 8px;
}

.dining-carousel__arrow svg {
	width: 22px;
	height: 22px;
}

/* Dots */
.dining-carousel__dots {
	position: absolute;
	bottom: 10px;
	left: 50%;
	transform: translateX( -50% );
	z-index: 3;
	display: flex;
	gap: 8px;
}

.dining-carousel__dot {
	width: 8px;
	height: 8px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: rgba( 255, 255, 255, 0.45 );
	cursor: pointer;
	transition: background 0.2s ease, transform 0.2s ease;
	-webkit-appearance: none;
	appearance: none;
}

.dining-carousel__dot.is-active {
	background: #fff;
	transform: scale( 1.15 );
}

/* Empty state (only shown to editors) */
.dining-carousel--empty {
	padding: 20px;
	text-align: center;
	color: #6b7280;
	font-size: 0.9rem;
}

/* Reduced motion */
@media ( prefers-reduced-motion: reduce ) {
	.dining-carousel__slide {
		transition: none;
	}
}

/* Desktop sizing (768px and up) */
@media ( min-width: 768px ) {
	.dining-carousel__viewport {
		height: var( --dc-desktop-h );
	}

	.dining-carousel__name {
		font-size: 1.25rem;
	}
}
