/**
 * PSPalmela Theme Styles
 * 
 * @package PSPalmela
 * @since 1.0.0
 */

/* =====================================
* @IMPORTS
* ====================================*/
@import url('https://fonts.googleapis.com/css2?family=Raleway:ital,wght@0,100..900;1,100..900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Nunito+Sans:ital,opsz,wght@0,6..12,200..1000;1,6..12,200..1000&display=swap');
@import url('https://fonts.googleapis.com/css2?family=PT+Sans:ital,wght@0,400;0,700;1,400;1,700&display=swap');

/* =====================================
* GENERAL
* ====================================*/
html, body {
	font-family: 'Nunito Sans', Arial, sans-serif;
	margin: 0;
	padding: 0;
}

/* =====================================
* HEADER :: NAVIGATION
* ====================================*/
header {
	background: #0A5159;
	border-bottom: 1px solid #29656C;
	color: #64B055;
	padding: 0;
	position: sticky;
	top: 0;
	z-index: 1030;	
}

.navbar {
	align-items: center;
	text-transform: uppercase;
	font-family: 'Raleway', Arial, sans-serif;
	font-weight: bold;
}

.navbar-toggler .toggler-icon {
  font-size: 2rem;
  color: #fff;
  border:none !important;
}

.navbar-toggler {
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
  outline: none !important;
  padding: 0.5rem;
}

.navbar-toggler:focus,
.navbar-toggler:active {
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
}

/* =====================================
* HEADER :: LOGO
* ====================================*/
.navbar-brand img {
	max-height: 48px;
	height: auto;
	width: auto;
	display: block;
	margin: 0;
}

/* =====================================
* HEADER :: MAIN MENU
* ====================================*/
.navbar-nav > li > a,
.navbar-nav li a {
	color: white;
	padding: 10px 15px;
	display: block;
	text-decoration: none;
}

.navbar-nav > li > a:hover,
.navbar-nav li a:hover {
	color: #8bc34a;
}

.sub-menu {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	background-color: #0A5159;
	min-width: 200px;
	z-index: 1000;
	border-radius: 4px;
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
	padding: 0;
	margin: 0;
	list-style: none;
	border: 1px solid #29656C;
}

.menu-item-has-children:hover > .sub-menu {
	display: block;
}

.sub-menu li a {
	padding: 10px 16px;
	color: white;
	border-bottom: 1px solid #29656C;
	white-space: nowrap;
	text-decoration: none;
}

.sub-menu li a:hover {
	/*background-color: #29656C;*/
	background: #529D55;
}

.menu-item-has-children {
	position: relative;
}

/* =====================================
* HEADER :: SOCIAL ICONS NETWORKS
* ====================================*/
.social-icons a {
	color: #0A5159;
	background: #64B055;
	border-radius: 50%;
	padding: 5px 10px;
	box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
	transition: 0.3s ease;
}

.social-icons a:hover {
	opacity: 0.8;
}

/* =====================================
* HEADER :: RESPONSIVE NAVIGATION
* ====================================*/
/* Desktop */
@media (min-width: 992px) {
	.navbar .container-fluid {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 0 1.5rem;
	}

	.navbar-brand {
		display: flex;
		align-items: center;
		height: 100%;
	}

	.navbar-nav {
		position: absolute;
		top: 50%;
		left: 50%;
		transform: translate(-50%, -50%);
		flex-direction: row;
		gap: 1.5rem;
		margin: 0;
	}

	.navbar-nav li {
		position: relative;
	}

	.navbar-nav li a {
		font-size: 1.20rem;
		font-weight: 500;
		color: #65A456;
		text-shadow: 0 2px 3px rgba(0, 0, 0, 0.10);
	}

	.navbar-nav li a:hover {
		color: #FFF;
	}

	.navbar-nav li.current_page_item a {
		color: #FFF;
	}

	.sub-menu li a {
		font-size: 1rem;
	}	
}

/* Mobile e Tablet */
@media (max-width: 991.98px) {
	.navbar > .container-fluid,
	#navbarSupportedContent {
		padding: 0 !important;
		margin: 0 !important;
		width: 100% !important;
	}

	.navbar-brand {
		display: flex;
		align-items: center;
		margin-left: 10px;
	}

	.navbar-toggler {
		margin-right: 10px;
	}

	.navbar-collapse {
		align-items: stretch !important;
		padding: 0 !important;
		margin: 0 !important;
		transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
		transform-origin: top center;
	}
	
	.navbar-collapse:not(.show) {
		transform: scaleY(0.95) translateY(-5px);
		opacity: 0;
	}
	
	.navbar-collapse.show {
		transform: scaleY(1) translateY(0);
		opacity: 1;
	}

	.navbar-nav {
		width: 100%;
		flex-direction: column;
		align-items: stretch !important;
		padding: 0;
		margin: 0 !important;
		gap: 0 !important;
	}

	.navbar-nav li {
		display: block;
		width: 100%;
		padding: 0 !important;
		margin: 0 !important;
		text-align: left !important;
		border-bottom: 1px solid #529D55;
		box-sizing: border-box;
		background-color: transparent;
	}
	
	.navbar-nav li > a {
		padding: 0.6rem 1rem !important;
		margin: 0 !important;
		display: block;
		transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	}
	
	.navbar-nav li > a:hover {
		transform: translateX(5px);
		color: #529D55 !important;
	}

	.navbar-nav li:last-child {
		border-bottom: 1px solid #529D55;
	}

	.social-icons {
		justify-content: center !important;
		margin-top: 1rem;
	}

	.menu-item-has-children.open > .sub-menu {
		display: block;
		transform: translateY(0) scale(1);
		opacity: 1;
	}

	.sub-menu {
		position: static;
		margin: 0 !important;
		padding: 0 !important;
		border: none;
		list-style: none;
		max-height: 0;
		opacity: 0;
		overflow: hidden;
		transform: translateY(-15px) scale(0.98);
		transition: max-height 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
		           opacity 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
		           transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
	}

	.sub-menu li {
		margin: 0 !important;
		padding: 0 !important;
		border-bottom: 1px solid #529D55;
		width: 100%;
		box-sizing: border-box;
	}

	.sub-menu li:first-child {
		border-top: 1px solid #529D55;
	}

	.sub-menu li:last-child {
		border-bottom: 1px solid #529D55;
		margin-bottom: 0 !important;
		padding-bottom: 0 !important;
	}

	.sub-menu li a {
		display: block;
		width: 100%;
		color: #FFF;
		text-decoration: none;
		padding: 0.6rem 2rem !important;
		margin: 0 !important;
		border: none !important;
		transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	}

	.sub-menu li a:hover {
		background: #529D55;
		color: white !important;
		transform: translateX(8px);
	}
	
	/* Fix spacing issues completely */
	.menu-item-has-children {
		margin: 0 !important;
		padding: 0 !important;
	}
	
	.menu-item-has-children.open {
		margin: 0 !important;
		padding: 0 !important;
	}
	
	.menu-item-has-children > a {
		margin: 0 !important;
		border-bottom: 0 !important;
		position: relative;
	}
	
	.menu-item-has-children > a::after {
		content: '▼';
		font-size: 10px;
		margin-left: 8px;
		transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
		transform-origin: center;
		display: inline-block;
		color: green;
	}
	
	.menu-item-has-children.open > a::after {
		transform: rotate(180deg) scale(1.1);
		color: #529D55;
	}
	
	/* Ensure no extra spacing between menu items and submenus */
	.navbar-nav li.menu-item-has-children {
		border-bottom: 1px solid #529D55 !important;
	}
	
	.navbar-nav li.menu-item-has-children.open {
		border-bottom: 0 !important;
	}
}

/* =====================================
* FOOTER
* ====================================*/
footer {
	font-family: 'PT Sans', Arial, sans-serif;
    background: #0A5159;
	border-top: 1px solid #29656C;	
    color: #fff;
    padding: 20px 0 10px 0;
}

footer .custom-logo {
	max-height: 60px;
	height: auto;
	width: auto;
	display: block;
	margin: 0 0;
	/*margin-left:10px;*/
}

.autarquicas-badge .badge {
	font-size: .80rem;
	letter-spacing: 1px;
	border-radius: 4px;
	border: 2px solid rgba(0, 0, 0, 0.50) !important;
	background-color: rgba(0, 0, 0, 0.50);
	color: #fff !important;
	display: inline-block;
	line-height: 2;
	margin-left:75px;
}

.autarquicas-badge {
	text-align: left;
}

footer .copyright-box {
	border-top: 1px solid #29656C;
	margin-top: 20px;
	padding-top: 15px;
	padding-bottom: 0;
}

footer .copyright {
	text-align: center;
	margin: 0;
	font-size: 0.875rem;
	color: #fff;
	line-height: 1.4;
}

footer .copyright a,
footer .copyright a:visited
footer .copyright a:active {
	color: #64B055;
	text-decoration: none;
	font-weight: 500;
	font-style: italic;
	font-size: 0.875rem;
}

footer .copyright a:hover {
	color: #8bc34a;
	text-decoration: none;
}

/*footer .social-icons {
	margin-right:15px;
}*/


/* Footer Responsive Layout */
@media (max-width: 991.98px) {
	footer .logo-container {
		text-align: center;
	}
	
	footer .logo-container img,
	footer .logo-container .custom-logo {
		margin: 0 auto;
		display: block;
	}
	
	footer .autarquicas-badge {
		text-align: center;
		margin-left: 0 !important;
	}
	
	.autarquicas-badge .badge {
		margin-left: 0 !important;
	}

	footer .social-icons {
		justify-content: center !important;
		margin-top: 20px !important;
		margin-bottom: 0 !important;
	}
}

/* =====================================
* WORDPRESS ADMIN BAR CONTROL
* ====================================*/
/* Hide admin bar on scroll for desktop */
@media screen and (min-width: 783px) {
	body.admin-bar #wpadminbar {
		position: fixed;
		top: 0;
		transition: transform 0.3s ease;
		z-index: 99999;
	}
	
	/* Hide admin bar when scrolling down */
	body.admin-bar.scrolling-down #wpadminbar {
		transform: translateY(-100%);
	}
	
	/* Adjust header position when admin bar is visible */
	body.admin-bar header {
		top: 32px;
		transition: top 0.3s ease;
	}
	
	/* Reset header position when admin bar is hidden - NO SPACE */
	body.admin-bar.scrolling-down header {
		top: 0 !important;
	}
}

/* Mobile admin bar behavior (keep default) */
@media screen and (max-width: 782px) {
	body.admin-bar header {
		top: 0;
	}
}

/* =====================================
* MAIN CONTENT LAYOUT
* ====================================*/
main, .main-content {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	margin:0;
}

.content-wrapper {
	flex: 1;
	display: flex;
	flex-direction: column;
	margin:0;
}

/* Ajuste para quando há admin bar */
body.admin-bar main,
body.admin-bar .main-content {
	min-height: calc(100vh - 32px);
}

@media screen and (max-width: 782px) {
	body.admin-bar main,
	body.admin-bar .main-content {
		min-height: calc(100vh - 46px);
	}
}

/* Mensagem de sem conteúdo */
.no-content-message {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 60vh;
	text-align: center;
	padding: 4rem 2rem;
	color: #666;
	font-size: 1.1rem;
}

/* =====================================
* BLOG LAYOUT
* ====================================*/
.blog-slider {
	margin-top: 0;
	margin-bottom: 3rem;
	overflow: hidden;
}

.blog-slider img {
	width: 100%;
	height: auto;
	max-height: 600px;
	object-fit: cover;
	object-position: center center;
}

/* Responsividade do banner */
@media (max-width: 1200px) {
	.blog-slider img {
		max-height: 400px;
	}
}

@media (max-width: 768px) {
	.blog-slider img {
		max-height: 300px;
	}
	
	.blog-slider {
		margin-bottom: 2rem;
	}
}

@media (max-width: 576px) {
	.blog-slider img {
		max-height: 250px;
	}
}

.blog-posts {
	margin-top: 2rem;
}

.blog-posts .card {
	border: 1px solid #e9ecef;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
	border-radius: 12px;
	overflow: hidden;
	background: #fff;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.blog-posts .card:hover {
	transform: translateY(-8px);
	box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
	border-color: #529D55;
}

.blog-posts .card-img-top {
	overflow: hidden;
	height: 220px;
	position: relative;
	background: #f8f9fa;
}

.blog-posts .card-img-top img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.4s ease;
}

.blog-posts .card:hover .card-img-top img {
	transform: scale(1.08);
}

.blog-posts .card-body {
	padding: 1.5rem;
	display: flex;
	flex-direction: column;
	height: auto;
	min-height: 200px;
}

.blog-posts .card-title {
	font-size: 1.1rem;
	font-weight: 600;
	margin-bottom: 0.8rem;
	line-height: 1.4;
	color: #333;
}

.blog-posts .card-title a {
	color: #333;
	text-decoration: none;
	transition: color 0.3s ease;
}

.blog-posts .card-title a:hover {
	color: #529D55;
}

.blog-posts .card-excerpt {
	font-size: 0.9rem;
	color: #666;
	line-height: 1.5;
	margin-bottom: 1.2rem;
	flex-grow: 1;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-overflow: ellipsis;
}

.blog-posts .card-footer-custom {
	margin-top: auto;
	padding-top: 1rem;
	border-top: 1px solid #f1f3f4;
}

.blog-posts .btn-saber-mais {
	background: #529D55;
	border: 2px solid #529D55;
	color: white;
	padding: 0.6rem 1.5rem;
	border-radius: 25px;
	font-size: 0.9rem;
	font-weight: 500;
	text-decoration: none;
	transition: all 0.3s ease;
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
}

.blog-posts .btn-saber-mais:hover {
	background: transparent;
	color: #529D55;
	transform: translateX(3px);
}

.blog-posts .btn-saber-mais i {
	font-size: 0.8rem;
	transition: transform 0.3s ease;
}

.blog-posts .btn-saber-mais:hover i {
	transform: translateX(3px);
}

/* Responsividade dos cards */
@media (max-width: 768px) {
	.blog-posts .card-img-top {
		height: 180px;
	}
	
	.blog-posts .card-body {
		padding: 1.2rem;
		min-height: 160px;
	}
	
	.blog-posts .card-title {
		font-size: 1rem;
	}
	
	.blog-posts .card-excerpt {
		font-size: 0.85rem;
		-webkit-line-clamp: 2;
		line-clamp: 2;
	}
	
	/* Paginação mobile */
	.page-numbers {
		padding: 10px 14px;
		margin: 0 3px;
		font-size: 0.85rem;
	}
	
	.page-numbers.prev,
	.page-numbers.next {
		padding: 10px 16px;
	}
}

@media (max-width: 576px) {
	.blog-posts {
		margin-top: 1.5rem;
	}
	
	.blog-posts .card-img-top {
		height: 160px;
	}
	
	.blog-posts .card-body {
		padding: 1rem;
		min-height: 140px;
	}
	
	/* Paginação muito pequena */
	.page-numbers {
		padding: 8px 12px;
		margin: 0 2px;
		font-size: 0.8rem;
	}
	
	.page-numbers.prev,
	.page-numbers.next {
		padding: 8px 14px;
	}
	
	/* Esconder números no mobile muito pequeno, só prev/next */
	.pagination-blog {
		flex-wrap: wrap;
		gap: 0.5rem;
	}
}

/* Blog pagination */
.pagination-blog {
	display: flex;
	justify-content: center;
	margin: 2rem 0;
}

.page-numbers {
	display: inline-flex;
	align-items: center;
	padding: 12px 18px;
	margin: 0 6px;
	color: #529D55;
	text-decoration: none;
	border: 2px solid #e9ecef;
	border-radius: 8px;
	transition: all 0.3s ease;
	font-weight: 500;
	font-size: 0.9rem;
}

.page-numbers:hover {
	background-color: #529D55;
	border-color: #529D55;
	color: white;
	text-decoration: none;
	transform: translateY(-2px);
	box-shadow: 0 4px 8px rgba(82, 157, 85, 0.3);
}

.page-numbers.current {
	background-color: #529D55;
	border-color: #529D55;
	color: white;
	box-shadow: 0 4px 8px rgba(82, 157, 85, 0.3);
}

.page-numbers.prev,
.page-numbers.next {
	padding: 12px 20px;
	font-weight: 600;
}

.page-numbers.dots {
	border: none;
	background: none;
	color: #666;
}

.page-numbers.dots:hover {
	background: none;
	color: #666;
	transform: none;
	box-shadow: none;
}

/* =====================================
* SINGLE ARTICLE LAYOUT
* ====================================*/
.single-article {
	margin-top: 2rem;
	margin-bottom: 2rem;
}

.single-article article {
	padding: 2rem;
	margin-bottom: 2rem;
}

.single-article h1 {
	color: #333;
	font-size: 2.2rem;
	font-weight: 600;
	margin-bottom: 1.5rem;
	line-height: 1.3;
	font-family: 'Raleway', Arial, sans-serif;
}

.single-article .entry-content {
	font-size: 1.1rem;
	line-height: 1.7;
	color: #444;
	margin-bottom: 2rem;
}

.single-article .entry-meta {
	padding-top: 1.5rem;
	border-top: 1px solid #e9ecef;
	font-size: 0.9rem;
	color: #666;
	font-style: italic;
}

/* Responsividade do artigo individual */
@media (max-width: 768px) {
	.single-article {
		margin-top: 1.5rem;
	}
	
	.single-article article {
		padding: 1.5rem;
		margin-bottom: 1.5rem;
	}
	
	.single-article h1 {
		font-size: 1.8rem;
		margin-bottom: 1.2rem;
	}
	
	.single-article .entry-content {
		font-size: 1rem;
		line-height: 1.6;
	}
}

@media (max-width: 576px) {
	.single-article article {
		padding: 1.2rem;
		border-radius: 8px;
	}
	
	.single-article h1 {
		font-size: 1.6rem;
		margin-bottom: 1rem;
	}
	
	.single-article .entry-content {
		font-size: 0.95rem;
	}
}

/* Botão Voltar ao Blog */
.back-to-blog {
	text-align: center;
	margin-top: 2rem;
	padding-top: 2rem;
	border-top: 1px solid #e9ecef;
}

.btn-voltar-blog {
	background: #529D55;
	border: 2px solid #529D55;
	color: white;
	padding: 0.8rem 2rem;
	border-radius: 25px;
	font-size: 1rem;
	font-weight: 500;
	text-decoration: none;
	transition: all 0.3s ease;
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	font-family: 'Raleway', Arial, sans-serif;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.btn-voltar-blog:hover {
	background: transparent;
	color: #529D55;
	text-decoration: none;
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(82, 157, 85, 0.3);
}

.btn-voltar-blog i {
	font-size: 0.9rem;
	transition: transform 0.3s ease;
}

.btn-voltar-blog:hover i {
	transform: translateX(-3px);
}

/* Responsividade do botão */
@media (max-width: 768px) {
	.back-to-blog {
		margin-top: 1.5rem;
		padding-top: 1.5rem;
	}
	
	.btn-voltar-blog {
		padding: 0.7rem 1.5rem;
		font-size: 0.9rem;
	}
}

@media (max-width: 576px) {
	.btn-voltar-blog {
		padding: 0.6rem 1.2rem;
		font-size: 0.85rem;
		letter-spacing: 0.3px;
	}
}

/* =====================================
* CUSTOM 404 PAGE
* ====================================*/
.error-404-page {
	min-height: 100vh;
	position: relative;
}

.error-404-background {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-size: cover;
	background-position: center center;
	background-repeat: no-repeat;
	background-attachment: fixed;
}

.error-404-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 1;
}

.error-404-content {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 100vh;
	z-index: 2;
	padding: 2rem 0;
}

.error-404-inner {
	text-align: center;
	max-width: 600px;
	margin: 0 auto;
	padding: 2rem;
}

.error-404-title {
	font-size: 4rem;
	font-weight: 700;
	margin-bottom: 1.5rem;
	font-family: 'Raleway', Arial, sans-serif;
	text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.error-404-message {
	font-size: 1.3rem;
	line-height: 1.6;
	margin-bottom: 2.5rem;
	text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.error-404-link {
	text-decoration: underline;
	font-weight: 600;
	transition: opacity 0.3s ease;
}

.error-404-link:hover {
	opacity: 0.8;
	text-decoration: underline;
}

.btn-voltar-home {
	background: rgba(255, 255, 255, 0.2);
	border: 2px solid rgba(255, 255, 255, 0.8);
	padding: 1rem 2.5rem;
	border-radius: 30px;
	font-size: 1.1rem;
	font-weight: 600;
	text-decoration: none;
	transition: all 0.3s ease;
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	font-family: 'Raleway', Arial, sans-serif;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	backdrop-filter: blur(10px);
	text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.btn-voltar-home:hover {
	background: rgba(255, 255, 255, 0.3);
	border-color: rgba(255, 255, 255, 1);
	text-decoration: none;
	transform: translateY(-3px);
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.btn-voltar-home i {
	font-size: 1rem;
	transition: transform 0.3s ease;
}

.btn-voltar-home:hover i {
	transform: translateX(-3px);
}

/* Responsividade da página 404 */
@media (max-width: 768px) {
	.error-404-background {
		background-attachment: scroll;
	}
	
	.error-404-inner {
		padding: 1.5rem;
	}
	
	.error-404-title {
		font-size: 3rem;
		margin-bottom: 1.2rem;
	}
	
	.error-404-message {
		font-size: 1.1rem;
		margin-bottom: 2rem;
	}
	
	.btn-voltar-home {
		padding: 0.8rem 2rem;
		font-size: 1rem;
	}
}

@media (max-width: 576px) {
	.error-404-inner {
		padding: 1rem;
	}
	
	.error-404-title {
		font-size: 2.5rem;
		margin-bottom: 1rem;
	}
	
	.error-404-message {
		font-size: 1rem;
		margin-bottom: 1.5rem;
	}
	
	.btn-voltar-home {
		padding: 0.7rem 1.5rem;
		font-size: 0.9rem;
		letter-spacing: 0.3px;
	}
}