/* Emirates Elements: EG Gallery Grid. Colors, sizes and spacing are set by the widget's style controls. */

.ee-gg {
	box-sizing: border-box;
	width: 100%;
}

.ee-gg--empty {
	padding: 24px;
	border: 1px dashed currentColor;
	text-align: center;
	opacity: 0.6;
}

.ee-gg__grid {
	display: grid;
	transition: opacity 0.25s ease;
}

.ee-gg.is-loading .ee-gg__grid {
	opacity: 0.35;
	pointer-events: none;
}

.ee-gg__card {
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	margin: 0;
	min-width: 0;
}

.ee-gg__media {
	position: relative;
	overflow: hidden;
	width: 100%;
}

/* Doubled class beats the theme's generic "img { height: auto }". */
.ee-gg .ee-gg__img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: 100%;
	object-fit: cover;
}

.ee-gg__media::after {
	content: "";
	position: absolute;
	inset: 0;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s ease;
}

.ee-gg__caption {
	box-sizing: border-box;
	margin: 0;
	font-style: normal;
}

/* Lightbox button: shown on hover or keyboard focus; always shown on touch screens. */
.ee-gg__open {
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	opacity: 0;
	transform: translate(-50%, -50%) scale(0.85);
	transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.2s ease;
}

.ee-gg__media:hover::after,
.ee-gg__media:focus-within::after {
	opacity: 1;
}

.ee-gg__media:hover .ee-gg__open,
.ee-gg__open:focus-visible {
	opacity: 1;
	transform: translate(-50%, -50%) scale(1);
}

@media (hover: none) {
	/* No hover on touch: keep the button visible, in the corner so the photo stays clear. */
	.ee-gg__open {
		top: auto;
		left: auto;
		right: 10px;
		bottom: 10px;
		opacity: 1;
		transform: none;
	}
}

/* Pagination */
.ee-gg__pager {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
}

.ee-gg__page {
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0 8px;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.ee-gg__page.is-disabled {
	opacity: 0.35;
	cursor: default;
}

.ee-gg__dots {
	opacity: 0.6;
}

/* Lightbox: a <dialog> opened with showModal(), so it sits above everything and traps focus. */
.ee-gg__lb {
	box-sizing: border-box;
	width: 100%;
	height: 100%;
	max-width: none;
	max-height: none;
	margin: 0;
	padding: 24px;
	border: 0;
	overflow: hidden;
}

.ee-gg__lb[open] {
	display: flex;
	align-items: center;
	justify-content: center;
}

.ee-gg__lb::backdrop {
	background: transparent;
}

.ee-gg__lb-panel {
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	gap: 24px;
	width: 100%;
	max-width: 1240px;
	max-height: 100%;
	overflow: hidden;
}

.ee-gg__lb-top {
	display: flex;
	justify-content: flex-end;
}

.ee-gg__lb-close {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	min-height: 44px;
	padding: 0 4px;
	border: 0;
	background: transparent;
	font-family: inherit;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	cursor: pointer;
}

/* Doubled class beats the theme's generic button colors, so the controls stay plain. */
.ee-gg .ee-gg__lb-close,
.ee-gg .ee-gg__lb-arrow,
.ee-gg .ee-gg__lb-close:hover,
.ee-gg .ee-gg__lb-arrow:hover,
.ee-gg .ee-gg__lb-close:focus,
.ee-gg .ee-gg__lb-arrow:focus {
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
}

.ee-gg__stage {
	position: relative;
	overflow: hidden;
	touch-action: pan-y;
	cursor: grab;
}

.ee-gg__stage.is-dragging {
	cursor: grabbing;
}

.ee-gg__stage.is-dragging .ee-gg__track {
	transition: none;
}

.ee-gg__track {
	display: flex;
	gap: 80px;
	transition: transform 0.5s cubic-bezier(0.22, 0.61, 0.36, 1);
	will-change: transform;
}

.ee-gg__slide {
	position: relative;
	flex: 0 0 var(--ee-gg-slide-w, 50%);
	max-height: calc(100dvh - 300px);
	margin: 0;
	overflow: hidden;
	opacity: 0.35;
	transition: opacity 0.4s ease;
	user-select: none;
}

.ee-gg__slide.is-active {
	opacity: 1;
}

.ee-gg .ee-gg__slide .ee-gg__slide-img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	-webkit-user-drag: none;
	pointer-events: none;
}

.ee-gg__slide-caption {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	box-sizing: border-box;
	padding: 18px 40px;
	font-style: normal;
}

.ee-gg__lb-bottom {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
}

.ee-gg__bars {
	display: flex;
	flex: 1 1 auto;
	align-items: center;
	gap: 10px;
	min-width: 0;
}

.ee-gg__bar {
	flex: 0 0 30px;
	height: 4px;
	border-radius: 4px;
	background: var(--ee-gg-bar, #e4d6c0);
	transition: background-color 0.3s ease, flex-basis 0.3s ease;
}

.ee-gg__bar.is-active {
	flex-basis: 30px;
	background: var(--ee-gg-bar-active, #48151e);
}

/* Many images: one progress track plus a counter replaces the row of pills. */
.ee-gg__progress {
	position: relative;
	flex: 1 1 auto;
	max-width: 320px;
	height: 4px;
	border-radius: 4px;
	background: var(--ee-gg-bar, #e4d6c0);
	overflow: hidden;
}

.ee-gg__progress-fill {
	position: absolute;
	inset: 0 auto 0 0;
	border-radius: 4px;
	background: var(--ee-gg-bar-active, #48151e);
	transition: width 0.4s ease;
}

.ee-gg__count {
	flex: 0 0 auto;
	font-size: 13px;
	font-weight: 600;
	color: var(--ee-gg-bar-active, #48151e);
}

.ee-gg__lb-nav {
	display: flex;
	flex: 0 0 auto;
	gap: 24px;
}

.ee-gg__lb-arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
	transition: opacity 0.2s ease;
}

.ee-gg__lb-arrow:disabled {
	opacity: 0.3;
	cursor: default;
}

.ee-gg__lb-close:focus-visible,
.ee-gg__lb-arrow:focus-visible,
.ee-gg__page:focus-visible,
.ee-gg__open:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

@media (max-width: 1024px) {
	.ee-gg__track {
		gap: 32px;
	}

	.ee-gg__slide-caption {
		padding: 14px 24px;
	}
}

@media (max-width: 767px) {
	.ee-gg__lb {
		padding: 12px;
	}

	.ee-gg__lb-panel {
		gap: 16px;
	}

	.ee-gg__track {
		gap: 16px;
	}

	.ee-gg__slide {
		max-height: calc(100dvh - 240px);
	}

	.ee-gg__slide-caption {
		padding: 12px 16px;
	}

	.ee-gg__lb-nav {
		gap: 8px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ee-gg__track,
	.ee-gg__slide,
	.ee-gg__open,
	.ee-gg__media::after,
	.ee-gg__grid {
		transition: none;
	}
}
