/*
Theme Name: DividendoX
Theme URI: https://blog.dividendox.com
Author: DividendoX
Author URI: https://blog.dividendox.com
Description: Tema WordPress limpo, minimalista e SEO otimizado para blogs de investimentos. Design neutro, legível e profissional.
Version: 2.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: dividendox
Tags: blog, finance, minimal, custom-logo, custom-menu, featured-images, translation-ready, responsive-layout, seo
*/

/* ==========================================================================
   Variables
   ========================================================================== */
:root {
    --text: #1a1a1a;
    --text-secondary: #555;
    --text-muted: #888;
    --bg: #fafafa;
    --white: #ffffff;
    --border: #e8e8e8;
    --accent: #1a1a1a;
    --link: #1a1a1a;
    --link-hover: #000;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --container: 1080px;
    --radius: 6px;
    --header-h: 64px;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    line-height: 1.7;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

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

a {
    color: var(--link);
    text-decoration: none;
    transition: opacity 0.15s ease;
}

a:hover {
    opacity: 0.7;
}

ul, ol {
    list-style: none;
}

/* ==========================================================================
   Typography
   ========================================================================== */
h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--text);
    letter-spacing: -0.02em;
}

h1 { font-size: 1.875rem; }
h2 { font-size: 1.375rem; }
h3 { font-size: 1.125rem; }

p {
    margin-bottom: 1.25em;
}

/* ==========================================================================
   Layout
   ========================================================================== */
.site {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.site-content {
    flex: 1;
    padding: 2.5rem 0 3.5rem;
}

.content-area {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 3rem;
    align-items: start;
}

.main-content {
    min-width: 0;
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-h);
    gap: 2rem;
}

.site-branding {
    flex-shrink: 0;
}

.site-logo img {
    max-height: 36px;
    width: auto;
}

.site-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
    letter-spacing: -0.03em;
}

.site-title a {
    color: var(--text);
}

.site-title a:hover {
    opacity: 1;
}

/* Navigation */
.main-navigation {
    display: flex;
    align-items: center;
}

.primary-menu {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.primary-menu > li > a {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius);
    transition: color 0.15s ease, background 0.15s ease;
}

.primary-menu > li > a:hover,
.primary-menu > li.current-menu-item > a {
    color: var(--text);
    background: var(--bg);
    opacity: 1;
}

.menu-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.35rem 0.6rem;
    border-radius: var(--radius);
    line-height: 1;
}

/* Search */
.header-search {
    position: relative;
    flex-shrink: 0;
}

.header-search input[type="search"] {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 0.4rem 1rem 0.4rem 2.1rem;
    color: var(--text);
    font-size: 0.85rem;
    width: 170px;
    transition: width 0.2s ease, border-color 0.15s ease;
}

.header-search input[type="search"]::placeholder {
    color: var(--text-muted);
}

.header-search input[type="search"]:focus {
    outline: none;
    border-color: #ccc;
    width: 210px;
    background: var(--white);
}

.header-search .search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.8rem;
    pointer-events: none;
}

/* ==========================================================================
   Posts list
   ========================================================================== */
.section-title {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.posts-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.post-item {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 1.5rem;
    padding: 1.75rem 0;
    border-bottom: 1px solid var(--border);
    align-items: start;
}

.post-item:first-child {
    padding-top: 0;
}

.post-item:last-child {
    border-bottom: none;
}

.post-item .post-thumbnail {
    border-radius: var(--radius);
    overflow: hidden;
    background: #eee;
    aspect-ratio: 16/10;
}

.post-item .post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-item .post-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.post-item .post-category {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.4rem;
}

.post-item .entry-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    line-height: 1.35;
}

.post-item .entry-title a {
    color: var(--text);
}

.post-item .entry-title a:hover {
    opacity: 0.65;
}

.post-item .entry-summary {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 0.6rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-item .post-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* ==========================================================================
   Single post
   ========================================================================== */
.single-post .entry-header {
    margin-bottom: 2rem;
    max-width: 680px;
}

.single-post .post-category {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.75rem;
    display: inline-block;
}

.single-post .entry-title {
    font-size: clamp(1.6rem, 4vw, 2.25rem);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.03em;
    margin-bottom: 1rem;
}

.single-post .post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
}

.single-post .post-meta .author strong {
    color: var(--text);
    font-weight: 600;
}

.single-post .post-thumbnail {
    margin: 2rem 0;
    border-radius: var(--radius);
    overflow: hidden;
}

.single-post .post-thumbnail img {
    width: 100%;
}

.single-post .entry-content {
    font-size: 1.0625rem;
    line-height: 1.8;
    color: #333;
    max-width: 680px;
}

.single-post .entry-content h2,
.single-post .entry-content h3 {
    margin-top: 2.25rem;
    margin-bottom: 0.75rem;
}

.single-post .entry-content p {
    margin-bottom: 1.4em;
}

.single-post .entry-content ul,
.single-post .entry-content ol {
    margin: 1.4em 0;
    padding-left: 1.4em;
}

.single-post .entry-content ul { list-style: disc; }
.single-post .entry-content ol { list-style: decimal; }
.single-post .entry-content li { margin-bottom: 0.4em; }

.single-post .entry-content blockquote {
    border-left: 3px solid var(--border);
    padding: 0.75rem 0 0.75rem 1.25rem;
    margin: 1.75em 0;
    color: var(--text-secondary);
    font-style: italic;
}

.single-post .entry-content img {
    border-radius: var(--radius);
    margin: 1.75em 0;
}

.single-post .entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.75em 0;
    font-size: 0.95rem;
}

.single-post .entry-content th,
.single-post .entry-content td {
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border);
    text-align: left;
}

.single-post .entry-content th {
    background: var(--bg);
    font-weight: 600;
}

.entry-footer {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    max-width: 680px;
}

.entry-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.entry-tags a {
    background: var(--bg);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    border: 1px solid var(--border);
}

.entry-tags a:hover {
    background: var(--border);
    opacity: 1;
}

/* Breadcrumbs */
.breadcrumbs {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.breadcrumbs a {
    color: var(--text-muted);
}

.breadcrumbs a:hover {
    color: var(--text);
    opacity: 1;
}

/* ==========================================================================
   Sidebar
   ========================================================================== */
.sidebar {
    position: sticky;
    top: calc(var(--header-h) + 1.5rem);
}

.widget {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.35rem;
    margin-bottom: 1.25rem;
}

.widget-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--border);
}

.widget ul li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

.widget ul li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.widget ul li a {
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.4;
}

.widget ul li a:hover {
    opacity: 0.65;
}

/* Newsletter */
.widget-newsletter p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.widget-newsletter input[type="email"] {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    margin-bottom: 0.6rem;
    background: var(--bg);
}

.widget-newsletter input[type="email"]:focus {
    outline: none;
    border-color: #ccc;
    background: var(--white);
}

.widget-newsletter button {
    width: 100%;
    background: var(--text);
    color: var(--white);
    border: none;
    padding: 0.65rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: opacity 0.15s ease;
}

.widget-newsletter button:hover {
    opacity: 0.85;
}

.widget_categories ul li {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.widget_categories .count {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
}

/* ==========================================================================
   Pagination
   ========================================================================== */
.pagination,
.nav-links {
    display: flex;
    justify-content: center;
    gap: 0.35rem;
    margin: 2.5rem 0 0;
    flex-wrap: wrap;
}

.pagination a,
.pagination span,
.nav-links a,
.nav-links span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 0.65rem;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.875rem;
    background: var(--white);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    transition: all 0.15s ease;
}

.pagination a:hover,
.nav-links a:hover {
    background: var(--bg);
    color: var(--text);
    opacity: 1;
}

.pagination .current,
.nav-links .current {
    background: var(--text);
    color: var(--white);
    border-color: var(--text);
}

/* ==========================================================================
   Comments
   ========================================================================== */
.comments-area {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    max-width: 680px;
}

.comments-title {
    font-size: 1.15rem;
    margin-bottom: 1.5rem;
}

.comment {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.15rem;
    margin-bottom: 0.85rem;
}

.comment-author {
    font-weight: 600;
    color: var(--text);
}

.comment-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.comment-content {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
    background: var(--white);
    border-top: 1px solid var(--border);
    padding: 2.5rem 0 1.5rem;
    margin-top: auto;
}

.footer-widgets {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.footer-widget h3 {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.footer-widget p {
    font-size: 0.9rem;
    line-height: 1.65;
    color: var(--text-secondary);
}

.footer-widget ul li {
    margin-bottom: 0.4rem;
}

.footer-widget ul li a {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer-widget ul li a:hover {
    color: var(--text);
    opacity: 1;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.footer-bottom a {
    color: var(--text-secondary);
}

.social-links {
    display: flex;
    gap: 0.75rem;
}

.social-links a {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.social-links a:hover {
    color: var(--text);
    opacity: 1;
}

/* ==========================================================================
   Page / Archive / 404
   ========================================================================== */
.page-header {
    margin-bottom: 1.75rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
}

.error-404 {
    text-align: center;
    padding: 4rem 0;
}

.error-404 h1 {
    font-size: 4rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.error-404 .page-title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--text);
    color: var(--white);
    font-weight: 600;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    transition: opacity 0.15s ease;
}

.btn:hover {
    opacity: 0.85;
    color: var(--white);
}

/* ==========================================================================
   Utilities
   ========================================================================== */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 900px) {
    .content-area {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }
}

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

    .main-navigation {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white);
        padding: 0.75rem 1.5rem 1.25rem;
        border-bottom: 1px solid var(--border);
        box-shadow: 0 8px 20px rgba(0,0,0,0.06);
    }

    .main-navigation.active {
        display: block;
    }

    .primary-menu {
        flex-direction: column;
        gap: 0;
        align-items: stretch;
    }

    .primary-menu > li > a {
        display: block;
        padding: 0.7rem 0.5rem;
        border-bottom: 1px solid var(--border);
    }

    .header-search {
        display: none;
    }

    .post-item {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .post-item .post-thumbnail {
        max-width: 100%;
    }

    .footer-widgets {
        grid-template-columns: 1fr;
        gap: 1.75rem;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }

    .single-post .entry-title {
        font-size: 1.5rem;
    }

    .single-post .entry-content {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1.15rem;
    }

    .site-title {
        font-size: 1.1rem;
    }
}
