/* ======================================================
   CENTRAL DE MATÉRIAS - SIMPLES E FUNCIONAL
   Paleta: Caramelo (#D1C4B0), Azul (#1D4A91), Bege (#F5EFE6)
   ====================================================== */

body {
    background: linear-gradient(135deg, #F5EFE6 0%, #F0E8DB 100%) !important;
}

.central-materias-wrapper {
    max-width: 1300px;
    margin: 0 auto;
    padding: 60px 40px 80px;
    background: transparent;
}

/* CABEÇALHO */
.main-header h1 {
    font-size: 2.8rem;
    font-weight: 800;
    color: #1D4A91;
    margin-bottom: 10px;
}

.main-header p {
    font-size: 1.2rem;
    color: #666;
}

/* NAVEGAÇÃO */
.materias-nav-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 40px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.btn-voltar {
    background: #D1C4B0 !important;
    color: #1F2937 !important;
    border: none !important;
    padding: 10px 20px !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-voltar:hover {
    background: #c0b39f !important;
    transform: translateX(-2px);
}

.btn-voltar i {
    width: 18px;
    height: 18px;
}

.artigos-breadcrumb {
    font-size: 1rem;
    color: #666;
    font-weight: 500;
}

/* CARDS DE MATÉRIAS */
.subjects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.subject-card {
    background: white;
    border-radius: 12px;
    border: 1px solid #E5E7EB;
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    cursor: pointer;
    min-height: 250px;
}

.subject-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 18px 35px rgba(209, 196, 176, 0.5);
    border-color: #D1C4B0;
}

.icon-box {
    background: #FEF3E8;
    width: 60px;
    height: 60px;
    border-radius: 12px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-box i {
    width: 28px;
    height: 28px;
    color: #D1C4B0;
    stroke-width: 2.8;
}

.subject-card h2 {
    font-size: 1.4rem;
    font-weight: 800;
    color: #1D4A91;
    margin: 0 0 8px 0;
}

.subject-card p {
    font-size: 1rem;
    color: #666;
    margin: 0;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #E5E7EB;
    margin-top: 15px;
}

.article-count-tag {
    font-size: 0.9rem;
    color: #999;
    font-weight: 600;
}

.action-link {
    background: #1D4A91;
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.3s;
}

.action-link:hover {
    background: #153a72;
}

/* ARTIGOS GRID */
.artigos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.article-card-link {
    text-decoration: none;
    color: inherit;
}

.article-card {
    background: white;
    border-radius: 8px;
    border: 1px solid #E5E7EB;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
}

.article-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 25px rgba(209, 196, 176, 0.25);
    border-color: #D1C4B0;
}

.article-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #fef9f3 0%, #fef3e8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-placeholder {
    color: #D1C4B0;
    font-size: 3rem;
}

.article-placeholder i {
    width: 60px;
    height: 60px;
}

.article-content {
    padding: 20px;
}

.article-content h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1D4A91;
    margin: 0 0 10px 0;
}

.article-content p {
    font-size: 0.95rem;
    color: #666;
    margin: 0 0 15px 0;
    line-height: 1.6;
}

.article-meta {
    display: flex;
    gap: 15px;
    font-size: 0.85rem;
    color: #999;
    padding-top: 15px;
    border-top: 1px solid #f0e8db;
}

.article-meta i {
    width: 16px;
    height: 16px;
    color: #D1C4B0;
}

/* ESTADOS */
.empty-msg {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 1.1rem;
    grid-column: 1 / -1;
}

.loading-state {
    text-align: center;
    padding: 80px 20px;
    color: #1D4A91;
    font-weight: 600;
    font-size: 1.1rem;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .central-materias-wrapper {
        padding: 40px 20px;
    }

    .main-header h1 {
        font-size: 2rem;
    }

    .subjects-grid {
        grid-template-columns: 1fr;
    }

    .artigos-grid {
        grid-template-columns: 1fr;
    }

    .materias-nav-controls {
        flex-direction: column;
        align-items: flex-start;
    }

    .btn-voltar {
        width: 100%;
        justify-content: center;
    }
}

/* --- ESTILOS PARA MACROTEMAS MANUAIS (Stage 2) --- */
/* --- ESTILOS PARA MACROTEMAS (STAGE 2) --- */

/* Contêiner de cabeçalho para o Stage 2 */
/* ======================================================
    CENTRAL DE MATÉRIAS - SIMPLES E FUNCIONAL (AJUSTES)
    ====================================================== */

/* ======================================================
    CENTRAL DE MATÉRIAS - ESTILOS CONSOLIDADOS E CORRIGIDOS
    Paleta: Caramelo (#D1C4B0), Azul (#1D4A91), Bege (#F5EFE6)
    ====================================================== */

body {
    background: linear-gradient(135deg, #F5EFE6 0%, #F0E8DB 100%) !important;
}

/* 1. LAYOUT PRINCIPAL E LARGURA MÁXIMA */
.central-materias-wrapper {
    max-width: 1500px; /* Largura ajustada */
    margin: 0 auto;
    padding: 60px 40px 80px;
    background: transparent;
}

/* 2. CABEÇALHO E NAVEGAÇÃO */
.main-header h1 {
    font-size: 2.8rem;
    font-weight: 800;
    color: #1D4A91;
    margin-bottom: 10px;
}
.materias-nav-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 40px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
.btn-voltar {
    background: #D1C4B0 !important;
    color: #1F2937 !important;
    border: none !important;
    padding: 10px 20px !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
}

/* 3. GRID DE CARDS (STAGE 1 & STAGE 2) */
.subjects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

/* 4. ESTILO BASE DOS ÍCONES E BOX (STAGE 1 e STAGE 2) */
.icon-box {
    background: #FEF3E8; /* Fundo Creme/Claro */
    width: 60px;
    height: 60px;
    border-radius: 12px;
    /* Margem do ícone box é gerenciada pelo padding do card, mas garantimos o estilo */
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px; /* Espaço entre o box e o H2 */
}
.icon-box i {
    width: 28px;
    height: 28px;
    color: #D1C4B0; /* Cor Caramelo/Coral nos ícones */
    stroke-width: 2.8;
}

/* --- ESTILO DOS CARDS DE MATÉRIA (STAGE 1) --- */
.subject-card {
    background: white !important;
    border-radius: 12px;
    border: none; /* Remove borda nativa */
    
    /* Borda Dupla (Moldura Caramelo) */
    box-shadow: 
        0 4px 10px rgba(0, 0, 0, 0.05),
        0 0 0 2px #D1C4B0; 
        
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.3s ease;
    cursor: pointer;
    min-height: 250px;
}
.subject-card:hover {
    transform: translateY(-8px);
    /* Destaque Azul no Hover */
    box-shadow: 
        0 18px 35px rgba(209, 196, 176, 0.5),
        0 0 0 3px #1D4A91; 
}
.subject-card h2 {
    color: #1D4A91;
}
.action-link {
    background: #1D4A91;
    color: white !important; /* CORREÇÃO: Garante texto branco */
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 600;
    text-decoration: none !important;
}

/* --- ESTILO DOS CARDS DE MACROTEMAS (STAGE 2) --- */

/* 5. TÍTULO E CABEÇALHO DO STAGE 2 */
.macrotemas-header {
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
.macrotemas-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: #1D4A91; /* CORREÇÃO: Cor forte para visibilidade */
    margin-bottom: 10px;
}

/* 6. ESTILO CARD MACROTEMAS (Moldura Dupla) */
.macrotema-card-styled {
    background: white;
    border-radius: 12px;
    border: none;
    
    /* Moldura Caramelo */
    box-shadow: 
        0 4px 10px rgba(0, 0, 0, 0.05),
        0 0 0 2px #D1C4B0; 
        
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.3s;
    cursor: default;
}
.macrotema-card-styled:hover {
    transform: translateY(-8px);
    /* Destaque Azul no Hover */
     box-shadow: 
        0 18px 35px rgba(209, 196, 176, 0.5),
        0 0 0 3px #1D4A91; 
}

/* 7. AJUSTES DE ESPAÇAMENTO INTERNO (CORREÇÃO COLADO) */
.macrotema-content {
    padding: 30px 30px 15px 30px; /* Padding interno */
}
.macrotema-card-styled h2 {
    /* CORREÇÃO: Adiciona espaço entre o Icon Box e o Título */
    margin: 15px 0 8px 0; 
    color: #1D4A91;
    font-weight: 800;
}
.macrotema-card-styled p {
    color: #666;
    line-height: 1.5;
    margin: 0 0 20px 0; /* CORREÇÃO: Adiciona espaço entre a descrição e os links */
}

/* 8. LINKS E RODAPÉ */
.macrotema-links-container {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding: 15px 30px 30px; 
    border-top: none; /* Remove linha */
    margin-top: 5px; 
}
.macrotema-link {
    background: #1D4A91;
    color: white !important; /* CORREÇÃO: Garante texto branco */
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 600;
    text-decoration: none !important;
}