/* =========================================================
   Diário do País - Folha de Estilos Principal
   Design profissional inspirado em portais de notícias
   ========================================================= */

:root {
    --primary: #c8102e;
    --primary-dark: #9b0a22;
    --dark: #1a1a1a;
    --text: #222;
    --muted: #666;
    --light: #f5f5f5;
    --border: #e5e5e5;
    --white: #fff;
    --serif: 'Merriweather', Georgia, serif;
    --display: 'Playfair Display', Georgia, serif;
    --sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.15);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: #fafafa;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; transition: color .2s; }
img { max-width: 100%; display: block; height: auto; }
ul { list-style: none; }

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

/* ============ TOP BAR ============ */
.top-bar {
    background: var(--dark);
    color: #ccc;
    font-size: 13px;
    padding: 8px 0;
}
.top-bar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.top-bar a { color: #ccc; margin-left: 18px; }
.top-bar a:hover { color: var(--primary); }
.top-bar i { margin-right: 5px; }

/* ============ TICKER ============ */
.ticker-bar {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    overflow: hidden;
}
.ticker-inner {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 20px;
}
.ticker-label {
    background: var(--primary);
    color: white;
    padding: 6px 14px;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 3px;
    white-space: nowrap;
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%,100% { opacity: 1; }
    50% { opacity: .7; }
}
.ticker-wrapper {
    flex: 1;
    overflow: hidden;
    position: relative;
}
.ticker-content {
    display: flex;
    gap: 40px;
    animation: ticker 45s linear infinite;
    white-space: nowrap;
}
.ticker-content a { font-size: 14px; color: var(--text); }
.ticker-content a:hover { color: var(--primary); }
@keyframes ticker {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

/* ============ HEADER ============ */
.main-header {
    background: var(--white);
    padding: 25px 0;
    border-bottom: 3px solid var(--primary);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--dark);
}
.logo {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
}
.logo-icon {
    width: 60px;
    height: 60px;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--display);
    font-size: 28px;
    font-weight: 900;
    border-radius: 6px;
    box-shadow: var(--shadow-sm);
}
.logo-text h1 {
    font-family: var(--display);
    font-size: 34px;
    font-weight: 900;
    color: var(--dark);
    line-height: 1;
    letter-spacing: -.5px;
}
.logo-text span {
    display: block;
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 4px;
}
.header-search form {
    display: flex;
    border: 2px solid var(--border);
    border-radius: 30px;
    overflow: hidden;
    transition: border-color .2s;
}
.header-search form:focus-within { border-color: var(--primary); }
.header-search input {
    border: none;
    padding: 10px 18px;
    width: 240px;
    font-size: 14px;
    outline: none;
    background: transparent;
}
.header-search button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0 18px;
    cursor: pointer;
    transition: background .2s;
}
.header-search button:hover { background: var(--primary-dark); }

/* ============ NAV ============ */
.main-nav {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}
.nav-list {
    display: flex;
    align-items: center;
    gap: 5px;
    overflow-x: auto;
}
.nav-list a {
    display: block;
    padding: 16px 18px;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: .5px;
    position: relative;
    white-space: nowrap;
}
.nav-list a:hover,
.nav-list a.active { color: var(--primary); }
.nav-list a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: var(--cat-color, var(--primary));
    transition: width .2s;
}
.nav-list a:hover::after,
.nav-list a.active::after { width: 80%; }

/* ============ HERO / DESTAQUE ============ */
.site-main { padding: 30px 0; }

.hero-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 40px;
}

.hero-principal {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: var(--dark);
    min-height: 480px;
    box-shadow: var(--shadow-lg);
}
.hero-principal img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    inset: 0;
    transition: transform .5s;
}
.hero-principal:hover img { transform: scale(1.04); }
.hero-principal .hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,.9) 0%, rgba(0,0,0,.3) 60%, transparent 100%);
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    color: white;
}
.hero-principal .cat-badge {
    display: inline-block;
    padding: 6px 12px;
    background: var(--primary);
    color: white;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 3px;
    margin-bottom: 14px;
    width: fit-content;
}
.hero-principal h2 {
    font-family: var(--display);
    font-size: 36px;
    font-weight: 900;
    line-height: 1.15;
    margin-bottom: 12px;
}
.hero-principal h2 a:hover { color: #ffd700; }
.hero-principal p {
    font-size: 16px;
    color: #ddd;
    max-width: 680px;
}
.hero-meta {
    margin-top: 14px;
    font-size: 13px;
    color: #bbb;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.hero-side {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.hero-card {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: var(--dark);
    min-height: 232px;
    box-shadow: var(--shadow);
}
.hero-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    inset: 0;
    transition: transform .5s;
}
.hero-card:hover img { transform: scale(1.05); }
.hero-card .hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,.88) 0%, transparent 70%);
    padding: 18px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    color: white;
}
.hero-card .cat-badge {
    display: inline-block;
    padding: 4px 10px;
    background: var(--primary);
    color: white;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 3px;
    margin-bottom: 10px;
    width: fit-content;
}
.hero-card h3 {
    font-family: var(--display);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
}
.hero-card h3 a:hover { color: #ffd700; }

/* ============ SECTION TITLE ============ */
.section-title {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--dark);
}
.section-title h2 {
    font-family: var(--display);
    font-size: 26px;
    font-weight: 900;
    color: var(--dark);
}
.section-title::before {
    content: '';
    width: 6px;
    height: 28px;
    background: var(--primary);
}
.section-title a.view-all {
    margin-left: auto;
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
}
.section-title a.view-all:hover { text-decoration: underline; }

/* ============ CONTENT LAYOUT ============ */
.content-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

/* ============ NEWS GRID & CARDS CORRIGIDOS ============ */
.news-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.news-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform .2s, box-shadow .2s;
    display: flex;
    flex-direction: column; /* Garante que a imagem fique em cima e o texto embaixo estruturados */
    height: 100%;
}

.news-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* ============ SIDEBAR ============ */
.sidebar .widget {
    background: white;
    border-radius: 8px;
    padding: 22px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}
.widget h3 {
    font-family: var(--display);
    font-size: 20px;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--primary);
    color: var(--dark);
}
.popular-list li {
    padding: 12px 0;
    border-bottom: 1px dashed var(--border);
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.popular-list li:last-child { border-bottom: none; }
.popular-list .num {
    font-family: var(--display);
    font-size: 32px;
    font-weight: 900;
    color: var(--primary);
    line-height: 1;
    min-width: 36px;
}
.popular-list .info h4 {
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 4px;
}
.popular-list .info h4 a:hover { color: var(--primary); }
.popular-list .info span {
    font-size: 11px;
    color: #999;
}
.tags-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tags-cloud a {
    display: inline-block;
    padding: 5px 12px;
    background: var(--light);
    border-radius: 20px;
    font-size: 12px;
    color: var(--text);
    transition: all .2s;
}
.tags-cloud a:hover {
    background: var(--primary);
    color: white;
}

/* ============ ARTICLE PAGE ============ */
.article-hero {
    margin-bottom: 30px;
}
.article-cat {
    display: inline-block;
    padding: 6px 14px;
    color: white;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 3px;
    margin-bottom: 14px;
}
.article-title {
    font-family: var(--display);
    font-size: 42px;
    font-weight: 900;
    line-height: 1.15;
    margin-bottom: 16px;
    color: var(--dark);
}
.article-subtitle {
    font-size: 20px;
    color: var(--muted);
    font-weight: 400;
    line-height: 1.4;
    margin-bottom: 20px;
    font-family: var(--serif);
}
.article-meta {
    display: flex;
    gap: 20px;
    align-items: center;
    padding: 14px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--muted);
    flex-wrap: wrap;
}
.article-meta i { margin-right: 6px; color: var(--primary); }
.article-image {
    margin: 0 -20px 30px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}
.article-image img { width: 100%; }
.article-image figcaption {
    padding: 10px 14px;
    font-size: 13px;
    color: var(--muted);
    background: var(--light);
    font-style: italic;
}
.article-content {
    font-family: var(--serif);
    font-size: 18px;
    line-height: 1.8;
    color: #333;
}
.article-content p { margin-bottom: 22px; }
.article-content h2, .article-content h3 {
    font-family: var(--display);
    margin: 30px 0 16px;
    color: var(--dark);
}
.article-content h2 { font-size: 30px; }
.article-content h3 { font-size: 24px; }
.article-content blockquote {
    border-left: 5px solid var(--primary);
    padding: 16px 24px;
    margin: 24px 0;
    background: var(--light);
    font-style: italic;
    font-size: 20px;
    color: var(--text);
}
.article-content ul, .article-content ol {
    margin: 16px 0 22px 30px;
}
.article-content a { color: var(--primary); text-decoration: underline; }
.article-content img { border-radius: 6px; margin: 20px 0; }

.share-bar {
    display: flex;
    gap: 10px;
    padding: 18px 0;
    margin: 30px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    align-items: center;
}
.share-bar span { font-weight: 700; margin-right: 8px; }
.share-btn {
    width: 42px; height: 42px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: white;
    font-size: 16px;
    transition: transform .2s;
}
.share-btn:hover { transform: scale(1.1); }
.share-btn.fb { background: #1877f2; }
.share-btn.tw { background: #000; }
.share-btn.wa { background: #25d366; }
.share-btn.tg { background: #0088cc; }

/* ============ CATEGORY PAGE ============ */
.category-header {
    padding: 30px 0;
    margin-bottom: 30px;
    border-bottom: 4px solid var(--cat-color, var(--primary));
}
.category-header h1 {
    font-family: var(--display);
    font-size: 48px;
    font-weight: 900;
}

.news-list .news-list-item {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 20px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    transition: transform .2s, box-shadow .2s;
}
.news-list .news-list-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}
.news-list .news-list-img img {
    width: 100%; height: 100%; object-fit: cover;
    min-height: 180px;
}
.news-list .news-list-body { padding: 20px; }
.news-list h3 {
    font-family: var(--display);
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.3;
}
.news-list h3 a:hover { color: var(--primary); }

/* ============ PAGINATION ============ */
.pagination {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin: 40px 0;
}
.pagination a, .pagination span {
    padding: 10px 16px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-weight: 600;
    min-width: 42px;
    text-align: center;
    transition: all .2s;
}
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination .current {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ============ NEWSLETTER ============ */
.newsletter-section {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 60px 0;
    margin-top: 50px;
}
.newsletter-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}
.newsletter-text h2 {
    font-family: var(--display);
    font-size: 30px;
    margin-bottom: 12px;
}
.newsletter-text h2 i { margin-right: 10px; }
.newsletter-form {
    display: flex;
    gap: 8px;
}
.newsletter-form input {
    flex: 1;
    padding: 14px 20px;
    border: none;
    border-radius: 30px;
    font-size: 15px;
    outline: none;
}
.newsletter-form button {
    padding: 14px 28px;
    background: var(--dark);
    color: white;
    border: none;
    border-radius: 30px;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s;
    white-space: nowrap;
}
.newsletter-form button:hover { background: #000; }

/* ============ FOOTER ============ */
.site-footer {
    background: var(--dark);
    color: #aaa;
    padding: 50px 0 0;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 40px;
    padding-bottom: 40px;
}
.footer-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}
.footer-logo .logo-icon { width: 50px; height: 50px; font-size: 22px; }
.footer-logo h3 {
    font-family: var(--display);
    color: white;
    font-size: 22px;
}
.footer-col p { font-size: 14px; line-height: 1.7; margin-bottom: 18px; }
.footer-col h4 {
    color: white;
    font-size: 16px;
    margin-bottom: 18px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.footer-col ul li { margin-bottom: 10px; font-size: 14px; }
.footer-col ul a:hover { color: var(--primary); }
.contact-list li i {
    color: var(--primary);
    margin-right: 8px;
    width: 16px;
}
.footer-social {
    display: flex;
    gap: 10px;
}
.footer-social a {
    width: 38px; height: 38px;
    background: rgba(255,255,255,.1);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    transition: background .2s;
}
.footer-social a:hover { background: var(--primary); }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,.1);
    padding: 20px 0;
    text-align: center;
    font-size: 13px;
}
.footer-bottom p { margin: 4px 0; }

/* ============ EMPTY STATE ============ */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}
.empty-state i {
    font-size: 64px;
    color: var(--border);
    margin-bottom: 20px;
}
.empty-state h2 {
    font-family: var(--display);
    margin-bottom: 10px;
}

/* ============ ALERTS ============ */
.alert {
    padding: 14px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    border-left: 4px solid;
}
.alert-success { background: #d4edda; color: #155724; border-color: #28a745; }
.alert-error { background: #f8d7da; color: #721c24; border-color: #dc3545; }
.alert-info { background: #d1ecf1; color: #0c5460; border-color: #17a2b8; }

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
    .hero-grid { grid-template-columns: 1fr; }
    .content-layout { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 30px; }
    .newsletter-inner { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .menu-toggle { display: block; }
    .nav-list {
        display: none;
        position: absolute;
        top: 100%;
        left: 0; right: 0;
        background: white;
        flex-direction: column;
        padding: 10px 0;
        box-shadow: var(--shadow);
    }
    .nav-list.open { display: flex; }
    .main-nav .container { position: relative; }
    .nav-list a { padding: 12px 20px; }
    .logo-text h1 { font-size: 22px; }
    .logo-text span { display: none; }
    .header-search { display: none; }
    .hero-principal { min-height: 340px; }
    .hero-principal h2 { font-size: 24px; }
    .news-grid { grid-template-columns: 1fr; }
    .article-title { font-size: 28px; }
    .article-subtitle { font-size: 16px; }
    .category-header h1 { font-size: 32px; }
    .news-list .news-list-item { grid-template-columns: 1fr; }
    .news-list .news-list-img img { min-height: 200px; }
    .footer-grid { grid-template-columns: 1fr; }
    .top-links { display: none; }
    .newsletter-form { flex-direction: column; }
}
@media (max-width: 480px) {
    .hero-principal h2 { font-size: 20px; }
    .section-title h2 { font-size: 20px; }
}
