/*
Theme Name: Notícia Alternativa - Mobile First
Theme URI: https://noticiaalternativa.com.br
Description: Tema ultra otimizado para mobile, Google News e Google Discover
Version: 2.0.0
Author: Notícia Alternativa
Text Domain: noticia-alternativa
*/

/* ========================================
   RESET & VARIÁVEIS
   ======================================== */

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

:root {
    --navy: #0a2540;
    --primary-blue: #0052cc;
    --accent-red: #e74c3c;
    --text-dark: #1a1a1a;
    --text-gray: #4a4a4a;
    --text-light: #6b6b6b;
    --bg-white: #ffffff;
    --bg-light: #f8f9fa;
    --border: #e0e0e0;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    color: var(--text-dark);
    background: var(--bg-white);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   HEADER - MOBILE FIRST
   ======================================== */

.site-header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

.header-content {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-logo a {
    font-size: 22px;
    font-weight: 900;
    color: var(--navy);
    text-decoration: none;
    letter-spacing: -0.5px;
}

/* Menu mobile minimalista */
.main-nav {
    background: var(--bg-light);
    border-bottom: 1px solid var(--border);
}

.main-nav ul {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    list-style: none;
    padding: 0 15px;
    margin: 0;
    gap: 5px;
}

.main-nav ul::-webkit-scrollbar {
    display: none;
}

.main-nav li {
    flex-shrink: 0;
}

.main-nav a {
    display: block;
    padding: 12px 18px;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    border-radius: 20px;
    transition: all 0.3s;
}

.main-nav a:active,
.main-nav .current-menu-item a {
    background: var(--primary-blue);
    color: white;
}

/* ========================================
   MAIN CONTENT
   ======================================== */

.main-content {
    min-height: 60vh;
    padding: 20px 0;
}

.container-mobile {
    max-width: 100%;
    padding: 0 15px;
}

/* ========================================
   POSTS FEED - Estilo Google Discover
   ======================================== */

.posts-feed {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Post Card Base */
.post-card {
    background: var(--bg-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.post-card:active {
    transform: scale(0.98);
}

/* Post Featured (primeiro - maior) */
.post-card-featured {
    margin-bottom: 10px;
}

.post-card-featured .post-image-large {
    width: 100%;
    height: 240px;
    overflow: hidden;
    background: var(--bg-light);
}

.post-card-featured .post-image-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-card-featured .post-content {
    padding: 20px;
}

.post-card-featured .post-title {
    font-size: 24px;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 12px;
}

.post-card-featured .post-excerpt {
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-gray);
    margin-bottom: 15px;
}

/* Post Horizontal (demais posts) */
.post-card-horizontal {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 15px;
    padding: 15px;
}

.post-image-medium {
    width: 120px;
    height: 120px;
    overflow: hidden;
    border-radius: 8px;
    background: var(--bg-light);
    flex-shrink: 0;
}

.post-image-medium img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-card-horizontal .post-content {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 120px;
}

.post-card-horizontal .post-title {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Post Meta */
.post-meta-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.post-category {
    display: inline-block;
    background: var(--primary-blue);
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.post-meta-top time {
    font-size: 13px;
    color: var(--text-light);
}

.post-meta-bottom {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-light);
}

.post-meta-bottom time {
    display: flex;
    align-items: center;
    gap: 5px;
}

.post-reading-time::before {
    content: "•";
    margin-right: 5px;
}

/* Post Titles */
.post-title a {
    color: var(--text-dark);
    text-decoration: none;
}

/* ========================================
   SINGLE ARTICLE PAGE
   ======================================== */

.article-single {
    background: var(--bg-white);
}

/* Breadcrumb */
.breadcrumb {
    padding: 15px 0;
    font-size: 13px;
    color: var(--text-light);
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
}

.breadcrumb::-webkit-scrollbar {
    display: none;
}

.breadcrumb a {
    color: var(--primary-blue);
    text-decoration: none;
}

.separator {
    margin: 0 8px;
    color: var(--border);
}

.current {
    color: var(--text-gray);
}

/* Article Header */
.article-meta-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.article-category {
    background: var(--primary-blue);
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.article-meta-top time {
    font-size: 14px;
    color: var(--text-light);
}

.article-title {
    font-size: 28px;
    font-weight: 900;
    line-height: 1.25;
    margin-bottom: 15px;
    color: var(--text-dark);
}

.article-subtitle {
    font-size: 18px;
    line-height: 1.6;
    color: var(--text-gray);
    margin-bottom: 20px;
    font-weight: 400;
}

/* Article Meta Info */
.article-meta-info {
    padding: 15px 0;
    margin-bottom: 20px;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.author-info {
    margin-bottom: 8px;
}

.author-name {
    font-weight: 700;
    font-size: 15px;
    color: var(--text-dark);
}

.reading-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-light);
}

/* Featured Image */
.article-featured-image {
    margin: 20px 0 30px;
    border-radius: 8px;
    overflow: hidden;
}

.article-featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

.article-featured-image figcaption {
    padding: 10px;
    font-size: 13px;
    color: var(--text-light);
    font-style: italic;
    background: var(--bg-light);
}

/* Article Body - Otimizado para leitura mobile */
.article-body {
    font-size: 18px;
    line-height: 1.8;
    color: var(--text-dark);
}

.article-body p {
    margin-bottom: 24px;
}

.article-body h2 {
    font-size: 24px;
    font-weight: 800;
    margin: 40px 0 20px;
    line-height: 1.3;
}

.article-body h3 {
    font-size: 20px;
    font-weight: 700;
    margin: 30px 0 15px;
}

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

.article-body blockquote {
    border-left: 4px solid var(--primary-blue);
    padding-left: 20px;
    margin: 30px 0;
    font-style: italic;
    color: var(--text-gray);
    font-size: 20px;
}

.article-body ul,
.article-body ol {
    margin: 20px 0;
    padding-left: 25px;
}

.article-body li {
    margin-bottom: 12px;
}

.article-body a {
    color: var(--primary-blue);
    text-decoration: underline;
}

/* Article Tags */
.article-tags {
    padding: 20px 0;
    margin: 30px 0;
    border-top: 1px solid var(--border);
    font-size: 14px;
}

.article-tags a {
    color: var(--primary-blue);
    text-decoration: none;
    margin-right: 8px;
}

/* Share Buttons - Mobile Optimized */
.article-share {
    padding: 25px 0;
    margin: 30px 0;
    border-top: 2px solid var(--border);
}

.article-share h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 15px;
}

.share-buttons {
    display: flex;
    gap: 10px;
}

.share-btn {
    flex: 1;
    padding: 12px;
    text-align: center;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    color: white;
    transition: transform 0.2s;
}

.share-btn:active {
    transform: scale(0.95);
}

.share-facebook {
    background: #1877f2;
}

.share-twitter {
    background: #1da1f2;
}

.share-whatsapp {
    background: #25d366;
}

/* ========================================
   RELATED ARTICLES
   ======================================== */

.related-articles {
    margin: 40px 0;
    padding-top: 30px;
    border-top: 2px solid var(--border);
}

.related-title {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 20px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.related-item {
    background: var(--bg-white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.related-image {
    width: 100%;
    height: 120px;
    overflow: hidden;
    background: var(--bg-light);
}

.related-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-content {
    padding: 12px;
}

.related-category {
    display: inline-block;
    background: var(--primary-blue);
    color: white;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.related-item-title {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 8px;
}

.related-item-title a {
    color: var(--text-dark);
    text-decoration: none;
}

.related-content time {
    font-size: 12px;
    color: var(--text-light);
}

/* ========================================
   PAGINATION
   ======================================== */

.pagination-mobile {
    padding: 30px 0;
    text-align: center;
}

.pagination-mobile .page-numbers {
    display: inline-block;
    padding: 10px 15px;
    margin: 0 4px;
    border-radius: 6px;
    background: var(--bg-light);
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    min-width: 44px;
    transition: all 0.2s;
}

.pagination-mobile .page-numbers:active {
    transform: scale(0.95);
}

.pagination-mobile .current {
    background: var(--primary-blue);
    color: white;
}

/* ========================================
   FOOTER
   ======================================== */

.site-footer {
    background: var(--navy);
    color: white;
    padding: 40px 20px 20px;
    margin-top: 60px;
}

.footer-content {
    font-size: 14px;
    line-height: 1.8;
    text-align: center;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    list-style: none;
    margin: 20px 0;
}

.footer-links a {
    color: white;
    text-decoration: none;
    opacity: 0.8;
}

.footer-copyright {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    opacity: 0.7;
    font-size: 13px;
}

/* ========================================
   COMMENTS
   ======================================== */

.comments-area {
    margin: 40px 0;
    padding-top: 30px;
    border-top: 2px solid var(--border);
}

.comments-title {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 20px;
}

.comment-form {
    background: var(--bg-light);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 16px;
    font-family: inherit;
}

.comment-form input[type="submit"] {
    background: var(--primary-blue);
    color: white;
    padding: 14px 30px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
}

.comment-list {
    list-style: none;
}

.comment {
    padding: 20px;
    margin-bottom: 15px;
    background: var(--bg-light);
    border-radius: 8px;
    border-left: 3px solid var(--primary-blue);
}

.comment-author {
    font-weight: 700;
    margin-bottom: 8px;
}

.comment-meta {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 12px;
}

.comment-content {
    line-height: 1.7;
}

/* ========================================
   DESKTOP OPTIMIZATIONS (>768px)
   ======================================== */

@media (min-width: 768px) {
    .container-mobile {
        max-width: 680px;
        margin: 0 auto;
    }
    
    .post-card-horizontal {
        grid-template-columns: 160px 1fr;
    }
    
    .post-image-medium {
        width: 160px;
        height: 160px;
    }
    
    .article-title {
        font-size: 36px;
    }
    
    .related-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1024px) {
    .container-mobile {
        max-width: 720px;
    }
    
    .article-body {
        font-size: 19px;
    }
}

/* ========================================
   PERFORMANCE OPTIMIZATIONS
   ======================================== */

/* Prevent layout shift */
img {
    max-width: 100%;
    height: auto;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Touch optimization */
a, button {
    -webkit-tap-highlight-color: rgba(0,0,0,0.1);
}

/* GPU acceleration for animations */
.post-card,
.share-btn,
.pagination-mobile .page-numbers {
    will-change: transform;
}
