/* =========================================================================
   NEXAFOBA GALLERY PAGE - shared styles for gallery.html & desk/gallery.html
   Uses the color variables already defined in stylesheet.css / desk_style.css
   ========================================================================= */

.g_hero {
	text-align: center;
	padding: 1.5rem 1rem 0.5rem;
}
.g_hero .tag {
	color: var(--color-hig);
	font-weight: 700;
	font-size: 0.85rem;
	letter-spacing: 0.15rem;
	text-transform: uppercase;
}
.g_hero .title {
	font-size: 2rem;
	font-weight: 900;
	letter-spacing: 0.5px;
	margin-top: 0.35rem;
	color: var(--color-dark);
}
.g_hero .title span {
	color: var(--color-hig);
}
.g_hero .sub {
	max-width: 640px;
	margin: 0.6rem auto 0;
	font-size: 0.92rem;
	opacity: 0.85;
	line-height: 1.5;
}

/* ---------- filter chips ---------- */
.g_filters {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	justify-content: center;
	padding: 1.25rem 1rem 0.5rem;
}
.g_filters .chip {
	padding: 0.4rem 1rem;
	border-radius: 2rem;
	font-size: 0.8rem;
	font-weight: 600;
	background: rgba(74, 163, 200, 0.12);
	color: var(--color-dark);
	cursor: pointer;
	transition: all 0.2s ease;
	border: 1px solid transparent;
}
.g_filters .chip:hover {
	border-color: var(--color-hig);
}
.g_filters .chip.active {
	background: var(--color-dark);
	color: rgb(191, 233, 247);
}

/* ---------- event card grid ---------- */
.g_grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1.1rem;
	padding: 0.75rem 1rem 6rem; /* extra bottom room on phones for the fixed nav */
	max-width: 1200px;
	margin: 0 auto;
	width: 100%;
}
@media (min-width: 600px) {
	.g_grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; padding-bottom: 3rem; }
}
@media (min-width: 960px) {
	.g_grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.6rem; padding: 1rem 2.5rem 3.5rem; }
}
.inner .g_grid { padding-left: 0; padding-right: 0; }

.g_item {
	display: flex;
	flex-direction: column;
	min-width: 0;
	background: #fff;
	border-radius: 1.1rem;
	overflow: hidden;
	box-shadow: 0 6px 22px rgba(28, 32, 39, 0.10);
	border: 1px solid rgba(28, 32, 39, 0.06);
	cursor: pointer;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
	-webkit-tap-highlight-color: transparent;
}
.g_item:focus-visible { outline: 3px solid var(--color-hig); outline-offset: 2px; }
.g_item:active { transform: scale(0.985); }
@media (hover: hover) {
	.g_item:hover {
		transform: translateY(-5px);
		box-shadow: 0 16px 38px rgba(28, 32, 39, 0.18);
	}
	.g_item:hover .g_thumb img { transform: scale(1.06); }
	.g_item:hover .g_more i { transform: translateX(4px); }
}

.g_thumb {
	position: relative;
	aspect-ratio: 4 / 3;
	background: #e7eef2;
	overflow: hidden;
	flex-shrink: 0;
}
.g_thumb img {
	width: 100%;
	height: 100%;
	display: block;
	object-fit: cover;
	transition: transform 0.5s ease;
}
.g_thumb::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(28, 32, 39, 0.35) 0%, rgba(28, 32, 39, 0) 40%);
	pointer-events: none;
}
.g_badge {
	position: absolute;
	left: 0.7rem;
	top: 0.7rem;
	z-index: 1;
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	background: rgba(248, 250, 252, 0.94);
	color: var(--color-dark);
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.02rem;
	padding: 0.3rem 0.7rem 0.3rem 0.55rem;
	border-radius: 2rem;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}
.g_badge i { color: var(--color-hig); font-size: 0.9rem; line-height: 1; }

.g_body {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: 0.95rem 1.05rem 1rem;
	min-width: 0;
}
.g_ttl {
	font-size: 1.02rem;
	font-weight: 800;
	line-height: 1.3;
	color: var(--color-dark);
	letter-spacing: 0.01rem;
	overflow-wrap: anywhere;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.g_desc {
	margin-top: 0.4rem;
	font-size: 0.86rem;
	line-height: 1.5;
	color: rgba(51, 51, 51, 0.82);
	overflow-wrap: anywhere;
	/* crop long descriptions to two lines */
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.g_more {
	margin-top: auto;
	padding-top: 0.8rem;
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	font-size: 0.8rem;
	font-weight: 700;
	color: #0093D9;
	letter-spacing: 0.02rem;
}
.g_more i { transition: transform 0.25s ease; font-size: 1rem; line-height: 1; }

.g_empty {
	text-align: center;
	padding: 3rem 1rem;
	opacity: 0.7;
	font-size: 0.95rem;
}

.g_skeleton {
	border-radius: 1.1rem;
	background: linear-gradient(100deg, #e7eef2 30%, #f3f7f9 50%, #e7eef2 70%);
	background-size: 200% 100%;
	animation: g_shimmer 1.4s infinite;
	height: 280px !important;
}
@keyframes g_shimmer {
	0% { background-position: 200% 0; }
	100% { background-position: -200% 0; }
}

/* ---------- details popup ---------- */
.g_lightbox {
	position: fixed;
	inset: 0;
	z-index: 5000;
	background: rgba(15, 17, 21, 0.78);
	display: none;
	align-items: flex-end;           /* bottom sheet on phones */
	justify-content: center;
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	overscroll-behavior: contain;
}
.g_lightbox.open { display: flex; animation: g_bg 0.25s ease; }
@keyframes g_bg { from { opacity: 0; } to { opacity: 1; } }

.g_lightbox .lb_card {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-height: 94vh;
	max-height: 94dvh;
	background: #fff;
	border-radius: 1.4rem 1.4rem 0 0;
	overflow: hidden;
	box-shadow: 0 -10px 50px rgba(0, 0, 0, 0.4);
	animation: g_up 0.32s cubic-bezier(.2, .8, .2, 1);
}
@keyframes g_up {
	from { transform: translateY(40px); opacity: 0; }
	to { transform: translateY(0); opacity: 1; }
}

.g_lightbox .lb_media {
	position: relative;
	flex: 0 0 auto;
	height: 38vh;
	height: 38dvh;
	min-height: 200px;
	background: #11141a;
	display: flex;
	align-items: center;
	justify-content: center;
}
.g_lightbox .lb_img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
	animation: g_fade 0.25s ease;
}
@keyframes g_fade {
	from { opacity: 0; transform: scale(0.98); }
	to { opacity: 1; transform: scale(1); }
}

.g_lightbox .lb_close,
.g_lightbox .lb_prev,
.g_lightbox .lb_next {
	position: absolute;
	color: #fff;
	background: rgba(15, 17, 21, 0.55);
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
	border-radius: 50%;
	width: 2.6rem;
	height: 2.6rem;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	font-size: 1.35rem;
	transition: background 0.2s ease;
	z-index: 10;
}
.g_lightbox .lb_close:hover,
.g_lightbox .lb_prev:hover,
.g_lightbox .lb_next:hover { background: rgba(15, 17, 21, 0.8); }
.g_lightbox .lb_close { top: 0.75rem; right: 0.75rem; }
.g_lightbox .lb_prev { left: 0.6rem; top: 50%; transform: translateY(-50%); }
.g_lightbox .lb_next { right: 0.6rem; top: 50%; transform: translateY(-50%); }
.g_lightbox .lb_counter {
	position: absolute;
	left: 0.75rem;
	bottom: 0.75rem;
	z-index: 10;
	color: #fff;
	background: rgba(15, 17, 21, 0.55);
	font-size: 0.74rem;
	font-weight: 700;
	letter-spacing: 0.05rem;
	padding: 0.25rem 0.7rem;
	border-radius: 2rem;
}

.g_lightbox .lb_info {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
	padding: 1.15rem 1.25rem 1.6rem;
	padding-bottom: max(1.6rem, env(safe-area-inset-bottom));
	user-select: text;
	-webkit-user-select: text;
}
.g_lightbox .lb_info * { user-select: text; -webkit-user-select: text; }
.g_lightbox .lb_date {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	font-size: 0.78rem;
	font-weight: 700;
	color: #0093D9;
	background: rgba(0, 147, 217, 0.1);
	padding: 0.3rem 0.8rem 0.3rem 0.65rem;
	border-radius: 2rem;
	margin-bottom: 0.7rem;
}
.g_lightbox .lb_date i { font-size: 1rem; line-height: 1; }
.g_lightbox .lb_title {
	font-size: 1.3rem;
	font-weight: 900;
	line-height: 1.25;
	color: var(--color-dark);
	letter-spacing: 0.01rem;
	overflow-wrap: anywhere;
}
.g_lightbox .lb_rule {
	width: 2.75rem;
	height: 3px;
	border-radius: 3px;
	background: linear-gradient(to right, #0093D9, #8BDAFF);
	margin: 0.8rem 0;
}
.g_lightbox .lb_desc {
	font-size: 0.95rem;
	line-height: 1.7;
	color: rgba(51, 51, 51, 0.92);
	white-space: pre-line;        /* keeps the admin's line breaks */
	overflow-wrap: anywhere;
}
.g_lightbox .lb_desc.none { opacity: 0.55; font-style: italic; }

/* tablets + desktop: centred two-column dialog */
@media (min-width: 720px) {
	.g_lightbox { align-items: center; padding: 1.5rem; }
	.g_lightbox .lb_card {
		flex-direction: row;
		max-width: 1020px;
		height: min(640px, 88vh);
		max-height: none;
		border-radius: 1.4rem;
		box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
	}
	.g_lightbox .lb_media {
		flex: 1 1 58%;
		height: auto;
		min-height: 0;
	}
	.g_lightbox .lb_info {
		flex: 0 0 42%;
		padding: 2.2rem 2rem 2rem;
	}
	.g_lightbox .lb_title { font-size: 1.6rem; }
	.g_lightbox .lb_prev { left: 0.9rem; }
	.g_lightbox .lb_next { right: 0.9rem; }
	/* close sits on the info side so it never covers the photo */
	.g_lightbox .lb_close {
		top: 0.9rem;
		right: 0.9rem;
		background: rgba(28, 32, 39, 0.08);
		color: var(--color-dark);
	}
	.g_lightbox .lb_close:hover { background: rgba(28, 32, 39, 0.16); }
	.g_lightbox .lb_info { padding-top: 3.4rem; }
}
/* short landscape phones */
@media (max-height: 480px) and (orientation: landscape) {
	.g_lightbox { align-items: center; padding: 0.5rem; }
	.g_lightbox .lb_card {
		flex-direction: row;
		max-width: 100%;
		height: 94vh;
		max-height: none;
		border-radius: 1rem;
	}
	.g_lightbox .lb_media { flex: 1 1 50%; height: auto; min-height: 0; }
	.g_lightbox .lb_info { flex: 0 0 50%; padding: 1rem 1.2rem; }
	.g_lightbox .lb_title { font-size: 1.1rem; }
}
@media (prefers-reduced-motion: reduce) {
	.g_lightbox.open, .g_lightbox .lb_card, .g_lightbox .lb_img { animation: none; }
	.g_item, .g_thumb img { transition: none; }
}

/* Desktop page-header variant (used inside desk/gallery.html's .page_header) */
.g_filters.desk {
	padding-top: 0;
	margin-top: -1rem;
}
