/* ═══════════════════════════════════════════════════════════════════════════
   Chomo Gallery — Frontend Styles
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── CSS Custom Properties (defaults) ────────────────────────────────────── */
.chomo-gallery-container {
	--chomo-columns: 3;
	--chomo-gap: 10px;
}

/* ─── Grid Layout ─────────────────────────────────────────────────────────── */
.chomo-layout-grid {
	display: grid;
	grid-template-columns: repeat(var(--chomo-columns), 1fr);
	gap: var(--chomo-gap);
}

/* ─── Masonry Layout (CSS column-count) ───────────────────────────────────── */
.chomo-layout-masonry {
	column-count: var(--chomo-columns);
	column-gap: var(--chomo-gap);
}

.chomo-layout-masonry .chomo-gallery-img-wrap {
	break-inside: avoid;
	margin-bottom: var(--chomo-gap);
	display: block;
}

/* ─── Image (scroll-reveal initial state) ─────────────────────────────────── */
.chomo-gallery-img-wrap {
	position: relative;
	display: block;
	overflow: hidden;
	border-radius: 8px;
	background: #f0f0f1;
	text-decoration: none;
	line-height: 0;

	/* Scroll-reveal: start hidden */
	opacity: 0;
	transform: translateY(24px);
	transition:
		opacity 0.55s ease,
		transform 0.55s ease;
}

/* When JS marks the item visible */
.chomo-gallery-img-wrap.chomo-reveal--visible {
	opacity: 1;
	transform: translateY(0);
}

/* Accessibility: honour reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
	.chomo-gallery-img-wrap {
		transform: none;
		transition: opacity 0.3s ease;
	}
}

.chomo-gallery-img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.4s ease;
}

/* ─── Aspect Ratio Overrides (Grid only) ──────────────────────────────────── */
.chomo-ratio-1-1 .chomo-gallery-img-wrap {
	aspect-ratio: 1 / 1;
}

.chomo-ratio-4-3 .chomo-gallery-img-wrap {
	aspect-ratio: 4 / 3;
}

.chomo-ratio-16-9 .chomo-gallery-img-wrap {
	aspect-ratio: 16 / 9;
}

/* ─── Hover Effects ──────────────────────────────────────────────────────── */

/* Zoom */
.chomo-hover-zoom:hover .chomo-gallery-img {
	transform: scale(1.08);
}

/* Fade */
.chomo-hover-fade .chomo-gallery-img {
	opacity: 1;
}

.chomo-hover-fade:hover .chomo-gallery-img {
	opacity: 0.72;
}

/* Overlay with Caption */
.chomo-hover-overlay .chomo-overlay-caption {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	padding: 14px 10px;
	background: linear-gradient(
		to top,
		rgba(0, 0, 0, 0.65) 0%,
		rgba(0, 0, 0, 0) 60%
	);
	opacity: 0;
	transition: opacity 0.35s ease;
	pointer-events: none;
}

.chomo-hover-overlay:hover .chomo-overlay-caption {
	opacity: 1;
}

.chomo-overlay-caption span {
	color: #fff;
	font-size: 13px;
	font-weight: 500;
	line-height: 1.35;
	text-align: center;
}

/* Zoom on overlay hover too */
.chomo-hover-overlay:hover .chomo-gallery-img {
	transform: scale(1.04);
}

/* ─── Caption (below image, non-overlay) ──────────────────────────────────── */
.chomo-caption {
	padding: 8px 4px 4px;
	line-height: 1.4;
}

.chomo-caption span {
	font-size: 13px;
	color: #555;
}

/* ─── Tabs Navigation ─────────────────────────────────────────────────────── */
.chomo-tabs-nav {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 20px;
}

.chomo-tab-btn {
	display: inline-flex;
	align-items: center;
	padding: 8px 18px;
	border: none;
	border-radius: 6px;
	background: #f0f0f1;
	color: #555;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: background-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
	line-height: 1.4;
}

.chomo-tab-btn:hover {
	background: #e2e4e7;
	color: #1d2327;
}

.chomo-tab-btn.active {
	background: #F48E28;
	color: #fff;
}

/* ─── Tab Panels ──────────────────────────────────────────────────────────── */
.chomo-tab-panel {
	display: none;
}

.chomo-tab-panel.active {
	display: block;
	animation: chomoFadeIn 0.35s ease;
}

@keyframes chomoFadeIn {
	from { opacity: 0; transform: translateY(6px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* ─── Empty State ─────────────────────────────────────────────────────────── */
.chomo-gallery-empty {
	text-align: center;
	padding: 40px 20px;
	color: #787c82;
	font-size: 14px;
}

/* ─── Wrapper ─────────────────────────────────────────────────────────────── */
.chomo-gallery-wrapper {
	width: 100%;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Chomo Gallery — Custom Lightbox
   ═══════════════════════════════════════════════════════════════════════════ */

/* Body lock: prevent scroll while lightbox is open. */
.chomo-lb-body-lock {
	overflow: hidden;
}

/* ─── Overlay ─────────────────────────────────────────────────────────────── */
#chomo-lb-overlay {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 999999;
	background: rgba(0, 0, 0, 0.92);
	flex-direction: column;
	align-items: center;
	justify-content: center;
	animation: chomoLbFadeIn 0.22s ease;
}

#chomo-lb-overlay.chomo-lb-open {
	display: flex;
}

@keyframes chomoLbFadeIn {
	from { opacity: 0; }
	to   { opacity: 1; }
}

/* ─── Stage (image area) ──────────────────────────────────────────────────── */
.chomo-lb-stage {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	max-width: 92vw;
	max-height: 82vh;
	min-width: 120px;
	min-height: 80px;
}

/* ─── Image ───────────────────────────────────────────────────────────────── */
.chomo-lb-img {
	display: block;
	max-width: 90vw;
	max-height: 80vh;
	object-fit: contain;
	border-radius: 4px;
	box-shadow: 0 8px 40px rgba(0, 0, 0, 0.7);
	opacity: 0;
	transition: opacity 0.28s ease;
}

.chomo-lb-img.chomo-lb-img-ready {
	opacity: 1;
}

/* ─── Loader spinner ──────────────────────────────────────────────────────── */
.chomo-lb-loader {
	position: absolute;
	width: 40px;
	height: 40px;
	border: 3px solid rgba(255, 255, 255, 0.2);
	border-top-color: #fff;
	border-radius: 50%;
	animation: chomoLbSpin 0.7s linear infinite;
}

@keyframes chomoLbSpin {
	to { transform: rotate(360deg); }
}

/* ─── Controls ────────────────────────────────────────────────────────────── */
.chomo-lb-close,
.chomo-lb-prev,
.chomo-lb-next {
	position: fixed;
	background: rgba(255, 255, 255, 0.1);
	border: 1px solid rgba(255, 255, 255, 0.18);
	border-radius: 50%;
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s ease, transform 0.15s ease;
	line-height: 1;
	font-style: normal;
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
}

.chomo-lb-close:hover,
.chomo-lb-prev:hover,
.chomo-lb-next:hover {
	background: rgba(255, 255, 255, 0.25);
	transform: scale(1.08);
}

.chomo-lb-close {
	top: 16px;
	right: 16px;
	width: 40px;
	height: 40px;
	font-size: 16px;
}

.chomo-lb-prev,
.chomo-lb-next {
	top: 50%;
	transform: translateY(-50%);
	width: 48px;
	height: 48px;
	font-size: 30px;
}

.chomo-lb-prev:hover,
.chomo-lb-next:hover {
	transform: translateY(-50%) scale(1.08);
}

.chomo-lb-prev { left: 16px; }
.chomo-lb-next { right: 16px; }

/* ─── Footer (caption + counter) ─────────────────────────────────────────── */
.chomo-lb-footer {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	margin-top: 14px;
	text-align: center;
	max-width: 90vw;
}

.chomo-lb-caption {
	color: rgba(255, 255, 255, 0.88);
	font-size: 14px;
	line-height: 1.5;
	margin: 0;
}

.chomo-lb-counter {
	color: rgba(255, 255, 255, 0.45);
	font-size: 12px;
}

