/* Basic Reset & Dark Theme */
html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    background-color: #000000;
    color: #e0e0e0;
}

a {
    color: #58a6ff;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

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

/* Header, Logo & Navigation */
header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 10px 0;
    margin-bottom: 10px;
    border-bottom: 1px solid #30363d;
    min-height: 50px; /* Garante altura mínima */
}

.logo-banner {
    text-align: center;
    padding: 30px 0;
}

.logo-banner img {
    max-width: 90%;
    height: auto;
    width: 450px;
}

#source-nav {
    display: flex;
    gap: 15px;
}

.filter-btn {
    background: none;
    border: 1px solid #30363d;
    color: #c9d1d9;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background-color 0.2s, color 0.2s;
}

.filter-btn:hover {
    background-color: #21262d;
}

/* Cores dos botões ativos */
.filter-btn.active {
    background-color: #58a6ff; /* Padrão Azul (A Madrugada) */
    color: #121212;
    border-color: #58a6ff;
}

.filter-btn[data-filter="all"].active {
    background-color: #9f0000; /* Vermelho */
    color: #ffffff;
    border-color: #9f0000;
}

.filter-btn[data-filter="tribuna-da-produção"].active {
    background-color: #56d364; /* Verde */
    color: #121212;
    border-color: #56d364;
}


#menu-toggle {
    display: none; /* Hidden on desktop */
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

#menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: #e0e0e0;
    margin: 5px 0;
    transition: all 0.3s ease-in-out;
}

/* Section Styles */
section {
    margin-bottom: 40px;
}

section h2 {
    font-size: 1.8rem;
    padding-bottom: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid;
}

#destaque-section h2 {
    color: #58a6ff;
    border-bottom-color: #58a6ff;
}

#mais-lidas-section h2 {
    color: #56d364;
    border-bottom-color: #56d364;
}

/* News Grid Layout */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

/* News Card Styling */
.news-card {
    background-color: #1c1c1c;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #30363d;
    text-decoration: none;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.3);
    border-color: #58a6ff;
}

.news-card-image {
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    background-size: cover;
    background-position: center;
    background-color: #333;
}

.news-card-image-placeholder {
    width: 100%;
    padding-top: 56.25%;
    background-color: #2a2a2a;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
}
.news-card-image-placeholder::after {
    content: 'Sem Imagem';
    font-size: 0.9rem;
}

.news-card-content {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.news-card-date {
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.news-card-content h3 {
    font-size: 1.05rem;
    margin: 0;
    line-height: 1.4;
    flex-grow: 1;
    color: #e0e0e0;
}

/* Loader and Error Styling */
.loader {
    text-align: center;
    padding: 50px;
    font-size: 1.2rem;
    color: #aaa;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #333;
    border-top: 4px solid #9f0000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-message {
    background-color: #4d1f24;
    color: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    text-align: center;
}

.error-message button {
    margin-left: 15px;
    padding: 5px 10px;
    border: 1px solid #f8d7da;
    background-color: transparent;
    color: #f8d7da;
    border-radius: 3px;
    cursor: pointer;
}

/* Article Page Styles */
.article-container {
    max-width: 800px;
    background-color: #1c1c1c;
    padding: 20px 40px;
    margin-top: 40px;
    margin-bottom: 40px;
    border-radius: 8px;
    border: 1px solid #30363d;
}

.article-container > h1 {
    font-size: 2.2rem;
    text-align: left;
    margin-top: 0;
    margin-bottom: 20px;
    color: #e0e0e0;
}

.back-button {
    display: inline-block;
    margin-bottom: 20px;
    color: #58a6ff;
    font-weight: bold;
}

.article-content {
    line-height: 1.7;
    font-size: 1.1rem;
    color: #c9d1d9;
}

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

.article-content p {
    margin-bottom: 1.2em;
}

.article-content h1,
.article-content h2,
.article-content h3 {
    margin-top: 1.5em;
    margin-bottom: 0.8em;
    line-height: 1.3;
    color: #e0e0e0;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .logo-banner img {
        width: 300px;
    }

    #source-nav {
        position: fixed;
        top: 0;
        right: 0;
        width: 250px;
        height: 100vh;
        background-color: #1c1c1c;
        flex-direction: column;
        padding: 80px 20px 20px;
        transform: translateX(100%);
        transition: transform 0.3s ease-in-out;
        z-index: 1000;
        border-left: 1px solid #30363d;
        gap: 20px;
        align-items: flex-start;
    }

    #source-nav.active {
        transform: translateX(0);
    }

    #menu-toggle {
        display: block;
    }

    #menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    #menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    #menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
}