/**
 * Full-screen image control (core/image + ghostdancersAllowFullscreen).
 */

.ghostdancers-image-fs {
	display: block;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
}

.ghostdancers-image-fs__actions {
	margin-bottom: 0.75rem;
}

.ghostdancers-image-fs__open--btn {
	appearance: none;
	-webkit-appearance: none;
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	width: auto;
	max-width: 100%;
	min-width: 0;
	min-height: 0;
	padding: 0.5rem 1rem;
	margin: 0;
	font-family: var(--gd-font-nav, "Carrois Gothic SC", "Segoe UI", sans-serif);
	font-size: 0.8125rem;
	line-height: 1;
	font-weight: 400;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	white-space: nowrap;
	color: #fff;
	background: rgba(18, 31, 39, 0.95);
	border: 1px solid rgba(255, 255, 255, 0.35);
	border-radius: 4px;
	cursor: pointer;
	text-decoration: none;
	transition: background 0.15s ease, border-color 0.15s ease;
}

.ghostdancers-image-fs__open-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 14px;
	height: 14px;
	margin-top: 1px;
}

.ghostdancers-image-fs__open-icon-svg {
	width: 14px;
	height: 14px;
	display: block;
	vertical-align: middle;
}

.ghostdancers-image-fs__open-label {
	display: inline-block;
	white-space: nowrap;
}

/* Column blocks often carry button styles from core/theme; force fullscreen trigger shape there too. */
.wp-block-columns .ghostdancers-image-fs__open--btn,
.wp-block-column .ghostdancers-image-fs__open--btn {
	display: inline-flex;
	padding: 0.5rem 1rem;
	font-size: 0.8125rem;
	background: rgba(18, 31, 39, 0.95);
	border: 1px solid rgba(255, 255, 255, 0.35);
	border-radius: 4px;
}

.ghostdancers-image-fs__open--btn:hover,
.ghostdancers-image-fs__open--btn:focus-visible {
	background: rgba(40, 56, 64, 0.98);
	border-color: rgba(255, 255, 255, 0.55);
	outline: none;
}

.ghostdancers-image-fs__open--btn:focus-visible {
	box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35);
}

.ghostdancers-image-fs__media {
	position: relative;
	width: 100%;
}

/* Full-viewport overlay */
.ghostdancers-image-fs-overlay {
	position: fixed;
	inset: 0;
	z-index: 500000;
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.ghostdancers-image-fs-overlay__backdrop {
	position: absolute;
	inset: 0;
	margin: 0;
	padding: 0;
	border: none;
	background: rgba(0, 0, 0, 0.9);
	cursor: pointer;
}

/*
 * Inner uses pointer-events: none so clicks pass through to the backdrop — except on
 * interactive children. Scrollbars belong to __stage (not inner), so scrollbar drags
 * hit the stage’s pointer-events: auto and does NOT close the overlay.
 */
.ghostdancers-image-fs-overlay__inner {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	width: 100%;
	height: 100%;
	max-width: 100vw;
	max-height: 100vh;
	max-height: 100dvh;
	box-sizing: border-box;
	padding: 48px 16px 16px;
	pointer-events: none;
}

.ghostdancers-image-fs-overlay__close,
.ghostdancers-image-fs-overlay__stage {
	pointer-events: auto;
}

/* Scroll + image area (receives scrollbar interaction). */
.ghostdancers-image-fs-overlay__stage {
	position: relative;
	flex: 1;
	min-height: 0;
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	box-sizing: border-box;
	touch-action: manipulation;
}

/* Original file pixels — scrolling happens here. */
.ghostdancers-image-fs-overlay__stage--natural {
	display: block;
	overflow: auto;
	overflow-x: auto;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	text-align: center;
	touch-action: pan-x pan-y;
}

.ghostdancers-image-fs-overlay__stage--natural .ghostdancers-image-fs-overlay__img {
	display: inline-block;
	vertical-align: middle;
	max-width: none !important;
	max-height: none !important;
	width: auto !important;
	height: auto !important;
	cursor: zoom-out;
}

.ghostdancers-image-fs-overlay__close {
	position: absolute;
	top: max(12px, env(safe-area-inset-top));
	right: max(12px, env(safe-area-inset-right));
	z-index: 2;
	min-width: 44px;
	min-height: 44px;
	padding: 0 12px;
	border: 1px solid rgba(255, 255, 255, 0.35);
	border-radius: 4px;
	background: rgba(18, 31, 39, 0.95);
	color: #fff;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
}

.ghostdancers-image-fs-overlay__close:hover,
.ghostdancers-image-fs-overlay__close:focus-visible {
	background: rgba(40, 56, 64, 0.98);
	outline: none;
}

/* Fit inside the overlay without scrolling (default after opening). */
.ghostdancers-image-fs-overlay__img.ghostdancers-image-fs-overlay__img--fit {
	max-width: 100%;
	max-height: calc(100vh - 64px);
	max-height: calc(100dvh - 64px);
	width: auto;
	height: auto;
	object-fit: contain;
	display: block;
	margin-left: auto;
	margin-right: auto;
	cursor: zoom-in;
}

/* Allow scroll gestures on the overlay stage (do not block with touch-action: none on body). */
body.ghostdancers-image-fs--open {
	overflow: hidden;
}
