/* ET Media Gallery – Frontend Styles */

:root {
	--etmg-inner-r:   8px;  /* border-radius dos elementos internos */
	--etmg-thumb-gap: 8px;  /* espaço entre thumbnails */
	--etmg-thumb-mt:  8px;  /* espaço entre slide principal e thumbnails */
}

/* ======================== GALERIA WRAPPER ======================== */
.etmg-gallery {
	background-color: #a5d8de;
	border-radius: 16px;
	padding: 0;
	box-sizing: border-box;
	font-family: inherit;
	position: relative;
	max-width: 100%;
	overflow: hidden;
}

/* ======================== ÁREA PRINCIPAL ======================== */
.etmg-main-area {
	position: relative;
	border-radius: var(--etmg-inner-r);
	overflow: hidden;
	background: #000;
	aspect-ratio: 16 / 9;
}

/* Suporte a browsers sem aspect-ratio */
@supports not (aspect-ratio: 16/9) {
	.etmg-main-area::before {
		content: '';
		display: block;
		padding-top: 56.25%;
	}
	.etmg-slides-container {
		position: absolute;
		inset: 0;
	}
}

/* ======================== SLIDES ======================== */
.etmg-slides-container {
	width: 100%;
	height: 100%;
	position: relative;
}

.etmg-slide {
	position: absolute;
	inset: 0;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.35s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #000;
}

.etmg-slide.etmg-active {
	opacity: 1;
	pointer-events: auto;
	z-index: 1;
}

.etmg-slide img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	border: none;
}

.etmg-slide video {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
	background: #000;
}

.etmg-slide iframe,
.etmg-yt-iframe {
	width: 100%;
	height: 100%;
	border: none;
	display: block;
}

/* ======================== YOUTUBE FACADE ======================== */
.etmg-yt-facade {
	position: absolute;
	inset: 0;
	background: #000;
	cursor: pointer;
}

.etmg-yt-poster {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.etmg-yt-play-btn {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	background: none;
	border: none;
	cursor: pointer;
	padding: 0;
	opacity: 0.88;
	transition: opacity 0.2s, transform 0.2s;
	filter: drop-shadow(0 2px 10px rgba(0,0,0,.5));
	line-height: 0;
}

.etmg-yt-play-btn:hover,
.etmg-yt-play-btn:focus-visible {
	opacity: 1;
	transform: translate(-50%, -50%) scale(1.1);
}

.etmg-yt-play-btn svg {
	width: 68px;
	height: 48px;
	display: block;
	pointer-events: none;
}

.etmg-yt-iframe {
	position: absolute;
	inset: 0;
}

/* ======================== SETAS ======================== */
.etmg-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 10;
	background: rgba(0, 0, 0, 0.35);
	border: none;
	border-radius: 50%;
	width: 44px;
	height: 44px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	transition: background 0.2s, transform 0.15s;
	outline: none;
	-webkit-tap-highlight-color: transparent;
}

.etmg-arrow:hover,
.etmg-arrow:focus-visible {
	background: rgba(0, 0, 0, 0.65);
	transform: translateY(-50%) scale(1.08);
}

.etmg-arrow:active {
	transform: translateY(-50%) scale(0.96);
}

.etmg-prev { left: 12px; }
.etmg-next { right: 12px; }

.etmg-arrow svg {
	fill: #cddc39;
	width: 24px;
	height: 24px;
	display: block;
	pointer-events: none;
}

/* Esconder setas via config */
.etmg-gallery.etmg-hide-arrows .etmg-arrow {
	display: none !important;
}

/* ======================== THUMBNAILS ======================== */
.etmg-thumbs-wrapper {
	margin-top: var(--etmg-thumb-mt);
	--etmg-thumb-count: 4;
	position: relative;
}

/* Sempre uma linha horizontal com scroll — desktop e mobile */
.etmg-thumbs-strip {
	display: flex;
	flex-wrap: nowrap;
	gap: var(--etmg-thumb-gap);
	overflow-x: auto;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.etmg-thumbs-strip::-webkit-scrollbar {
	display: none;
}

/* Setas das thumbnails – mesmo padrão do slide principal */
.etmg-thumb-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 5;
	background: rgba(0, 0, 0, 0.40);
	border: none;
	border-radius: 50%;
	width: 36px;
	height: 36px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	transition: background 0.2s, transform 0.15s;
	outline: none;
	-webkit-tap-highlight-color: transparent;
}

.etmg-thumb-arrow:hover,
.etmg-thumb-arrow:focus-visible {
	background: rgba(0, 0, 0, 0.70);
	transform: translateY(-50%) scale(1.08);
}

.etmg-thumb-arrow:active {
	transform: translateY(-50%) scale(0.96);
}

.etmg-thumb-prev { left: 4px; }
.etmg-thumb-next { right: 4px; }

.etmg-thumb-arrow svg {
	fill: #cddc39;
	width: 20px;
	height: 20px;
	display: block;
	pointer-events: none;
}

.etmg-thumb {
	flex: 0 0 auto;
	/* Exatamente N thumbnails visíveis (N = --etmg-thumb-count) */
	width: calc(
		(100% - (var(--etmg-thumb-count, 4) - 1) * var(--etmg-thumb-gap, 8px))
		/ var(--etmg-thumb-count, 4)
	);
	border-radius: var(--etmg-inner-r);
	overflow: hidden;
	cursor: pointer;
	aspect-ratio: 4 / 3;
	background: #1a1a1a;
	border: 2px solid transparent;
	transition: border-color 0.2s, opacity 0.2s;
	position: relative;
	outline: none;
}

.etmg-thumb:hover,
.etmg-thumb:focus-visible {
	opacity: 0.88;
}

.etmg-thumb.etmg-active {
	border-color: #cddc39;
	box-shadow: 0 0 0 1px #cddc39;
}

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

.etmg-thumb-empty {
	width: 100%;
	height: 100%;
	background: #222;
}

/* Ícone play nas thumbs de vídeo */
.etmg-thumb-play-icon {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.35);
	pointer-events: none;
}

.etmg-thumb-play-icon svg {
	fill: rgba(255, 255, 255, 0.85);
	width: 20px;
	height: 20px;
	filter: drop-shadow(0 1px 2px rgba(0,0,0,.4));
}

/* ======================== RESPONSIVO ======================== */
@media (max-width: 767px) {
	.etmg-gallery {
		border-radius: 14px;
	}

	/* Setas do slide principal menores no mobile */
	.etmg-arrow {
		width: 34px;
		height: 34px;
	}

	.etmg-arrow svg {
		width: 18px;
		height: 18px;
	}

	.etmg-prev { left: 8px; }
	.etmg-next { right: 8px; }

	/* Setas das thumbnails menores no mobile */
	.etmg-thumb-arrow {
		width: 28px;
		height: 28px;
	}

	.etmg-thumb-arrow svg {
		width: 16px;
		height: 16px;
	}
}
