/* ============================================================
   SITE DE NOTÍCIAS - Estilos Principais
   Paleta: Branco (#fff) + Azul (#1a73e8)
   Ícones: Tabler Icons (CDN)
   ============================================================ */

/* ---- Reset & Base ---- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f8f9fa;
    color: #1a1a2e;
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: #1a73e8;
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: #1557b0;
}

img {
    max-width: 100%;
    height: auto;
}

/* ---- Container ---- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* ---- Header (Site Público) ---- */
.site-header {
    background: #fff;
    border-bottom: 1px solid #e8ecf0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    gap: 16px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a73e8;
}

.logo i {
    font-size: 1.8rem;
}

.logo-img {
    max-height: 42px;
    max-width: 200px;
    width: auto;
    height: auto;
    display: none;
}

.logo-text {
    display: flex;
    align-items: center;
    gap: 10px;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.main-nav a {
    padding: 8px 14px;
    border-radius: 8px;
    color: #444;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.main-nav a:hover {
    background: #e8f0fe;
    color: #1a73e8;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #444;
    padding: 8px;
}

/* ---- Admin Header ---- */
.admin-header {
    background: #1a1a2e;
    border-bottom: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.admin-header .logo {
    color: #fff;
}

.admin-header .main-nav a {
    color: #b0b0c0;
}

.admin-header .main-nav a:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.admin-body {
    background: #f0f2f5;
}

.admin-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ---- Main Content ---- */
.main-content {
    flex: 1;
    padding-top: 32px;
    padding-bottom: 40px;
}

/* ---- Hero Section ---- */
.hero-section {
    margin-bottom: 40px;
}

.hero-card {
    display: block;
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    height: 420px;
    background: #1a1a2e;
    color: #fff;
}

.hero-image {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0.6;
    transition: transform 0.4s;
}

.hero-card:hover .hero-image {
    transform: scale(1.03);
}

.hero-overlay {
    position: relative;
    z-index: 2;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, transparent 100%);
}

.hero-categoria {
    display: inline-block;
    background: #1a73e8;
    color: #fff;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: fit-content;
    margin-bottom: 12px;
}

.hero-overlay h1 {
    font-size: 2rem;
    line-height: 1.3;
    margin-bottom: 8px;
}

.hero-overlay p {
    font-size: 1.05rem;
    opacity: 0.85;
    max-width: 600px;
}

.hero-data {
    margin-top: 12px;
    font-size: 0.85rem;
    opacity: 0.7;
}

.hero-empty {
    text-align: center;
    padding: 60px 20px;
    color: #888;
}

.hero-empty i {
    font-size: 3rem;
    margin-bottom: 16px;
    color: #ccc;
}

/* ---- News Grid ---- */
.news-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.news-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #eef1f4;
}

.news-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.news-card-image {
    display: block;
    height: 200px;
    background-size: cover;
    background-position: center;
    background-color: #e8ecf0;
}

.news-card-body {
    padding: 20px;
}

.news-card-categoria {
    display: inline-block;
    color: #1a73e8;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.news-card-body h2,
.news-card-body h3 {
    font-size: 1.15rem;
    line-height: 1.4;
    margin-bottom: 8px;
}

.news-card-body h2 a,
.news-card-body h3 a {
    color: #1a1a2e;
}

.news-card-body h2 a:hover,
.news-card-body h3 a:hover {
    color: #1a73e8;
}

.news-card-body p {
    color: #666;
    font-size: 0.92rem;
    line-height: 1.6;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card-data {
    color: #999;
    font-size: 0.82rem;
}

/* ---- Paginação ---- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 24px 0;
}

.page-info {
    color: #666;
    font-size: 0.9rem;
}

/* ---- Página da Notícia ---- */
.noticia-completa {
    max-width: 800px;
    margin: 0 auto;
}

.noticia-header {
    margin-bottom: 24px;
}

.noticia-header h1 {
    font-size: 2rem;
    line-height: 1.3;
    margin: 12px 0;
    color: #1a1a2e;
}

.noticia-subtitulo {
    font-size: 1.15rem;
    color: #666;
    line-height: 1.6;
    margin-bottom: 16px;
}

.noticia-meta {
    display: flex;
    gap: 24px;
    color: #888;
    font-size: 0.9rem;
}

.noticia-meta i {
    margin-right: 6px;
}

.noticia-imagem {
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 32px;
}

.noticia-imagem img {
    width: 100%;
    display: block;
}

.noticia-conteudo {
    font-size: 1.08rem;
    line-height: 1.85;
    color: #2c2c3e;
}

.noticia-conteudo p {
    margin-bottom: 16px;
}

.related-grid {
    margin-top: 20px;
}

/* ---- Category Header ---- */
.category-header {
    margin-bottom: 32px;
}

.category-header h1 {
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #1a1a2e;
}

.category-header h1 i {
    color: #1a73e8;
}

.category-header p {
    color: #666;
    margin-top: 4px;
}

/* ---- Not Found ---- */
.not-found {
    text-align: center;
    padding: 60px 20px;
}

.not-found i {
    font-size: 3.5rem;
    color: #ccc;
    margin-bottom: 16px;
}

.not-found h1,
.not-found h2 {
    margin-bottom: 16px;
    color: #444;
}

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

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.section-header h1,
.section-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.4rem;
    color: #1a1a2e;
}

.subtitle {
    color: #888;
    margin-bottom: 24px;
    font-size: 1rem;
}

/* ---- Stats Grid (Dashboard) ---- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    border: 1px solid #eef1f4;
}

.stat-card i {
    font-size: 2rem;
    color: #1a73e8;
}

.stat-card strong {
    display: block;
    font-size: 1.5rem;
    color: #1a1a2e;
}

.stat-card span {
    font-size: 0.85rem;
    color: #888;
}

.stat-success i { color: #0f9d58; }
.stat-warning i { color: #f4b400; }
.stat-info i    { color: #4285f4; }

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #fff;
    color: #444;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn:hover {
    background: #f5f5f5;
    border-color: #b0b5bd;
    color: #1a1a2e;
}

.btn-primary {
    background: #1a73e8;
    color: #fff;
    border-color: #1a73e8;
}

.btn-primary:hover {
    background: #1557b0;
    border-color: #1557b0;
    color: #fff;
}

.btn-danger {
    background: #dc3545;
    color: #fff;
    border-color: #dc3545;
}

.btn-danger:hover {
    background: #b02a37;
    border-color: #b02a37;
    color: #fff;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.82rem;
}

.btn-full {
    width: 100%;
    justify-content: center;
}

/* ---- Forms ---- */
.form {
    max-width: 800px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: #333;
    font-size: 0.92rem;
}

.form-group label i {
    margin-right: 6px;
    color: #1a73e8;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="file"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #d0d5dd;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26,115,232,0.12);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
}

.current-image {
    margin-top: 8px;
}

.current-image img {
    border-radius: 8px;
    border: 1px solid #eef1f4;
}

/* ---- Search Form ---- */
.search-form {
    margin-bottom: 20px;
}

.search-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.search-group input,
.search-group select {
    padding: 10px 14px;
    border: 1.5px solid #d0d5dd;
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
    flex: 1;
    min-width: 180px;
}

.search-group input:focus,
.search-group select:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26,115,232,0.12);
}

/* ---- Table ---- */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.table th,
.table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #eef1f4;
    font-size: 0.9rem;
}

.table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.table tbody tr:hover {
    background: #f8f9ff;
}

.table .empty {
    text-align: center;
    color: #999;
    padding: 40px;
}

.actions {
    display: flex;
    gap: 6px;
}

/* ---- Badges ---- */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
}

.badge-success {
    background: #e6f4ea;
    color: #0f9d58;
}

.badge-warning {
    background: #fef7e0;
    color: #e37400;
}

/* ---- Flash Messages ---- */
.flash {
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 0.92rem;
    font-weight: 500;
}

.flash-success {
    background: #e6f4ea;
    color: #0f9d58;
    border: 1px solid #b7e1cd;
}

.flash-error {
    background: #fce8e6;
    color: #c5221f;
    border: 1px solid #f5c6c2;
}

.flash-info {
    background: #e8f0fe;
    color: #1a73e8;
    border: 1px solid #c6dafc;
}

/* ---- Login ---- */
.login-body {
    background: #f0f2f5;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-box {
    background: #fff;
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}

.login-header {
    text-align: center;
    margin-bottom: 28px;
}

.login-header i {
    font-size: 3rem;
    color: #1a73e8;
    margin-bottom: 12px;
}

.login-header h1 {
    font-size: 1.5rem;
    color: #1a1a2e;
    margin-bottom: 4px;
}

.login-header p {
    color: #888;
    font-size: 0.9rem;
}

.login-form .form-group {
    margin-bottom: 18px;
}

/* ---- Footer ---- */
.site-footer {
    background: #1a1a2e;
    color: #b0b0c0;
    padding: 24px 0;
    text-align: center;
    font-size: 0.9rem;
}

/* ---- Responsivo ---- */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .main-nav {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: #fff;
        flex-direction: column;
        padding: 16px;
        box-shadow: 0 8px 24px rgba(0,0,0,0.1);
        border-bottom: 1px solid #eef1f4;
    }

    .main-nav.active {
        display: flex;
    }

    .main-nav a {
        padding: 12px 16px;
        width: 100%;
        border-radius: 8px;
    }

    .admin-header .main-nav {
        background: #1a1a2e;
    }

    .admin-header .main-nav a {
        color: #b0b0c0;
    }

    .logo-img {
        max-height: 28px !important;
        max-width: 120px !important;
    }

    .hero-card {
        height: 300px;
    }

    .hero-overlay {
        padding: 24px;
    }

    .hero-overlay h1 {
        font-size: 1.4rem;
    }

    .news-grid {
        grid-template-columns: 1fr;
    }

    .noticia-header h1 {
        font-size: 1.5rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .search-group {
        flex-direction: column;
    }

    .search-group input,
    .search-group select {
        min-width: auto;
    }

    .admin-actions {
        display: none;
    }
}

@media (max-width: 480px) {
    .hero-card {
        height: 240px;
    }

    .hero-overlay h1 {
        font-size: 1.2rem;
    }

    .hero-overlay p {
        font-size: 0.9rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .noticia-meta {
        flex-direction: column;
        gap: 8px;
    }

    .login-box {
        padding: 24px;
    }
}
