/* --- RESET E LAYOUT ESTRUTURAL --- */
html, body {
    height: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
    font-family: system-ui, -apple-system, sans-serif;
    background-color: var(--bg-main, #f3f4f6);
    color: var(--text-main, #1f2937);
    line-height: 1.6;
}

/* --- HEADER FIXO NO TOPO (Sticky Header) --- */
.top-nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(8px);
    color: #f8fafc;
    padding: 12px 24px;
    font-size: 0.875rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.top-nav a {
    color: #38bdf8;
    text-decoration: none;
    margin-left: 20px;
    font-weight: 500;
    transition: color 0.2s;
}

.top-nav a:hover {
    color: #7dd3fc;
    text-decoration: underline;
}

/* --- CORPO PRINCIPAL --- */
.main-content {
    flex: 1;
    padding-bottom: 50px;
}

header.portal-header {
    background: var(--bg-card, #ffffff);
    border-bottom: 1px solid var(--border-color, #e5e7eb);
    padding: 40px 20px;
    text-align: center;
}

header.portal-header h1 {
    margin: 0 0 10px 0;
    font-size: 2.5rem;
    color: var(--text-main, #1f2937);
}

header.portal-header p {
    color: var(--text-muted, #6b7280);
    font-size: 1.1rem;
    margin: 0;
}

.container {
    max-width: 1000px;
    margin: 40px auto;
    padding: 0 20px;
}

/* --- GRELHA DE CARTÕES DE ARTIGOS --- */
.grid-articles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.article-card {
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

.article-card h3 {
    margin-top: 0;
    font-size: 1.25rem;
}

.article-card h3 a {
    color: var(--text-main, #1f2937);
    text-decoration: none;
}

.article-card h3 a:hover {
    color: var(--primary-color, #10b981);
}

.article-meta {
    font-size: 0.85rem;
    color: var(--text-muted, #6b7280);
    margin-top: 15px;
    border-top: 1px solid var(--border-color, #e5e7eb);
    padding-top: 12px;
}

.btn-read {
    display: inline-block;
    margin-top: 15px;
    color: var(--primary-color, #10b981);
    font-weight: 600;
    text-decoration: none;
}

.btn-read:hover {
    text-decoration: underline;
}

/* --- ESTILOS DO VISUALIZADOR DE ARTIGOS (ver.php) --- */
.article-wrapper {
    max-width: 800px;
    margin: 40px auto;
    background: var(--bg-card, #ffffff);
    padding: 50px;
    border-radius: 16px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color, #e5e7eb);
}

.article-wrapper h1 {
    font-size: 2.25rem;
    line-height: 1.2;
    margin-top: 0;
    margin-bottom: 25px;
    color: var(--text-main, #1f2937);
}

.divider {
    height: 4px;
    width: 60px;
    background-color: var(--primary-color, #10b981);
    border-radius: 2px;
    margin-bottom: 30px;
}

.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
}

.article-body p {
    margin-bottom: 1.5rem;
}

.back-link {
    display: inline-block;
    margin-top: 40px;
    color: var(--primary-color, #10b981);
    text-decoration: none;
    font-weight: 600;
}

.back-link:hover {
    text-decoration: underline;
}

/* --- FOOTER FIXO / ANCORADO --- */
footer {
    background: var(--bg-card, #ffffff);
    border-top: 1px solid var(--border-color, #e5e7eb);
    text-align: center;
    padding: 20px;
    color: var(--text-muted, #6b7280);
    font-size: 0.9rem;
    margin-top: auto;
}