/* Legend Components Styles */

/* Base Legend Styles */
.layer-legend, .block-editor-block-list__block .layer-legend {
	position: absolute;
	top: 20px;
	right: 20px;
	max-width: 380px;
	background: rgba(255,255,255,0.3);
	border-radius: 4px;
	padding: 8px 15px;
	transition: all 0.3s ease;
	display: flex;
	align-items: center;
	gap: 13px;
}

/* Legend Full Text */
.legend-full {
	position: relative;
	display: none;
	opacity: 0;
	transition: opacity 0.3s ease;
	margin: 10px 0 0 0 !important;
	font-size: 0.9rem !important;
	line-height: 1.5 !important;
	color: var(--wp--preset--color--gray) !important;
}
.block-editor-block-list__block .legend-full {
	display: block !important;
	opacity: 1 !important;
}

/* Expanded Legend State */
.layer-legend.expanded .legend-full {
	display: block;
	opacity: 1;
}

/* Legend Toggle Button */
.legend-toggle, .block-editor-block-list__block .legend-toggle, .block-editor-block-list__block figure {
	margin: 0 !important;
}

.legend-toggle .wp-block-button__link, .block-editor-block-list__block .legend-toggle .wp-block-button__link {
	width: 22px !important;
	height: 22px !important;
	border-radius: 50% !important;
	font-size: 16px !important;
	transition: transform 0.3s ease !important;
	padding: 0 !important;
	min-width: 22px !important;
	line-height: 1 !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	text-align: center !important;
	font-family: Arial, sans-serif !important;
	font-weight: normal !important;
	text-decoration: none !important;
	letter-spacing: 0 !important;
}

/* Expanded Toggle Animation */
.legend-toggle.expanded .wp-block-button__link {
	transform: rotate(45deg);
}

.legend-toggle.expanded:hover .wp-block-button__link {
	transform: rotate(45deg);
}

/* Standalone Legend - Relative Positioning */
.legend-standalone {
	position: relative;
	max-width: 380px;
	background: rgba(255,255,255,0.3);
	border-radius: 4px;
	padding: 8px 15px;
	transition: all 0.3s ease;
	display: flex;
	align-items: center;
	gap: 13px;
}

.legend-standalone.expanded .legend-full {
	display: block;
	opacity: 1;
}

/* Context-specific Legend Positioning */
.parallax-layer .layer-legend, .image-full-container .layer-legend, .block-editor-block-list__block .parallax-layer .layer-legend, .block-editor-block-list__block .image-full-container .layer-legend {
	right: 0;
	padding-right: 36px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
	.layer-legend {
		top: 15px;
		right: 15px;
		max-width: 250px;
		padding: 15px;
	}
	
	.legend-short {
		font-size: 1rem !important;
	}
	
	.legend-full {
		font-size: 0.85rem !important;
	}
	
	.legend-toggle .wp-block-button__link {
		width: 28px !important;
		height: 28px !important;
		font-size: 14px !important;
		min-width: 28px !important;
		display: flex !important;
		align-items: center !important;
		justify-content: center !important;
		text-align: center !important;
	}
	
}

@media (max-width: 403px) {
	.legend-standalone, .layer-legend {
		max-width: 90vw !important;
		justify-content: end;
	}
}