/* ==========================================================================
   Design System - Portal Público de Notícias Tech
   Estilo moderno, limpo, responsivo e de leitura confortável
   ========================================================================== */

:root {
    --bg-body: #0b0f19;
    --bg-surface: #111827;
    --bg-surface-elevated: #1f2937;
    --border-subtle: #1f2937;
    --border-hover: #374151;
    --text-primary: #f9fafb;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --brand-blue: #3b82f6;
    --brand-blue-hover: #2563eb;
    --accent-teal: #14b8a6;
    --font-heading: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-body: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --max-w-content: 1200px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-body);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

/* Header e Navegação */
.site-header {
    background-color: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-container {
    max-width: var(--max-w-content);
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.site-logo {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #60a5fa;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
}

.site-logo .logo-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: contain;
    display: block;
}

.fallback-logo-img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    display: inline-block;
    vertical-align: middle;
    margin-right: 0.4rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    list-style: none;
    overflow-x: auto;
    white-space: nowrap;
}

.nav-link {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.nav-link:hover, .nav-link.active {
    color: #fff;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-box {
    position: relative;
}

.search-input {
    background-color: var(--bg-body);
    border: 1px solid var(--border-hover);
    color: #fff;
    padding: 0.45rem 1rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    width: 180px;
    transition: width 0.3s ease, border-color 0.2s ease;
}

.search-input:focus {
    width: 240px;
    outline: none;
    border-color: var(--brand-blue);
}

/* Layout Principal */
.main-wrapper {
    max-width: var(--max-w-content);
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
    flex: 1;
    width: 100%;
}

/* Hero e Matéria Principal */
.featured-hero {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 2.5rem;
    margin-bottom: 3rem;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.featured-hero:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.hero-tag {
    display: inline-block;
    color: #60a5fa;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.hero-title {
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: #fff;
}

.hero-summary {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    max-width: 850px;
}

.hero-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Seções e Grid de Notícias */
.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.75rem;
}

.news-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.news-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-3px);
}

.card-category {
    font-size: 0.75rem;
    font-weight: 700;
    color: #60a5fa;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.card-title {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 0.75rem;
    color: #fff;
}

.card-title a:hover {
    color: #60a5fa;
}

.card-summary {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 1.25rem;
    flex: 1;
}

.card-footer {
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 0.75rem;
    display: flex;
    justify-content: space-between;
}

/* Página do Artigo Individual */
.article-container {
    max-width: 820px;
    margin: 0 auto;
}

.article-header {
    margin-bottom: 2.5rem;
}

.article-category {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 700;
    color: #60a5fa;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.article-title {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: #fff;
}

.article-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 1.5rem;
    font-style: italic;
}

.article-meta-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.9rem;
    color: var(--text-muted);
}

.article-lede {
    background-color: var(--bg-surface);
    border-left: 4px solid var(--brand-blue);
    padding: 1.25rem 1.5rem;
    border-radius: 0 8px 8px 0;
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 2rem;
    color: #e2e8f0;
}

.article-body {
    font-size: 1.1rem;
    line-height: 1.85;
    color: #cbd5e1;
    margin-bottom: 3rem;
}

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

.article-body h2, .article-body h3 {
    color: #fff;
    margin: 2rem 0 1rem 0;
    line-height: 1.3;
}

.article-body ul, .article-body ol {
    margin: 1rem 0 1.5rem 1.5rem;
}

.article-body li {
    margin-bottom: 0.5rem;
}

/* Fontes Auditadas no Rodapé do Artigo */
.sources-box {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 3rem;
}

.sources-box h4 {
    font-size: 0.95rem;
    color: #fff;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sources-list {
    list-style: none;
    font-size: 0.9rem;
}

.sources-list li {
    margin-bottom: 0.5rem;
}

.sources-list a {
    color: #60a5fa;
    text-decoration: underline;
}

.sources-list a:hover {
    color: #93c5fd;
}

/* Tags */
.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.tag-badge {
    background-color: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    padding: 0.3rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.tag-badge:hover {
    color: #fff;
    border-color: var(--border-hover);
}

/* ==========================================================================
   Layout Inspirado no Blog Manual - Seção Superior Assimétrica (5 + 3)
   ========================================================================== */
.home-container {
    max-width: var(--max-w-content);
    margin: 0 auto;
    width: 100%;
}

.home-top-section {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 1.75rem;
    align-items: start;
    margin-bottom: 2.75rem;
}

/* Coluna Esquerda: Cards Compactos (Até 5) */
.compact-column {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.compact-card {
    background-color: #121929;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.compact-card:hover {
    transform: translateY(-2px);
    border-color: rgba(96, 165, 250, 0.4);
    box-shadow: 0 10px 24px -6px rgba(0, 0, 0, 0.45);
}

.compact-thumb-link {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 145px;
    overflow: hidden;
    background-color: #0b0f19;
}

.compact-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.compact-card:hover .compact-thumb-img {
    transform: scale(1.03);
}

.compact-content {
    padding: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    flex: 1;
}

.compact-title {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.35;
    color: #f8fafc;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.compact-title a:hover {
    color: #60a5fa;
}

.compact-snippet {
    font-size: 0.8rem;
    color: #94a3b8;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-date {
    font-size: 0.72rem;
    color: #64748b;
    font-weight: 500;
    margin-top: auto;
}

/* Coluna Direita: Grandes Destaques (Até 3) */
.prominent-column {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.prominent-card {
    background-color: #121929;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.prominent-card:hover {
    transform: translateY(-3px);
    border-color: rgba(96, 165, 250, 0.45);
    box-shadow: 0 14px 30px -8px rgba(0, 0, 0, 0.5);
}

.prominent-thumb-link {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 280px;
    overflow: hidden;
    background-color: #0b0f19;
}

.prominent-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.prominent-card:hover .prominent-img {
    transform: scale(1.025);
}

.prominent-body {
    padding: 1.35rem 1.45rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.prominent-title {
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.3;
    color: #f8fafc;
    letter-spacing: -0.01em;
}

.prominent-title a:hover {
    color: #60a5fa;
}

.meta-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 500;
}

.prominent-summary {
    font-size: 0.9rem;
    color: #94a3b8;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.read-more-link {
    font-size: 0.88rem;
    font-weight: 600;
    color: #38bdf8;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.35rem;
    transition: color 0.15s ease, transform 0.15s ease;
}

.read-more-link:hover {
    color: #7dd3fc;
    transform: translateX(3px);
}

.read-more-link.sm {
    font-size: 0.82rem;
    margin-top: 0;
}

/* ==========================================================================
   Seção Inferior: Grid de 3 Colunas
   ========================================================================== */
.home-grid-section {
    margin-top: 0.5rem;
    margin-bottom: 2.75rem;
}

.three-col-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.grid-card {
    background-color: #121929;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.grid-card:hover {
    transform: translateY(-2px);
    border-color: rgba(96, 165, 250, 0.4);
    box-shadow: 0 10px 24px -6px rgba(0, 0, 0, 0.45);
}

.grid-thumb-link {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 165px;
    overflow: hidden;
    background-color: #0b0f19;
}

.grid-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.grid-card:hover .grid-thumb-img {
    transform: scale(1.03);
}

.grid-body {
    padding: 1rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.grid-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
    color: #f8fafc;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.grid-title a:hover {
    color: #60a5fa;
}

.grid-summary {
    font-size: 0.83rem;
    color: #94a3b8;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.grid-footer {
    padding: 0.75rem 1.1rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Fallbacks Visuais de Imagem */
.thumb-fallback,
.prominent-fallback,
.grid-fallback {
    width: 100%;
    height: 100%;
    min-height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #60a5fa;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.06em;
}

.prominent-fallback {
    min-height: 220px;
    font-size: 1rem;
}

/* Pílulas de Tags e Categorias */
.badges-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}

.badge-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.25);
    text-transform: capitalize;
    transition: all 0.15s ease;
}

.badge-tag:hover {
    background: rgba(59, 130, 246, 0.25);
    color: #93c5fd;
}

.badge-tag.highlight {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
    border-color: rgba(99, 102, 241, 0.35);
}

.badge-tag.subtle {
    background: rgba(148, 163, 184, 0.1);
    color: #cbd5e1;
    border-color: rgba(148, 163, 184, 0.2);
}

/* ==========================================================================
   Barra de Paginação
   ========================================================================== */
.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2.75rem;
    margin-bottom: 2rem;
}

.page-numbers {
    display: flex;
    gap: 0.4rem;
}

.page-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 0.85rem;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    background-color: #121929;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    transition: all 0.15s ease;
}

.page-item:hover {
    border-color: #60a5fa;
    color: #fff;
    background-color: #1e293b;
}

.page-item.active {
    background-color: #2563eb;
    border-color: #3b82f6;
    color: #fff;
    pointer-events: none;
}

/* ==========================================================================
   Estilização do Artigo Individual (Tipografia Revista Digital & Markdown)
   ========================================================================== */
.article-featured-figure {
    margin: 1.5rem 0 2rem;
    border-radius: 12px;
    overflow: hidden;
    background-color: #0b0f19;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.article-featured-img {
    width: 100%;
    max-height: 480px;
    object-fit: cover;
    display: block;
}

.article-caption {
    padding: 0.65rem 1rem;
    font-size: 0.82rem;
    color: #94a3b8;
    background-color: #111827;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.article-body h2 {
    font-size: 1.45rem;
    font-weight: 700;
    color: #f8fafc;
    margin: 2.25rem 0 0.95rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 0.5rem;
    line-height: 1.35;
}

.article-body h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #93c5fd;
    margin: 1.75rem 0 0.65rem;
    line-height: 1.35;
}

.article-body p {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #cbd5e1;
    margin-bottom: 1.35rem;
}

.article-body ul, .article-body ol {
    margin: 1rem 0 1.5rem 1.75rem;
    color: #cbd5e1;
    font-size: 1.02rem;
}

.article-body li {
    margin-bottom: 0.5rem;
    line-height: 1.65;
}

.article-body a {
    color: #38bdf8;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.article-body blockquote {
    border-left: 4px solid #3b82f6;
    padding: 0.75rem 1.25rem;
    margin: 1.5rem 0;
    background-color: rgba(59, 130, 246, 0.08);
    border-radius: 0 8px 8px 0;
    color: #e2e8f0;
    font-style: italic;
}

.article-body img {
    max-width: 100%;
    max-height: 480px;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    margin: 2rem auto;
    display: block;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
    background-color: #0b0f19;
    transition: transform 0.25s ease;
}

.article-body img:hover {
    transform: scale(1.01);
}

/* Estado Vazio */
.empty-state-box {
    background-color: #121929;
    padding: 4rem 2rem;
    text-align: center;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    max-width: 600px;
    margin: 3rem auto;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.empty-state-box h3 {
    font-size: 1.25rem;
    color: #f8fafc;
    margin-bottom: 0.5rem;
}

.empty-state-box p {
    color: #94a3b8;
    font-size: 0.95rem;
}

/* Footer */
.site-footer {
    background-color: var(--bg-surface);
    border-top: 1px solid var(--border-subtle);
    padding: 2.5rem 1.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: auto;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

/* Responsividade Mobile e Tablet */
@media (max-width: 992px) {
    .home-top-section {
        grid-template-columns: 1fr;
    }
    .three-col-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    .header-actions {
        width: 100%;
        justify-content: space-between;
    }
    .article-title {
        font-size: 1.65rem;
    }
    .three-col-grid {
        grid-template-columns: 1fr;
    }
}

