/*
Theme Name: Colpar Brasil
Theme URI: https://colparbrasil.com
Author: Colpar Brasil
Description: Tema Colpar Brasil. Cores e tokens vêm de inc/enqueue.php (@theme + :root).
Version: 1.0
Text Domain: colpar-brasil
*/

/* ==========================================================================
   Design system: use sempre var(--color-*) para cores. Tokens em enqueue.php
   ========================================================================== */

/* Containers de largura (Tailwind: max-w-[1200px] padrão, max-w-[1600px] no header).
   Opção mais larga sem ser full: use a classe abaixo ou max-w-[1400px] mx-auto px-6 no HTML. */
.container-wide {
	max-width: 1400px;
	margin-left: auto;
	margin-right: auto;
	padding-left: 1.5rem;
	padding-right: 1.5rem;
}

/* --- Acessibilidade (conteúdo só para leitores de tela e SEO) --- */
.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
.skip-link.screen-reader-text {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 100000;
	padding: 0.5rem 1rem;
	background: var(--color-accent);
	color: #fff;
	text-decoration: none;
}
.skip-link.screen-reader-text:focus {
	left: 0;
}

/* --- Header --- */
.site-header.is-scrolled {
	background-color: var(--color-accent);
	padding-top: 0.75rem;
	padding-bottom: 0.75rem;
}
.mobile-menu.bg-accent {
	background-color: var(--color-accent);
}

/* --- Menu mobile: submenu escondido até clicar no item (ex.: Nossos Negócios) --- */
@media (max-width: 767px) {
	.mobile-menu .sub-menu {
		display: none;
		list-style: none;
		margin: 0.5rem 0 0 0;
		padding: 0;
	}
	.mobile-menu .menu-item-has-children.is-open .sub-menu,
	.mobile-menu .sub-menu.mobile-submenu-open {
		display: block;
	}
	.mobile-menu .sub-menu {
		background-color: rgba(0, 30, 80, 0.35);
		border-radius: 0.375rem;
		padding: 0.25rem 0;
	}
	.mobile-menu .sub-menu a {
		display: block;
		padding: 0.5rem 1rem;
		color: #fff;
		text-decoration: none;
		font-size: 1rem;
	}
	.mobile-menu .sub-menu a:hover {
		background-color: rgba(255, 255, 255, 0.08);
	}
}

/* --- Desktop: item atual com outline/borda arredondada (pill) --- */
.primary-nav .current-menu-item > a {
	border-radius: 9999px;
}

/* --- Hero página interna (~400px, imagem de fundo, título centralizado) --- */
.page-hero-interna {
	min-height: 400px;
	height: 400px;
	background-color: var(--color-primary);
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
}
.page-hero-interna::before {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(0, 30, 80, 0.4);
	pointer-events: none;
}
.page-hero-interna__inner {
	position: relative;
	z-index: 1;
	padding: 0 1.5rem;
}
.page-hero-interna-bar {
	height: 5px;
	background-color: var(--color-primary-light);
}

/* --- ESG: grid e cards (hover) --- */
.esg-card__link:hover .esg-card__img--hover {
	opacity: 1;
}
.esg-card__link:hover .esg-card__img--default {
	opacity: 0;
}
@media (hover: hover) {
	.esg-card__link:hover .esg-card__img--hover { opacity: 1; }
	.esg-card__link:hover .esg-card__img--default { opacity: 0; }
}

/* --- ESG: carrossel galeria (1 foto por slide; larguras em px via JS) --- */
.esg-carousel {
	position: relative;
	overflow: hidden;
	min-height: 280px;
	width: 100%;
}
.esg-carousel__track {
	display: flex;
	flex-wrap: nowrap;
	will-change: transform;
}
.esg-carousel__slide {
	flex: 0 0 auto;
}
.esg-carousel__slide img {
	width: 100%;
	height: auto;
	display: block;
	object-fit: cover;
	max-height: 70vh;
}

/* --- Conteúdo páginas internas (Governança, etc.) --- */
.page-interna-content {
	color: var(--color-muted);
}
.page-interna-body .page-interna-block {
	border-bottom: 1px solid rgba(0, 30, 80, 0.08);
	padding-bottom: 2.5rem;
}
.page-interna-body .page-interna-block:last-child,
.page-interna-body .page-interna-block--last {
	border-bottom: none;
	padding-bottom: 0;
}

/* --- Estrutura de Gestão (fluxo governança) --- */
.estrutura-gestao {
	padding-bottom: 1rem;
}
.estrutura-gestao__flow {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 0;
	font-size: 0.875rem;
}
.estrutura-gestao__flow > .estrutura-gestao__node--centered,
.estrutura-gestao__flow > .estrutura-gestao__plataforma {
	align-self: stretch;
}
.estrutura-gestao__node {
	padding: 1rem 1.25rem;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}
.estrutura-gestao__node--dark {
	background-color: var(--color-primary);
	color: #fff;
}
.estrutura-gestao__node--light {
	background-color: rgba(0, 30, 80, 0.12);
	color: var(--color-primary);
	border: 1px solid rgba(0, 30, 80, 0.2);
}
.estrutura-gestao__node-title {
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	margin: 0;
	font-size: 0.8rem;
	line-height: 1.3;
}
.estrutura-gestao__list {
	list-style: none;
	margin: 0;
	padding: 0;
	font-size: 0.75rem;
	opacity: 0.95;
}
.estrutura-gestao__list li {
	position: relative;
	padding-left: 0.75rem;
	margin-bottom: 0.25rem;
}
.estrutura-gestao__list li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.4em;
	width: 4px;
	height: 4px;
	background: currentColor;
	border-radius: 50%;
}
/* Conector: no mobile é linha vertical (fluxo para baixo) */
.estrutura-gestao__connector {
	flex-shrink: 0;
	width: 2px;
	min-width: 2px;
	height: 20px;
	align-self: center;
	border-bottom: none;
	border-left: 2px solid rgba(0, 30, 80, 0.35);
	background: transparent;
}
.estrutura-gestao__connector--h {
	width: 2px;
	min-width: 2px;
	height: 20px;
}
.estrutura-gestao__comites {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	justify-content: flex-start;
}
.estrutura-gestao__comites .estrutura-gestao__node {
	min-width: 0;
}
/* Mobile: plataforma em coluna – barra horizontal depois departamentos em grid 2 colunas */
.estrutura-gestao__plataforma {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 0.5rem;
}
.estrutura-gestao__node--vertical {
	min-width: 0;
	width: 100%;
	padding: 0.75rem 1rem;
	justify-content: center;
	align-items: center;
}
.estrutura-gestao__plataforma-label {
	writing-mode: horizontal-tb;
	transform: none;
	white-space: nowrap;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	font-size: 0.75rem;
}
.estrutura-gestao__deptos {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.5rem;
}
.estrutura-gestao__node--depto {
	min-width: 0;
	justify-content: center;
	text-align: center;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	font-size: 0.7rem;
	padding: 0.75rem 0.5rem;
}

/* Desktop: fluxo horizontal */
@media (min-width: 900px) {
	.estrutura-gestao {
		overflow-x: auto;
	}
	.estrutura-gestao__flow {
		flex-direction: row;
		align-items: stretch;
		min-width: min-content;
	}
	.estrutura-gestao__flow > .estrutura-gestao__node--centered,
	.estrutura-gestao__flow > .estrutura-gestao__plataforma {
		align-self: center;
	}
	.estrutura-gestao__node {
		min-width: 180px;
	}
	.estrutura-gestao__connector {
		width: 24px;
		min-width: 24px;
		height: auto;
		border-left: none;
		border-bottom: 2px solid rgba(0, 30, 80, 0.35);
	}
	.estrutura-gestao__connector--h {
		width: 20px;
		min-width: 20px;
		height: auto;
	}
	.estrutura-gestao__comites {
		gap: 0;
		justify-content: space-between;
	}
	.estrutura-gestao__comites .estrutura-gestao__node {
		min-width: 200px;
	}
	.estrutura-gestao__plataforma {
		flex-direction: row;
		gap: 0;
	}
	.estrutura-gestao__node--vertical {
		min-width: 32px;
		width: 32px;
		padding: 1rem 0.5rem;
	}
	.estrutura-gestao__plataforma-label {
		writing-mode: vertical-rl;
		text-orientation: mixed;
		transform: rotate(-180deg);
		font-size: 0.7rem;
	}
	.estrutura-gestao__deptos {
		display: flex;
		flex-direction: column;
		grid-template-columns: unset;
		gap: 0;
		justify-content: space-between;
	}
	.estrutura-gestao__node--depto {
		min-width: 140px;
		font-size: 0.75rem;
		padding: 1rem 1.25rem;
	}
}
@media (min-width: 1024px) {
	.estrutura-gestao__connector--h {
		width: 32px;
		min-width: 32px;
	}
	.estrutura-gestao__node {
		min-width: 200px;
	}
	.estrutura-gestao__comites .estrutura-gestao__node {
		min-width: 220px;
	}
}

/* --- Navegação (submenu desktop) --- */
@media (min-width: 768px) {
	.primary-nav .menu-item-has-children {
		position: relative;
	}
	.primary-nav .menu-item-has-children > a {
		display: inline-flex;
		align-items: center;
		gap: 0.35rem;
	}
	.primary-nav .menu-item-has-children > a::after {
		content: "";
		display: inline-block;
		width: 0.5em;
		height: 0.5em;
		background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
		background-size: contain;
		background-repeat: no-repeat;
		background-position: center;
		opacity: 0.9;
	}
	.primary-nav .sub-menu {
		position: absolute;
		top: 100%;
		left: 0;
		min-width: 12rem;
		margin: 0;
		padding: 0.5rem 0;
		list-style: none;
		background: rgba(0, 42, 124, 0.5);
		backdrop-filter: blur(6px);
		border-radius: 0.25rem;
		box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
		opacity: 0;
		visibility: hidden;
		transition: opacity 0.2s ease, visibility 0.2s ease;
	}
	.primary-nav .menu-item-has-children:hover .sub-menu {
		opacity: 1;
		visibility: visible;
	}
	.primary-nav .sub-menu .menu-item {
		display: block;
	}
	.primary-nav .sub-menu a {
		display: block;
		padding: 0.5rem 1rem;
		font-size: 1rem;
		letter-spacing: 0.05em;
		color: #fff;
		text-decoration: none;
		white-space: nowrap;
		border: none;
	}
	.primary-nav .sub-menu a:hover {
		opacity: 0.9;
		background-color: rgba(255, 255, 255, 0.1);
	}
}

/* --- Hero: vídeo Vimeo 9:16 em fundo (estilo Elementor). Dimensões do iframe em hero-video.js --- */
.home-hero-video-container {
	position: absolute;
	inset: 0;
	overflow: hidden;
	pointer-events: none;
}
.home-hero-video-embed {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}
.home-hero-video-embed__iframe {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	/* width/height definidos por hero-video.js para cover 9:16 em qualquer viewport */
}

/* --- Título de seção com traço verde (reutilizado: timeline, redes, notícias) --- */
.section-title-underline {
	border-bottom: 3px solid var(--color-secondary);
	display: inline-block;
	padding-bottom: 0.25rem;
}

/* --- Timeline: layout específico (grid, track) --- */
.home-timeline-inicio-img {
	max-width: 380px;
}
@media (min-width: 1024px) {
	.home-timeline-track {
		display: flex;
		flex-direction: row;
		gap: 1rem;
		width: 100%;
	}
	.home-timeline-item {
		flex: 1;
		min-width: 0;
	}
}
.home-timeline-card-caption {
	text-align: right;
}
.home-timeline-card-caption h3 {
	font-weight: 700;
}
.home-timeline-card-caption p {
	font-size: 0.75rem;
	font-weight: 400;
	letter-spacing: 0.02em;
	opacity: 0.95;
}
@media (min-width: 768px) {
	.home-timeline-card-caption p {
		font-size: 0.8125rem;
	}
}

/* --- Notícias: faixa primária + cards sobrepostos (layout que não é só utilitário) --- */
.home-noticias-faixa {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 17rem;
	background-color: var(--color-primary);
}
@media (min-width: 768px) {
	.home-noticias-faixa {
		height: 14rem;
	}
}
.home-noticias-cards {
	margin-top: -2rem;
}
@media (min-width: 768px) {
	.home-noticias-cards {
		margin-top: -1rem;
	}
}

/* --- Mapa do Brasil (SVG: fills usam var) --- */
.mapa-brasil-wrap {
	position: relative;
}
#map {
	width: 100%;
	height: auto;
	display: block;
}
#map .state {
	cursor: pointer;
	transition: opacity 0.2s ease;
}
#map .state:hover {
	opacity: 0.9;
}
#map .shape {
	fill: #dddddd;
	transition: fill 0.2s ease;
}
#map .label_icon_state {
	fill: #fff;
	pointer-events: none;
	transition: fill 0.2s ease;
	font-weight: 600;
	font-size: 11px;
	font-family: "Source Sans 3", sans-serif;
	text-anchor: middle;
	dominant-baseline: central;
}
#map .icon_state {
	fill: #a0a0a0;
	pointer-events: none;
	transition: fill 0.2s ease;
}
#map a.state.has-empresas .shape {
	fill: var(--color-primary);
}
#map a.state.has-empresas .label_icon_state {
	fill: #fff;
}
#map a.state.has-empresas .icon_state {
	fill: #a0a0a0;
}
#map .label_state {
	display: none;
}

/* --- Popover mapa (estrutura fixa; cores via var) --- */
.mapa-balao {
	position: fixed;
	z-index: 1000;
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1), 0 12px 24px -8px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 30, 80, 0.06);
	max-width: 90vw;
	width: 380px;
	max-height: 75vh;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	backdrop-filter: blur(8px);
}
.mapa-balao.hidden {
	display: none !important;
}
.mapa-balao-fechar {
	position: absolute;
	top: 0.875rem;
	right: 0.875rem;
	width: 2.25rem;
	height: 2.25rem;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.5rem;
	line-height: 1;
	color: var(--color-muted-dark);
	background: rgba(0, 30, 80, 0.04);
	border: none;
	cursor: pointer;
	border-radius: 50%;
	transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
	z-index: 2;
}
.mapa-balao-fechar:hover {
	background: rgba(0, 30, 80, 0.08);
	color: var(--color-primary);
	transform: scale(1.05);
}
.mapa-balao-conteudo {
	padding: 1.5rem 1.75rem 1.75rem;
	padding-right: 3rem;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	font-size: 0.9375rem;
	line-height: 1.55;
	color: #1a1a1a;
}
.mapa-balao-conteudo h3 {
	font-size: 1.25rem;
	font-weight: 600;
	color: var(--color-primary);
	margin-bottom: 1rem;
	letter-spacing: 0.02em;
}
.mapa-balao-conteudo .border-b {
	border-color: rgba(0, 30, 80, 0.08);
}
.mapa-balao-conteudo strong {
	color: var(--color-primary);
	font-weight: 600;
}
.mapa-balao-conteudo .text-muted-dark {
	color: var(--color-muted-dark);
}

.mapa-balao:not(.hidden) {
	animation: mapa-balao-entrada 0.25s ease-out;
}
@keyframes mapa-balao-entrada {
	from { opacity: 0; transform: translateY(8px); }
	to { opacity: 1; transform: translateY(0); }
}
@media (min-width: 768px) {
	.mapa-balao:not(.hidden) {
		animation: mapa-balao-entrada-desktop 0.25s ease-out;
	}
}
@keyframes mapa-balao-entrada-desktop {
	from { opacity: 0; transform: translate(-0.75rem, calc(-50% - 8px)); }
	to { opacity: 1; transform: translate(-0.75rem, -50%); }
}
@media (max-width: 767px) {
	.mapa-balao {
		left: 50%;
		transform: translateX(-50%);
		bottom: 1.5rem;
		top: auto;
		max-height: 60vh;
		width: calc(100vw - 2rem);
		max-width: 400px;
	}
	.mapa-balao:not(.hidden) {
		animation: mapa-balao-entrada-mobile 0.3s ease-out;
	}
	.mapa-balao-conteudo {
		padding: 1.25rem 1.5rem 1.5rem;
		padding-right: 2.5rem;
	}
}
@keyframes mapa-balao-entrada-mobile {
	from { opacity: 0; transform: translate(-50%, 20px); }
	to { opacity: 1; transform: translate(-50%, 0); }
}
@media (min-width: 768px) {
	.mapa-balao {
		position: absolute;
		top: 50%;
		left: auto;
		right: 100%;
		transform: translate(-0.75rem, -50%);
	}
}
.mapa-balao-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.25);
	z-index: 999;
	cursor: pointer;
	transition: opacity 0.2s ease;
}
.mapa-balao-overlay.hidden {
	display: none !important;
}
