/* ==========================================================================
   HG Image Grid & Carousel
   ========================================================================== */

.hgc-wrapper {
	--hgc-cols: 3;
	--hgc-gap: 20px;
	--hgc-row-gap: 20px;
	--hgc-dur: .5s;
	--hgc-speed: 600ms;
	--hgc-tilt: 2deg;
	--hgc-frame-color: #fff;
	--hgc-frame-inset: 16px;
	--hgc-frame-w: 1px;
	--hgc-accent: #1f6feb;
	position: relative;
	width: 100%;
}

.hgc-wrapper *,
.hgc-wrapper *::before,
.hgc-wrapper *::after {
	box-sizing: border-box;
}

.hgc-empty {
	padding: 30px;
	text-align: center;
	border: 2px dashed #cbd5e1;
	color: #64748b;
	border-radius: 8px;
}

/* ---------- Grid / track ---------- */

.hgc-mode-grid .hgc-track {
	display: grid;
	grid-template-columns: repeat(var(--hgc-cols), minmax(0, 1fr));
	gap: var(--hgc-row-gap) var(--hgc-gap);
	align-items: stretch;
}

.hgc-stage {
	position: relative;
}

/* ---------- Carousel ---------- */

.hgc-mode-carousel .hgc-viewport {
	overflow: hidden;
	touch-action: pan-y;
	cursor: grab;
	padding: 14px 0;
	margin: -14px 0;
}

.hgc-mode-carousel .hgc-viewport.is-dragging {
	cursor: grabbing;
	user-select: none;
}

.hgc-mode-carousel .hgc-track {
	display: flex;
	gap: 0 var(--hgc-gap);
	align-items: stretch;
	transition: transform var(--hgc-speed) cubic-bezier(.22, .61, .36, 1);
	will-change: transform;
}

.hgc-mode-carousel .hgc-viewport.is-dragging .hgc-track {
	transition: none;
}

.hgc-mode-carousel .hgc-item {
	flex: 0 0 calc((100% - (var(--hgc-cols) - 1) * var(--hgc-gap)) / var(--hgc-cols));
}

/* ---------- Item ---------- */

.hgc-wrapper .hgc-item {
	position: relative;
	display: flex;
	flex-direction: column;
	min-width: 0;
	margin: 0;
	overflow: hidden;
	transform: translateY(var(--hgc-lift, 0px)) rotate(var(--hgc-rot, 0deg));
	transition: transform var(--hgc-dur) ease, box-shadow var(--hgc-dur) ease;
}

.hgc-wrapper .hgc-trigger {
	display: block;
	color: inherit;
	text-decoration: none;
	box-shadow: none;
	border: 0;
	outline-offset: -3px;
}

.hgc-has-lightbox .hgc-trigger {
	cursor: zoom-in;
}

.hgc-wrapper .hgc-media {
	position: relative;
	display: block;
	margin: 0;
	height: 280px;
	overflow: hidden;
	background: #e2e8f0;
}

.hgc-wrapper .hgc-media img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	object-position: center center;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	transition: transform var(--hgc-dur) cubic-bezier(.22, .61, .36, 1), filter var(--hgc-dur) ease;
	-webkit-user-drag: none;
	user-select: none;
}

/* ---------- Overlay (user controllable) ---------- */

.hgc-wrapper .hgc-overlay {
	position: absolute;
	inset: 0;
	z-index: 2;
	pointer-events: none;
}

.hgc-wrapper .hgc-overlay::after {
	content: "";
	position: absolute;
	inset: 0;
	background-color: rgba(0, 0, 0, .35);
	opacity: 0;
	transition: opacity var(--hgc-dur) ease;
}

.hgc-wrapper .hgc-item:hover .hgc-overlay::after {
	opacity: 1;
}

/* ---------- Hover icon ---------- */

.hgc-wrapper .hgc-icon {
	position: absolute;
	z-index: 4;
	top: 50%;
	left: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	font-size: 18px;
	color: #111;
	background-color: #fff;
	border-radius: 50%;
	opacity: 0;
	transform: translate(-50%, -50%) scale(.6);
	transition: opacity var(--hgc-dur) ease, transform var(--hgc-dur) cubic-bezier(.22, .61, .36, 1), background-color .3s, color .3s;
	pointer-events: none;
}

.hgc-wrapper .hgc-icon svg {
	width: 1em;
	height: 1em;
	fill: currentColor;
}

.hgc-wrapper .hgc-item:hover .hgc-icon {
	opacity: 1;
	transform: translate(-50%, -50%) scale(1);
}

/* ---------- Content ---------- */

.hgc-wrapper .hgc-content {
	padding: 18px 20px 20px;
	text-align: left;
}

.hgc-wrapper .hgc-title {
	margin: 0;
	font-size: 18px;
	font-weight: 600;
	line-height: 1.3;
	color: #111827;
}

.hgc-wrapper .hgc-caption {
	margin: 6px 0 0;
	font-size: 14px;
	line-height: 1.5;
	color: #64748b;
}

/* ==========================================================================
   Layout 1 – Slide-Up Overlay
   ========================================================================== */

.hgc-layout-overlay .hgc-media::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	background: linear-gradient(to top, rgba(0, 0, 0, .78) 0%, rgba(0, 0, 0, 0) 62%);
	pointer-events: none;
}

.hgc-layout-overlay .hgc-content {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 3;
	transform: translateY(10px);
	transition: transform var(--hgc-dur) cubic-bezier(.22, .61, .36, 1);
}

.hgc-layout-overlay .hgc-title {
	color: #fff;
}

.hgc-layout-overlay .hgc-caption {
	color: rgba(255, 255, 255, .85);
	opacity: 0;
	transition: opacity var(--hgc-dur) ease;
}

.hgc-layout-overlay .hgc-item:hover .hgc-content {
	transform: translateY(0);
}

.hgc-layout-overlay .hgc-item:hover .hgc-caption {
	opacity: 1;
}

.hgc-layout-overlay .hgc-icon {
	top: 16px;
	left: auto;
	right: 16px;
	width: 42px;
	height: 42px;
	font-size: 15px;
	transform: scale(.6);
}

.hgc-layout-overlay .hgc-item:hover .hgc-icon {
	transform: scale(1);
}

/* ==========================================================================
   Layout 2 – Clean Card
   ========================================================================== */

.hgc-layout-card .hgc-item {
	background-color: #fff;
	border-radius: 16px;
	box-shadow: 0 6px 24px rgba(15, 23, 42, .08);
}

.hgc-layout-card .hgc-item:hover {
	--hgc-lift: -6px;
	box-shadow: 0 18px 40px rgba(15, 23, 42, .16);
}

.hgc-layout-card .hgc-content {
	flex: 1 1 auto;
}

/* ==========================================================================
   Layout 3 – Frame Reveal
   ========================================================================== */

.hgc-layout-frame .hgc-item {
	border-radius: 4px;
}

.hgc-layout-frame .hgc-media::before {
	content: "";
	position: absolute;
	inset: var(--hgc-frame-inset);
	z-index: 3;
	border: var(--hgc-frame-w) solid var(--hgc-frame-color);
	opacity: 0;
	transform: scale(1.1);
	transition: opacity var(--hgc-dur) ease, transform var(--hgc-dur) cubic-bezier(.22, .61, .36, 1);
	pointer-events: none;
}

.hgc-layout-frame .hgc-item:hover .hgc-media::before {
	opacity: 1;
	transform: scale(1);
}

.hgc-layout-frame .hgc-overlay::after {
	background-color: rgba(10, 10, 12, .55);
}

.hgc-layout-frame .hgc-content {
	position: absolute;
	inset: 0;
	z-index: 3;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 36px 40px 70px;
	text-align: center;
	opacity: 0;
	transform: translateY(16px);
	transition: opacity var(--hgc-dur) ease, transform var(--hgc-dur) cubic-bezier(.22, .61, .36, 1);
}

.hgc-layout-frame .hgc-item:hover .hgc-content {
	opacity: 1;
	transform: translateY(0);
}

.hgc-layout-frame .hgc-title {
	color: #fff;
}

.hgc-layout-frame .hgc-caption {
	color: rgba(255, 255, 255, .85);
}

.hgc-layout-frame .hgc-icon {
	top: auto;
	bottom: calc(var(--hgc-frame-inset) + 16px);
	width: 44px;
	height: 44px;
	font-size: 15px;
	transform: translate(-50%, 0) scale(.6);
}

.hgc-layout-frame .hgc-item:hover .hgc-icon {
	transform: translate(-50%, 0) scale(1);
}

/* ==========================================================================
   Layout 4 – Polaroid
   ========================================================================== */

.hgc-layout-polaroid .hgc-item {
	padding: 12px 12px 0;
	background-color: #fff;
	border-radius: 4px;
	box-shadow: 0 10px 30px rgba(15, 23, 42, .14);
}

.hgc-layout-polaroid .hgc-item:nth-child(odd) {
	--hgc-rot: var(--hgc-tilt);
}

.hgc-layout-polaroid .hgc-item:nth-child(even) {
	--hgc-rot: calc(var(--hgc-tilt) * -1);
}

.hgc-layout-polaroid .hgc-item:hover:nth-child(n) {
	--hgc-rot: 0deg;
	--hgc-lift: -8px;
	box-shadow: 0 22px 44px rgba(15, 23, 42, .22);
}

.hgc-layout-polaroid .hgc-media {
	border-radius: 2px;
}

.hgc-layout-polaroid .hgc-content {
	flex: 1 1 auto;
	padding: 16px 8px 18px;
	text-align: center;
}

/* ==========================================================================
   Arrows & dots
   ========================================================================== */

.hgc-wrapper .hgc-arrow {
	position: absolute;
	top: 50%;
	z-index: 6;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	margin: 0;
	padding: 0;
	font-size: 18px;
	line-height: 1;
	color: #111827;
	background-color: #fff;
	border: 0;
	border-radius: 50%;
	box-shadow: 0 8px 20px rgba(15, 23, 42, .2);
	cursor: pointer;
	transform: translateY(-50%);
	transition: background-color .3s, color .3s, opacity .3s, transform .3s;
}

.hgc-wrapper .hgc-arrow svg {
	width: 1em;
	height: 1em;
	fill: none;
	stroke: currentColor;
	stroke-width: 2.6;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.hgc-wrapper .hgc-prev {
	left: 12px;
}

.hgc-wrapper .hgc-next {
	right: 12px;
}

.hgc-wrapper .hgc-arrow:hover:not(:disabled),
.hgc-wrapper .hgc-arrow:focus-visible:not(:disabled) {
	color: #fff;
	background-color: var(--hgc-accent);
	box-shadow: 0 8px 20px rgba(15, 23, 42, .2);
}

.hgc-wrapper .hgc-arrow:disabled {
	opacity: .35;
	cursor: default;
}

.hgc-wrapper .hgc-dots {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin-top: 24px;
}

.hgc-wrapper .hgc-dot {
	display: block;
	width: 10px;
	height: 10px;
	min-width: 0;
	min-height: 0;
	margin: 0;
	padding: 0;
	font-size: 0;
	line-height: 0;
	background-color: #cbd5e1;
	border: 0;
	border-radius: 999px;
	box-shadow: none;
	cursor: pointer;
	transition: width .3s ease, background-color .3s ease;
}

.hgc-wrapper .hgc-dot:hover {
	background-color: #94a3b8;
}

.hgc-wrapper .hgc-dot.is-active {
	width: 28px;
	background-color: var(--hgc-accent);
}

/* ==========================================================================
   Lightbox (appended to <body>)
   ========================================================================== */

html.hgc-lb-lock {
	overflow: hidden;
}

.hgc-lb {
	--hgc-lb-bg: rgba(10, 10, 12, .94);
	--hgc-lb-color: #fff;
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 56px 72px;
	color: var(--hgc-lb-color);
	background: var(--hgc-lb-bg);
	opacity: 0;
	transition: opacity .3s ease;
	touch-action: pan-y;
}

.hgc-lb.is-open {
	opacity: 1;
}

.hgc-lb__figure {
	display: flex;
	flex-direction: column;
	align-items: center;
	max-width: 100%;
	max-height: 100%;
	margin: 0;
	transform: scale(.94);
	transition: transform .4s cubic-bezier(.22, .61, .36, 1);
}

.hgc-lb.is-open .hgc-lb__figure {
	transform: scale(1);
}

.hgc-lb__img {
	display: block;
	max-width: 100%;
	max-height: calc(100vh - 170px);
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: 6px;
	box-shadow: 0 24px 70px rgba(0, 0, 0, .5);
	transition: opacity .25s ease;
	user-select: none;
	-webkit-user-drag: none;
}

.hgc-lb__img.is-loading {
	opacity: 0;
}

.hgc-lb__cap {
	max-width: 70ch;
	margin-top: 16px;
	font-size: 15px;
	line-height: 1.5;
	text-align: center;
}

.hgc-lb__cap strong {
	display: block;
	font-size: 17px;
	font-weight: 600;
}

.hgc-lb__cap span {
	display: block;
	margin-top: 4px;
	opacity: .8;
}

.hgc-lb__count {
	position: absolute;
	top: 20px;
	left: 24px;
	font-size: 14px;
	letter-spacing: .08em;
	opacity: .8;
}

.hgc-lb button.hgc-lb__btn {
	position: absolute;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	margin: 0;
	padding: 0;
	color: var(--hgc-lb-color);
	background: rgba(255, 255, 255, .12);
	border: 0;
	border-radius: 50%;
	box-shadow: none;
	cursor: pointer;
	transition: background-color .3s, transform .3s;
}

.hgc-lb button.hgc-lb__btn:hover,
.hgc-lb button.hgc-lb__btn:focus-visible {
	color: var(--hgc-lb-color);
	background: rgba(255, 255, 255, .26);
}

.hgc-lb__btn svg {
	width: 22px;
	height: 22px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2.4;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.hgc-lb__close {
	top: 14px;
	right: 18px;
}

.hgc-lb__prev {
	top: 50%;
	left: 16px;
	margin-top: -23px !important;
}

.hgc-lb__next {
	top: 50%;
	right: 16px;
	margin-top: -23px !important;
}

/* ==========================================================================
   Responsive & motion
   ========================================================================== */

@media (max-width: 767px) {
	.hgc-lb {
		padding: 64px 12px 28px;
	}

	.hgc-lb__prev {
		top: auto;
		bottom: 14px;
		left: 20px;
		margin-top: 0 !important;
	}

	.hgc-lb__next {
		top: auto;
		bottom: 14px;
		right: 20px;
		margin-top: 0 !important;
	}

	.hgc-lb__img {
		max-height: calc(100vh - 210px);
	}

	.hgc-wrapper .hgc-arrow {
		width: 38px;
		height: 38px;
		font-size: 15px;
	}

	/* Touch devices have no hover: keep captions and icons readable. */
	.hgc-layout-overlay .hgc-caption {
		opacity: 1;
	}

	.hgc-layout-overlay .hgc-content {
		transform: none;
	}
}

@media (hover: none) {
	.hgc-layout-frame .hgc-content {
		opacity: 1;
		transform: none;
	}

	.hgc-layout-frame .hgc-media::before {
		opacity: 1;
		transform: none;
	}

	.hgc-layout-frame .hgc-overlay::after {
		opacity: 1;
	}

	.hgc-wrapper .hgc-icon {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.hgc-wrapper *,
	.hgc-wrapper *::before,
	.hgc-wrapper *::after,
	.hgc-lb,
	.hgc-lb * {
		transition-duration: .01ms !important;
	}
}
