/*
 * Global Reset and Dark Mode Variables
 */
:root {
	--bg: #ffffff;
	--text: #111827;
	--primary: #026a9e; /* Azul escurecido para acessibilidade (Contraste 4.5+) */
	--card-bg: #f3f4f6;
	--drawing-bg: #ffffff; /* Fundo dos cards de imagens/desenhos */
	--border: #e5e7eb;
}

:root.dark {
	--bg: #111827;
	--text: #f9fafb;
	--card-bg: #1f2937;
	--drawing-bg: #1f2937; /* Fundo dos cards de imagens/desenhos no dark mode */
	--border: #374151;
	--primary: #38bdf8;
}

*, *::before, *::after {
	box-sizing: border-box;
}

body {
	margin: 0;
	padding: 0;
	background-color: var(--bg);
	color: var(--text);
	font-family: var(--wp--preset--font-family--system, system-ui, sans-serif);
	line-height: 1.5;
	transition: background-color 0.2s, color 0.2s;
	overflow-x: hidden;
}

img, picture, video, canvas, svg {
	display: block;
	max-width: 100%;
	height: auto;
}

a {
	color: var(--primary);
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

/* Utilities */
.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border-width: 0;
}

/* Header & Navigation */
.site-header {
	background-color: var(--bg);
	border-bottom: 1px solid var(--border);
	position: sticky;
	top: 0;
	z-index: 100;
}

.site-branding {
	display: flex;
	align-items: center;
}

.site-title {
	font-size: 1.25rem;
	font-weight: 700;
	margin: 0;
}

.site-title a {
	color: var(--text);
	text-decoration: none;
}

.custom-logo-link {
	display: flex;
	align-items: center;
	min-height: 48px;
}

.custom-logo {
	max-height: 48px;
	width: auto;
}

.main-navigation ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	gap: 1.5rem;
}

.main-navigation a {
	color: var(--text);
	font-weight: 500;
	transition: color 0.15s;
}

.main-navigation a:hover {
	color: var(--primary);
	text-decoration: none;
}

.menu-toggle {
	display: none;
	background: transparent;
	border: 1px solid var(--border);
	border-radius: 6px;
	padding: 0.4rem;
	color: var(--text);
	cursor: pointer;
	min-width: 48px;
	min-height: 48px;
}

.theme-toggle {
	background: transparent;
	border: 1px solid var(--border);
	border-radius: 50%;
	width: 38px;
	height: 38px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	font-size: 1.1rem;
	transition: background-color 0.15s;
}

.theme-toggle:hover {
	background-color: var(--card-bg);
}

/* Mobile Navigation (< 768px) */
@media (max-width: 768px) {
	.site-header .header-inner {
		flex-wrap: wrap;
		gap: 0;
		justify-content: space-between;
	}
	
	.main-navigation {
		order: 1;
		flex: 0 0 auto;
		margin: 0;
		position: relative;
	}

	.site-branding {
		order: 2;
		flex: 1 1 auto;
		display: flex;
		justify-content: center;
		padding: 0 0.5rem;
	}
	
	.theme-toggle {
		order: 3;
		flex: 0 0 auto;
		margin: 0;
	}

	.header-search-container {
		order: 4;
		display: block !important;
		width: 100% !important;
		margin: 0.8rem 0 0 0 !important;
	}
	
	.header-search-form,
	#fc-header-live-search {
		width: 100% !important;
		max-width: 100% !important;
		box-sizing: border-box !important;
	}

	.menu-toggle {
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.main-navigation ul {
		display: none;
		position: absolute;
		top: calc(100% + 0.75rem);
		left: 0;
		background-color: var(--bg);
		border: 1px solid var(--border);
		border-radius: 8px;
		flex-direction: column;
		min-width: 220px;
		padding: 0.75rem 0;
		box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.2);
		gap: 0;
		z-index: 9999;
	}

	.main-navigation.toggled ul {
		display: flex;
	}

	.main-navigation li a {
		display: block;
		padding: 0.6rem 1.25rem;
	}

	.main-navigation li a:hover {
		background-color: var(--card-bg);
	}
}

/* Buttons and Badges */
.button {
	display: inline-block;
	padding: 0.75rem 1.5rem;
	font-weight: 600;
	border-radius: 8px;
	cursor: pointer;
	text-align: center;
	transition: opacity 0.15s;
	border: none;
}

.button:hover {
	opacity: 0.9;
	text-decoration: none;
}

.button-primary {
	background-color: var(--primary);
	color: #ffffff;
}

.button-secondary {
	background-color: var(--card-bg);
	color: var(--text);
	border: 1px solid var(--border);
}

.print-counter-badge {
	display: inline-block;
	font-size: 0.875rem;
	color: var(--text);
	opacity: 0.8;
	background-color: var(--card-bg);
	border: 1px solid var(--border);
	border-radius: 9999px;
	padding: 0.25rem 0.75rem;
	margin-top: 0.5rem;
}

/* Pagination */
.dc-pagination .nav-links {
	display: flex;
	justify-content: center;
	gap: 0.5rem;
	flex-wrap: wrap;
}
.dc-pagination .page-numbers {
	display: inline-block;
	padding: 0.5rem 1rem;
	background: var(--card-bg);
	color: var(--primary);
	border: 1px solid var(--border);
	border-radius: 8px;
	text-decoration: none;
	font-weight: bold;
	transition: all 0.2s;
}
.dc-pagination .page-numbers:hover {
	background: var(--border);
}
.dc-pagination .page-numbers.current {
	background: var(--primary);
	color: #fff;
	border-color: var(--primary);
}

/* Footer */
.site-footer {
	background-color: #2185bb; /* Azul similar ao header, mas mais escuro (ajustável) */
	color: #ffffff;
	padding-top: 4rem;
}

:root.dark .site-footer {
	background-color: #0f172a;
	border-top: 1px solid var(--border);
}

.footer-main {
	display: grid;
	grid-template-columns: 1.2fr 1fr 1fr 1fr;
	gap: 2rem;
	margin-bottom: 2rem;
}

.footer-col .footer-desc {
	font-size: 0.85rem;
	line-height: 1.5;
	color: rgba(255, 255, 255, 0.8);
	margin-top: 0;
	max-width: 90%;
}

.footer-title {
	font-size: 0.9rem;
	font-weight: 700;
	margin-top: 0;
	margin-bottom: 1.25rem;
	letter-spacing: 0.02em;
	color: #ffffff;
}

/* Footer Tags (Temas Populares como Menu WP) */
.footer-tags-list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	list-style: none;
	padding: 0;
	margin: 0;
}

.footer-tags-list li {
	margin: 0;
	padding: 0;
}

.footer-tags-list a, .footer-tag {
	display: inline-block;
	background-color: rgba(255, 255, 255, 0.15);
	color: #ffffff !important;
	padding: 0.5rem 1rem;
	border-radius: 9999px;
	font-size: 0.85rem;
	font-weight: 500;
	text-decoration: none !important;
	transition: background-color 0.15s;
}

.footer-tags-list a:hover, .footer-tag:hover {
	background-color: rgba(255, 255, 255, 0.25);
}

/* Footer Menus (Atividades e Institucional) */
.footer-menu {
	list-style: none;
	padding: 0;
	margin: 0;
}

.footer-menu li {
	margin-bottom: 0.1rem;
}

.footer-menu a {
	display: block;
	padding: 0.4rem 0;
	color: rgba(255, 255, 255, 0.85) !important;
	font-size: 0.85rem;
	text-decoration: none !important;
	transition: color 0.15s;
}

.footer-menu a:hover {
	color: #ffffff !important;
}

/* Bottom Copyright Bar */
.footer-bottom {
	border-top: 1px solid rgba(255, 255, 255, 0.1);
	padding: 1.5rem 0;
}

.site-info {
	text-align: center;
	font-size: 0.75rem;
	color: rgba(255, 255, 255, 0.6);
}

/* Responsividade do Footer */
@media (max-width: 1024px) {
	.footer-main {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 640px) {
	.footer-main {
		grid-template-columns: 1fr;
		gap: 2.5rem;
	}
	.footer-col .footer-desc {
		max-width: 100%;
	}
}
