/* CBT Galeria — site (cores da identidade do CBT) */
.cbtg {
	--cbtg-amarelo: #fbb91a;
	--cbtg-cinza: #5b616b;
	--cbtg-cinza-escuro: #3f444b;
	--cbtg-azul: #2b2a7e;
	--cbtg-verde: #1e9b4b;
	--cbtg-texto: #3c3c3c;
	--cbtg-fundo: #f1f1f1;
	--cbtg-cols: 4;
	margin: 0 0 1.75em;
	color: var(--cbtg-texto);
}

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

.cbtg-titulo {
	margin: 0 0 14px;
	padding-bottom: 8px;
	border-bottom: 2px solid var(--cbtg-amarelo);
}

.cbtg-aviso {
	padding: 10px 14px;
	background: #fff8e5;
	border-left: 4px solid var(--cbtg-amarelo);
	font-size: 14px;
}

.cbtg img {
	max-width: 100%;
	height: auto;
}

.cbtg [hidden] {
	display: none !important;
}

/* ===================== Álbum ===================== */
.cbtg-cols-1 { --cbtg-cols: 1; }
.cbtg-cols-2 { --cbtg-cols: 2; }
.cbtg-cols-3 { --cbtg-cols: 3; }
.cbtg-cols-4 { --cbtg-cols: 4; }
.cbtg-cols-5 { --cbtg-cols: 5; }
.cbtg-cols-6 { --cbtg-cols: 6; }

.cbtg-grade {
	display: grid;
	grid-template-columns: repeat(var(--cbtg-cols), minmax(0, 1fr));
	gap: 12px;
}

.cbtg-item {
	margin: 0;
	padding: 0;
}

.cbtg-album .cbtg-link {
	position: relative;
	display: block;
	overflow: hidden;
	aspect-ratio: 3 / 2;
	background: var(--cbtg-fundo);
	border-bottom: 3px solid transparent;
	transition: border-color 0.2s;
}

.cbtg-album .cbtg-link::after {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(43, 42, 126, 0) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M15.5 14h-.8l-.3-.3A6.5 6.5 0 1 0 9.5 16a6.5 6.5 0 0 0 4.2-1.6l.3.3v.8l5 5 1.5-1.5-5-5zm-6 0a4.5 4.5 0 1 1 0-9 4.5 4.5 0 0 1 0 9zM10 7H9v2H7v1h2v2h1v-2h2V9h-2z'/%3E%3C/svg%3E") center / 0 no-repeat;
	transition: background-color 0.25s, background-size 0.25s;
}

.cbtg-album .cbtg-img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.4s ease;
}

.cbtg-album .cbtg-link:hover,
.cbtg-album .cbtg-link:focus-visible {
	border-bottom-color: var(--cbtg-amarelo);
}

.cbtg-album .cbtg-link:hover .cbtg-img,
.cbtg-album .cbtg-link:focus-visible .cbtg-img {
	transform: scale(1.05);
}

.cbtg-album .cbtg-link:hover::after,
.cbtg-album .cbtg-link:focus-visible::after {
	background-color: rgba(43, 42, 126, 0.35);
	background-size: 40px;
}

.cbtg-link:focus-visible {
	outline: 3px solid var(--cbtg-amarelo);
	outline-offset: 2px;
}

.cbtg-mais {
	position: absolute;
	inset: 0;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(63, 68, 75, 0.7);
	color: #fff;
	font-size: 2em;
	font-weight: 700;
}

.cbtg-legenda {
	margin-top: 6px;
	font-size: 14px;
	line-height: 1.35;
}

@media (max-width: 900px) {
	.cbtg-cols-4,
	.cbtg-cols-5,
	.cbtg-cols-6 { --cbtg-cols: 3; }
}

@media (max-width: 600px) {
	.cbtg-grade { gap: 8px; }
	.cbtg-cols-3,
	.cbtg-cols-4,
	.cbtg-cols-5,
	.cbtg-cols-6 { --cbtg-cols: 2; }
}

/* ===================== Carrossel ===================== */
.cbtg-palco {
	position: relative;
	background: var(--cbtg-cinza-escuro);
	border-bottom: 4px solid var(--cbtg-amarelo);
}

.cbtg-viewport {
	overflow: hidden;
	touch-action: pan-y;
	user-select: none;
}

.cbtg-trilho {
	display: flex;
	transition: transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
	will-change: transform;
}

.cbtg-trilho.is-arrastando {
	transition: none;
}

.cbtg-slide {
	position: relative;
	flex: 0 0 100%;
	margin: 0;
	height: var(--cbtg-altura, 520px);
}

.cbtg-carrossel .cbtg-link {
	display: block;
	width: 100%;
	height: 100%;
	cursor: zoom-in;
}

.cbtg-carrossel .cbtg-img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	-webkit-user-drag: none;
	pointer-events: none;
}

.cbtg-fit-cover .cbtg-img {
	object-fit: cover;
}

.cbtg-carrossel .cbtg-legenda {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	margin: 0;
	padding: 28px 70px 12px 16px;
	background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
	color: #fff;
	font-size: 15px;
	pointer-events: none;
}

.cbtg-seta,
.cbtg-play {
	position: absolute;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.9);
	color: var(--cbtg-cinza-escuro);
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
	transition: background-color 0.2s, transform 0.2s;
}

.cbtg-seta {
	top: 50%;
	width: 44px;
	height: 44px;
	margin-top: -22px;
}

.cbtg-seta--ant { left: 12px; }
.cbtg-seta--prox { right: 12px; }

.cbtg-seta svg,
.cbtg-play svg {
	width: 28px;
	height: 28px;
	fill: currentColor;
}

.cbtg-play {
	right: 12px;
	bottom: 12px;
	width: 36px;
	height: 36px;
}

.cbtg-play svg {
	width: 18px;
	height: 18px;
}

.cbtg-play .cbtg-ico-play,
.cbtg-play.is-pausado .cbtg-ico-pause { display: none; }
.cbtg-play.is-pausado .cbtg-ico-play { display: block; }

.cbtg-seta:hover,
.cbtg-play:hover,
.cbtg-seta:focus-visible,
.cbtg-play:focus-visible {
	background: var(--cbtg-amarelo);
	outline: none;
}

.cbtg-contador {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 2;
	padding: 3px 10px;
	border-radius: 20px;
	background: rgba(0, 0, 0, 0.55);
	color: #fff;
	font-size: 13px;
	line-height: 1.5;
	pointer-events: none;
}

.cbtg-pontos {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin-top: 12px;
}

.cbtg-ponto {
	width: 12px;
	height: 12px;
	padding: 0;
	border: 2px solid var(--cbtg-cinza);
	border-radius: 50%;
	background: transparent;
	cursor: pointer;
}

.cbtg-ponto.is-ativo {
	background: var(--cbtg-amarelo);
	border-color: var(--cbtg-amarelo);
}

.cbtg-miniaturas {
	display: flex;
	gap: 8px;
	margin-top: 10px;
	padding-bottom: 6px;
	overflow-x: auto;
	scrollbar-width: thin;
	scrollbar-color: var(--cbtg-amarelo) transparent;
}

.cbtg-mini {
	flex: 0 0 auto;
	width: 86px;
	height: 58px;
	padding: 0;
	border: 0;
	border-bottom: 3px solid transparent;
	background: var(--cbtg-fundo);
	opacity: 0.55;
	cursor: pointer;
	transition: opacity 0.2s, border-color 0.2s;
}

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

.cbtg-mini:hover,
.cbtg-mini:focus-visible {
	opacity: 1;
}

.cbtg-mini.is-ativo {
	opacity: 1;
	border-bottom-color: var(--cbtg-amarelo);
}

@media (max-width: 600px) {
	.cbtg-slide { height: min(var(--cbtg-altura, 520px), 70vw); }
	.cbtg-seta { width: 36px; height: 36px; margin-top: -18px; }
	.cbtg-seta--ant { left: 6px; }
	.cbtg-seta--prox { right: 6px; }
	.cbtg-carrossel .cbtg-legenda { padding: 20px 52px 8px 10px; font-size: 13px; }
	.cbtg-mini { width: 64px; height: 44px; }
}

/* ===================== Lightbox ===================== */
html.cbtg-lb-aberto,
html.cbtg-lb-aberto body {
	overflow: hidden;
}

.cbtg-lb {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(30, 33, 38, 0.96);
	animation: cbtg-fade 0.2s ease;
}

.cbtg-lb[hidden] {
	display: none;
}

.cbtg-lb *,
.cbtg-lb *::before {
	box-sizing: border-box;
}

.cbtg-lb-topo {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 14px;
	color: #fff;
	font-size: 14px;
	border-top: 4px solid #fbb91a;
}

.cbtg-lb-figura {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 60px 80px 20px;
	touch-action: pan-y;
}

.cbtg-lb-img {
	display: block;
	max-width: 100%;
	max-height: calc(100% - 40px);
	width: auto;
	height: auto;
	object-fit: contain;
	box-shadow: 0 6px 30px rgba(0, 0, 0, 0.5);
	transition: opacity 0.25s;
	user-select: none;
	-webkit-user-drag: none;
}

.cbtg-lb.is-carregando .cbtg-lb-img {
	opacity: 0;
}

.cbtg-lb-legenda {
	min-height: 1.4em;
	margin-top: 12px;
	color: #fff;
	font-size: 15px;
	text-align: center;
}

.cbtg-lb-carregando {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 40px;
	height: 40px;
	margin: -20px 0 0 -20px;
	border: 3px solid rgba(255, 255, 255, 0.25);
	border-top-color: #fbb91a;
	border-radius: 50%;
	opacity: 0;
	animation: cbtg-giro 0.8s linear infinite;
}

.cbtg-lb.is-carregando .cbtg-lb-carregando {
	opacity: 1;
}

.cbtg-lb button {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	cursor: pointer;
	transition: background-color 0.2s, color 0.2s;
}

.cbtg-lb button[hidden] {
	display: none;
}

.cbtg-lb button:hover,
.cbtg-lb button:focus-visible {
	background: #fbb91a;
	color: #3f444b;
	outline: none;
}

.cbtg-lb button svg {
	fill: currentColor;
}

.cbtg-lb-fechar {
	width: 42px;
	height: 42px;
}

.cbtg-lb-fechar svg {
	width: 26px;
	height: 26px;
}

.cbtg-lb-seta {
	position: absolute;
	top: 50%;
	z-index: 2;
	width: 52px;
	height: 52px;
	margin-top: -26px;
}

.cbtg-lb-seta svg {
	width: 34px;
	height: 34px;
}

.cbtg-lb-seta--ant { left: 14px; }
.cbtg-lb-seta--prox { right: 14px; }

@media (max-width: 600px) {
	.cbtg-lb-figura { padding: 56px 8px 70px; }
	.cbtg-lb-seta { top: auto; bottom: 12px; margin-top: 0; width: 46px; height: 46px; }
	.cbtg-lb-seta--ant { left: calc(50% - 56px); }
	.cbtg-lb-seta--prox { right: calc(50% - 56px); }
}

@keyframes cbtg-fade {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes cbtg-giro {
	to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
	.cbtg-trilho,
	.cbtg-album .cbtg-img,
	.cbtg-lb { transition: none; animation: none; }
}
