/* Gallery Collections — Frontend
   Accent color comes from Settings and is injected as CSS custom properties:
   --gc-brand, --gc-brand-dark, --gc-brand-rgb
------------------------------------------------------------------ */

.gc-wrap { margin: 24px 0; }

/* A dependency-free search/zoom icon, drawn with plain CSS (no icon font needed). */
.gc-icon-search {
	position: relative;
	display: inline-block;
	width: 14px;
	height: 14px;
	border: 2px solid currentColor;
	border-radius: 50%;
	flex: 0 0 auto;
}
.gc-icon-search::after {
	content: "";
	position: absolute;
	width: 6px;
	height: 2px;
	background: currentColor;
	right: -6px;
	bottom: -2px;
	transform: rotate(45deg);
	border-radius: 1px;
}

/* ---------- Grid of cover cards ---------- */

.gc-grid {
	display: grid;
	grid-template-columns: repeat(var(--gc-columns, 3), minmax(0, 1fr));
	gap: 24px;
}
@media (max-width: 900px) { .gc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .gc-grid { grid-template-columns: 1fr; } }

.gc-card {
	border-radius: 10px;
	overflow: hidden;
	background: #fff;
	border: 1px solid rgba(0, 0, 0, 0.06);
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.gc-card:hover {
	box-shadow: 0 10px 26px rgba(var(--gc-brand-rgb), 0.28);
	transform: translateY(-3px);
}

.gc-card-header {
	background: var(--gc-brand, #10783F);
	color: #fff;
	font-weight: 700;
	font-size: 16px;
	padding: 14px 18px;
	line-height: 1.3;
}

.gc-card-media {
	position: relative;
	aspect-ratio: 16 / 11;
	background: #e9edea;
	overflow: hidden;
}
.gc-card-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.35s ease;
}
.gc-card:hover .gc-card-media img { transform: scale(1.06); }

.gc-card-overlay {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(to top, rgba(var(--gc-brand-rgb), 0.78) 0%, rgba(var(--gc-brand-rgb), 0.15) 45%, rgba(0, 0, 0, 0) 70%);
	opacity: 0;
	transition: opacity 0.25s ease;
}
.gc-card:hover .gc-card-overlay,
.gc-card:focus-within .gc-card-overlay { opacity: 1; }

.gc-open-btn {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	background: #fff;
	color: var(--gc-brand-dark, #0c5c30);
	border: none;
	border-radius: 999px;
	padding: 10px 20px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
	transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}
.gc-open-btn:hover:not(:disabled) {
	background: var(--gc-brand, #10783F);
	color: #fff;
	transform: scale(1.04);
}
.gc-open-btn:disabled { cursor: not-allowed; opacity: 0.6; }

/* ---------- Inline per-collection grid (layout="grid") ---------- */

.gc-inline-grid {
	display: grid;
	grid-template-columns: repeat(var(--gc-columns, 3), minmax(0, 1fr));
	gap: 14px;
}
@media (max-width: 900px) { .gc-inline-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .gc-inline-grid { grid-template-columns: 1fr; } }

.gc-thumb-btn {
	position: relative;
	display: block;
	padding: 0;
	border: 2px solid transparent;
	border-radius: 8px;
	overflow: hidden;
	background: #eee;
	aspect-ratio: 4 / 3;
	cursor: pointer;
	transition: border-color 0.2s ease, transform 0.2s ease;
}
.gc-thumb-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gc-thumb-btn:hover { border-color: var(--gc-brand, #10783F); transform: translateY(-2px); }

.gc-thumb-zoom {
	position: absolute;
	right: 10px;
	bottom: 10px;
	width: 28px;
	height: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(var(--gc-brand-rgb), 0.9);
	color: #fff;
	border-radius: 50%;
}
.gc-thumb-zoom.gc-icon-search { border-color: #fff; }

.gc-error {
	padding: 12px 16px;
	background: #fdecea;
	border-left: 4px solid #d63638;
	color: #58151c;
}

/* ==========================================================
   LIGHTBOX — one big photo, obvious next/prev, a counter,
   captions, a thumbnail strip, and an optional slideshow.
   ========================================================== */

.gc-lightbox {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: none;
	flex-direction: column;
	background: rgba(6, 20, 12, 0.94);
	backdrop-filter: blur(2px);
}
.gc-lightbox.is-open { display: flex; }

.gc-lightbox-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 16px 20px;
	color: #fff;
	flex: 0 0 auto;
}
.gc-lightbox-titlewrap { display: flex; align-items: center; gap: 12px; min-width: 0; }
.gc-lightbox-title {
	font-size: 18px;
	font-weight: 700;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.gc-lightbox-counter {
	background: rgba(var(--gc-brand-rgb), 0.9);
	padding: 4px 12px;
	border-radius: 999px;
	font-size: 13px;
	font-weight: 600;
	white-space: nowrap;
	flex: 0 0 auto;
}

.gc-lightbox-actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }

.gc-lightbox-play,
.gc-lightbox-close {
	background: transparent;
	border: 2px solid rgba(255, 255, 255, 0.5);
	color: #fff;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	font-size: 15px;
	line-height: 1;
	cursor: pointer;
	transition: background 0.2s ease, border-color 0.2s ease;
}
.gc-lightbox-close { font-size: 20px; }
.gc-lightbox-play:hover,
.gc-lightbox-close:hover {
	background: var(--gc-brand, #10783F);
	border-color: var(--gc-brand, #10783F);
}
.gc-lightbox-play[data-playing="1"] {
	background: var(--gc-brand, #10783F);
	border-color: var(--gc-brand, #10783F);
}

.gc-lightbox-stage {
	position: relative;
	flex: 1 1 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 0;
	padding: 0 70px;
}
.gc-lightbox-image-wrap {
	max-width: 100%;
	max-height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	width: 100%;
}
.gc-lightbox-image {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	border-radius: 6px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
	background: #111;
	opacity: 0;
	transform: scale(0.98);
	transition: opacity 0.25s ease, transform 0.25s ease;
}
.gc-lightbox-image.is-loaded { opacity: 1; transform: scale(1); }

.gc-lightbox-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 48px;
	height: 48px;
	border-radius: 50%;
	border: none;
	background: var(--gc-brand, #10783F);
	color: #fff;
	font-size: 18px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
	transition: background 0.2s ease, transform 0.15s ease;
	z-index: 2;
}
.gc-lightbox-nav:hover { background: var(--gc-brand-dark, #0c5c30); transform: translateY(-50%) scale(1.08); }
.gc-lightbox-nav.is-hidden { display: none; }
.gc-lightbox-prev { left: 12px; }
.gc-lightbox-next { right: 12px; }

.gc-lightbox-caption {
	flex: 0 0 auto;
	text-align: center;
	color: #f2f5f3;
	font-size: 14px;
	padding: 6px 20px 0;
	min-height: 20px;
}

.gc-lightbox-thumbs {
	flex: 0 0 auto;
	display: flex;
	gap: 8px;
	padding: 14px 20px 20px;
	overflow-x: auto;
	scrollbar-width: thin;
}
.gc-lightbox-thumbs::-webkit-scrollbar { height: 6px; }
.gc-lightbox-thumbs::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.3); border-radius: 3px; }

.gc-lightbox-thumb {
	flex: 0 0 auto;
	width: 64px;
	height: 48px;
	border-radius: 6px;
	overflow: hidden;
	border: 2px solid transparent;
	opacity: 0.55;
	cursor: pointer;
	padding: 0;
	background: #222;
	transition: opacity 0.2s ease, border-color 0.2s ease;
}
.gc-lightbox-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gc-lightbox-thumb:hover { opacity: 0.85; }
.gc-lightbox-thumb.is-active { opacity: 1; border-color: var(--gc-brand, #10783F); }

body.gc-lightbox-open { overflow: hidden; }

@media (max-width: 640px) {
	.gc-lightbox-stage { padding: 0 44px; }
	.gc-lightbox-nav { width: 38px; height: 38px; font-size: 15px; }
	.gc-lightbox-title { font-size: 14px; max-width: 40vw; }
}
