/**
 * Estilos para a Página de Contato
 * SG Jurídico Theme
 */

/* REGRA GLOBAL: Remover TODOS os espaços vazios na página de contato */
body.page-template-page-contato,
body.page.contato {
	overflow-x: hidden;
}

body.page-template-page-contato *,
body.page.contato * {
	box-sizing: border-box;
}

/* Layout geral da página de contato */
/* Ocultar título da página e remover espaços em branco */
.page-contato .entry-header,
.page-contato .entry-title {
	display: none !important;
}

.entry-content {
	padding-top: 0;
	margin-top: 0;
}

body.page-template-page-contato .entry-content,
body.page-template-page-contato .site-main {
	padding-top: 0;
	margin-top: 0;
}

/* Remover padding inferior excessivo do site-main */
body.page-template-page-contato .site-main,
body.page.contato .site-main {
	padding-bottom: 0 !important;
}

/* Remover min-height desnecessário que cria espaço em branco */
body.page-template-page-contato .site-main,
body.page.contato .site-main {
	min-height: auto !important;
}

body.page-template-page-contato .site-main-wrapper,
body.page.contato .site-main-wrapper {
	min-height: auto !important;
	padding-bottom: 0 !important;
}

/* Remover padding excessivo do container na página de contato */
body.page-template-page-contato .entry-content .container,
body.page.contato .entry-content .container {
	padding-bottom: 0;
}

/* Remover espaços vazios em article e entry-content */
body.page-template-page-contato article.page,
body.page.contato article.page {
	margin-bottom: 0;
	padding-bottom: 0;
}

body.page-template-page-contato .entry-content,
body.page.contato .entry-content {
	padding-bottom: 0;
	margin-bottom: 0;
}

/* Ajustar footer para não criar espaço desnecessário - regras mais agressivas */
body.page-template-page-contato .entry-footer,
body.page.contato .entry-footer {
	margin-top: 0 !important;
	padding-top: 0 !important;
	margin-bottom: 0 !important;
	padding-bottom: 0 !important;
	height: auto !important;
	min-height: auto !important;
}

body.page-template-page-contato .entry-footer .container,
body.page.contato .entry-footer .container {
	padding-top: 20px !important;
	padding-bottom: 20px !important;
	margin-top: 0 !important;
	margin-bottom: 0 !important;
	height: auto !important;
	min-height: auto !important;
}

/* Remover TODOS os espaços vazios desnecessários - regras mais agressivas */
body.page-template-page-contato #primary,
body.page.contato #primary {
	margin-bottom: 0 !important;
	padding-bottom: 0 !important;
}

body.page-template-page-contato #main,
body.page.contato #main {
	padding-bottom: 0 !important;
	margin-bottom: 0 !important;
}

/* Garantir que não há altura mínima criando espaço */
body.page-template-page-contato #primary,
body.page.contato #primary,
body.page-template-page-contato #main,
body.page.contato #main {
	min-height: auto !important;
	height: auto !important;
}

/* Remover espaços do article e entry-content de forma mais agressiva */
body.page-template-page-contato article.page,
body.page.contato article.page {
	margin-bottom: 0 !important;
	padding-bottom: 0 !important;
	height: auto !important;
	min-height: auto !important;
}

body.page-template-page-contato .entry-content,
body.page.contato .entry-content {
	padding-bottom: 0 !important;
	margin-bottom: 0 !important;
	height: auto !important;
	min-height: auto !important;
}

body.page-template-page-contato .contact-page-wrapper,
body.page.contato .contact-page-wrapper {
	margin-bottom: 0 !important;
	padding-bottom: 0 !important;
}

/* Ocultar sidebar completa na página de contato */
body.page-template-page-contato #secondary,
body.page-template-page-contato .widget-area,
body.page.contato #secondary,
body.page.contato .widget-area,
body.page-template-page-contato #calendario-concursos,
body.page-template-page-contato .widget-concursos-calendar,
body.page.contato #calendario-concursos,
body.page.contato .widget-concursos-calendar {
	display: none !important;
}

/* Ajustar layout quando sidebar não está visível */
body.page-template-page-contato .site-main-wrapper,
body.page.contato .site-main-wrapper {
	grid-template-columns: 1fr !important;
}

/* Container da página de contato - remover espaços desnecessários */
body.page-template-page-contato .contact-container,
body.page.contato .contact-container {
	padding-top: 20px;
	padding-bottom: 0 !important;
	margin-bottom: 0 !important;
}

/* Layout wrapper da página de contato */
.contact-page-wrapper {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 30px;
	width: 100%;
	max-width: 100%;
}

/* Seção Entre em Contato - Ocupa todas as 3 colunas */
.contact-section-full {
	grid-column: 1 / -1;
	width: 100%;
	margin-bottom: 0;
	padding-bottom: 0;
}

/* Garantir que não há espaços */
body.page-template-page-contato .contact-section-full,
body.page.contato .contact-section-full {
	margin-bottom: 0 !important;
	padding-bottom: 0 !important;
}

.contact-content {
	width: 100%;
	max-width: 100%;
	margin: 0;
	padding: 30px;
	padding-bottom: 20px;
	background: linear-gradient(135deg, #f8f9fa 0%, var(--sg-color-gray-light) 100%);
	border-radius: 12px;
	border: 1px solid var(--sg-color-border);
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

/* Garantir que não há padding inferior criando espaço */
body.page-template-page-contato .contact-content,
body.page.contato .contact-content {
	padding-bottom: 20px !important;
}

/* Grid para os itens de contato (3 colunas) */
.contact-items-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 20px;
	margin-top: 20px;
}

.contact-content h2 {
	font-size: 32px;
	font-weight: 700;
	color: var(--sg-color-heading);
	margin-bottom: 12px;
	line-height: 1.2;
}

.contact-content > p {
	font-size: 18px;
	color: var(--sg-color-text-secondary);
	margin-bottom: 30px;
	line-height: 1.6;
}

/* Seção de Informações de Contato */
.contact-info {
	margin: 30px 0;
	padding: 0;
	background: transparent;
	border-radius: 0;
	border: none;
	box-shadow: none;
}

.contact-info h3 {
	font-size: 24px;
	font-weight: 700;
	color: var(--sg-color-heading);
	margin-bottom: 24px;
	padding-bottom: 12px;
	border-bottom: 3px solid var(--sg-color-primary);
}

.contact-item {
	margin-bottom: 0;
	padding: 24px;
	background: var(--sg-color-white);
	border-radius: 8px;
	border-left: 4px solid var(--sg-color-primary);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	height: 100%;
	display: flex;
	flex-direction: column;
}

.contact-item:hover {
	transform: translateY(-4px);
	box-shadow: 0 4px 12px rgba(92, 225, 230, 0.3);
}

.contact-item strong {
	display: block;
	color: var(--sg-color-primary);
	margin-bottom: 8px;
	font-size: 16px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.contact-item p {
	margin: 0;
	color: var(--sg-color-text);
	font-size: 16px;
	line-height: 1.6;
}

/* Links de Redes Sociais */
.contact-content h3 {
	font-size: 24px;
	font-weight: 700;
	color: var(--sg-color-heading);
	margin: 30px 0 20px;
	padding-bottom: 12px;
	border-bottom: 3px solid var(--sg-color-primary);
}

/* Formulário de Contato */
.contact-form-section {
	margin: 40px 0;
	padding: 30px;
	background: var(--sg-color-white);
	border-radius: 12px;
	border: 1px solid var(--sg-color-border);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.contact-form-section h3 {
	font-size: 24px;
	font-weight: 700;
	color: var(--sg-color-heading);
	margin: 0 0 24px;
	padding-bottom: 12px;
	border-bottom: 3px solid var(--sg-color-primary);
}

.contact-form {
	width: 100%;
}

.form-row {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 20px;
	margin-bottom: 20px;
}

.form-group {
	margin-bottom: 20px;
}

.form-group label {
	display: block;
	margin-bottom: 8px;
	font-weight: 600;
	color: var(--sg-color-text);
	font-size: 14px;
}

.form-group label .required {
	color: #e74c3c;
	margin-left: 2px;
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form input[type="tel"],
.contact-form select,
.contact-form textarea {
	width: 100%;
	padding: 12px 16px;
	border: 2px solid var(--sg-color-border);
	border-radius: 8px;
	font-size: 16px;
	font-family: inherit;
	background: var(--sg-color-white);
	color: var(--sg-color-text);
	transition: all 0.3s ease;
	box-sizing: border-box;
}

.contact-form input[type="text"]:focus,
.contact-form input[type="email"]:focus,
.contact-form input[type="tel"]:focus,
.contact-form select:focus,
.contact-form textarea:focus {
	outline: none;
	border-color: var(--sg-color-primary);
	box-shadow: 0 0 0 3px rgba(92, 225, 230, 0.1);
}

.contact-form textarea {
	resize: vertical;
	min-height: 120px;
}

.contact-form select {
	cursor: pointer;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23333' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 16px center;
	appearance: none;
	padding-right: 40px;
}

.contact-form input.error,
.contact-form select.error,
.contact-form textarea.error {
	border-color: #e74c3c;
}

.form-submit {
	margin-top: 30px;
	text-align: center;
}

.contact-submit-btn {
	background: var(--sg-color-primary);
	color: #000;
	padding: 16px 40px;
	font-size: 18px;
	font-weight: 700;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.3s ease;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-width: 200px;
}

.contact-submit-btn:hover {
	background: var(--sg-color-primary-dark);
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(92, 225, 230, 0.4);
}

.contact-submit-btn:active {
	transform: translateY(0);
}

.contact-submit-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
	transform: none;
}

.form-message {
	padding: 16px;
	border-radius: 8px;
	margin-top: 20px;
	font-weight: 500;
}

.form-message.success {
	background: #d4edda;
	color: #155724;
	border: 2px solid #c3e6cb;
}

.form-message.error {
	background: #f8d7da;
	color: #721c24;
	border: 2px solid #f5c6cb;
}

.social-links {
	margin: 20px 0;
	padding: 24px;
	background: var(--sg-color-white);
	border-radius: 8px;
	border: 1px solid var(--sg-color-border);
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	align-items: center;
	justify-content: center;
}

/* Na página de contato, remover todo o margin dos social-links */
body.page-template-page-contato .social-links,
body.page.contato .social-links {
	margin-bottom: 0 !important;
	margin-top: 20px !important;
}

.social-links a.social-icon {
	color: var(--sg-color-primary);
	text-decoration: none;
	transition: all 0.3s ease;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 12px;
	border: 2px solid var(--sg-color-primary);
	border-radius: 50%;
	width: 50px;
	height: 50px;
	background: transparent;
}

.social-links a.social-icon:hover {
	background: var(--sg-color-primary);
	color: var(--sg-color-black);
	transform: translateY(-4px) scale(1.1);
	box-shadow: 0 6px 20px rgba(92, 225, 230, 0.5);
}

.social-links a.social-icon svg {
	width: 24px;
	height: 24px;
}

/* Conteúdo da página organizado em 3 colunas */
.contact-page-content {
	grid-column: 1 / -1;
	width: 100%;
	margin-top: 30px;
	margin-bottom: 0 !important;
	padding-bottom: 0 !important;
}

/* Remover margin do último elemento e de todos os filhos */
body.page-template-page-contato .contact-page-wrapper > :last-child,
body.page.contato .contact-page-wrapper > :last-child,
body.page-template-page-contato .contact-section-full:last-child,
body.page.contato .contact-section-full:last-child,
body.page-template-page-contato .contact-page-content:last-child,
body.page.contato .contact-page-content:last-child {
	margin-bottom: 0 !important;
	padding-bottom: 0 !important;
}

/* Remover qualquer espaço após o conteúdo de contato */
body.page-template-page-contato .contact-content > :last-child,
body.page.contato .contact-content > :last-child {
	margin-bottom: 0 !important;
}


/* Cards para links "Sobre a SG Jurídico" */
/* Seleciona listas que vêm após h2 e contêm links */
.contact-page-content ul,
.contact-page-content h2 ~ ul,
.contact-page-content h2 + ul {
	display: grid !important;
	grid-template-columns: repeat(3, 1fr);
	gap: 20px;
	margin: 30px 0 !important;
	padding: 0 !important;
	list-style: none !important;
}

/* Estilos dos cards individuais */
.contact-page-content ul li,
.entry-content ul li {
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
}

.contact-page-content ul li a,
.entry-content ul li a {
	display: flex !important;
	flex-direction: column;
	padding: 24px !important;
	background: var(--sg-color-white) !important;
	border: 2px solid var(--sg-color-border) !important;
	border-radius: 12px !important;
	text-decoration: none !important;
	color: var(--sg-color-text) !important;
	transition: all 0.3s ease !important;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
	min-height: 120px;
	position: relative;
	overflow: hidden;
}

.contact-page-content ul li a::before,
.entry-content ul li a::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	width: 4px;
	height: 100%;
	background: var(--sg-color-primary);
	transform: scaleY(0);
	transition: transform 0.3s ease;
}

.contact-page-content ul li a:hover,
.entry-content ul li a:hover {
	border-color: var(--sg-color-primary) !important;
	transform: translateY(-4px) !important;
	box-shadow: 0 8px 24px rgba(92, 225, 230, 0.25) !important;
	background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%) !important;
}

.contact-page-content ul li a:hover::before,
.entry-content ul li a:hover::before {
	transform: scaleY(1);
}

/* Ícone de seta nos cards */
.contact-page-content ul li a::after,
.entry-content ul li a::after {
	content: '→';
	position: absolute;
	top: 24px;
	right: 24px;
	font-size: 20px;
	color: var(--sg-color-primary);
	opacity: 0.5;
	transition: all 0.3s ease;
}

.contact-page-content ul li a:hover::after,
.entry-content ul li a:hover::after {
	opacity: 1;
	transform: translateX(4px);
}

/* Melhorar o texto dentro dos cards */
.contact-page-content ul li a,
.entry-content ul li a {
	font-size: 16px;
	line-height: 1.6;
	font-weight: 400;
}

.contact-page-content ul li a strong,
.entry-content ul li a strong {
	font-weight: 600;
	color: var(--sg-color-heading);
	margin-bottom: 8px;
	display: block;
	font-size: 18px;
}

/* Garantir que parágrafos entre h2 e ul não quebrem o layout */
.contact-page-content h2 ~ p,
.entry-content h2 ~ p {
	margin-bottom: 20px;
}

/* Responsivo */
@media (max-width: 992px) {
	.contact-items-grid {
		grid-template-columns: 1fr;
		gap: 20px;
	}
	
	.contact-page-content ul {
		grid-template-columns: repeat(2, 1fr) !important;
	}
	
	.form-row {
		grid-template-columns: 1fr;
	}
	
	.contact-form-section {
		padding: 24px;
	}
}

@media (max-width: 768px) {
	.contact-page-wrapper {
		grid-template-columns: 1fr;
		gap: 20px;
	}
	
	.contact-section-full {
		grid-column: 1;
	}
	
	.contact-page-content {
		grid-column: 1;
	}
	
	.contact-content {
		padding: 20px;
	}

	.contact-content h2 {
		font-size: 28px;
	}

	.contact-content > p {
		font-size: 16px;
		margin-bottom: 30px;
	}

	.contact-info {
		margin: 30px 0;
	}

	.contact-info h3,
	.contact-content h3,
	.contact-form-section h3 {
		font-size: 20px;
	}
	
	.contact-form-section {
		padding: 20px;
		margin: 30px 0;
	}
	
	.form-row {
		grid-template-columns: 1fr;
		gap: 0;
	}
	
	.contact-submit-btn {
		width: 100%;
		min-width: auto;
		padding: 14px 30px;
		font-size: 16px;
	}

	.contact-item {
		padding: 14px;
		margin-bottom: 20px;
	}

	.contact-item strong {
		font-size: 14px;
	}

	.contact-item p {
		font-size: 15px;
	}

	.social-links {
		padding: 20px;
		gap: 10px;
	}

	.social-links a.social-icon {
		width: 44px;
		height: 44px;
		padding: 10px;
	}
	
	.social-links a.social-icon svg {
		width: 20px;
		height: 20px;
	}

	/* Cards responsivos */
	.contact-page-content ul,
	.entry-content ul {
		grid-template-columns: 1fr !important;
		gap: 16px !important;
	}

	.entry-content ul li a {
		padding: 20px !important;
		min-height: 100px;
	}

}

@media (max-width: 480px) {
	.contact-content h2 {
		font-size: 24px;
	}

	.contact-info {
		padding: 20px 16px;
	}

	.contact-info h3,
	.contact-content h3 {
		font-size: 18px;
	}

	.social-links {
		flex-direction: row;
		gap: 12px;
	}
	
	.social-links a.social-icon {
		width: 40px;
		height: 40px;
		padding: 8px;
	}
	
	.social-links a.social-icon svg {
		width: 18px;
		height: 18px;
	}

	/* Cards em mobile */
	.contact-page-content ul,
	.entry-content ul {
		grid-template-columns: 1fr !important;
	}

	.entry-content ul li a {
		padding: 18px !important;
		font-size: 15px;
	}

	.entry-content ul li a::after {
		top: 18px;
		right: 18px;
		font-size: 18px;
	}
}

/* Animações suaves */
.contact-content {
	animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.contact-item {
	animation: fadeInUp 0.5s ease-out;
}

.contact-item:nth-child(1) { animation-delay: 0.1s; }
.contact-item:nth-child(2) { animation-delay: 0.2s; }
.contact-item:nth-child(3) { animation-delay: 0.3s; }

@keyframes fadeInUp {
	from {
		opacity: 0;
		transform: translateY(15px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* ============================================
   REGRAS FINAIS PARA ELIMINAR ESPAÇO EM BRANCO
   Prioridade máxima - aplicar no final do arquivo
   ============================================ */
body.page-template-page-contato .entry-content .container,
body.page.contato .entry-content .container,
body.page-template-page-contato .contact-container,
body.page.contato .contact-container,
body.page-template-page-contato .contact-page-wrapper,
body.page.contato .contact-page-wrapper,
body.page-template-page-contato .contact-section-full,
body.page.contato .contact-section-full {
	margin-bottom: 0 !important;
	padding-bottom: 0 !important;
	height: auto !important;
	min-height: auto !important;
}

/* Forçar remoção de qualquer espaço após o último elemento de conteúdo */
body.page-template-page-contato .contact-content,
body.page.contato .contact-content,
body.page-template-page-contato .contact-form-section,
body.page.contato .contact-form-section,
body.page-template-page-contato .social-links,
body.page.contato .social-links,
body.page-template-page-contato .contact-page-content,
body.page.contato .contact-page-content {
	margin-bottom: 0 !important;
}

/* Ocultar entry-footer completamente na página de contato */
body.page-template-page-contato .entry-footer,
body.page.contato .entry-footer {
	display: none !important;
}

/* Reduzir padding do site-main na página de contato */
body.page-template-page-contato #main.site-main,
body.page.contato #main.site-main {
	padding-top: 20px;
	padding-bottom: 0 !important;
}

/* Remover padding da entry-content na página de contato */
body.page-template-page-contato .entry-content,
body.page.contato .entry-content {
	padding-top: 0 !important;
	padding-bottom: 0 !important;
}

/* Remover espaçamento de article e outros containers na página de contato */
body.page-template-page-contato article.page,
body.page.contato article.page,
body.page-template-page-contato #primary,
body.page.contato #primary {
	margin-bottom: 0 !important;
	padding-bottom: 0 !important;
}

/* REGRA FINAL - Zerar qualquer espaçamento que sobrou */
body.page-template-page-contato .site-main .entry-content .container,
body.page.contato .site-main .entry-content .container {
	padding-bottom: 0 !important;
	margin-bottom: 0 !important;
}

/* Remover min-height que força espaço extra */
body.page-template-page-contato .site-main .container,
body.page.contato .site-main .container {
	min-height: auto !important;
}

