/* Tavern Tools — front-end popup */

.tavern-popup {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 4vw;
	opacity: 0;
	transition: opacity 0.25s ease;
}

.tavern-popup[hidden] {
	display: none;
}

.tavern-popup.is-open {
	opacity: 1;
}

.tavern-popup__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.7);
	cursor: pointer;
}

.tavern-popup__dialog {
	position: relative;
	width: 100%;
	max-height: 92vh;
	transform: translateY(12px);
	transition: transform 0.25s ease;
}

.tavern-popup.is-open .tavern-popup__dialog {
	transform: none;
}

.tavern-popup__dialog:focus {
	outline: none;
}

.tavern-popup__link {
	display: block;
}

.tavern-popup__link:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 3px;
}

.tavern-popup__image {
	display: block;
	width: 100%;
	height: auto;
	max-height: 92vh;
	object-fit: contain;
}

.tavern-popup__close {
	position: absolute;
	top: -14px;
	right: -14px;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 2px solid #fff;
	border-radius: 50%;
	background: #000;
	color: #fff;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.tavern-popup__close:hover {
	background: #333;
}

.tavern-popup__close:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 2px;
}

@media (max-width: 600px) {
	.tavern-popup__close {
		top: -18px;
		right: -6px;
	}
}

.tavern-popup-open,
.tavern-popup-open body {
	overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
	.tavern-popup,
	.tavern-popup__dialog {
		transition: none;
	}
}
