:root {
    --primary-color: #0073aa;
    --bg-color: #ffffff;
    --bg-rgb: 255, 255, 255;
    --text-color: #333333;
}

body.dark-mode-supported[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --bg-rgb: 26, 26, 26;
    --text-color: #e0e0e0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 30px;
}
.container.has-right-sidebar { display: grid; grid-template-columns: 1fr 340px; gap: 60px; }
.container.has-left-sidebar { display: grid; grid-template-columns: 340px 1fr; gap: 60px; }
.container.has-left-sidebar main { order: 2; }
.container.has-left-sidebar aside { order: 1; }
.container.no-sidebar { display: block; }

#content {
    padding: 80px 0;
}

/* Layout do Header e Top Bar */
.top-bar {
    padding: 10px 0;
    font-size: 0.9rem;
}

.top-bar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

/* Styles for Top Bar */
.top-bar.style-contained .top-bar-container {
    max-width: 1200px;
    margin: 0 auto;
}

.top-bar.style-mini {
    margin: 15px auto;
    width: fit-content;
    padding: 8px 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    border: 1px solid rgba(255,255,255,0.1);
}

.top-bar.style-contained {
    margin: 10px auto;
    width: 95%;
    max-width: 1200px;
}

.top-bar-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.top-bar-content i {
    margin-right: 5px;
    opacity: 0.8;
}

.top-bar-date, .top-bar-time {
    display: flex;
    align-items: center;
    font-weight: 500;
}

.news-bar {
    flex: 1;
    overflow: hidden;
    position: relative;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.news-bar-ticker {
    display: inline-block;
    white-space: nowrap;
    animation: ticker 15s linear infinite;
    padding-left: 100%;
}

@keyframes ticker {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

.site-header {
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 15px 0;
}

.site-header.is-sticky {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(var(--bg-rgb), 0.8) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-col img {
    max-width: 100%;
    display: block;
}

.main-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 20px;
}

.main-navigation a {
    text-decoration: none;
    color: inherit;
    font-weight: 500;
}

.main-navigation a:hover {
    color: var(--primary-color);
}

/* Header Search */
.header-search {
    position: relative;
    display: flex;
    align-items: center;
}

.search-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-color);
    padding: 8px;
    border-radius: 50%;
    transition: background 0.3s;
}

.search-toggle:hover {
    background: rgba(0,0,0,0.05);
}

body[data-theme="dark"] .search-toggle:hover {
    background: rgba(255,255,255,0.1);
}

.header-search-form {
    position: absolute;
    top: 100%;
    right: 0;
    width: 300px;
    background: var(--bg-color);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    z-index: 100;
    border: 1px solid rgba(0,0,0,0.05);
}

.header-search-form input[type="search"] {
    width: 100%;
    padding: 10px 15px;
    border-radius: 20px;
    border: 1px solid #ddd;
    outline: none;
}

/* Header Dark Mode Toggle */
.header-dark-mode-toggle {
    display: flex;
    align-items: center;
}

.dark-mode-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-color);
    padding: 8px;
    font-size: 1.2rem;
    transition: color 0.3s;
}

.dark-mode-btn:hover {
    color: var(--primary-color);
}

/* Responsive Header */
@media (max-width: 992px) {
    .header-row {
        grid-template-columns: 1fr 1fr !important;
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .header-row {
        grid-template-columns: 1fr !important;
        gap: 15px;
        text-align: center;
    }
    
    .header-col {
        justify-content: center;
        display: flex;
    }
    
    .main-navigation ul {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }
    
    .header-search-form {
        width: 100%;
        left: 0;
        right: 0;
        position: fixed;
        top: auto;
        bottom: 0;
        border-radius: 20px 20px 0 0;
    }
}

/* Post Grid & Cards - Consolidated */
.post-grid {
    display: grid;
    gap: 30px;
    margin-bottom: 50px;
}

.post-grid.columns-2 { grid-template-columns: repeat(2, 1fr); }
.post-grid.columns-3 { grid-template-columns: repeat(3, 1fr); }
.post-grid.columns-4 { grid-template-columns: repeat(4, 1fr); }
.post-grid.list-layout { grid-template-columns: 1fr; }

.fm-post-card {
    background: var(--bg-color);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    border: 1px solid rgba(0,0,0,0.06);
    height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.fm-post-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-color: var(--primary-color);
}

.fm-post-thumbnail {
    position: relative;
    overflow: hidden;
}

.fm-post-thumbnail img {
    transition: transform 0.5s ease;
}

.fm-post-card:hover .fm-post-thumbnail img {
    transform: scale(1.05);
}

.fm-post-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.fm-post-title {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 12px;
}

.fm-post-title a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s;
}

.fm-post-title a:hover {
    color: var(--primary-color);
}

.fm-post-excerpt {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #666;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

body[data-theme="dark"] .fm-post-excerpt {
    color: #aaa;
}

/* Sidebar & Widgets */
#secondary {
    width: 320px;
}

.widget {
    background: rgba(var(--bg-rgb), 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0,0,0,0.05);
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 30px;
    transition: all 0.3s ease;
}

body[data-theme="dark"] .widget {
    background: rgba(var(--bg-rgb), 0.4);
    border-color: rgba(255,255,255,0.1);
}

.widget-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
    display: inline-block;
}

.widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget li {
    padding: 10px 0;
    border-bottom: 1px solid rgba(0,0,0,0.03);
}

.widget a {
    text-decoration: none;
    color: var(--text-color);
    transition: color 0.3s;
}

.widget a:hover { color: var(--primary-color); }

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

.entry-header {
    padding: 20px;
}

.entry-title {
    margin: 0 0 10px;
    font-size: 1.25rem;
}

.entry-meta {
    font-size: 0.85rem;
    color: #666;
}
/* --- Professional Blog Layouts --- */
.card-list .fm-post-card {
    flex-direction: row;
    align-items: flex-start;
}
.card-list .fm-post-thumbnail {
    flex: 0 0 350px;
}
.card-list .fm-post-thumbnail img {
    height: 100%;
}

.card-gallery .fm-post-excerpt,
.card-gallery .fm-post-footer {
    display: none;
}
.card-gallery .fm-post-body {
    padding: 15px;
    text-align: center;
}

/* Magazine Layout Special Logic */
.fm-mag-featured {
    grid-column: 1 / -1;
    margin-bottom: 20px;
}
.fm-mag-featured .fm-post-card {
    flex-direction: row;
    min-height: 450px;
    background: var(--bg-color);
}
.fm-mag-featured .fm-post-thumbnail {
    flex: 0 0 55%;
}
.fm-mag-featured .fm-post-thumbnail img {
    height: 100%;
    width: 100%;
    object-fit: cover;
}
.fm-mag-featured .fm-post-body {
    padding: 50px;
    justify-content: center;
}
.fm-mag-featured .fm-post-title {
    font-size: 2.5rem;
    margin-bottom: 20px;
    line-height: 1.1;
}
.fm-mag-featured .fm-post-excerpt {
    font-size: 1.1rem;
    -webkit-line-clamp: 4;
}

@media (max-width: 992px) {
    .card-list .fm-post-card, 
    .fm-mag-featured .fm-post-card {
        flex-direction: column;
    }
    .card-list .fm-post-thumbnail,
    .fm-mag-featured .fm-post-thumbnail {
        flex: none;
        width: 100%;
    }
    .fm-mag-featured {
        grid-column: span 1;
    }
}

.fm-post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 0.85rem;
    opacity: 0.7;
    margin-bottom: 20px;
}
.fm-post-meta i {
    color: var(--primary-color);
    margin-right: 5px;
}

.fm-read-more {
    display: inline-block;
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
    transition: transform 0.2s;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.fm-read-more:hover {
    transform: translateX(5px);
}

.fm-read-more i {
    transition: transform 0.3s;
}

.fm-read-more:hover i {
    transform: translateX(5px);
}

/* Popup Styles */
.fm-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.fm-popup-container {
    background: var(--bg-color);
    padding: 40px;
    max-width: 600px;
    width: 90%;
    border-radius: 12px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    color: var(--text-color);
}

/* Lead Form Styles */
.fm-lead-form-container {
    background: rgba(var(--bg-rgb), 0.05);
    padding: 30px;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.05);
    margin: 20px 0;
}

.fm-form-group { margin-bottom: 15px; }

.fm-form-group input {
    width: 100%;
    padding: 12px 15px;
    border-radius: 8px;
    border: 1px solid #ddd;
    background: var(--bg-color);
    color: var(--text-color);
}

/* Dark Mode Toggle */
.fm-dark-mode-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: #fff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 1001;
    border: none;
    font-size: 20px;
    transition: transform 0.3s;
}

.fm-dark-mode-toggle:hover { transform: scale(1.1); }

.author-bio {
    display: flex;
    gap: 30px;
    padding: 30px;
    background: var(--card-bg);
    border-radius: 15px;
    margin: 40px auto;
    border: 1px solid rgba(0,0,0,0.05);
}
.author-avatar img {
    border-radius: 50%;
}
.author-description h3 {
    margin: 0 0 10px;
}

.site-content-wrapper {
    display: flex;
    gap: 50px;
}
.site-content-wrapper.with-sidebar .site-main {
    flex: 1;
}
.site-content-wrapper.layout-left {
    flex-direction: row-reverse;
}
.site-content-wrapper.full-width .site-main {
    width: 100%;
}

@media (max-width: 992px) {
    .site-content-wrapper {
        flex-direction: column;
    }
    .author-bio {
        flex-direction: column;
        text-align: center;
    }
}
/* Footer Enhancements */
.footer-widgets {
    display: grid;
    gap: 40px;
    padding: 60px 0;
}

.footer-cols-1 { grid-template-columns: 1fr; }
.footer-cols-2 { grid-template-columns: repeat(2, 1fr); }
.footer-cols-3 { grid-template-columns: repeat(3, 1fr); }
.footer-cols-4 { grid-template-columns: repeat(4, 1fr); }

.footer-col .widget-title {
    color: #fff;
    font-size: 1.25rem;
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 15px;
}

.footer-col .widget-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--primary-color);
}

.footer-bottom {
    padding: 25px 0;
    border-top: 1px solid rgba(255,255,255,0.05);
    background: rgba(0,0,0,0.1);
}

.footer-bottom-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.footer-copyright {
    font-size: 0.9rem;
    opacity: 0.7;
}

.footer-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 20px;
}

.footer-menu a {
    text-decoration: none;
    color: inherit;
    font-size: 0.9rem;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.footer-menu a:hover {
    opacity: 1;
}

@media (max-width: 768px) {
    .footer-widgets {
        grid-template-columns: 1fr;
        padding: 40px 0;
    }
    .footer-bottom-container {
        flex-direction: column;
        text-align: center;
    }
    .footer-menu ul {
        justify-content: center;
    }
}
