/* Expanding Gallery — frontend styles */

.eg-gallery {
	--eg-cols: 6;
	--eg-cell-h: 150px;
	--eg-gap: 10px;
	--eg-radius: 14px;
	position: relative;
	border-radius: 20px;
	font-family: inherit;
	box-sizing: border-box;
}

.eg-gallery *,
.eg-gallery *::before,
.eg-gallery *::after {
	box-sizing: border-box;
}

.eg-title {
	text-align: center;
	font-weight: 700;
	font-size: 32px;
	margin: 0 0 26px;
	letter-spacing: -0.01em;
	line-height: 1.15;
}

/* Viewport clips the slider track; visible for grid growth */
.eg-viewport {
	position: relative;
}

.eg-gallery[data-mode="slider"] .eg-viewport {
	overflow: hidden;
	padding: 4px 2px;
}

/* ---------- GRID ---------- */
.eg-gallery[data-mode="grid"] .eg-track {
	display: grid;
	grid-template-columns: repeat(var(--eg-cols), 1fr);
	grid-auto-rows: var(--eg-cell-h);
	gap: var(--eg-gap);
}

/* ---------- SLIDER ---------- */
.eg-gallery[data-mode="slider"] .eg-track {
	display: flex;
	gap: var(--eg-gap);
}

.eg-gallery[data-mode="slider"] .eg-card {
	flex: 1 1 0%;
	min-width: 0;
	height: var(--eg-cell-h);
	transition: flex 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- CARD ---------- */
.eg-card {
	position: relative;
	border-radius: var(--eg-radius);
	overflow: hidden;
	cursor: pointer;
	background: #20203c;
	z-index: 1;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
	will-change: transform;
	backface-visibility: hidden;
	transition: transform 0.42s cubic-bezier(0.2, 0.8, 0.25, 1), box-shadow 0.42s ease, flex 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.eg-card:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.eg-img {
	position: absolute;
	inset: 0;
	background-size: cover;
	background-position: center;
	transition: transform 0.42s cubic-bezier(0.2, 0.8, 0.25, 1);
}

.eg-card.is-hover {
	z-index: 20;
	box-shadow: 0 22px 55px rgba(0, 0, 0, 0.6);
}

.eg-card.is-hover .eg-img {
	transform: scale(1.06);
}

.eg-scrim {
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(6, 10, 20, 0.85) 0%, rgba(6, 10, 20, 0.15) 45%, rgba(6, 10, 20, 0) 70%);
	opacity: 0;
	transition: opacity 0.35s ease;
	pointer-events: none;
}

.eg-card.is-hover .eg-scrim {
	opacity: 1;
}

.eg-meta {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 14px 16px 16px;
	opacity: 0;
	transform: translateY(8px);
	transition: opacity 0.3s ease 0.1s, transform 0.3s ease 0.1s;
	pointer-events: none;
}

.eg-card.is-hover .eg-meta {
	opacity: 1;
	transform: translateY(0);
}

.eg-card-title {
	font-weight: 600;
	color: #fff;
	line-height: 1.2;
	font-size: 16px;
	text-wrap: pretty;
}

.eg-card-date {
	color: #9fd8ec;
	margin-top: 5px;
	font-weight: 500;
	font-size: 12.5px;
}

/* Grid meta scales with the card; keep base small so it reads well when grown */
.eg-gallery[data-mode="grid"] .eg-meta {
	padding: 9px 10px 11px;
}

.eg-gallery[data-mode="grid"] .eg-card-title {
	font-size: 9px;
}

.eg-gallery[data-mode="grid"] .eg-card-date {
	font-size: 7.5px;
	margin-top: 3px;
}

/* ---------- SLIDER ARROWS ---------- */
.eg-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	box-sizing: border-box !important;
	padding: 0 !important;
	margin: 0 !important;
	min-width: 0 !important;
	min-height: 0 !important;
	max-width: none !important;
	max-height: none !important;
	width: 42px;
	height: 42px;
	aspect-ratio: 1 / 1 !important;
	border-radius: 50% !important;
	border: 1px solid rgba(255, 255, 255, 0.18);
	background: rgba(20, 20, 40, 0.85);
	color: #fff;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	z-index: 30;
	backdrop-filter: blur(4px);
	transition: opacity 0.2s ease;
}

.eg-arrow.eg-prev {
	left: -8px;
}

.eg-arrow.eg-next {
	right: -8px;
}

.eg-arrow[disabled] {
	opacity: 0.3;
	cursor: default;
}

/* ---------- LIGHTBOX ---------- */
.eg-lightbox {
	position: fixed;
	inset: 0;
	background: rgba(8, 8, 18, 0.9);
	backdrop-filter: blur(6px);
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 40px;
	opacity: 0;
	transition: opacity 0.25s ease;
}

.eg-lightbox.is-open {
	opacity: 1;
}

.eg-lightbox-inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 16px;
	max-width: 88vw;
	max-height: 88vh;
	transform: scale(0.94);
	transition: transform 0.25s ease;
}

.eg-lightbox.is-open .eg-lightbox-inner {
	transform: scale(1);
}

.eg-lightbox img {
	max-width: 88vw;
	max-height: 74vh;
	object-fit: contain;
	border-radius: 14px;
	box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
}

.eg-lightbox-title {
	font-weight: 600;
	font-size: 20px;
	color: #fff;
	text-align: center;
}

.eg-lightbox-date {
	font-size: 14px;
	color: #9fd8ec;
	text-align: center;
	margin-top: 4px;
}

.eg-lightbox-close {
	position: fixed;
	top: 22px;
	right: 26px;
	box-sizing: border-box !important;
	padding: 0 !important;
	margin: 0 !important;
	min-width: 0 !important;
	min-height: 0 !important;
	max-width: none !important;
	max-height: none !important;
	width: 44px;
	height: 44px;
	aspect-ratio: 1 / 1 !important;
	border-radius: 50% !important;
	background: rgba(255, 255, 255, 0.1);
	border: 1px solid rgba(255, 255, 255, 0.2);
	color: #fff;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
}

/* ---------- MOBILE: title/date always visible, no hover growth ---------- */
@media (max-width: 767px) {
	.eg-title {
		font-size: 24px;
	}

	.eg-gallery.eg-touch .eg-scrim {
		opacity: 1;
	}

	.eg-gallery.eg-touch .eg-meta {
		opacity: 1;
		transform: translateY(0);
	}

	.eg-gallery[data-mode="grid"].eg-touch .eg-card-title {
		font-size: 13px;
	}

	.eg-gallery[data-mode="grid"].eg-touch .eg-card-date {
		font-size: 11px;
	}
}
