/**
 * Gallery Lightbox Styles
 */

/* Prevent body scroll when modal is open */
body.ml-akaro-gallery-modal-open {
	overflow: hidden;
}

/* Modal Container */
.ml-akaro-gallery-modal {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.ml-akaro-gallery-modal.ml-akaro-modal-active {
	opacity: 1;
}

/* Backdrop */
.ml-akaro-modal-backdrop {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: rgba( 0, 0, 0, 0.85 );
	z-index: -1;
}

/* Modal Content */
.ml-akaro-modal-content {
	position: relative;
	z-index: 1;
	width: 90%;
	max-width: 900px;
	max-height: 90vh;
	display: flex;
	flex-direction: column;
	pointer-events: auto;
}

/* Close Button */
.ml-akaro-modal-close {
	position: absolute;
	top: -40px;
	right: 0;
	background: none;
	border: none;
	font-size: 40px;
	color: #fff;
	cursor: pointer;
	padding: 0;
	line-height: 1;
	z-index: 10;
	transition: color 0.2s ease;
}

.ml-akaro-modal-close:hover {
	color: #ccc;
}

@media (max-width: 768px) {
	.ml-akaro-modal-close {
		top: 10px;
		right: 10px;
		font-size: 30px;
	}
}

/* Carousel Container */
.ml-akaro-carousel-container {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 20px;
	width: 100%;
}

@media (max-width: 768px) {
	.ml-akaro-carousel-container {
		gap: 10px;
	}
}

/* Carousel Wrapper */
.ml-akaro-carousel-wrapper {
	flex: 1;
	overflow: hidden;
	position: relative;
	background-color: #000;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 400px;
	max-height: 80vh;
}

@media (max-width: 768px) {
	.ml-akaro-carousel-wrapper {
		min-height: 300px;
	}
}

/* Carousel Inner */
.ml-akaro-carousel-inner {
	position: relative;
	width: 100%;
	height: 100%;
}

/* Slides */
.ml-akaro-slide {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transition: opacity 0.4s ease;
	pointer-events: none;
}

.ml-akaro-slide.ml-akaro-slide-active {
	opacity: 1;
	position: relative;
	pointer-events: auto;
}

.ml-akaro-slide img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	display: block;
}

/* Image Alt Text */
.ml-akaro-image-alt {
	position: absolute;
	bottom: 60px;
	left: 50%;
	transform: translateX( -50% );
	background-color: rgba( 0, 0, 0, 0.7 );
	color: #fff;
	padding: 12px 20px;
	border-radius: 4px;
	font-size: 14px;
	line-height: 1.4;
	pointer-events: none;
	max-width: 80%;
	text-align: center;
	word-wrap: break-word;
	overflow-wrap: break-word;
}

@media (max-width: 768px) {
	.ml-akaro-image-alt {
		font-size: 13px;
		padding: 10px 16px;
		bottom: 50px;
		max-width: 90%;
	}
}

@media (max-width: 480px) {
	.ml-akaro-image-alt {
		font-size: 12px;
		padding: 8px 12px;
		bottom: 45px;
		max-width: 95%;
	}
}

/* Image Counter */
.ml-akaro-image-counter {
	position: absolute;
	bottom: 20px;
	left: 50%;
	transform: translateX( -50% );
	background-color: rgba( 0, 0, 0, 0.6 );
	color: #fff;
	padding: 8px 16px;
	border-radius: 4px;
	font-size: 14px;
	font-weight: 500;
	pointer-events: none;
}

@media (max-width: 768px) {
	.ml-akaro-image-counter {
		font-size: 12px;
		padding: 6px 12px;
		bottom: 10px;
	}
}

/* Carousel Navigation Buttons */
.ml-akaro-carousel-nav {
	background-color: rgba( 255, 255, 255, 0.9 );
	border: none;
	width: 45px;
	height: 45px;
	border-radius: 4px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 24px;
	color: #000;
	transition: background-color 0.2s ease, transform 0.2s ease;
	flex-shrink: 0;
	padding: 0;
	line-height: 1;
}

.ml-akaro-carousel-nav:hover {
	background-color: rgba( 255, 255, 255, 1 );
	transform: scale( 1.05 );
}

.ml-akaro-carousel-nav:active {
	transform: scale( 0.95 );
}

@media (max-width: 768px) {
	.ml-akaro-carousel-nav {
		width: 40px;
		height: 40px;
		font-size: 20px;
	}
}

/* Accessibility: Disable arrows on touch devices */
@media (hover: none) and (pointer: coarse) {
	.ml-akaro-carousel-nav:active {
		transform: none;
	}
}

/* Gallery Images - Add pointer cursor */
.wp-block-gallery img {
	transition: opacity 0.2s ease;
}

/* Only add cursor pointer if lightbox is enabled */
[data-enable-lightbox="true"] .wp-block-gallery img {
	cursor: pointer;
}

/* Responsive adjustments */
@media (max-width: 480px) {
	.ml-akaro-modal-content {
		width: 95%;
	}

	.ml-akaro-carousel-container {
		flex-wrap: wrap;
	}

	.ml-akaro-carousel-wrapper {
		order: 2;
		width: 100%;
		min-height: 250px;
	}

	.ml-akaro-carousel-prev {
		order: 1;
		width: 100%;
	}

	.ml-akaro-carousel-next {
		order: 3;
		width: 100%;
	}
}

/* Print styles */
@media print {
	.ml-akaro-gallery-modal {
		display: none !important;
	}
}
