/* ==========================================================================
   Admin - meta box de seleção de imagens
   ========================================================================== */

.gfs-imagens-lista {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 10px 0;
	padding: 0;
	list-style: none;
}

.gfs-imagens-lista .gfs-item {
	position: relative;
	width: 90px;
	height: 90px;
	border: 1px solid #ccd0d4;
	border-radius: 4px;
	overflow: hidden;
	cursor: move;
	background: #f0f0f1;
}

.gfs-imagens-lista .gfs-item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.gfs-imagens-lista .gfs-item.gfs-ordenando {
	opacity: 0.5;
}

.gfs-remover-imagem {
	position: absolute;
	top: 2px;
	right: 2px;
	width: 20px;
	height: 20px;
	line-height: 18px;
	text-align: center;
	background: #d63638;
	color: #fff;
	border-radius: 50%;
	text-decoration: none;
	font-weight: bold;
	font-size: 14px;
}

.gfs-remover-imagem:hover {
	background: #a00;
	color: #fff;
}

/* ==========================================================================
   Frontend - alternador de visualização (grade / slide)
   ========================================================================== */

.gfs-galeria-container {
	margin: 20px 0;
}

.gfs-screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

.gfs-toggle-visualizacao {
	display: flex;
	justify-content: flex-end;
	gap: 4px;
	margin-bottom: 8px;
}

.gfs-toggle-btn {
	background: none;
	border: none;
	padding: 4px;
	margin: 0;
	line-height: 0;
	color: #666;
	opacity: 0.55;
	cursor: pointer;
	transition: opacity 0.2s ease, color 0.2s ease;
}

.gfs-toggle-btn:hover {
	opacity: 0.85;
}

.gfs-toggle-btn[aria-pressed="true"] {
	opacity: 1;
	color: #2271b1;
}

/* ==========================================================================
   Frontend - grid da galeria
   ========================================================================== */

.gfs-galeria.gfs-view-grade {
	display: none;
}

.gfs-galeria.gfs-view-grade.gfs-view-ativa {
	display: grid;
	grid-template-columns: repeat(var(--gfs-colunas, 4), 1fr);
	gap: 12px;
}

@media (max-width: 782px) {
	.gfs-galeria.gfs-view-grade.gfs-view-ativa {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 480px) {
	.gfs-galeria.gfs-view-grade.gfs-view-ativa {
		grid-template-columns: 1fr 1fr;
	}
}

.gfs-galeria .gfs-item {
	display: block;
	position: relative;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	border-radius: 6px;
	background: #eee;
}

.gfs-galeria .gfs-item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.25s ease;
}

.gfs-galeria .gfs-item:hover img {
	transform: scale(1.06);
}

/* ==========================================================================
   Frontend - visualização em slide (foto em destaque + miniaturas)
   ========================================================================== */

.gfs-galeria.gfs-view-slide {
	display: none;
}

.gfs-galeria.gfs-view-slide.gfs-view-ativa {
	display: block;
}

.gfs-slide-principal {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 12px;
}

.gfs-slide-imagem-atual {
	display: block;
	max-width: 100%;
	max-height: 75vh;
	width: auto;
	height: auto;
	margin: 0 auto;
	cursor: zoom-in;
}

/* Setas de navegação: apenas o ícone, sem fundo nem forma ao redor. */
.gfs-slide-seta {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 2;
	background: none;
	border: none;
	padding: 8px;
	color: #fff;
	cursor: pointer;
	font-size: 36px;
	line-height: 1;
	opacity: 0.8;
	text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85), 0 0 12px rgba(0, 0, 0, 0.5);
	transition: opacity 0.2s ease;
}

.gfs-slide-seta:hover {
	opacity: 1;
}

.gfs-slide-anterior {
	left: 4px;
}

.gfs-slide-proximo {
	right: 4px;
}

.gfs-slide-thumbs-wrap {
	display: flex;
	align-items: center;
	gap: 2px;
}

/* Setas de rolagem das miniaturas: apenas o ícone, sem fundo nem forma ao redor. */
.gfs-thumbs-seta {
	flex: 0 0 auto;
	background: none;
	border: none;
	padding: 4px 6px;
	margin: 0;
	color: #666;
	cursor: pointer;
	font-size: 28px;
	line-height: 1;
	opacity: 0.55;
	transition: opacity 0.2s ease;
}

.gfs-thumbs-seta:hover {
	opacity: 1;
}

.gfs-thumbs-seta.gfs-oculto {
	visibility: hidden;
	pointer-events: none;
}

.gfs-slide-thumbs {
	display: flex;
	flex: 1 1 auto;
	gap: 8px;
	overflow-x: auto;
	padding: 4px 2px;
	margin: 0;
	list-style: none;
	scroll-behavior: smooth;
}

.gfs-slide-thumb {
	flex: 0 0 auto;
	width: 72px;
	height: 72px;
	border-radius: 4px;
	overflow: hidden;
	cursor: pointer;
	opacity: 0.55;
	border: 2px solid transparent;
	transition: opacity 0.2s ease, border-color 0.2s ease;
}

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

.gfs-slide-thumb:hover {
	opacity: 0.85;
}

.gfs-slide-thumb.gfs-ativo {
	opacity: 1;
	border-color: #2271b1;
}

@media (max-width: 600px) {
	.gfs-slide-seta {
		font-size: 28px;
	}

	.gfs-thumbs-seta {
		font-size: 22px;
	}

	.gfs-slide-thumb {
		width: 56px;
		height: 56px;
	}
}

/* ==========================================================================
   Lightbox
   ========================================================================== */

.gfs-lightbox {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 100000;
	background: rgba(0, 0, 0, 0.9);
	align-items: center;
	justify-content: center;
}

.gfs-lightbox.gfs-aberto {
	display: flex;
}

.gfs-lightbox-imagem {
	max-width: 90vw;
	max-height: 85vh;
	object-fit: contain;
	box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

.gfs-lightbox button {
	position: absolute;
	background: rgba(255, 255, 255, 0.15);
	border: none;
	color: #fff;
	cursor: pointer;
	border-radius: 50%;
	width: 44px;
	height: 44px;
	font-size: 22px;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s ease;
}

.gfs-lightbox button:hover {
	background: rgba(255, 255, 255, 0.3);
}

.gfs-lightbox-fechar {
	top: 20px;
	right: 20px;
}

.gfs-lightbox-anterior {
	left: 20px;
	top: 50%;
	transform: translateY(-50%);
}

.gfs-lightbox-proximo {
	right: 20px;
	top: 50%;
	transform: translateY(-50%);
}

@media (max-width: 600px) {
	.gfs-lightbox button {
		width: 36px;
		height: 36px;
		font-size: 18px;
	}
}
