/* ── CAHOPE Gallery ───────────────────────────────────────────────────── */

:root {
	--cgal-size:        280px;
	--cgal-gap:         16px;
	--cgal-radius:      16px;
	--cgal-overlay:     rgba(30,45,77,0.55);
	--cgal-overlay-dur: 0.35s;
}

/* ── Wrapper ─────────────────────────────────────────────────────────── */

.cgal-wrap {
	width: 100%;
	overflow: hidden;
	position: relative;
}

/* ── Track ───────────────────────────────────────────────────────────── */

.cgal-track {
	overflow: hidden;
	width: 100%;
}

/* ── Scrolling list ──────────────────────────────────────────────────── */

.cgal-list {
	display: flex;
	gap: var(--cgal-gap);
	width: max-content;
	will-change: transform;
}

/* Direction animations */
@keyframes cgal-scroll-left {
	from { transform: translateX(0); }
	to   { transform: translateX(-50%); }
}

@keyframes cgal-scroll-right {
	from { transform: translateX(-50%); }
	to   { transform: translateX(0); }
}

.cgal-list[data-anim="left"] {
	animation: cgal-scroll-left linear infinite;
}

.cgal-list[data-anim="right"] {
	animation: cgal-scroll-right linear infinite;
}

/* Pause scrolling on hover */
.cgal-wrap:hover .cgal-list {
	animation-play-state: paused;
}

/* ── Individual Image Item ───────────────────────────────────────────── */

.cgal-item {
	position: relative;
	width:  var(--cgal-size);
	height: var(--cgal-size);
	border-radius: var(--cgal-radius);
	overflow: hidden;
	flex-shrink: 0;
	cursor: pointer;
	transition: transform 0.5s ease;
}

.cgal-img {
	position: absolute !important;
	inset: 0 !important;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	max-height: none !important;
	object-fit: cover !important;
	object-position: center center !important;
	display: block !important;
	pointer-events: none;
}


/* ── Overlay ─────────────────────────────────────────────────────────── */

.cgal-overlay {
	position: absolute;
	inset: 0;
	background: var(--cgal-overlay);
	border-radius: inherit;
	transition: opacity var(--cgal-overlay-dur) ease;
	pointer-events: none;
}

.cgal-item:hover .cgal-overlay {
	opacity: 0;
}

/* ── Zoom icon ───────────────────────────────────────────────────────── */

.cgal-zoom {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%) scale(0.7);
	opacity: 0;
	transition: opacity var(--cgal-overlay-dur) ease, transform var(--cgal-overlay-dur) ease;
	color: #ffffff;
	pointer-events: none;
}

.cgal-zoom svg {
	width: 36px;
	height: 36px;
	filter: drop-shadow(0 2px 8px rgba(0,0,0,0.4));
}

.cgal-item:hover .cgal-zoom {
	opacity: 1;
	transform: translate(-50%, -50%) scale(1);
}

/* ════════════════════════════════════════════════════════════════════════
   LIGHTBOX
   ════════════════════════════════════════════════════════════════════════ */

.cgal-lb {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 99999;
	background: var(--cgal-lb-bg, rgba(0,0,0,0.92));
	align-items: center;
	justify-content: center;
	padding: 24px;
	animation: cgal-lb-in 0.25s ease forwards;
}

.cgal-lb.is-open {
	display: flex;
}

@keyframes cgal-lb-in {
	from { opacity: 0; }
	to   { opacity: 1; }
}

/* Image container */
.cgal-lb-inner {
	position: relative;
	max-width: 90vw;
	max-height: 88vh;
	display: flex;
	align-items: center;
	justify-content: center;
	animation: cgal-lb-img-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes cgal-lb-img-in {
	from { transform: scale(0.88); opacity: 0; }
	to   { transform: scale(1);    opacity: 1; }
}

.cgal-lb-img {
	max-width: 90vw;
	max-height: 85vh;
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: 8px;
	box-shadow: 0 24px 80px rgba(0,0,0,0.6);
	display: block;
}

/* Controls */
.cgal-lb-close,
.cgal-lb-prev,
.cgal-lb-next {
	position: fixed;
	background: rgba(255,255,255,0.12);
	border: 2px solid rgba(255,255,255,0.25);
	color: #fff;
	cursor: pointer;
	backdrop-filter: blur(6px);
	transition: background 0.2s ease, border-color 0.2s ease;
	line-height: 1;
}

.cgal-lb-close,
.cgal-lb-prev,
.cgal-lb-next { border-radius: 50%; }

.cgal-lb-close:hover,
.cgal-lb-prev:hover,
.cgal-lb-next:hover {
	background: rgba(255,255,255,0.28);
	border-color: #fff;
}

.cgal-lb-close {
	top: 20px;
	right: 20px;
	width: 44px;
	height: 44px;
	font-size: 1.1rem;
	display: flex;
	align-items: center;
	justify-content: center;
}

.cgal-lb-prev,
.cgal-lb-next {
	top: 50%;
	transform: translateY(-50%);
	width: 52px;
	height: 52px;
	font-size: 2rem;
	display: flex;
	align-items: center;
	justify-content: center;
}

.cgal-lb-prev { left: 20px; }
.cgal-lb-next { right: 20px; }

/* Counter */
.cgal-lb-counter {
	position: fixed;
	bottom: 20px;
	left: 50%;
	transform: translateX(-50%);
	color: rgba(255,255,255,0.65);
	font-size: 0.85rem;
	margin: 0;
	letter-spacing: 0.08em;
}

/* ── Mobile ──────────────────────────────────────────────────────────── */

@media (max-width: 767px) {
	.cgal-wrap {
		--cgal-size: 200px !important;
	}
	.cgal-item {
		width:  200px !important;
		height: 200px !important;
	}
}

/* ── Reduced Motion ──────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
	.cgal-list { animation: none !important; }
	.cgal-img  { transition: none !important; }
}
