/* Variáveis de Cores (Tema Claro Padrão) */
:root {
    --bg-color: #f4f7fa;
    --text-color: #333;
    --header-bg: #ffffff;
    --card-bg: #ffffff;
    --primary-blue: #00a8e8;
    --hover-blue: #0077b6;
    --border-radius: 12px;
    --shadow: 0 4px 6px rgba(0,0,0,0.05);
    --transition: all 0.3s ease;
}

/* Variáveis Tema Escuro */
body.dark-theme {
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --header-bg: #1e1e1e;
    --card-bg: #252525;
    --primary-blue: #4fc3f7;
    --hover-blue: #81d4fa;
    --shadow: 0 4px 6px rgba(0,0,0,0.3);
}

/* Reset Básico */
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', Roboto, sans-serif; }

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

html { scroll-behavior: smooth; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* Header */
header {
    background-color: var(--header-bg);
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo { font-size: 1.5rem; font-weight: bold; color: var(--primary-blue); display: flex; align-items: center; gap: 10px; }
.nav-menu ul { display: flex; gap: 20px; }
.nav-menu a:hover { color: var(--primary-blue); }

#theme-toggle {
    background: none;
    border: 2px solid var(--primary-blue);
    color: var(--text-color);
    padding: 5px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: var(--transition);
}
#theme-toggle:hover { background: var(--primary-blue); color: #fff; }

/* Layout Principal */
.container { max-width: 1200px; margin: 30px auto; padding: 0 20px; flex: 1; }

/* Títulos das Seções */
.category-group { margin-bottom: 60px; }
.category-group h2, .categories-section h2 {
    margin-bottom: 20px;
    border-left: 5px solid var(--primary-blue);
    padding-left: 10px;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Menu de Pílulas (Categorias) */
.categories-section { margin-bottom: 40px; }
.category-list { display: flex; flex-wrap: wrap; gap: 10px; }
.cat-pill {
    background-color: var(--card-bg);
    padding: 10px 20px;
    border-radius: 50px;
    box-shadow: var(--shadow);
    font-weight: 500;
    transition: var(--transition);
    border: 1px solid transparent;
}
.cat-pill:hover {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
    transform: translateY(-2px);
}

/* === GRID DE BLOCOS (5 POR LINHA) === */
.grid-container {
    display: grid;
    grid-template-columns: repeat(5, 1fr); /* Aqui define 5 colunas */
    gap: 20px;
}

.tech-block {
    background-color: var(--card-bg);
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    text-align: center;
    border-bottom: 3px solid transparent;
    padding: 10px; /* Espaço interno para o texto não bater na borda */
}

.tech-block i {
    font-size: 2.5rem; /* Ajustei levemente o tamanho para caber melhor */
    color: var(--primary-blue);
    margin-bottom: 15px;
}

.tech-block span {
    font-weight: 600;
    font-size: 0.95rem;
    white-space: normal; /* Permite quebra de linha */
    line-height: 1.2;
}

.tech-block:hover {
    transform: translateY(-5px);
    border-bottom-color: var(--primary-blue);
}

/* Footer */
footer {
    background-color: var(--header-bg);
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    border-top: 1px solid rgba(0,0,0,0.1);
}

/* === RESPONSIVIDADE (Tablets e Celulares) === */
@media (max-width: 900px) {
    .grid-container {
        grid-template-columns: repeat(3, 1fr); /* 3 colunas em tablets */
    }
}

@media (max-width: 600px) {
    header { flex-direction: column; gap: 15px; }
    
    .grid-container {
        grid-template-columns: repeat(2, 1fr); /* 2 colunas em celulares */
    }
    
    .tech-block { aspect-ratio: auto; padding: 20px 10px; }
}

/* =========================================
   ESTILOS DA PÁGINA DE POST (CONTEÚDO)
   ========================================= */

/* Limita a largura do texto para leitura confortável */
.post-container {
    max-width: 900px; 
}

/* Cabeçalho do Post */
.post-header {
    text-align: center;
    margin-bottom: 30px;
}

.post-header h1 {
    color: var(--primary-blue);
    margin-bottom: 15px;
    font-size: 2rem;
}

.post-description {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-color);
    max-width: 80%;
    margin: 0 auto;
}

/* Imagem Centralizada e Pequena */
.image-wrapper {
    text-align: center;
    margin-bottom: 40px;
}

.post-image {
    max-width: 300px; /* Define o tamanho pequeno */
    width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border: 3px solid var(--card-bg);
}

/* Lista de Downloads */
.download-section h3 {
    border-bottom: 2px solid var(--primary-blue);
    padding-bottom: 10px;
    margin-bottom: 20px;
    color: var(--text-color);
}

.download-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.download-item {
    background-color: var(--card-bg);
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Para celulares */
    gap: 15px;
    border-left: 5px solid var(--primary-blue); /* Detalhe visual */
}

.file-info {
    display: flex;
    flex-direction: column;
}

.file-name {
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.file-meta {
    font-size: 0.85rem;
    opacity: 0.7;
}

/* Botões de Download */
.file-buttons {
    display: flex;
    gap: 10px;
}

.btn-download {
    background-color: var(--primary-blue);
    color: #fff;
    padding: 8px 20px;
    border-radius: 5px;
    font-weight: 600;
    transition: var(--transition);
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-download:hover {
    background-color: var(--hover-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Link de Voltar */
.back-link {
    margin-top: 40px;
    text-align: center;
}
.back-link a {
    color: var(--text-color);
    opacity: 0.7;
    transition: var(--transition);
}
.back-link a:hover {
    color: var(--primary-blue);
    opacity: 1;
}

/* Responsivo para celular */
@media (max-width: 600px) {
    .download-item {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
    
    .file-buttons {
        width: 100%;
    }
    
    .btn-download {
        flex: 1;
        justify-content: center;
    }
}