/*
 * CM Núcleo — Cabeçalho fixo (estrutura).
 * As cores e alturas configuráveis saem do CSS dinâmico do plugin.
 */

/* Transições do cabeçalho e das barras internas. */
.cmn-cabecalho-fixo {
	transition: transform .28s ease, background-color .28s ease, box-shadow .28s ease;
}

.cmn-cabecalho-fixo .main-header-bar,
.cmn-cabecalho-fixo .ast-primary-header-bar,
.cmn-cabecalho-fixo .site-primary-header-wrap,
.cmn-cabecalho-fixo .custom-logo-link img,
.cmn-cabecalho-fixo .site-branding img {
	transition: min-height .28s ease, height .28s ease, max-height .28s ease;
}

/* Estado fixado: a posição "top" é ajustada pelo JavaScript para respeitar a
   barra do administrador e a barra de anúncio fixa, quando existirem. */
.cmn-cabecalho-fixo.cmn-fixo-ativo {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	width: 100%;
	z-index: 999;
}

/* Escondido ao descer a página. */
.cmn-cabecalho-fixo.cmn-fixo-oculto {
	transform: translateY(-100%);
}

/* Espaçador: ocupa a altura do cabeçalho para a página não "pular"
   no momento em que ele passa a ser fixo. */
.cmn-fixo-espacador {
	height: 0;
	transition: height .28s ease;
}

/* Sentinela usada pelo IntersectionObserver — invisível e sem afetar o layout. */
.cmn-fixo-sentinela {
	position: absolute;
	top: 0;
	left: 0;
	width: 1px;
	visibility: hidden;
	pointer-events: none;
}

/* Quem pediu menos animação no sistema não vê nenhuma transição. */
@media (prefers-reduced-motion: reduce) {
	.cmn-cabecalho-fixo,
	.cmn-cabecalho-fixo .main-header-bar,
	.cmn-cabecalho-fixo .ast-primary-header-bar,
	.cmn-cabecalho-fixo .site-primary-header-wrap,
	.cmn-cabecalho-fixo .custom-logo-link img,
	.cmn-cabecalho-fixo .site-branding img,
	.cmn-fixo-espacador {
		transition: none !important;
	}
}
