/* ==========================================================================
   GG Gallery for Elementor — frontend styles
   ========================================================================== */

.gg-gallery {
	--gg-columns: 3;
	--gg-gap: 16px;
	--gg-ratio: 1/1;
	--gg-fit: cover;
	--gg-speed: 450ms;
	--gg-ease: cubic-bezier(0.22, 1, 0.36, 1);
	--gg-row-height: 260px;
	--gg-lb-bg: rgba(10, 11, 16, 0.94);
	--gg-lb-ui: #ffffff;
	--gg-lb-accent: #ffffff;
	--gg-lb-radius: 8px;
	position: relative;
}

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

.gg-empty {
	padding: 40px 20px;
	text-align: center;
	border: 1px dashed rgba(0, 0, 0, 0.18);
	border-radius: 10px;
	color: #6b7280;
	font-size: 14px;
}

/* --------------------------------------------------------------------------
   Filters
   -------------------------------------------------------------------------- */

.gg-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 28px;
}

.gg-filter {
	appearance: none;
	border: 0;
	cursor: pointer;
	background: rgba(0, 0, 0, 0.05);
	color: #5b6070;
	font: inherit;
	font-size: 14px;
	line-height: 1.2;
	padding: 9px 18px;
	border-radius: 999px;
	transition: background-color 250ms var(--gg-ease), color 250ms var(--gg-ease);
	position: relative;
	white-space: nowrap;
}

.gg-filter:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.gg-filters--scroll {
	flex-wrap: nowrap;
	overflow-x: auto;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
	scroll-snap-type: x proximity;
}

.gg-filters--scroll::-webkit-scrollbar {
	display: none;
}

.gg-filters--scroll .gg-filter {
	flex: 0 0 auto;
	scroll-snap-align: center;
}

.gg-filters--underline .gg-filter,
.gg-filters--plain .gg-filter {
	background: transparent !important;
	border-radius: 0 !important;
	padding-left: 4px;
	padding-right: 4px;
}

.gg-filters--underline .gg-filter::after {
	content: "";
	position: absolute;
	left: 4px;
	right: 4px;
	bottom: 0;
	height: 2px;
	background: currentColor;
	transform: scaleX(0);
	transform-origin: left;
	transition: transform 300ms var(--gg-ease);
}

.gg-filters--underline .gg-filter.is-active::after {
	transform: scaleX(1);
}

/* --------------------------------------------------------------------------
   Shared item shell
   -------------------------------------------------------------------------- */

.gg-viewport {
	position: relative;
}

.gg-item {
	min-width: 0;
}

.gg-item__inner {
	position: relative;
	overflow: hidden;
	border-radius: 14px;
	background: rgba(0, 0, 0, 0.04);
	transform: translateZ(0);
	transition: transform var(--gg-speed) var(--gg-ease), box-shadow var(--gg-speed) var(--gg-ease);
}

.gg-item__link {
	display: block;
	position: relative;
	height: 100%;
	text-decoration: none;
	color: inherit;
}

.gg-item__link:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

.gg-media {
	position: relative;
	overflow: hidden;
	height: 100%;
}

.gg-media img {
	display: block;
	width: 100%;
	height: auto;
	transition: transform var(--gg-speed) var(--gg-ease), filter var(--gg-speed) var(--gg-ease);
	will-change: transform;
}

.gg-has-ratio .gg-media {
	aspect-ratio: var(--gg-ratio);
}

.gg-has-ratio .gg-media img {
	height: 100%;
	object-fit: var(--gg-fit);
}

/* Fallback for browsers without aspect-ratio */
@supports not (aspect-ratio: 1/1) {
	.gg-has-ratio .gg-media {
		padding-top: 100%;
	}
	.gg-has-ratio .gg-media img {
		position: absolute;
		inset: 0;
	}
}

/* --------------------------------------------------------------------------
   Layouts
   -------------------------------------------------------------------------- */

/* Grid */
.gg-layout-grid .gg-grid {
	display: grid;
	grid-template-columns: repeat(var(--gg-columns), minmax(0, 1fr));
	gap: var(--gg-gap);
}

/* Masonry */
.gg-layout-masonry .gg-grid {
	columns: var(--gg-columns);
	column-gap: var(--gg-gap);
}

.gg-layout-masonry .gg-item {
	break-inside: avoid;
	-webkit-column-break-inside: avoid;
	page-break-inside: avoid;
	margin-bottom: var(--gg-gap);
	display: inline-block;
	width: 100%;
}

/* Justified */
.gg-layout-justified .gg-grid {
	display: flex;
	flex-wrap: wrap;
	gap: var(--gg-gap);
}

.gg-layout-justified .gg-item {
	flex-grow: 1;
	height: var(--gg-row-height);
}

.gg-layout-justified .gg-item__inner,
.gg-layout-justified .gg-media {
	height: 100%;
}

.gg-layout-justified .gg-media img {
	height: 100%;
	width: 100%;
	object-fit: cover;
}

.gg-layout-justified .gg-grid::after {
	content: "";
	flex-grow: 999999;
}

/* Carousel */
.gg-layout-carousel .gg-grid {
	display: flex;
	gap: var(--gg-gap);
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none;
	-ms-overflow-style: none;
	-webkit-overflow-scrolling: touch;
	padding-bottom: 2px;
}

.gg-layout-carousel .gg-grid::-webkit-scrollbar {
	display: none;
}

.gg-layout-carousel.gg-free-scroll .gg-grid {
	scroll-snap-type: none;
}

.gg-layout-carousel .gg-item {
	flex: 0 0 calc((100% - (var(--gg-columns) - 1) * var(--gg-gap)) / var(--gg-columns));
	scroll-snap-align: start;
}

.gg-layout-carousel .gg-grid.is-dragging {
	scroll-behavior: auto;
	cursor: grabbing;
	scroll-snap-type: none;
}

.gg-layout-carousel .gg-grid.is-dragging a {
	pointer-events: none;
}

.gg-layout-carousel .gg-grid:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 4px;
}

/* --------------------------------------------------------------------------
   Overlay + caption
   -------------------------------------------------------------------------- */

.gg-overlay {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	align-items: flex-start;
	text-align: left;
	padding: 20px;
	background-image: linear-gradient(180deg, rgba(8, 10, 20, 0) 30%, rgba(8, 10, 20, 0.78) 100%);
	pointer-events: none;
}

.gg-content {
	position: relative;
	width: 100%;
}

.gg-overlay :where(.gg-title) {
	color: #fff;
	margin: 0 0 6px;
	font-size: 18px;
	line-height: 1.3;
}

.gg-overlay :where(.gg-desc) {
	color: rgba(255, 255, 255, 0.82);
	margin: 0;
	font-size: 14px;
	line-height: 1.5;
}

.gg-caption :where(.gg-title) {
	color: #0f1420;
	margin: 0 0 6px;
	font-size: 17px;
	line-height: 1.3;
}

.gg-caption :where(.gg-desc) {
	color: #5b6070;
	margin: 0;
	font-size: 14px;
	line-height: 1.5;
}

.gg-caption {
	padding: 14px 2px 0;
}

.gg-icon {
	position: absolute;
	top: 16px;
	right: 16px;
	width: 46px;
	height: 46px;
	display: grid;
	place-items: center;
	border-radius: 50%;
	color: #fff;
	background: rgba(255, 255, 255, 0.18);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	transform: scale(0.7);
	opacity: 0;
	transition: transform var(--gg-speed) var(--gg-ease), opacity var(--gg-speed) var(--gg-ease);
}

.gg-icon svg {
	width: 45%;
	height: 45%;
}

.gg-overlay--icon-only {
	background-image: linear-gradient(180deg, rgba(8, 10, 20, 0.35), rgba(8, 10, 20, 0.35));
	opacity: 0;
	transition: opacity var(--gg-speed) var(--gg-ease);
}

.gg-item:hover .gg-overlay--icon-only {
	opacity: 1;
}

.gg-item:hover .gg-icon,
.gg-item__link:focus-visible .gg-icon {
	transform: scale(1);
	opacity: 1;
}

/* Caption reveal modes */
.gg-caption-fade .gg-overlay,
.gg-caption-slide .gg-overlay,
.gg-caption-zoom .gg-overlay {
	opacity: 0;
	transition: opacity var(--gg-speed) var(--gg-ease), transform var(--gg-speed) var(--gg-ease);
}

.gg-caption-slide .gg-content {
	transform: translateY(14px);
	transition: transform var(--gg-speed) var(--gg-ease);
}

.gg-caption-zoom .gg-content {
	transform: scale(0.94);
	transition: transform var(--gg-speed) var(--gg-ease);
}

.gg-caption-fade .gg-item:hover .gg-overlay,
.gg-caption-slide .gg-item:hover .gg-overlay,
.gg-caption-zoom .gg-item:hover .gg-overlay,
.gg-caption-fade .gg-item__link:focus-visible .gg-overlay,
.gg-caption-slide .gg-item__link:focus-visible .gg-overlay,
.gg-caption-zoom .gg-item__link:focus-visible .gg-overlay {
	opacity: 1;
}

.gg-caption-slide .gg-item:hover .gg-content,
.gg-caption-zoom .gg-item:hover .gg-content,
.gg-caption-slide .gg-item__link:focus-visible .gg-content,
.gg-caption-zoom .gg-item__link:focus-visible .gg-content {
	transform: none;
}

/* Touch devices: no hover, so reveal the caption permanently */
@media (hover: none) {
	.gg-touch-reveal .gg-overlay,
	.gg-touch-reveal .gg-content,
	.gg-touch-reveal .gg-overlay--icon-only {
		opacity: 1;
		transform: none;
	}
	.gg-touch-reveal .gg-icon {
		opacity: 1;
		transform: none;
	}
}

/* --------------------------------------------------------------------------
   Image hover effects
   -------------------------------------------------------------------------- */

.gg-hover-zoom-in .gg-item:hover .gg-media img {
	transform: scale(1.08);
}

.gg-hover-zoom-out .gg-media img {
	transform: scale(1.1);
}

.gg-hover-zoom-out .gg-item:hover .gg-media img {
	transform: scale(1);
}

.gg-hover-pan .gg-item:hover .gg-media img {
	transform: scale(1.12) translateY(-3%);
}

.gg-hover-tilt .gg-item:hover .gg-media img {
	transform: scale(1.1) rotate(2deg);
}

.gg-hover-grayscale .gg-media img {
	filter: grayscale(1);
}

.gg-hover-grayscale .gg-item:hover .gg-media img {
	filter: grayscale(0);
}

.gg-hover-blur .gg-item:hover .gg-media img {
	filter: blur(3px);
	transform: scale(1.05);
}

.gg-hover-lift .gg-item:hover .gg-item__inner {
	transform: translateY(-8px);
}

/* --------------------------------------------------------------------------
   Filtering + load more states
   -------------------------------------------------------------------------- */

.gg-item.is-hidden {
	display: none;
}

.gg-item.is-filtering {
	opacity: 0;
	transform: scale(0.96);
	transition: opacity 220ms var(--gg-ease), transform 220ms var(--gg-ease);
}

.gg-loadmore {
	display: flex;
	justify-content: center;
	margin-top: 32px;
}

.gg-loadmore__btn {
	appearance: none;
	border: 0;
	cursor: pointer;
	font: inherit;
	font-size: 15px;
	padding: 14px 34px;
	border-radius: 999px;
	color: #fff;
	background: #111827;
	transition: background-color 250ms var(--gg-ease), color 250ms var(--gg-ease), transform 250ms var(--gg-ease);
}

.gg-loadmore__btn:hover {
	transform: translateY(-2px);
}

.gg-loadmore__btn:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

.gg-loadmore.is-done {
	display: none;
}

/* --------------------------------------------------------------------------
   Reveal on scroll
   -------------------------------------------------------------------------- */

.gg-gallery[data-reveal] .gg-item {
	opacity: 0;
	transition: opacity 620ms var(--gg-ease), transform 620ms var(--gg-ease);
	transition-delay: var(--gg-delay, 0ms);
}

.gg-gallery[data-reveal="up"] .gg-item {
	transform: translateY(24px);
}

.gg-gallery[data-reveal="scale"] .gg-item {
	transform: scale(0.94);
}

.gg-gallery[data-reveal] .gg-item.is-in {
	opacity: 1;
	transform: none;
}

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

.gg-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 5;
	width: 44px;
	height: 44px;
	display: grid;
	place-items: center;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	color: #111827;
	background: #fff;
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.14);
	transition: opacity 250ms var(--gg-ease), transform 250ms var(--gg-ease);
}

.gg-arrow svg {
	width: 45%;
	height: 45%;
}

.gg-arrow:hover {
	transform: translateY(-50%) scale(1.06);
}

.gg-arrow:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

.gg-arrow[disabled] {
	opacity: 0.35;
	pointer-events: none;
}

.gg-arrows-inside .gg-arrow--prev { left: 12px; }
.gg-arrows-inside .gg-arrow--next { right: 12px; }

.gg-arrows-outside .gg-viewport {
	padding-inline: 60px;
}
.gg-arrows-outside .gg-arrow--prev { left: 0; }
.gg-arrows-outside .gg-arrow--next { right: 0; }

.gg-arrows-bottom .gg-arrow {
	position: static;
	transform: none;
	box-shadow: none;
}
.gg-arrows-bottom .gg-arrow:hover {
	transform: scale(1.06);
}

.gg-nav {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 14px;
	margin-top: 20px;
}

.gg-arrows-bottom .gg-nav {
	gap: 18px;
}

.gg-dots {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
}

.gg-dot {
	width: 8px;
	height: 8px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	cursor: pointer;
	background: rgba(17, 24, 39, 0.25);
	transition: width 300ms var(--gg-ease), background-color 300ms var(--gg-ease);
}

.gg-dot.is-active {
	width: 26px;
	background: #111827;
}

.gg-dot:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

@media (max-width: 767px) {
	.gg-arrows-outside .gg-viewport {
		padding-inline: 0;
	}
	.gg-arrows-outside .gg-arrow--prev { left: 8px; }
	.gg-arrows-outside .gg-arrow--next { right: 8px; }
}

/* --------------------------------------------------------------------------
   Lightbox
   -------------------------------------------------------------------------- */

.gg-lb {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	flex-direction: column;
	background: var(--gg-lb-bg, rgba(10, 11, 16, 0.94));
	opacity: 0;
	visibility: hidden;
	transition: opacity 280ms var(--gg-ease), visibility 280ms;
	-webkit-tap-highlight-color: transparent;
}

.gg-lb.is-open {
	opacity: 1;
	visibility: visible;
}

.gg-lb__stage {
	position: relative;
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 64px 16px 8px;
	min-height: 0;
	overflow: hidden;
	touch-action: pan-y;
}

.gg-lb__figure {
	position: relative;
	max-width: 100%;
	max-height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 260ms var(--gg-ease), opacity 200ms linear;
}

.gg-lb__figure img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: var(--gg-lb-radius, 8px);
	box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
	user-select: none;
	-webkit-user-drag: none;
}

.gg-lb__figure.is-loading {
	opacity: 0.35;
}

.gg-lb__spinner {
	position: absolute;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	border: 2px solid rgba(255, 255, 255, 0.25);
	border-top-color: var(--gg-lb-accent, #fff);
	animation: gg-spin 700ms linear infinite;
	opacity: 0;
	pointer-events: none;
}

.gg-lb.is-loading .gg-lb__spinner {
	opacity: 1;
}

@keyframes gg-spin {
	to { transform: rotate(360deg); }
}

.gg-lb__bar {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 16px;
	color: var(--gg-lb-ui, #fff);
	z-index: 3;
}

.gg-lb__counter {
	font-size: 14px;
	letter-spacing: 0.04em;
	opacity: 0.75;
	font-variant-numeric: tabular-nums;
}

.gg-lb__actions {
	display: flex;
	gap: 6px;
	margin-left: auto;
}

.gg-lb__btn {
	width: 42px;
	height: 42px;
	display: grid;
	place-items: center;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	color: var(--gg-lb-ui, #fff);
	background: rgba(255, 255, 255, 0.1);
	transition: background-color 200ms var(--gg-ease), transform 200ms var(--gg-ease);
}

.gg-lb__btn:hover {
	background: rgba(255, 255, 255, 0.2);
}

.gg-lb__btn:focus-visible {
	outline: 2px solid var(--gg-lb-accent, #fff);
	outline-offset: 2px;
}

.gg-lb__btn svg {
	width: 20px;
	height: 20px;
}

.gg-lb__nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 52px;
	height: 52px;
	display: grid;
	place-items: center;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	color: var(--gg-lb-ui, #fff);
	background: rgba(255, 255, 255, 0.1);
	transition: background-color 200ms var(--gg-ease);
	z-index: 3;
}

.gg-lb__nav:hover {
	background: rgba(255, 255, 255, 0.2);
}

.gg-lb__nav:focus-visible {
	outline: 2px solid var(--gg-lb-accent, #fff);
	outline-offset: 2px;
}

.gg-lb__nav svg {
	width: 24px;
	height: 24px;
}

.gg-lb__nav--prev { left: 14px; }
.gg-lb__nav--next { right: 14px; }

.gg-lb__nav[hidden] { display: none; }

.gg-lb__caption {
	color: var(--gg-lb-ui, #fff);
	text-align: center;
	padding: 14px 24px 6px;
	max-width: 760px;
	margin: 0 auto;
}

.gg-lb__caption:empty {
	display: none;
}

.gg-lb__caption h4 {
	margin: 0 0 4px;
	font-size: 17px;
	font-weight: 600;
}

.gg-lb__caption p {
	margin: 0;
	font-size: 14px;
	line-height: 1.5;
	opacity: 0.72;
}

.gg-lb__thumbs {
	display: flex;
	gap: 8px;
	justify-content: flex-start;
	padding: 14px 16px 18px;
	overflow-x: auto;
	scrollbar-width: none;
	scroll-behavior: smooth;
}

.gg-lb__thumbs::-webkit-scrollbar { display: none; }

.gg-lb__thumb {
	flex: 0 0 auto;
	width: 62px;
	height: 46px;
	padding: 0;
	border: 0;
	border-radius: 6px;
	overflow: hidden;
	cursor: pointer;
	opacity: 0.4;
	background: none;
	transition: opacity 200ms var(--gg-ease), transform 200ms var(--gg-ease);
}

.gg-lb__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.gg-lb__thumb.is-active {
	opacity: 1;
	box-shadow: 0 0 0 2px var(--gg-lb-accent, #fff);
}

.gg-lb__thumb:hover {
	opacity: 0.85;
}

.gg-lb__thumb:focus-visible {
	outline: 2px solid var(--gg-lb-accent, #fff);
	outline-offset: 2px;
}

.gg-lb.is-zoomed .gg-lb__stage {
	overflow: auto;
	cursor: zoom-out;
	touch-action: auto;
}

.gg-lb.is-zoomed .gg-lb__figure img {
	max-width: none;
	max-height: none;
	width: auto;
	cursor: zoom-out;
}

body.gg-lb-open {
	overflow: hidden;
}

@media (max-width: 767px) {
	.gg-lb__stage { padding: 60px 8px 4px; }
	.gg-lb__nav { width: 42px; height: 42px; }
	.gg-lb__nav--prev { left: 6px; }
	.gg-lb__nav--next { right: 6px; }
	.gg-lb__thumbs { padding-bottom: 14px; }
}

/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	.gg-gallery *,
	.gg-lb * {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		scroll-behavior: auto !important;
	}
	.gg-gallery[data-reveal] .gg-item {
		opacity: 1;
		transform: none;
	}
}
