/* =============================================================
   Piwigo Gallery Slider — Hero Layout Styles
   Version: 1.3.0
   ============================================================= */

.pgs-gallery-slider {
	--pgs-accent  : #0073aa;
	--pgs-radius  : 6px;
	position: relative;
	width: 100%;
	margin: 24px 0;
	font-family: inherit;
	box-sizing: border-box;
}

.pgs-gallery-slider *,
.pgs-gallery-slider *::before,
.pgs-gallery-slider *::after {
	box-sizing: inherit;
}

/* ---- Loading / Error / Empty ---- */
.pgs-loading,
.pgs-error,
.pgs-empty {
	text-align: center;
	padding: 40px 20px;
	color: #888;
	font-size: 14px;
}

.pgs-error {
	color: #c0392b;
	background: #fdf0ef;
	border: 1px solid #f5c6c1;
	border-radius: var(--pgs-radius);
}

.pgs-empty {
	background: #f9f9f9;
	border: 1px dashed #ddd;
	border-radius: var(--pgs-radius);
}

.pgs-spinner {
	display: inline-block;
	width: 18px;
	height: 18px;
	border: 3px solid #e0e0e0;
	border-top-color: var(--pgs-accent);
	border-radius: 50%;
	animation: pgs-spin 0.7s linear infinite;
	vertical-align: middle;
	margin-right: 6px;
}

@keyframes pgs-spin {
	to { transform: rotate(360deg); }
}

/* =============================================================
   HERO LAYOUT
   ============================================================= */

.pgs-hero {
	position: relative;
	width: 100%;
	background: #111;
	border-radius: var(--pgs-radius);
	overflow: hidden;
	user-select: none;
}

/* ---- Stage (image area) ---- */
.pgs-hero-stage {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	background: #1a1a1a;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}

.pgs-hero-img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;   /* show full photo, no cropping */
	transition: opacity 0.35s ease;
}

/* Loading spinner inside stage */
.pgs-hero-spinner {
	position: absolute;
	width: 40px;
	height: 40px;
	border: 4px solid rgba(255,255,255,0.15);
	border-top-color: rgba(255,255,255,0.8);
	border-radius: 50%;
	animation: pgs-spin 0.7s linear infinite;
	display: none;
}

/* ---- Overlaid Arrows ---- */
.pgs-hero-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 10;
	width: 52px;
	height: 72px;
	background: rgba(0, 0, 0, 0.35);
	border: none;
	color: #fff;
	font-size: 42px;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	padding: 0;
	transition: background 0.2s ease, opacity 0.2s ease;
	border-radius: 4px;
}

.pgs-hero-prev { left: 0;  border-radius: 0 4px 4px 0; }
.pgs-hero-next { right: 0; border-radius: 4px 0 0 4px; }

.pgs-hero-arrow:hover:not(:disabled) {
	background: rgba(0, 0, 0, 0.65);
}

.pgs-hero-arrow:disabled {
	opacity: 0;
	pointer-events: none;
}

.pgs-hero-arrow:focus-visible {
	outline: 2px solid #fff;
	outline-offset: -3px;
}

/* ---- Footer Bar ---- */
.pgs-hero-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	background: rgba(0, 0, 0, 0.75);
	color: #fff;
	padding: 8px 14px;
	min-height: 38px;
}

.pgs-hero-counter {
	flex-shrink: 0;
	font-size: 13px;
	color: rgba(255,255,255,0.65);
	font-variant-numeric: tabular-nums;
	min-width: 48px;
}

.pgs-hero-caption {
	flex: 1;
	text-align: center;
	font-size: 13px;
	color: rgba(255,255,255,0.9);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	padding: 0 8px;
}

/* Fullscreen / external link button */
.pgs-hero-extlink {
	flex-shrink: 0;
	background: none;
	border: 1px solid rgba(255,255,255,0.3);
	color: rgba(255,255,255,0.75);
	width: 28px;
	height: 28px;
	border-radius: 4px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 16px;
	text-decoration: none;
	cursor: pointer;
	transition: background 0.15s, color 0.15s;
	padding: 0;
	line-height: 1;
}

.pgs-hero-extlink:hover {
	background: rgba(255,255,255,0.15);
	color: #fff;
}

/* ---- Dot navigation ---- */
.pgs-hero-dots {
	display: flex;
	justify-content: center;
	gap: 6px;
	padding: 8px 14px;
	background: rgba(0,0,0,0.65);
	flex-wrap: wrap;
}

.pgs-hero-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: rgba(255,255,255,0.3);
	border: none;
	cursor: pointer;
	padding: 0;
	transition: background 0.2s, transform 0.2s;
	flex-shrink: 0;
}

.pgs-hero-dot:hover {
	background: rgba(255,255,255,0.6);
	transform: scale(1.2);
}

.pgs-hero-dot-active {
	background: #fff;
	transform: scale(1.25);
}

.pgs-hero-dot:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

/* =============================================================
   LIGHTBOX
   ============================================================= */

#pgs-lightbox {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 999999;
	align-items: center;
	justify-content: center;
}

#pgs-lightbox.pgs-lb-open {
	display: flex;
}

.pgs-lb-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.94);
	cursor: zoom-out;
}

.pgs-lb-shell {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
	gap: 16px;
	max-width: 96vw;
	max-height: 96vh;
}

.pgs-lb-stage {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 80px;
	min-height: 80px;
}

.pgs-lb-img {
	display: block;
	max-width: 84vw;
	max-height: 86vh;
	object-fit: contain;
	border-radius: 3px;
	transition: opacity 0.25s ease;
}

.pgs-lb-spinner {
	position: absolute;
	width: 44px;
	height: 44px;
	border: 4px solid rgba(255,255,255,0.15);
	border-top-color: #fff;
	border-radius: 50%;
	animation: pgs-spin 0.7s linear infinite;
}

.pgs-lb-close {
	position: absolute;
	top: -52px;
	right: 0;
	background: none;
	border: none;
	color: rgba(255,255,255,0.8);
	font-size: 42px;
	line-height: 1;
	cursor: pointer;
	padding: 4px 8px;
	transition: color 0.15s, transform 0.15s;
}

.pgs-lb-close:hover {
	color: #fff;
	transform: scale(1.1);
}

.pgs-lb-prev,
.pgs-lb-next {
	flex-shrink: 0;
	width: 52px;
	height: 52px;
	border-radius: 50%;
	border: 2px solid rgba(255,255,255,0.3);
	background: rgba(255,255,255,0.08);
	color: #fff;
	font-size: 34px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	padding: 0;
	transition: background 0.2s, border-color 0.2s;
}

.pgs-lb-prev:hover:not(:disabled),
.pgs-lb-next:hover:not(:disabled) {
	background: rgba(255,255,255,0.2);
	border-color: rgba(255,255,255,0.6);
}

.pgs-lb-prev:disabled,
.pgs-lb-next:disabled {
	opacity: 0.2;
	cursor: default;
}

.pgs-lb-footer {
	position: absolute;
	bottom: -46px;
	left: 0;
	right: 0;
	text-align: center;
}

.pgs-lb-counter {
	font-size: 12px;
	color: rgba(255,255,255,0.45);
	margin-bottom: 3px;
}

.pgs-lb-caption {
	font-size: 13px;
	color: rgba(255,255,255,0.8);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 84vw;
	margin: 0 auto;
}

body.pgs-lb-body-lock {
	overflow: hidden;
}

/* =============================================================
   GUTENBERG EDITOR PREVIEW
   ============================================================= */

.pgs-block-preview {
	background: #1a1a1a;
	border-radius: var(--pgs-radius, 6px);
	padding: 40px 20px;
	text-align: center;
	color: #aaa;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	aspect-ratio: 16 / 9;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
}

.pgs-block-preview .dashicons {
	font-size: 52px !important;
	width: 52px !important;
	height: 52px !important;
	color: #555;
}

.pgs-block-preview p {
	margin: 4px 0;
	font-size: 13px;
	color: #888;
}

.pgs-block-preview strong {
	color: #ccc;
}

/* =============================================================
   RESPONSIVE
   ============================================================= */

@media ( max-width: 600px ) {
	.pgs-hero-arrow {
		width: 38px;
		height: 56px;
		font-size: 30px;
	}

	.pgs-lb-prev,
	.pgs-lb-next {
		width: 38px;
		height: 38px;
		font-size: 22px;
	}

	.pgs-lb-img {
		max-width: 92vw;
		max-height: 78vh;
	}

	.pgs-lb-close {
		font-size: 34px;
		top: -44px;
	}

	.pgs-hero-footer {
		padding: 6px 10px;
	}
}
