/* Publicações Oficiais — estilos do front-end */

.po-header { margin-bottom: 26px; }

/* Título do cabeçalho — barra de destaque colorida ao lado, tipografia
 * mais forte e subtítulo mais leve, para um visual moderno em vez do
 * título fino/solto do design anterior. */
.po-header-titulo { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 22px; }
.po-header-titulo-barra {
	width: 5px;
	align-self: stretch;
	min-height: 38px;
	border-radius: 3px;
	background: var(--po-cor-titulo-destaque, #6C5CE7);
	flex-shrink: 0;
}
.po-header-titulo-texto { min-width: 0; }
.po-header h2 {
	margin: 0 0 6px;
	font-size: 26px;
	font-weight: 800;
	letter-spacing: -.01em;
	line-height: 1.2;
	color: var(--po-cor-titulo-texto, #1a1a1a);
}
.po-subtitulo { color: #6b6b76; margin: 0; font-size: 14px; line-height: 1.5; max-width: 640px; }

.po-header-info { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }

.po-info-card {
	background: #fff;
	border: 1px solid #ececec;
	border-radius: 12px;
	padding: 14px 12px 12px;
	text-align: center;
	position: relative;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
	transition: transform .2s cubic-bezier(.2, .8, .2, 1), box-shadow .2s ease, border-color .2s ease;
	will-change: transform;
}
.po-info-card:hover {
	transform: translateY(-4px) scale(1.015);
	box-shadow: 0 10px 22px rgba(0, 0, 0, .1);
	border-color: transparent;
}
.po-info-card:active { transform: translateY(-1px) scale(.98); box-shadow: 0 4px 10px rgba(0, 0, 0, .1); }
.po-info-card::before {
	content: "";
	position: absolute;
	top: 0; left: 0; right: 0;
	height: 4px;
	background: linear-gradient(90deg, var(--po-cor-card-inicio, #6C5CE7), var(--po-cor-card-fim, #00B894));
}
.po-info-icone {
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--po-cor-card-inicio, #6C5CE7), var(--po-cor-card-fim, #00B894));
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 6px auto 8px;
	transition: transform .25s ease;
}
.po-info-card:hover .po-info-icone { transform: scale(1.1) rotate(-4deg); }
.po-info-icone .dashicons { color: #fff; font-size: 15px; width: 15px; height: 15px; }
.po-info-label { display: block; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: #888; margin-bottom: 5px; }
.po-info-valor { display: block; font-weight: 700; color: #1a1a1a; font-size: 12.5px; line-height: 1.4; }

/* ---------------------------------------------------------------------
 * Formulário de busca — layout compacto, estilo Gov UI/UX.
 * ------------------------------------------------------------------ */

.po-form {
	position: relative;
	background: #fff;
	border: 1px solid #e4e4e7;
	border-radius: 10px;
	padding: 14px 16px;
	margin: 18px 0;
	overflow: hidden;
}
.po-form::before {
	content: "";
	position: absolute;
	top: 0; left: 0; right: 0;
	height: 3px;
	background: linear-gradient(90deg, var(--po-cor-card-inicio, #6C5CE7), var(--po-cor-card-fim, #00B894));
}

.po-form-row {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 10px;
}

.po-form-field { display: flex; flex-direction: column; min-width: 0; }
.po-form-field-titulo { flex: 2 1 220px; }
.po-form-field-ano { flex: 1 1 100px; }
.po-form-field-data { flex: 1 1 140px; }

.po-form-field label {
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .04em;
	margin-bottom: 4px;
	color: #666;
}

.po-form-field { position: relative; }
.po-form-field input,
.po-form-field select {
	padding: 7px 10px;
	border: 1px solid #e0e0e0;
	border-radius: 6px;
	font-size: 14px;
	line-height: 1.3;
	background: #fff;
	color: #222;
	transition: border-color .15s ease, box-shadow .15s ease;
	appearance: none;
	-webkit-appearance: none;
	width: 100%;
	box-sizing: border-box;
	height: 34px;
}
.po-form-field-titulo input { padding-left: 30px; }
.po-form-field-titulo::after {
	content: "\f179";
	font-family: dashicons;
	position: absolute;
	left: 8px;
	bottom: 8px;
	font-size: 15px;
	line-height: 1;
	color: #9a9aa2;
	pointer-events: none;
	transition: color .15s ease;
}
.po-form-field-titulo:focus-within::after { color: var(--po-cor-primario-fundo, #6C5CE7); }
.po-form-field select {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23999' stroke-width='1.6' fill='none' fill-rule='evenodd' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 10px center;
	padding-right: 26px;
	cursor: pointer;
}
.po-form-field input:hover,
.po-form-field select:hover { border-color: #b6b6bf; }

/* Foco visível — acessibilidade (Gov UI). */
.po-form-field input:focus,
.po-form-field select:focus,
.po-btn:focus-visible,
.po-anexo-btn:focus-visible,
.po-downloads-toggle:focus-visible,
.po-pagina-link:focus-visible {
	outline: 2px solid var(--po-cor-primario-fundo, #6C5CE7);
	outline-offset: 1px;
	border-color: var(--po-cor-primario-fundo, #6C5CE7);
}

.po-form-actions {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: 0 0 auto;
}

/* As regras de cor/tamanho abaixo usam !important propositalmente: temas
 * e page builders (ex: Elementor Pro) costumam aplicar estilos globais de
 * botão/link com alta especificidade em todo o site, sobrescrevendo as
 * cores configuradas em Configurações > Publicações Oficiais. Como estas
 * classes são exclusivas do plugin, forçar a prioridade aqui é seguro e
 * garante que a cor escolhida no admin sempre prevaleça. */
.po-btn {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	gap: 6px !important;
	padding: 0 16px !important;
	height: 34px !important;
	border-radius: 6px !important;
	font-size: 12px !important;
	font-weight: 700 !important;
	text-decoration: none !important;
	text-transform: none !important;
	cursor: pointer;
	border: 1px solid transparent;
	letter-spacing: .02em;
	white-space: nowrap;
	box-shadow: none !important;
	transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .1s ease;
}
.po-btn .dashicons { font-size: 15px; width: 15px; height: 15px; }
.po-btn-primary,
.po-btn-search {
	background: var(--po-cor-primario-fundo, #6C5CE7) !important;
	color: var(--po-cor-primario-texto, #fff) !important;
}
.po-btn-primary:hover,
.po-btn-search:hover { background: var(--po-cor-primario-hover, #5747C7) !important; }
.po-btn-primary:active,
.po-btn-search:active { transform: scale(.97); }
.po-btn-secondary {
	background: transparent !important;
	color: var(--po-cor-secundario-normal, #777) !important;
	border-color: #d6d6db !important;
	padding: 0 12px !important;
}
.po-btn-secondary:hover { color: var(--po-cor-secundario-hover, #333) !important; border-color: #b6b6bf !important; }
.po-btn-secondary:active { transform: scale(.97); }

@media (min-width: 761px) {
	.po-form-row { flex-wrap: nowrap; }
}

.po-resultados h3 { margin-bottom: 14px; font-size: 16px; }

.po-lista {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 12px;
}
.po-item {
	background: #fff;
	border: 1px solid #ececec;
	border-radius: 14px;
	padding: 16px 14px 14px;
	position: relative;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	box-shadow: 0 2px 6px rgba(20, 20, 43, .04);
	transition: transform .2s cubic-bezier(.2, .8, .2, 1), box-shadow .2s ease, border-color .2s ease;
	will-change: transform;
}
.po-item:hover {
	transform: translateY(-5px) scale(1.02);
	box-shadow: 0 14px 26px rgba(20, 20, 43, .12);
	border-color: transparent;
}
.po-item:active { transform: translateY(-1px) scale(.98); box-shadow: 0 4px 10px rgba(0, 0, 0, .1); }
.po-item::before {
	content: "";
	position: absolute;
	top: 0; left: 0; right: 0;
	height: 4px;
	background: linear-gradient(90deg, var(--po-cor-card-inicio, #6C5CE7), var(--po-cor-card-fim, #00B894));
}
.po-item-icone {
	font-size: 18px;
	width: 34px;
	height: 34px;
	color: #fff;
	background: linear-gradient(135deg, var(--po-cor-card-inicio, #6C5CE7), var(--po-cor-card-fim, #00B894));
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 6px 0 10px;
	transition: transform .25s ease;
}
.po-item:hover .po-item-icone { transform: scale(1.1) rotate(-4deg); }
.po-item a { color: #1a1a1a; text-decoration: none; font-weight: 700; font-size: 13px; line-height: 1.45; display: block; }
.po-item a:hover { color: var(--po-cor-card-inicio, #6C5CE7); }

/* Rodapé do card (hora + downloads) sempre alinhado na base, mesmo com
 * títulos de tamanhos diferentes entre os cards da mesma grade. */
.po-item-footer { margin-top: auto; }
.po-item-hora { display: flex; align-items: center; gap: 4px; font-size: 11px; color: #999; margin-top: 10px; padding-top: 10px; border-top: 1px dashed #eee; }
.po-item-hora .dashicons { font-size: 13px; width: 13px; height: 13px; }
.po-sem-resultados { color: #777; font-style: italic; background: #fafafa; border: 1px dashed #e0e0e0; border-radius: 10px; padding: 14px 16px; }

.po-fallback { margin-top: 14px; }
.po-fallback-label { font-weight: 600; color: #444; margin-bottom: 8px; font-size: 13px; }

/* ---------------------------------------------------------------------
 * Anexos e formatos alternativos — botões de download identificados por
 * cor e extensão, agrupados num dropdown quando há mais de um formato
 * disponível (padrão Dados Abertos Atricon/PNTP).
 * ------------------------------------------------------------------ */

.po-anexos { margin-top: 10px; padding-top: 10px; border-top: 1px dashed #eee; position: relative; }

.po-downloads-toggle {
	display: inline-flex !important;
	align-items: center !important;
	gap: 6px !important;
	max-width: 100%;
	box-sizing: border-box;
	background: var(--po-cor-download-fundo, #1976D2) !important;
	color: var(--po-cor-download-texto, #fff) !important;
	border: none !important;
	border-radius: 6px !important;
	padding: 6px 10px !important;
	font-size: 11px !important;
	font-weight: 700 !important;
	text-transform: none !important;
	box-shadow: none !important;
	cursor: pointer;
	line-height: 1.3;
	white-space: normal;
	transition: opacity .15s ease;
}
.po-downloads-toggle:hover { opacity: .88; }
.po-downloads-toggle .dashicons { font-size: 13px; width: 13px; height: 13px; }
.po-downloads-seta { transition: transform .2s ease; }
.po-downloads-toggle[aria-expanded="true"] .po-downloads-seta { transform: rotate(180deg); }

.po-downloads-dropdown {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	max-height: 0;
	overflow: hidden;
	transition: max-height .25s ease;
}
.po-downloads-dropdown:empty { display: none; }
.po-anexos > .po-downloads-dropdown { margin-top: 8px; }

.po-anexo-btn {
	--po-anexo-cor: #616161;
	--po-anexo-cor-clara: #f2f2f2;
	display: inline-flex !important;
	align-items: center !important;
	gap: 5px !important;
	max-width: 100%;
	box-sizing: border-box;
	background: var(--po-anexo-cor-clara) !important;
	color: var(--po-anexo-cor) !important;
	border: 1px solid var(--po-anexo-cor) !important;
	border-radius: 6px !important;
	padding: 5px 9px !important;
	font-size: 11px !important;
	font-weight: 700 !important;
	text-decoration: none !important;
	text-transform: none !important;
	box-shadow: none !important;
	line-height: 1.3;
	transition: background-color .15s ease, color .15s ease, transform .1s ease;
}
.po-anexo-btn .dashicons { font-size: 13px; width: 13px; height: 13px; }
.po-anexo-btn:hover { background: var(--po-anexo-cor) !important; color: #fff !important; }
.po-anexo-btn:active { transform: scale(.96); }

.po-anexo-pdf       { --po-anexo-cor-clara: #fbe9e9; }
.po-anexo-excel     { --po-anexo-cor-clara: #e8f3e9; }
.po-anexo-word      { --po-anexo-cor-clara: #e7f0fa; }
.po-anexo-zip       { --po-anexo-cor-clara: #f1e6f5; }
.po-anexo-dados     { --po-anexo-cor-clara: #eef6fb; }
.po-anexo-acessivel { --po-anexo-cor-clara: #f2f2f2; }
.po-anexo-outro     { --po-anexo-cor-clara: #eeeeee; }

.po-paginacao-info { font-size: 12px; color: #888; margin: 18px 0 8px; }

.po-paginacao { display: flex; align-items: center; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.po-pagina-link {
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	min-width: 34px;
	height: 34px !important;
	padding: 0 8px !important;
	border: 1px solid #ddd !important;
	border-radius: 8px !important;
	text-decoration: none !important;
	text-transform: none !important;
	box-shadow: none !important;
	color: var(--po-cor-secundario-normal, #333) !important;
	font-size: 13px !important;
	transition: border-color .15s ease, color .15s ease, background-color .15s ease;
}
.po-pagina-link:hover { border-color: var(--po-cor-secundario-hover, #6C5CE7) !important; color: var(--po-cor-secundario-hover, #6C5CE7) !important; }
.po-pagina-link.po-pagina-ativa {
	background: var(--po-cor-secundario-ativo, #6C5CE7) !important;
	color: #fff !important;
	border-color: transparent !important;
	font-weight: 700 !important;
}
.po-pagina-seta .dashicons { font-size: 16px; width: 16px; height: 16px; }
.po-pagina-reticencias { padding: 0 4px; color: #999; font-size: 13px; }

.po-widget-item { font-weight: 600; margin-bottom: 4px; }

.po-info-card,
.po-item { -webkit-tap-highlight-color: transparent; }

/* ---------------------------------------------------------------------
 * Responsividade.
 * ------------------------------------------------------------------ */

@media (max-width: 900px) {
	.po-form-field-titulo { flex-basis: 100%; }
}

@media (max-width: 760px) {
	.po-form-row { flex-direction: column; align-items: stretch; }
	.po-form-field,
	.po-form-actions { width: 100%; }
	.po-form-actions { justify-content: flex-start; margin-top: 2px; }
	.po-btn { flex: 1 1 auto; }
}

@media (max-width: 600px) {
	.po-header-info,
	.po-lista { grid-template-columns: 1fr 1fr; }
	.po-header h2 { font-size: 21px; }
	.po-header-titulo-barra { min-height: 30px; }
}

@media (max-width: 420px) {
	.po-header-info,
	.po-lista { grid-template-columns: 1fr; }
}
