/* Gallery Slider Block Styles */

/* Improved Placeholder for when no images are added */
.gallery-slider-placeholder {
	text-align: center;
	padding: 80px 20px;
	background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
	border: 2px dashed var(--wp--preset--color--secondary, #ddd);
}

.placeholder-content {
	max-width: 350px;
	margin: 0 auto;
}

.placeholder-icon {
	font-size: 56px;
	margin-bottom: 20px;
	opacity: 0.7;
}

.placeholder-content h4 {
	margin: 0 0 12px 0;
	font-size: 20px;
	color: var(--wp--preset--color--contrast, #333);
}

.placeholder-content p {
	margin: 0;
	color: var(--wp--preset--color--secondary, #666);
	font-size: 15px;
	line-height: 1.5;
}

/* Sidebar Gallery Management Styles */
.gallery-management-section {
	padding: 16px 0;
}

.add-image-button {
	width: 100%;
	justify-content: center;
	margin-bottom: 20px;
}

.no-images-message {
	background: #f8f9fa;
	border-radius: 6px;
	padding: 16px;
	border: 1px dashed #ddd;
}

.gallery-management-item {
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	padding: 16px;
	margin-bottom: 16px;
	background: #fafafa;
	transition: background-color 0.3s ease, border-color 0.3s ease;
}

.gallery-management-item:hover {
	background: #f5f5f5;
	border-color: #ccc;
}

.gallery-item-header {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 16px;
}

.gallery-preview {
	flex-shrink: 0;
}

.gallery-info {
	flex: 1;
}

.gallery-title {
	font-weight: 600;
	font-size: 14px;
	color: #333;
	margin-bottom: 2px;
	display: flex;
	align-items: center;
}

.tall-image-badge {
	font-size: 12px;
	opacity: 0.8;
}

.gallery-filename {
	font-size: 12px;
	color: #666;
	font-family: monospace;
	word-break: break-all;
}

.remove-image-button {
	flex-shrink: 0;
}

.gallery-fields {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.gallery-list {
	background: white;
	border-radius: 6px;
	padding: 20px;
	border: 1px solid #e0e0e0;
}

.gallery-list h4 {
	margin: 0 0 15px 0;
	font-size: 16px;
	font-weight: 600;
	color: var(--wp--preset--color--secondary, #333);
}

.gallery-item-editor {
	display: flex;
	align-items: center;
	gap: 15px;
	padding: 15px;
	border: 1px solid #f0f0f0;
	border-radius: 6px;
	margin-bottom: 10px;
	background: #fafafa;
}

.gallery-item-editor:last-child {
	margin-bottom: 0;
}

.gallery-controls {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

/* Frontend Styles */
.gallery-slider {
	width: 100%;
	overflow: hidden;
}

/* Width alignment classes */
.gallery-slider.alignleft {
	float: left;
	margin-right: var(--wp--preset--spacing--40, 2rem);
	max-width: 50%;
}

.gallery-slider.alignright {
	float: right;
	margin-left: var(--wp--preset--spacing--40, 2rem);
	max-width: 50%;
}

.gallery-slider.aligncenter {
	margin-left: auto;
	margin-right: auto;
	clear: both;
}

.gallery-slider.alignwide {
	width: 100%;
	max-width: var(--wp--style--global--wide-size, 1200px);
	margin-left: auto;
	margin-right: auto;
}

.gallery-slider.alignfull {
	width: 100vw;
	max-width: none;
	margin-left: calc(-50vw + 50%);
	margin-right: calc(-50vw + 50%);
}

.gallery-slider-splide {
	width: 100%;
}

.gallery-slider .splide__track {
	overflow: visible;
}

.gallery-slider .splide__list {
	display: flex;
	align-items: center; /* Center align all slides vertically */
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Continuous Scroll Styles */
.gallery-slider .splide__list[style*="animation"] {
	will-change: transform;
}

/* Cloned slides: prevent clicks but allow hover effects */
.gallery-slider .splide__slide--clone {
	pointer-events: auto; /* Allow hover events */
}

.gallery-slider .splide__slide--clone a {
	pointer-events: none; /* But prevent clicks on links */
}

/* Ensure smooth continuous scroll */
.gallery-slider .splide__list {
	/* Optimize for smooth animations */
	transform: translateZ(0);
	backface-visibility: hidden;
	perspective: 1000px;
}

/* Continuous scroll hover effects - only when pause on hover is enabled */
.gallery-slider.pause-on-hover:hover .splide__list[style*="animation"] {
	animation-play-state: paused !important;
}

/* Ensure slides are visible - include cloned slides */
.gallery-slider .splide__slide,
.gallery-slider .splide__slide--clone {
	visibility: visible !important;
	opacity: 1;
}

.gallery-slider .splide__slide,
.gallery-slider .splide__slide--clone {
	display: flex;
	align-items: center; /* Center align content vertically within each slide */
	justify-content: center;
	padding: 0 10px;
	transition: transform 0.3s ease;
}

.gallery-slide-content {
	display: flex;
	align-items: center; /* Center align the image container vertically */
	justify-content: center;
	width: 100%;
	height: auto;
}

.gallery-image-container {
	width: 100%;
	overflow: hidden;
	background: #f5f5f5;
	position: relative;
	/* Removed transition for hover effects */
}

/* Responsive height system using CSS custom properties */
.gallery-image-container.is-even {
	height: var(--even-height-desktop, 400px);
}

.gallery-image-container.is-uneven {
	height: var(--uneven-height-desktop, 600px);
}

/* Tablet responsive heights */
@media (max-width: 1024px) {
	.gallery-image-container.is-even {
		height: var(--even-height-tablet, 350px) !important;
	}
	
	.gallery-image-container.is-uneven {
		height: var(--uneven-height-tablet, 500px) !important;
	}
}

/* Mobile responsive heights */
@media (max-width: 768px) {
	.gallery-image-container.is-even {
		height: var(--even-height-mobile, 300px) !important;
	}
	
	.gallery-image-container.is-uneven {
		height: var(--uneven-height-mobile, 450px) !important;
	}
}

.gallery-image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	/* Removed transition for hover effects */
	display: block;
}

/* Removed hover effects - no longer needed */

/* Loading state */
.gallery-slider.is-loading {
	opacity: 0.5;
	pointer-events: none;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
	.gallery-slide-content {
		padding: 0 8px;
	}
	
	/* Reset alignment on tablet */
	.gallery-slider.alignleft,
	.gallery-slider.alignright {
		float: none;
		margin-left: auto;
		margin-right: auto;
		max-width: 100%;
	}
}

@media (max-width: 768px) {
	.gallery-slider .splide__slide {
		padding: 0 6px;
	}
	
	.gallery-slider {
		margin: var(--wp--preset--spacing--32, 1.5rem) 0;
	}

	/* Reset all alignment on mobile */
	.gallery-slider.alignfull {
		width: 100%;
		margin-left: 0;
		margin-right: 0;
	}
}

@media (max-width: 480px) {
	.gallery-slider .splide__slide {
		padding: 0 4px;
	}
	
	.gallery-slider {
		margin: var(--wp--preset--spacing--24, 1rem) 0;
	}
}

/* Editor responsive */
@media (max-width: 768px) {
	.gallery-item-editor {
		flex-direction: column;
		align-items: flex-start;
		gap: 10px;
	}
	
	.gallery-controls {
		width: 100%;
	}
	
	.gallery-slider-header {
		flex-direction: column;
		align-items: flex-start;
		gap: 15px;
	}
}

/* Editor-specific styles for better visibility */

/* Make sure editor continuous scroll animations work - but respect pause on hover */
.wp-block-pinkrebel-gallery-slider .splide__list[style*="animation"] {
	animation-play-state: running !important;
}

/* But allow pause on hover to work in editor too */
.wp-block-pinkrebel-gallery-slider.pause-on-hover:hover .splide__list[style*="animation"] {
	animation-play-state: paused !important;
}

/* Override any editor styles that might interfere - include cloned slides */
.editor-styles-wrapper .gallery-slider .splide__slide,
.editor-styles-wrapper .gallery-slider .splide__slide--clone {
	visibility: visible !important;
	opacity: 1 !important;
}

/* Ensure proper overflow for continuous scroll in editor */
.wp-block-pinkrebel-gallery-slider .gallery-slider {
	overflow: hidden !important;
}

.wp-block-pinkrebel-gallery-slider .splide__track {
	overflow: hidden !important;
}

/* Special styling for uneven heights visualization in editor */
.wp-block-pinkrebel-gallery-slider .gallery-image-container {
	position: relative;
}

.wp-block-pinkrebel-gallery-slider .gallery-image-container::after {
	content: '';
	position: absolute;
	top: 0;
	right: 0;
	width: 0;
	height: 0;
	border-top: 15px solid #007cba;
	border-left: 15px solid transparent;
	opacity: 0;
	transition: opacity 0.3s ease;
}

/* Show height indicator for tall images in editor */
.wp-block-pinkrebel-gallery-slider[data-enable-uneven-heights="true"] .gallery-slide-content:nth-child(3n) .gallery-image-container::after {
	opacity: 0.8;
}

/* Removed lightbox-style click indication and zoom icon */
