/* ============================================================
   ONVORE — Screenshot gallery + lightbox
   Used on every plugin detail page. Falls back to the static
   <figure> grid (set hidden by JS) when JS is unavailable.
   ============================================================ */

.onvore-gallery {
	margin: 0 auto;
	max-width: 1080px;
}

.onvore-gallery__viewer {
	position: relative;
	background: #ffffff;
	border: 1px solid var(--onvore-line);
	border-radius: 18px;
	overflow: hidden;
	box-shadow: 0 18px 50px -22px rgba(26, 14, 46, 0.20);
}

.onvore-gallery__stage {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 10;
	background: linear-gradient(135deg, #fbf6f9 0%, #fff4d6 100%);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 28px;
}

.onvore-gallery__stage > * {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
}

.onvore-gallery__stage img {
	display: block;
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: 8px;
}

.onvore-gallery__stage svg {
	display: block;
	width: 100%;
	height: 100%;
}

.onvore-gallery__nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 44px;
	height: 44px;
	border-radius: 999px;
	background: rgba(14, 10, 31, 0.78);
	color: #ffffff;
	border: 0;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 22px;
	line-height: 1;
	transition: background 0.15s ease, transform 0.15s ease;
	z-index: 2;
}

.onvore-gallery__nav:hover { background: var(--onvore-brand); transform: translateY(-50%) scale(1.05); }
.onvore-gallery__nav:focus { outline: 2px solid var(--onvore-brand); outline-offset: 3px; }
.onvore-gallery__nav--prev { left: 14px; }
.onvore-gallery__nav--next { right: 14px; }
.onvore-gallery__nav[disabled] { opacity: 0.35; cursor: default; pointer-events: none; }

.onvore-gallery__expand {
	position: absolute;
	top: 14px;
	right: 14px;
	width: 36px;
	height: 36px;
	border-radius: 10px;
	background: rgba(14, 10, 31, 0.72);
	color: #ffffff;
	border: 0;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 2;
	transition: background 0.15s ease;
}

.onvore-gallery__expand:hover { background: var(--onvore-brand); }

.onvore-gallery__counter {
	position: absolute;
	top: 14px;
	left: 14px;
	background: rgba(14, 10, 31, 0.72);
	color: #ffffff;
	padding: 6px 12px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.04em;
	z-index: 2;
}

.onvore-gallery__caption {
	padding: 14px 22px 18px;
	border-top: 1px solid var(--onvore-line);
	font-size: 14px;
	font-weight: 600;
	color: var(--onvore-ink-soft);
	min-height: 22px;
}

.onvore-gallery__thumbs {
	display: flex;
	gap: 10px;
	margin-top: 18px;
	overflow-x: auto;
	padding: 4px 4px 12px;
	scroll-snap-type: x mandatory;
}

.onvore-gallery__thumb {
	flex: 0 0 120px;
	aspect-ratio: 16 / 10;
	border-radius: 10px;
	overflow: hidden;
	background: #ffffff;
	border: 2px solid var(--onvore-line);
	cursor: pointer;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	scroll-snap-align: start;
	transition: border-color 0.15s ease, transform 0.15s ease;
}

.onvore-gallery__thumb img,
.onvore-gallery__thumb svg {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.onvore-gallery__thumb:hover { transform: translateY(-2px); }
.onvore-gallery__thumb[aria-selected="true"] { border-color: var(--onvore-brand); box-shadow: 0 6px 18px -8px rgba(189, 30, 81, 0.5); }
.onvore-gallery__thumb:focus { outline: 2px solid var(--onvore-brand); outline-offset: 2px; }

/* Static fallback grid — visible until JS upgrades the section */
.onvore-gallery__seed {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 20px;
}

.onvore-gallery[data-ready="1"] .onvore-gallery__seed {
	display: none;
}

.onvore-gallery:not([data-ready]) .onvore-gallery__viewer,
.onvore-gallery:not([data-ready]) .onvore-gallery__thumbs,
.onvore-gallery:not([data-ready]) .onvore-gallery__caption {
	display: none;
}

/* ============================================================
   Lightbox overlay
   ============================================================ */

.onvore-lightbox {
	position: fixed;
	inset: 0;
	background: rgba(14, 10, 31, 0.92);
	z-index: 9999;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 56px 56px 80px;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease;
}

.onvore-lightbox[data-open="1"] {
	opacity: 1;
	pointer-events: auto;
}

.onvore-lightbox__stage {
	position: relative;
	width: 100%;
	max-width: 1280px;
	max-height: 80vh;
	display: flex;
	align-items: center;
	justify-content: center;
}

.onvore-lightbox__stage img,
.onvore-lightbox__stage svg {
	display: block;
	max-width: 100%;
	max-height: 80vh;
	width: auto;
	height: auto;
	border-radius: 12px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.onvore-lightbox__caption {
	color: #ffffff;
	font-size: 14px;
	font-weight: 600;
	margin-top: 18px;
	text-align: center;
	max-width: 720px;
	min-height: 22px;
}

.onvore-lightbox__close {
	position: absolute;
	top: 18px;
	right: 22px;
	width: 44px;
	height: 44px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.16);
	color: #ffffff;
	border: 0;
	cursor: pointer;
	font-size: 22px;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 2;
}

.onvore-lightbox__close:hover { background: var(--onvore-brand); }
.onvore-lightbox__close:focus { outline: 2px solid var(--onvore-brand); outline-offset: 3px; }

.onvore-lightbox__nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 56px;
	height: 56px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.16);
	color: #ffffff;
	border: 0;
	cursor: pointer;
	font-size: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 2;
}

.onvore-lightbox__nav:hover { background: var(--onvore-brand); }
.onvore-lightbox__nav--prev { left: 22px; }
.onvore-lightbox__nav--next { right: 22px; }
.onvore-lightbox__nav[disabled] { opacity: 0.35; cursor: default; pointer-events: none; }

.onvore-lightbox__counter {
	position: absolute;
	bottom: 22px;
	left: 50%;
	transform: translateX(-50%);
	color: rgba(255, 255, 255, 0.7);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.06em;
}

body.onvore-no-scroll { overflow: hidden; }

@media (max-width: 720px) {
	.onvore-gallery__nav { width: 36px; height: 36px; font-size: 18px; }
	.onvore-gallery__thumb { flex: 0 0 90px; }
	.onvore-lightbox { padding: 48px 16px 64px; }
	.onvore-lightbox__nav { width: 44px; height: 44px; font-size: 22px; }
	.onvore-lightbox__nav--prev { left: 8px; }
	.onvore-lightbox__nav--next { right: 8px; }
}
