/**
 * Lightbox — Esmeralda + zoom (wheel / pinch)
 */

.ashe-wc-lb {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1.25rem;
}

.ashe-wc-lb[hidden] {
	display: none !important;
}

.ashe-wc-lb__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(20, 24, 22, 0.82);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
}

.ashe-wc-lb__panel {
	position: relative;
	z-index: 1;
	max-width: min(1040px, 100%);
	max-height: min(92vh, 100%);
	width: min(1040px, 100%);
	padding: 1.1rem 1.1rem 1.15rem;
	border-radius: var(--ashe-wc-radius-lg, 12px);
	border: 1px solid var(--ashe-wc-line, #e5e1db);
	background: #fff;
	box-shadow: var(--ashe-wc-shadow, 0 1px 2px rgba(23, 25, 26, 0.04), 0 12px 32px rgba(23, 25, 26, 0.1));
	outline: none;
	overflow: hidden;
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
}

body.ashe-dark-mode .ashe-wc-lb__panel {
	background: var(--ashe-dm-surface, #16181c);
	border-color: var(--ashe-dm-border, #2e3238);
}

.ashe-wc-lb__figure {
	margin: 0;
	width: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	min-height: 0;
}

/* Stage de zoom */
.ashe-wc-lb__stage {
	position: relative;
	width: 100%;
	max-height: min(78vh, 860px);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	border-radius: var(--ashe-wc-radius, 8px);
	touch-action: none;
	cursor: zoom-in;
	user-select: none;
	-webkit-user-select: none;
	background: var(--ashe-wc-paper, #f7f4ef);
}

.ashe-wc-lb__stage.is-zoomed {
	cursor: grab;
}

.ashe-wc-lb__stage.is-zoomed.is-panning,
.ashe-wc-lb__stage.is-panning {
	cursor: grabbing;
}

.ashe-wc-lb__img {
	display: block;
	max-width: 100%;
	max-height: min(78vh, 860px);
	width: auto;
	height: auto;
	margin: 0 auto;
	object-fit: contain;
	border-radius: var(--ashe-wc-radius, 8px);
	transform-origin: center center;
	will-change: transform;
	transition: transform 0.05s linear;
	pointer-events: none; /* eventos no stage */
}

.ashe-wc-lb.is-zoomed .ashe-wc-lb__img {
	transition: none;
}

.ashe-wc-lb__cap {
	margin: 0.85rem 0 0;
	font-size: 0.9rem;
	line-height: 1.5;
	color: var(--ashe-wc-muted, #6f736f);
	font-family: var(--ashe-wc-font-sans, "Open Sans", sans-serif);
	flex: 0 0 auto;
}

.ashe-wc-lb__cap a.ashe-wc-lb__ext {
	color: var(--ashe-wc-moss-deep, #2c3a34);
	text-decoration: underline;
	text-underline-offset: 2px;
	font-weight: 600;
}

.ashe-wc-lb__cap a.ashe-wc-lb__ext:hover,
.ashe-wc-lb__cap a.ashe-wc-lb__ext:focus-visible {
	color: var(--ashe-wc-moss, #455a51);
}

body.ashe-dark-mode .ashe-wc-lb__cap {
	color: var(--ashe-dm-text-2, #b8b4ae);
}

body.ashe-dark-mode .ashe-wc-lb__cap a.ashe-wc-lb__ext {
	color: #cbb79c;
}

body.ashe-dark-mode .ashe-wc-lb__stage {
	background: #12141a;
}

.ashe-wc-lb__close {
	position: absolute;
	top: 0.4rem;
	right: 0.45rem;
	z-index: 3;
	width: 2.25rem;
	height: 2.25rem;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--ashe-wc-muted, #666);
	font-size: 1.4rem;
	line-height: 1;
	cursor: pointer;
}

.ashe-wc-lb__close:hover,
.ashe-wc-lb__close:focus-visible {
	background: var(--ashe-wc-moss-soft, #e8f0ed);
	color: var(--ashe-wc-ink, #222);
}

body.ashe-dark-mode .ashe-wc-lb__close:hover {
	background: rgba(255, 255, 255, 0.08);
	color: var(--ashe-dm-text, #f3f0ec);
}

.ashe-wc-lb__nav {
	position: absolute;
	top: 50%;
	z-index: 3;
	transform: translateY(-50%);
	width: 2.25rem;
	height: 2.25rem;
	border: 1px solid var(--ashe-wc-line, #e5e1db);
	border-radius: 50%;
	background: #fff;
	color: var(--ashe-wc-moss-deep, #2f4840);
	font-size: 1.35rem;
	line-height: 1;
	cursor: pointer;
}

.ashe-wc-lb__nav:hover,
.ashe-wc-lb__nav:focus-visible {
	border-color: var(--ashe-wc-moss, #3d5c52);
	color: var(--ashe-wc-moss, #3d5c52);
}

.ashe-wc-lb__prev {
	left: 0.4rem;
}

.ashe-wc-lb__next {
	right: 0.4rem;
}

body.ashe-dark-mode .ashe-wc-lb__nav {
	background: var(--ashe-dm-elevated, #1f2228);
	border-color: var(--ashe-dm-border, #2e3238);
	color: var(--ashe-dm-text, #f3f0ec);
}

body.ashe-wc-lb-open {
	overflow: hidden;
}

/* Mobile: centrado, imagem grande, zoom pinch */
@media screen and (max-width: 720px) {
	.ashe-wc-lb {
		padding: 0.65rem;
		align-items: center;
		justify-content: center;
	}

	.ashe-wc-lb__panel {
		max-width: 100%;
		width: 100%;
		max-height: min(94vh, 100%);
		padding: 0.85rem 0.65rem 1rem;
		border-radius: 14px;
		margin: 0 auto;
	}

	.ashe-wc-lb__stage {
		max-height: min(76vh, 100%);
		min-height: min(52vh, 420px);
	}

	.ashe-wc-lb__img {
		max-height: min(76vh, 100%);
	}

	.ashe-wc-lb__cap {
		font-size: 0.8rem;
		margin-top: 0.65rem;
		text-align: center;
		width: 100%;
	}

	.ashe-wc-lb__close {
		width: 2.5rem;
		height: 2.5rem;
		top: 0.2rem;
		right: 0.2rem;
	}

	.ashe-wc-lb__nav {
		width: 2.35rem;
		height: 2.35rem;
		font-size: 1.2rem;
	}
}
