/**
 * Styles for the "Fayna Gallery Grid" Elementor widget.
 * Split (gap, heights, radius) comes from Elementor style controls (inline selectors).
 */
.rw-fg-wrapper {
	display: flex;
	align-items: stretch;
}

.rw-fg-featured {
	position: relative;
	flex: 0 0 50%;
	max-width: 50%;
	overflow: visible;
}

.rw-fg-grid {
	flex: 0 0 50%;
	max-width: 50%;
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	align-content: start;
}

.rw-fg-item {
	position: relative;
	display: block;
	height: 100%;
	overflow: visible;
	text-decoration: none;
	cursor: pointer;
	transition: box-shadow 0.35s ease;
}

.rw-fg-item:hover,
.rw-fg-item:focus-visible,
.rw-fg-video-block:hover,
.rw-fg-video-block:focus-visible {
	position: relative;
	z-index: 2;
	box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

.rw-fg-video-block {
	position: relative;
	display: block;
	height: 100%;
	overflow: hidden;
	cursor: pointer;
	transition: box-shadow 0.35s ease;
}

.rw-fg-item--featured {
	height: 100%;
}

.rw-fg-item-media {
	position: absolute;
	inset: 0;
	overflow: hidden;
	border-radius: inherit;
}

.rw-fg-item-image {
	position: absolute;
	inset: 0;
	background-size: cover;
	background-position: center;
	transition: transform 0.5s ease;
}

.rw-fg-item:hover .rw-fg-item-image,
.rw-fg-item:focus-visible .rw-fg-item-image,
.rw-fg-video-block:hover .rw-fg-item-image,
.rw-fg-video-block:focus-visible .rw-fg-item-image {
	transform: scale(1.08);
}

.rw-fg-item-overlay {
	position: absolute;
	inset: 0;
	background-color: rgba(0, 0, 0, 0.35);
	opacity: 0;
	transition: opacity 0.35s ease, background-color 0.35s ease;
}

.rw-fg-item:hover .rw-fg-item-overlay,
.rw-fg-item:focus-visible .rw-fg-item-overlay {
	opacity: 1;
}

/* The featured video block keeps its overlay always visible for contrast behind the play button. */
.rw-fg-video-block .rw-fg-item-overlay {
	opacity: 1;
}

.rw-fg-video-embed,
.rw-fg-video-embed iframe,
.rw-fg-video-embed video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border: 0;
}

.rw-fg-item-title {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 20px;
	line-height: 1.3;
	text-align: center;
	opacity: 0;
	transition: opacity 0.35s ease, transform 0.35s ease;
}

.rw-fg-icon {
	display: block;
	flex-shrink: 0;
}

/* Overlay, title and icon stay hidden until the item is hovered/focused. */
.rw-fg-item:hover .rw-fg-item-title,
.rw-fg-item:focus-visible .rw-fg-item-title {
	opacity: 1;
	transform: scale(1.05);
}

/* Stack the featured block on top of the grid below tablet/desktop widths. */
@media (max-width: 1024px) {
	.rw-fg-wrapper {
		flex-direction: column;
	}

	.rw-fg-featured,
	.rw-fg-grid {
		flex-basis: 100% !important;
		max-width: 100%;
	}
}

/* Full gallery modal. */
.rw-fg-modal {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 999999;
}

.rw-fg-modal--open {
	display: block;
}

.rw-fg-modal-overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.85);
}

.rw-fg-modal-content {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	padding: 40px;
	box-sizing: border-box;
}

.rw-fg-modal-image {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.rw-fg-modal-close {
	position: absolute;
	top: 15px;
	right: 20px;
	background: transparent;
	border: 0;
	color: #fff;
	font-size: 36px;
	line-height: 1;
	cursor: pointer;
}

.rw-fg-modal-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background: rgba(255, 255, 255, 0.15);
	border: 0;
	color: #fff;
	font-size: 32px;
	line-height: 1;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	cursor: pointer;
}

.rw-fg-modal-prev {
	left: 15px;
}

.rw-fg-modal-next {
	right: 15px;
}

.rw-fg-modal-counter {
	position: absolute;
	bottom: 15px;
	left: 0;
	right: 0;
	text-align: center;
	color: #fff;
	font-size: 14px;
}

body.rw-fg-modal-lock {
	overflow: hidden;
}

/* Featured video: play button over the poster. */
.rw-fg-video-play {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 72px;
	height: 72px;
	border-radius: 50%;
	background-color: rgba(255, 255, 255, 0.9);
	color: #111;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
	transition: transform 0.3s ease, background-color 0.3s ease;
}

.rw-fg-video-block:hover .rw-fg-video-play,
.rw-fg-video-block:focus-visible .rw-fg-video-play {
	transform: translate(-50%, -50%) scale(1.08);
	background-color: #fff;
}

/* Video popup. */
.rw-fg-video-modal {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 999999;
}

.rw-fg-video-modal--open {
	display: block;
}

.rw-fg-video-modal-overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.85);
}

.rw-fg-video-modal-content {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	padding: 40px;
	box-sizing: border-box;
}

.rw-fg-video-modal-close {
	position: absolute;
	top: 15px;
	right: 20px;
	background: transparent;
	border: 0;
	color: #fff;
	font-size: 36px;
	line-height: 1;
	cursor: pointer;
}

.rw-fg-video-modal-inner {
	position: relative;
	width: min(92vw, 1100px);
	aspect-ratio: 16 / 9;
}

.rw-fg-video-modal-inner .rw-fg-video-embed,
.rw-fg-video-modal-inner iframe,
.rw-fg-video-modal-inner video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}
