/* Estilos Gerais */
body, html {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    /* overflow-x: hidden; */ /* <-- REMOVIDO: Esta linha quebrava o position: sticky do header */
    /*overflow-y: auto;*/
    transition: background-color 0.3s, color 0.3s;
}

:root {
    --background-color: #17171bff;
    --text-color: #c9d1d9;
    --header-bg: #161b22;
    --header-border: #450a0a;
    --post-bg: #171717;
    --link-hover: #ef4444;
    
    /* Nova Paleta de Gradiente */
    --gradient-main: linear-gradient(70deg, #dc2626, #ef4444);
    --gradient-accent-color: #dc2626;
}

html.light-theme, body.light-theme {
    --background-color: #f0f0f0;
    --text-color: #333;
    --header-bg: #fff;
    --header-border: #eee;
    --post-bg: #f8f9fa;
    --link-hover: #c2903d;
}

/* Classe Mágica para Texto em Gradiente */
.gradient-text {
    color: var(--text-color);
}


/* Estilos do Header e Theme Switcher movidos para header.php */

/* Overlay de Conteúdo */
#content-overlay {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    text-align: center;
}

/* Carousel Container */
.carousel-container {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin-bottom: 3rem;
    overflow: hidden;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.carousel-slide {
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.carousel-item {
    min-width: 100%;
    position: relative;
    display: none;
}

.fade {
  animation-name: fade;
  animation-duration: 1.5s;
}

@keyframes fade {
  from {opacity: .4} 
  to {opacity: 1}
}

.carousel-item img {
    width: 100%;
    height: 500px;
    object-fit: cover;
    display: block;
}

.carousel-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 20%, transparent);
    color: #fff;
    padding: 4rem 2rem 2rem;
    text-align: left;
}

.carousel-caption h2 {
    font-size: 3rem;
    margin: 0 0 0.5rem;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
}

.carousel-caption p {
    font-size: 1.2rem;
}

/* Prev/Next Buttons */
.prev, .next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: auto;
    padding: 1rem;
    color: white;
    transition: 0.3s ease;
    border-radius: 50%;
    user-select: none;
    background-color: rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.prev {
    left: 1rem;
}

.next {
    right: 1rem;
}

.prev:hover, .next:hover {
    background-color: rgba(0,0,0,0.6);
}

.prev svg, .next svg {
    width: 32px;
    height: 32px;
}



/* Search Bar */
.search-container {
    width: 100%;
    max-width: 800px;
    margin-bottom: 2.5rem;
}

#search-bar {
    width: 100%;
    padding: 0.8rem 1.2rem;
    font-size: 1rem;
    border-radius: 25px;
    border: 2px solid var(--header-border);
    background-color: var(--header-bg);
    color: var(--text-color);
    outline: none;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

#search-bar:focus {
    border-color: var(--gradient-accent-color);
}

/* Seção de Posts */
#blog-posts {
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    gap: 3.5rem;
}

/* Estilo dos Cards de Post */
.post-card {
    background-color: var(--post-bg);
    border-radius: 15px;
    overflow: hidden; /* Garante que a imagem não ultrapasse as bordas arredondadas */
    text-align: left;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    border: 1px solid var(--header-border);
}

.post-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15);
}

.post-card-image {
    width: 100%;
    height: 350px; /* Altura fixa para a imagem */
    object-fit: cover; /* Garante que a imagem cubra o espaço sem distorcer */
    display: block;
}

.post-card-content {
    padding: 1.5rem 2rem;
}

.post-card h2 {
    color: var(--text-color);
    margin-top: 0;
    font-size: 1.8rem;
}

.post-card .meta {
    font-size: 0.9rem;
    color: #aaa;
    margin-bottom: 1rem;
    font-style: italic;
}

.post-card p {
    line-height: 1.6;
}

.read-more {
    display: inline-block;
    margin-top: 1rem;
    color: var(--gradient-accent-color);
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s;
}

.read-more:hover {
    color: var(--link-hover);
}

/* Footer */
footer {
    margin-top: 4rem;
    padding: 1rem;
    color: #888;
    font-size: 0.9rem;
    text-align: center;
}

/* Paginação */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 3rem;
}

.pagination-controls button {
    color: #000;
    font-weight: 600;
    text-decoration: none;
    font-size: 1rem;
    padding: 0.6rem 1.2rem;
    border: 1px solid var(--gradient-accent-color);
    border-radius: 25px;
    transition: all 0.4s ease;
    background: var(--gradient-main);
    background-size: 200% auto;
    cursor: pointer;
}

.pagination-controls button:hover {
    background-position: right center;
    box-shadow: 0 0 20px var(--gradient-accent-color);
    color: #000;
}

.pagination-controls button:disabled {
    background: #30363d;
    color: #6c757d;
    cursor: not-allowed;
    box-shadow: none;
    border-color: #30363d;
}

#page-info {
    font-weight: 600;
}

/* --- NOVOS ESTILOS PARA A PÁGINA INICIAL --- */

.home-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem;
    text-align: center;
}

.home-hero {
    padding: 4rem 1rem;
}

.home-hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.home-hero p {
    font-size: 1.2rem;
    color: #8b949e;
    max-width: 650px;
    margin: 0 auto;
}

body.light-theme .home-hero p {
    color: #555;
}

.home-cta-container {
    display: flex;
    gap: 2rem;
    margin-top: 3rem;
    justify-content: center;
}

.home-cta-card {
    background-color: #161b22;
    border: 1px solid var(--header-border);
    border-radius: 15px;
    padding: 2.5rem;
    width: 40%;
    max-width: 400px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.home-cta-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.home-cta-card .card-icon {
    margin-bottom: 1.5rem;
    font-size: 48px; /* Tamanho do ícone */
    color: var(--gradient-accent-color);
}

.home-cta-card h2 {
    font-size: 1.8rem;
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.home-cta-card p {
    line-height: 1.6;
    flex-grow: 1; /* Faz o parágrafo ocupar o espaço para alinhar os botões */
}

.cta-button {
    display: inline-block;
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    font-size: 1rem;
    padding: 0.8rem 1.8rem;
    border: 1px solid var(--gradient-accent-color);
    border-radius: 25px;
    transition: all 0.4s ease;
    background: var(--gradient-main);
    background-size: 200% auto;
    margin-top: 1.5rem;
}

.cta-button:hover {
    background-position: right center;
    box-shadow: 0 0 20px var(--gradient-accent-color);
    color: #fff;
}

.home-about {
    margin-top: 6rem;
    padding: 3rem 1rem;
    background-color: #161b22;
    border-radius: 15px;
    border: 1px solid var(--header-border);
}

.home-about h3 {
    font-size: 1.5rem;
    margin-top: 0;
}

.home-about p {
    line-height: 1.7;
    color: #8b949e;
}

body.light-theme .home-about p {
    color: #555;
}

.cta-button-outline {
    display: inline-block;
    color: var(--gradient-accent-color);
    font-weight: 600;
    text-decoration: none;
    font-size: 1rem;
    padding: 0.8rem 1.8rem;
    border: 1px solid var(--gradient-accent-color);
    border-radius: 25px;
    transition: all 0.3s ease;
    background: transparent;
    margin-top: 1rem;
}

.cta-button-outline:hover {
    background: var(--gradient-main);
    color: #ffffff;
}

/* --- Modal Styles --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: var(--post-bg);
    padding: 2rem;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    border: 1px solid var(--header-border);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
}

.updates-btn {
    background-color: var(--header-border);
    color: var(--text-color);
    padding: 0.3rem 0.8rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s;
}

.updates-btn:hover {
    background-color: var(--gradient-accent-color);
}

.update-item {
    border-bottom: 1px solid var(--header-border);
    padding-bottom: 0.5rem;
}

.light-theme .modal-content {
    background-color: #fff;
}

.light-theme #new-update-text {
    background-color: #f0f0f0;
    color: #111;
    border-color: #e0e0e0;
}
.remove-update-btn {
    background: none;
    border: 1px solid var(--header-border);
    color: var(--text-color);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    line-height: 22px;
    text-align: center;
    cursor: pointer;
    margin-left: 1rem;
}

.remove-update-btn:hover {
    background-color: var(--gradient-accent-color);
    color: #fff;
}


/* --- Responsividade & Mobile Menu --- */
/* Estilos do Mobile Menu movidos para header.php */


/* Aplica os estilos do menu em telas menores */
@media (max-width: 900px) {
    .home-hero h1 {
        font-size: 2.8rem;
    }
    .home-cta-container {
        flex-direction: column;
        align-items: center;
    }
    .home-cta-card {
        width: 80%;
        max-width: 500px;
    }


}

@media (max-width: 768px) {

}

@media (max-width: 600px) {
    .home-hero h1 {
        font-size: 2.2rem;
    }
    .home-hero p {
        font-size: 1rem;
    }
    .home-cta-card {
        width: 100%;
        padding: 2rem;
    }
}

/* --- Estilos para o Modal de Login e Gerenciador de Admin --- */

/* O fundo escuro que cobre a tela */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8); /* Mais escuro para dar foco */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

/* O container branco/cinza do modal */
.modal-content {
    background-color: var(--post-bg);
    padding: 2rem;
    border-radius: 15px;
    width: 90%;
    max-width: 500px; /* Tamanho bom para login */
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    border: 1px solid var(--header-border);
}

/* Botão 'X' para fechar */
.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
}

/* Estilo para os campos de input do formulário de login */
#login-form input {
    width: 100%;
    padding: 0.8rem 1rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    border: 1px solid var(--header-border);
    background-color: var(--background-color);
    color: var(--text-color);
    box-sizing: border-box; /* Garante que o padding não estoure a largura */
}

/* Estilos para o tema claro */
body.light-theme .modal-content { 
    background-color: #fff; 
}
body.light-theme #login-form input {
     background-color: #f0f0f0;
     border-color: #ddd;
}

/* --- Estilos do Gerenciador de Admin --- */

/* Botão de remover admin */
.remove-admin-btn {
    background-color: #991b1b;
    color: white;
    border: none;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
}
/* Estilo do botão quando desabilitado */
.remove-admin-btn:disabled {
    background-color: #555;
    cursor: not-allowed;
}

/* Campo para adicionar novo admin */
#new-admin-email {
    padding: 0.5rem;
    border-radius: 6px;
    border: 1px solid var(--header-border);
    background-color: var(--background-color);
    color: var(--text-color);
    width: 100%;
    box-sizing: border-box;
}