:root {
    --bg-color: #F7F7F5;
    --text-color: #222222;
    --accent-color: #8B4513; /* Marrom editorial suave */
    --font-heading: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --max-width: 760px;
    --card-bg: #ffffff;
    --border-color: #e0e0e0;
    --muted-color: #666;
    --sidebar-bg: #17181a;
    --sidebar-text: #d8d6d1;
    --sidebar-muted: #8f8d88;
    --sidebar-border: #2c2d2f;
}

[data-theme="dark"] {
    --bg-color: #17181a;
    --text-color: #e8e6e1;
    --accent-color: #d99a5b;
    --card-bg: #232426;
    --border-color: #3a3b3d;
    --muted-color: #a3a3a3;
}

html { font-size: 100%; transition: font-size 0.15s ease; }

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    line-height: 1.8;
    font-size: 1.125rem;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.25s ease, color 0.25s ease;
}

h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 600; line-height: 1.3; }
a { color: var(--text-color); text-decoration: none; border-bottom: 1px solid transparent; transition: border-color 0.3s; }
a:hover { border-bottom-color: var(--accent-color); }

/* ===== Layout geral (sidebar + conteúdo) ===== */
.layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 280px;
    flex-shrink: 0;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}
.sidebar-brand { padding: 2rem 1.5rem 1rem; }
.sidebar-title { font-size: 1.6rem; color: #fff; text-transform: uppercase; letter-spacing: 0.03em; line-height: 1.25; }
.sidebar-author { font-size: 0.85rem; font-style: italic; color: var(--sidebar-muted); margin-top: 0.4rem; }

.sidebar-nav { padding: 1rem 1.5rem 0; }
.sidebar-nav .nav-item {
    display: flex; align-items: center; gap: 0.6rem;
    color: var(--sidebar-text); padding: 0.55rem 0.6rem;
    font-family: var(--font-body); font-weight: 500; font-size: 1rem; border: none; border-radius: 4px;
}
.sidebar-nav .nav-item:hover { color: #fff; background: rgba(255,255,255,0.05); }
.sidebar-nav .nav-cat.active { color: var(--accent-color); border-left: 2px solid var(--accent-color); padding-left: 0.4rem; background: rgba(217,154,91,0.08); }
.sidebar-nav .nav-tagline { display: block; font-size: 0.75rem; color: var(--sidebar-muted); font-style: italic; margin: -0.3rem 0 0.4rem 0.6rem; }

.sidebar-spacer { flex: 1; }

.sidebar-search { padding: 1rem 1.5rem; border-top: 1px solid var(--sidebar-border); }
.sidebar-search-form { position: relative; }
.sidebar-search input[type="text"] {
    background: #1f2022; border: 1px solid var(--sidebar-border); color: #eee;
    margin-bottom: 0; padding-right: 2.4rem;
}
.sidebar-search button {
    position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
    width: auto; background: transparent; padding: 0.4rem; color: var(--sidebar-muted);
}
.sidebar-search button:hover { background: transparent; color: #fff; }

.sidebar-footer { padding: 1.5rem; border-top: 1px solid var(--sidebar-border); font-size: 0.8rem; color: var(--sidebar-muted); }
.sidebar-footer strong { color: #e8e6e1; }
.sidebar-footer a { color: var(--sidebar-muted); border: none; }
.sidebar-footer a:hover { color: #fff; }
.sidebar-footer .footer-links { margin-top: 0.7rem; font-size: 0.78rem; line-height: 1.9; }
.sidebar-footer .copyright { margin-top: 1rem; font-size: 0.75rem; color: #63615d; }

.main-wrap { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
    display: flex; justify-content: flex-end; align-items: center; gap: 0.6rem;
    padding: 1rem 2rem; border-bottom: 1px solid var(--border-color);
}
.lang-select { display: flex; align-items: center; gap: 0.4rem; color: var(--muted-color); margin-right: 0.6rem; }
.topbar select {
    width: auto; margin: 0; padding: 0.3rem 0.5rem; font-size: 0.85rem;
    border: 1px solid var(--border-color); background: var(--card-bg); color: var(--text-color);
}
.topbar button {
    width: auto; background: transparent; border: 1px solid var(--border-color); color: var(--text-color);
    padding: 0.35rem 0.6rem; font-size: 0.85rem; text-transform: none; letter-spacing: normal; border-radius: 4px;
}
.topbar button:hover { background: var(--accent-color); color: #fff; border-color: var(--accent-color); }
.mobile-sidebar-toggle { display: none; }
.sidebar-overlay { display: none; }

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

/* Article Display */
.article-header { margin-bottom: 2.5rem; }
.article-category { font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent-color); margin-bottom: 1rem; display: block; font-weight: 600; }
.article-title { font-size: 2.6rem; margin-bottom: 1rem; }
.article-meta { display: flex; flex-wrap: wrap; gap: 1.3rem; align-items: center; font-size: 0.9rem; color: var(--muted-color); margin-bottom: 2rem; }
.article-meta span { display: inline-flex; align-items: center; gap: 0.4rem; }
.article-meta svg { flex-shrink: 0; }
.article-cover { width: 100%; height: auto; margin-bottom: 2.5rem; border-radius: 6px; display: block; }
.article-content { text-align: justify; hyphens: auto; }
.article-content p { margin-bottom: 1.5rem; }
.article-content blockquote { border-left: 3px solid var(--accent-color); padding-left: 1.5rem; font-style: italic; color: var(--muted-color); margin: 2rem 0; }

.btn-outline {
    display: inline-block; width: auto; background: transparent; border: 1px solid var(--accent-color);
    color: var(--accent-color); padding: 0.7rem 1.4rem; font-family: var(--font-heading);
    text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.9rem;
}
.btn-outline:hover { background: var(--accent-color); color: #fff; border-bottom: 1px solid var(--accent-color); }

/* Compartilhamento + idioma */
.share-row {
    display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem;
    margin: 2.5rem 0; padding: 1.2rem 0; border-top: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color);
}
.share-row .share-label { font-family: var(--font-heading); color: var(--muted-color); margin-right: 0.3rem; }
.share-icons { display: flex; gap: 0.6rem; align-items: center; }
.share-icons a, .share-icons button {
    display: flex; align-items: center; justify-content: center; width: 36px; height: 36px;
    border-radius: 50%; color: #fff; border: none; padding: 0; cursor: pointer;
}
.share-icons .whatsapp { background: #25D366; }
.share-icons .facebook { background: #1877F2; }
.share-icons .x { background: #111; }
.share-icons .email { background: #777; }
.share-icons .copy { background: #999; }

/* Archive List */
.archive-year { font-family: var(--font-heading); font-size: 1.5rem; margin-top: 2.5rem; margin-bottom: 1rem; border-bottom: 1px solid var(--border-color); padding-bottom: 0.5rem; }
.archive-item { margin-bottom: 1.5rem; padding-left: 1rem; border-left: 2px solid var(--border-color); }
.archive-item h3 { font-size: 1.4rem; margin-bottom: 0.3rem; }
.archive-item .date { font-size: 0.9rem; color: var(--muted-color); }

/* Forms */
input, textarea, select { width: 100%; padding: 0.8rem; margin-bottom: 1rem; border: 1px solid var(--border-color); background: var(--card-bg); color: var(--text-color); font-family: var(--font-body); font-size: 1rem; }
button { background: var(--text-color); color: var(--bg-color); border: none; padding: 0.8rem 1.5rem; cursor: pointer; font-family: var(--font-heading); text-transform: uppercase; letter-spacing: 0.05em; transition: background 0.3s; }
button:hover { background: var(--accent-color); }

/* Comentários */
.comments-section h3 { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.4rem; }
.comments-intro { color: var(--muted-color); font-size: 0.95rem; margin-bottom: 1.5rem; }
.comment-form { display: grid; grid-template-columns: 1fr 1fr 1.6fr; gap: 0 1rem; margin-bottom: 0.5rem; }
.comment-form .field { display: flex; flex-direction: column; }
.comment-form label { font-size: 0.8rem; color: var(--muted-color); margin-bottom: 0.3rem; }
.comment-form textarea { min-height: 100%; }
.comment-consent-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin: 0.5rem 0 2rem; }
.comment-consent { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; color: var(--muted-color); }
.comment-consent input[type="checkbox"] { width: auto; margin: 0; }
.comment-consent-row button { width: auto; }
.comments-list-empty {
    display: flex; align-items: center; gap: 0.6rem; background: var(--card-bg); border: 1px solid var(--border-color);
    padding: 1rem; border-radius: 4px; color: var(--muted-color); font-size: 0.95rem;
}
.comment-item { margin-bottom: 1.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border-color); }

/* Responsive */
@media (max-width: 900px) {
    .sidebar {
        position: fixed; left: -300px; top: 0; z-index: 60; width: 280px;
        transition: left 0.25s ease; box-shadow: 2px 0 20px rgba(0,0,0,0.35);
    }
    .sidebar.active { left: 0; }
    .mobile-sidebar-toggle { display: inline-flex; align-items: center; justify-content: center; }
    .sidebar-overlay.active {
        display: block; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 50;
    }
    .article-title { font-size: 2rem; }
    .comment-form { grid-template-columns: 1fr; }
    .topbar { padding: 1rem; }
    .container { padding: 2rem 1.2rem; }
    .lang-select span { display: none; }
}

/* Honeypot for spam */
.hp-field { display: none !important; }
