/**
 * Map popup (assets/js/map-popup.js) — Google Maps embed in a native <dialog>.
 * Plain CSS (no build), enqueued by inc/map-popup.php. Same look as the
 * booking notice popup: primary #292521, light bg #F2EEE9.
 */

html.zd-map-popup-open {
	overflow: hidden;
}

.zd-map-popup {
	box-sizing: border-box;
	width: min(56rem, calc(100vw - 2rem));
	max-width: none;
	max-height: calc(100dvh - 4rem);
	margin: auto;
	padding: 0;
	border: 0;
	border-radius: 1.5rem;
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--primary);
	box-shadow: var(--wp--preset--shadow--overlay);
	overflow: hidden;
}

.zd-map-popup[open] {
	animation: zd-map-popup-in 0.2s ease-out;
}

.zd-map-popup::backdrop {
	background: color-mix(in srgb, var(--wp--preset--color--primary) 60%, transparent);
}

.zd-map-popup__panel {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	padding: 1.5rem;
}

.zd-map-popup__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
}

.zd-map-popup__title {
	margin: 0;
	font-size: 1.25rem;
	font-weight: 600;
	line-height: 1.3;
	color: inherit;
}

.zd-map-popup__close {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--wp--preset--color--bg-color-light);
	color: var(--wp--preset--color--primary);
	cursor: pointer;
	transition: opacity 0.2s ease;
}

.zd-map-popup__close:hover {
	opacity: 0.8;
}

.zd-map-popup__frame {
	height: min(32rem, calc(100dvh - 14rem));
	min-height: 16rem;
	border-radius: 1rem;
	overflow: hidden;
	background: var(--wp--preset--color--bg-color-light);
}

.zd-map-popup__frame iframe {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
}

.zd-map-popup__open {
	align-self: flex-start;
	color: var(--wp--preset--color--primary);
	font-size: 1rem;
	font-weight: 500;
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

.zd-map-popup__open:hover {
	opacity: 0.8;
}

.zd-map-popup__close:focus-visible,
.zd-map-popup__open:focus-visible {
	outline: 2px solid var(--wp--preset--color--primary);
	outline-offset: 3px;
}

@keyframes zd-map-popup-in {
	from {
		opacity: 0;
		transform: translateY(1rem);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

/* Phones: bottom sheet across the full width. */
@media (max-width: 767px) {
	.zd-map-popup {
		width: 100vw;
		max-height: 90dvh;
		margin: auto 0 0;
		border-radius: 1.5rem 1.5rem 0 0;
	}

	.zd-map-popup[open] {
		animation-name: zd-map-popup-up;
	}

	.zd-map-popup__panel {
		padding: 1.25rem 1.25rem 1.5rem;
	}

	.zd-map-popup__title {
		font-size: 1.125rem;
	}

	.zd-map-popup__frame {
		height: 60dvh;
	}

	@keyframes zd-map-popup-up {
		from {
			transform: translateY(100%);
		}
		to {
			transform: none;
		}
	}
}
