/*--------------------------------------------------------------
1.0 - Reset e Variáveis Globais (CSS Custom Properties)
--------------------------------------------------------------*/
:root {
    --cor-primaria: #0073e6;
    --cor-fundo: #f8f9fa;
    --cor-fundo-item: #ffffff;
    --cor-texto: #212529;
    --cor-texto-suave: #6c757d;
    --cor-borda: #dee2e6;
    --sombra-suave: 0 4px 15px rgba(0, 0, 0, 0.07);
    --fonte-principal: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --fonte-titulo: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --raio-borda: 12px;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: var(--fonte-principal);
    font-size: 16px;
    line-height: 1.6;
    color: var(--cor-texto);
    background-color: var(--cor-fundo);
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--fonte-titulo);
    font-weight: 700;
    line-height: 1.2;
    margin: 1.5em 0 0.5em;
}

a {
    color: var(--cor-primaria);
    text-decoration: none;
    transition: color 0.2s ease;
}
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }

/*--------------------------------------------------------------
2.5 - Header & Footer (VERSÃO FINAL E LIMPA)
--------------------------------------------------------------*/
.container { max-width: 1200px; margin-left: auto; margin-right: auto; padding-left: 20px; padding-right: 20px; }
#content { padding-top: 2rem; padding-bottom: 2rem; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* Header Estrutura */
.site-header { box-shadow: 0 2px 5px rgba(0,0,0,0.05); }

/* Topo */
.top-bar-wrapper { width: 100%; background-color: var(--cor-fundo); border-bottom: 1px solid var(--cor-borda); }
.top-bar-wrapper .container { display: flex; justify-content: space-between; align-items: center; height: 40px; font-size: 0.85rem; color: var(--cor-texto-suave); }
.search-toggle-button { background: none; border: none; cursor: pointer; padding: 0; line-height: 1; color: var(--cor-texto-suave); }

/* Logo */
.branding-wrapper { width: 100%; background-color: #fff; }
.branding-wrapper .container { padding: 2rem 20px; text-align: center; }
.site-title a { font-size: 2.5rem; text-decoration: none; color: var(--cor-texto); }

/* Navegação */
.main-navigation-wrapper { width: 100%; background-color: var(--cor-fundo-item); border-top: 1px solid var(--cor-borda); border-bottom: 1px solid var(--cor-borda); position: sticky; top: 0; z-index: 900; }
.main-navigation { display: flex; justify-content: center; }
.main-navigation ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; }
.main-navigation li a { display: block; padding: 15px 20px; font-weight: 700; text-decoration: none; color: var(--cor-texto); }
.main-navigation li a:hover { color: var(--cor-primaria); }
.main-navigation .menu-toggle { display: none; }

/* Sub-menus */
.main-navigation li { position: relative; }
.main-navigation ul ul.sub-menu { display: none; position: absolute; top: 100%; left: 0; background-color: #fff; box-shadow: 0 5px 15px rgba(0,0,0,0.1); min-width: 220px; border-radius: 0 0 8px 8px; z-index: 1001; }
.main-navigation li:hover > ul.sub-menu { display: block; }
.main-navigation ul ul li { width: 100%; }
.main-navigation ul ul a { font-weight: 400; border-bottom: 1px solid var(--cor-borda); }
.main-navigation ul ul li:last-child a { border-bottom: none; }

/* Pop-up de Busca */
.search-popup-container {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 9999; display: flex; align-items: flex-start; justify-content: center;
    visibility: hidden; transition: visibility 0s 0.3s;
}
.search-popup-container.is-active { visibility: visible; transition-delay: 0s; }
.search-popup-container .search-popup-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(17, 17, 17, 0.85); backdrop-filter: blur(5px);
    opacity: 0; transition: opacity 0.3s ease;
}
.search-popup-container.is-active .search-popup-overlay { opacity: 1; }
.search-popup-content {
    position: relative; width: 90%; max-width: 600px; margin-top: 10vh;
    transform: translateY(-50px); opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.search-popup-container.is-active .search-popup-content { transform: translateY(0); opacity: 1; }
.search-popup-close-button {
    position: absolute; top: -40px; right: -10px; font-size: 2.5rem;
    color: #fff; background: none; border: none; cursor: pointer;
    opacity: 0.8;
}
.search-popup-close-button:hover { opacity: 1; }

/* Footer Estrutura */
.site-footer { color: #adb5bd; }
.footer-widgets-wrapper { width: 100%; background-color: #212529; padding: 3rem 0; }
.footer-widgets-wrapper .container { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 40px; }
.widget-title { color: #fff; margin: 0 0 1rem; font-size: 1.1rem; }
.footer-widgets-wrapper ul { list-style: none; padding: 0; margin: 0; }
.footer-widgets-wrapper li { margin-bottom: 0.5rem; }
.footer-widgets-wrapper a { color: #adb5bd; text-decoration: none; }
.footer-widgets-wrapper a:hover { color: #fff; }
.site-info-wrapper { width: 100%; background-color: #111; padding: 1.5rem 0; text-align: center; font-size: 0.8rem; }

/* Responsividade */
@media (max-width: 900px) {
    .main-navigation-wrapper .container { position: relative; }
    .main-navigation { justify-content: flex-end; }
    .menu-toggle { display: block; background: none; border: none; width: 30px; height: 22px; cursor: pointer; margin: 15px 0; position: relative; }
    .menu-toggle span { display: block; position: absolute; height: 3px; width: 100%; background: var(--cor-texto); border-radius: 3px; transition: all .25s ease-in-out; }
    .menu-toggle span:nth-child(1) { top: 0px; }
    .menu-toggle span:nth-child(2) { top: 9px; }
    .menu-toggle span:nth-child(3) { top: 18px; }
    .main-navigation.toggled .menu-toggle span:nth-child(1) { top: 9px; transform: rotate(135deg); }
    .main-navigation.toggled .menu-toggle span:nth-child(2) { opacity: 0; left: -60px; }
    .main-navigation.toggled .menu-toggle span:nth-child(3) { top: 9px; transform: rotate(-135deg); }
    
    .main-navigation ul#primary-menu { display: none; flex-direction: column; position: absolute; top: calc(100% + 5px); right: 0; width: 300px; max-width: 90vw; background: #fff; box-shadow: 0 5px 15px rgba(0,0,0,0.1); border: 1px solid var(--cor-borda); z-index: 999; }
    .main-navigation.toggled ul#primary-menu { display: block; }
    .main-navigation ul li { width: 100%; text-align: left; }
    .main-navigation ul ul.sub-menu { position: static; box-shadow: none; border-top: 1px solid var(--cor-borda); }
}

/* --- Pop-up de Busca --- */
.search-popup-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    visibility: hidden;
    transition: visibility 0s 0.3s;
}
.search-popup-container.is-active {
    visibility: visible;
    transition-delay: 0s;
}
.search-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(17, 17, 17, 0.85);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: pointer; /* Permite fechar clicando no fundo */
}
.search-popup-container.is-active .search-popup-overlay {
    opacity: 1;
}
.search-popup-content {
    position: relative;
    width: 90%;
    max-width: 600px;
    margin-top: 10vh;
    transform: translateY(-50px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.search-popup-container.is-active .search-popup-content {
    transform: translateY(0);
    opacity: 1;
}
.search-popup-close-button {
    position: absolute;
    top: -50px; /* Posiciona acima do campo de busca */
    right: 0;
    font-size: 2.5rem;
    color: #fff;
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
    padding: 5px;
}
.search-popup-close-button:hover {
    opacity: 1;
}

/*--------------------------------------------------------------
2.8 - Estilos de Tipografia e Títulos
--------------------------------------------------------------*/

/* Estilo base para todos os títulos de conteúdo */
.entry-content h1, .entry-content h2, .entry-content h3, .entry-content h4 {
    color: var(--cor-texto);
    letter-spacing: -0.5px;
    margin-top: 2.5em;
    margin-bottom: 1.5em;
}

/* Título H1 (Título principal do post) */
.entry-title {
    font-size: clamp(2rem, 6vw, 3rem); /* Fonte responsiva */
    text-align: center;
    line-height: 1.2;
    margin-bottom: 1em;
}

/* Título H2 (Títulos de seção principal) */
.entry-content h2, .wp-block-heading:where(h2) {
    font-size: clamp(1.8rem, 5vw, 2.2rem);
    text-align: center;
    position: relative;
    padding-bottom: 15px;
}
.entry-content h2::after, .wp-block-heading:where(h2)::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--cor-primaria) 0%, #a1c4fd 100%);
    border-radius: 2px;
    margin: 15px auto 0;
}

/* Título H3 (Sub-títulos) */
.entry-content h3, .wp-block-heading:where(h3) {
    font-size: clamp(1.4rem, 4vw, 1.7rem);
    border-left: 4px solid var(--cor-primaria);
    padding-left: 15px;
    color: #343a40; /* Um pouco mais suave que o preto total */
}

/* Título H4 (Detalhes menores) */
.entry-content h4, .wp-block-heading:where(h4) {
    font-size: clamp(1.1rem, 3vw, 1.3rem);
    color: var(--cor-texto-suave);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px dotted var(--cor-borda);
    padding-bottom: 10px;
}