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

:root {
    --primary: #000000;
    --secondary: #ffffff;
    --border: #e5e5e5;
    --text: #333333;
    --text-light: #666666;
    --bg-light: #f5f5f5;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    --spacing: 1rem;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--secondary);
}

/* HEADER E NAVEGAÇÃO */
header {
    background-color: var(--primary);
    color: var(--secondary);
    padding: var(--spacing) 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--spacing);
    text-decoration: none;
    color: var(--secondary);
    font-weight: bold;
    font-size: 1.5rem;
}

.logo img {
    height: 50px;
    width: auto;
}

.blog-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 1px;
}

nav {
    display: flex;
    gap: 2rem;
}

nav a {
    color: var(--secondary);
    text-decoration: none;
    transition: opacity 0.3s;
    font-size: 0.95rem;
    font-weight: 500;
}

nav a:hover {
    opacity: 0.7;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-menu a,
.user-menu button {
    color: var(--secondary);
    background: transparent;
    border: 1px solid var(--secondary);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.user-menu a:hover,
.user-menu button:hover {
    background-color: var(--secondary);
    color: var(--primary);
}

/* CONTAINERS */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing);
}

.section {
    padding: 3rem 0;
}

/* HERO SECTION */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, #1a1a1a 100%);
    color: var(--secondary);
    text-align: center;
    padding: 4rem var(--spacing);
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 700;
    letter-spacing: 2px;
}

.hero p {
    font-size: 1.3rem;
    opacity: 0.9;
}

/* GRID */
.grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-sidebar {
    grid-template-columns: 1fr 300px;
    gap: 2rem;
}

/* CARD */
.card {
    background: var(--secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.card:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border-color: var(--primary);
}

.card-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    background-color: var(--bg-light);
}

.card-body {
    padding: 1.5rem;
}

.card-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.card-text {
    color: var(--text-light);
    margin-bottom: 1rem;
    font-size: 0.95rem;
    line-height: 1.6;
}

.card-footer {
    padding: 1rem 1.5rem;
    background-color: var(--bg-light);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

/* BOTÕES */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
    text-align: center;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--secondary);
}

.btn-primary:hover {
    background-color: #333333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background-color: var(--secondary);
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-secondary:hover {
    background-color: var(--primary);
    color: var(--secondary);
}

.btn-success {
    background-color: var(--success);
    color: white;
}

.btn-success:hover {
    background-color: #20c997;
}

.btn-danger {
    background-color: var(--danger);
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.btn-block {
    display: block;
    width: 100%;
}

/* FORMULÁRIOS */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="date"],
input[type="time"],
textarea,
select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="url"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

textarea {
    resize: vertical;
    min-height: 150px;
}

/* POST */
.post-item {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 2rem;
}

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

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

.post-content {
    flex: 1;
}

.post-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

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

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

.post-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: var(--text-light);
}

.post-meta-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.post-excerpt {
    color: var(--text-light);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.8rem;
    text-decoration: none;
    color: var(--text);
    transition: all 0.3s;
}

.tag:hover {
    background-color: var(--primary);
    color: var(--secondary);
    border-color: var(--primary);
}

/* SIDEBAR */
.sidebar {
    background-color: var(--secondary);
}

.sidebar-widget {
    background-color: var(--secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.sidebar-widget h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary);
}

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

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

.widget-list li:last-child {
    border-bottom: none;
}

.widget-list a {
    color: var(--text);
    text-decoration: none;
    transition: color 0.3s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.widget-count {
    background-color: var(--primary);
    color: var(--secondary);
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
}

/* PAGINATION */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    text-decoration: none;
    color: var(--text);
    transition: all 0.3s;
}

.pagination a:hover {
    background-color: var(--primary);
    color: var(--secondary);
    border-color: var(--primary);
}

.pagination .active {
    background-color: var(--primary);
    color: var(--secondary);
    border-color: var(--primary);
}

/* FOOTER */
footer {
    background-color: var(--primary);
    color: var(--secondary);
    padding: 3rem var(--spacing) 1rem;
    margin-top: 4rem;
    border-top: 1px solid #333;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-widget h4 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.footer-widget a {
    color: var(--secondary);
    text-decoration: none;
    font-size: 0.95rem;
    transition: opacity 0.3s;
    display: block;
    margin-bottom: 0.5rem;
}

.footer-widget a:hover {
    opacity: 0.7;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
    text-align: center;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* ALERTS */
.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* ARTIGO COMPLETO */
.article {
    max-width: 900px;
    margin: 0 auto;
}

.article-header {
    text-align: center;
    margin-bottom: 3rem;
}

.article-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.article-meta {
    display: flex;
    justify-content: center;
    gap: 2rem;
    font-size: 0.95rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.article-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.article-author img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
}

.article-featured-image {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.article-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text);
}

.article-content h2 {
    font-size: 2rem;
    margin: 2rem 0 1rem;
}

.article-content h3 {
    font-size: 1.5rem;
    margin: 1.5rem 0 0.75rem;
}

.article-content p {
    margin-bottom: 1rem;
}

.article-content ul,
.article-content ol {
    margin-bottom: 1rem;
    margin-left: 2rem;
}

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

.article-content blockquote {
    border-left: 4px solid var(--primary);
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    color: var(--text-light);
    font-style: italic;
}

.article-content code {
    background-color: var(--bg-light);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
}

.article-content pre {
    background-color: var(--primary);
    color: var(--secondary);
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    margin-bottom: 1rem;
}

.article-content pre code {
    background: none;
    color: inherit;
    padding: 0;
}

/* ADMIN */
.admin-header {
    background-color: var(--primary);
    color: var(--secondary);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

/* ADMIN PANEL LAYOUT */
.admin-container {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
    min-height: calc(100vh - 100px);
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.admin-sidebar {
    background: linear-gradient(135deg, #f5f5f5 0%, #ffffff 100%);
    padding: 1.5rem;
    border-radius: 8px;
    position: sticky;
    top: 120px;
    height: fit-content;
    width: 100%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.admin-sidebar img {
    transition: transform 0.3s ease;
}

.admin-sidebar img:hover {
    transform: scale(1.05);
}

.admin-main {
    width: 100%;
}

.admin-menu {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
}

.admin-menu li {
    margin-bottom: 0.5rem;
    display: block !important;
}

.admin-menu a {
    display: block !important;
    padding: 0.75rem 1rem;
    color: var(--text);
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s;
    width: 100% !important;
}

.admin-menu a:hover {
    background-color: var(--primary);
    color: var(--secondary);
}

.admin-menu a.active {
    background-color: var(--primary);
    color: var(--secondary);
    font-weight: 600;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.table th,
.table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.table th {
    background-color: var(--bg-light);
    font-weight: 600;
    color: var(--text);
}

.table tbody tr:hover {
    background-color: var(--bg-light);
}

.table .actions {
    display: flex;
    gap: 0.5rem;
}

.table .actions a {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
}

/* RESPONSIVIDADE */
@media (max-width: 768px) {
    .admin-container {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem;
        min-height: auto;
    }

    .admin-sidebar {
        position: relative;
        top: auto;
        margin-bottom: 1rem;
        height: auto;
    }

    .admin-main {
        padding: 0;
    }

    .header-container {
        flex-direction: column;
        gap: 1rem;
    }

    nav {
        gap: 1rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .grid {
        grid-template-columns: 1fr;
    }

    .grid-2 {
        grid-template-columns: 1fr;
    }

    .grid-sidebar {
        grid-template-columns: 1fr;
    }

    .post-item {
        flex-direction: column;
    }

    .post-image {
        width: 100%;
    }

    .article-title {
        font-size: 1.8rem;
    }

    .article-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .pagination {
        gap: 0.25rem;
    }

    .pagination a,
    .pagination span {
        padding: 0.4rem 0.5rem;
        font-size: 0.8rem;
    }
}

/* UTILIDADES */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

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

.mt-1 { margin-top: var(--spacing); }
.mt-2 { margin-top: calc(var(--spacing) * 2); }
.mt-3 { margin-top: calc(var(--spacing) * 3); }
.mb-1 { margin-bottom: var(--spacing); }
.mb-2 { margin-bottom: calc(var(--spacing) * 2); }
.mb-3 { margin-bottom: calc(var(--spacing) * 3); }

.hidden {
    display: none !important;
}

.clearfix::after {
    content: '';
    display: table;
    clear: both;
}

/* HOME PAGE LAYOUT */
.content-wrapper {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
}

.posts-section {
    margin-bottom: 2rem;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.post-card {
    background: var(--secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border-color: var(--primary);
}

.post-header {
    padding: 1.5rem;
}

.post-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    line-height: 1.4;
}

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

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

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-light);
    margin-top: 0.5rem;
}

.post-category {
    color: var(--text-light) !important;
    text-decoration: none;
}

.post-category:hover {
    color: var(--primary) !important;
}

.post-excerpt {
    padding: 0 1.5rem;
    flex-grow: 1;
}

.post-excerpt p {
    margin: 0;
    color: var(--text);
    line-height: 1.6;
    font-size: 0.95rem;
}

.post-footer {
    padding: 1rem 1.5rem;
    background-color: var(--bg-light);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.read-more {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.read-more:hover {
    color: var(--text);
}

.post-comments {
    font-size: 0.85rem;
    color: var(--text-light);
}

.no-posts {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 3rem;
    flex-wrap: wrap;
}

.pagination-link,
.pagination-current {
    padding: 0.6rem 1rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
}

.pagination-link {
    background-color: var(--bg-light);
    color: var(--text);
    border: 1px solid var(--border);
}

.pagination-link:hover {
    background-color: var(--primary);
    color: var(--secondary);
    border-color: var(--primary);
}

.pagination-current {
    background-color: var(--primary);
    color: var(--secondary);
    cursor: default;
}

/* SIDEBAR */
.sidebar {
    position: sticky;
    top: 120px;
    height: fit-content;
}

.widget {
    background: var(--secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.widget-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary);
}

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

.categories-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.categories-list li:last-child {
    border-bottom: none;
}

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

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

.count {
    background: var(--bg-light);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--text-light);
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    background: var(--bg-light);
    color: var(--text);
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.85rem;
    transition: all 0.3s;
}

.tag:hover {
    background: var(--primary);
    color: var(--secondary);
}

.recent-posts {
    list-style: none;
    padding: 0;
    margin: 0;
}

.recent-posts li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.recent-posts li:last-child {
    border-bottom: none;
}

.recent-posts a {
    color: var(--text);
    text-decoration: none;
    transition: color 0.3s;
    flex: 1;
}

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

.recent-posts .date {
    font-size: 0.8rem;
    color: var(--text-light);
    white-space: nowrap;
}

.widget-content {
    color: var(--text);
    line-height: 1.6;
    font-size: 0.95rem;
    margin: 0;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .content-wrapper {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        top: auto;
    }

    .posts-grid {
        grid-template-columns: 1fr;
    }

    .post-meta {
        flex-direction: column;
        gap: 0.25rem;
    }

    .recent-posts li {
        flex-direction: column;
    }

    .recent-posts .date {
        white-space: normal;
    }
}
