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

:root {
    --color-bg: #0d0d1a;
    --color-bg-alt: #151528;
    --color-surface: #1a1a35;
    --color-surface-hover: #222245;
    --color-border: #2a2a4a;
    --color-text: #c8c8e0;
    --color-text-muted: #8888aa;
    --color-heading: #e8e8ff;
    --color-primary: #7c6cf0;
    --color-primary-hover: #9a8df5;
    --color-accent: #c4a6ff;
    --color-link: #9b8aff;
    --color-link-hover: #c4b5ff;
    --font-body: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-heading: Georgia, 'Times New Roman', serif;
    --max-width: 1200px;
    --max-width-narrow: 780px;
    --radius: 8px;
    --shadow: 0 2px 12px rgba(0,0,0,0.3);
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main { flex: 1; }

a { color: var(--color-link); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--color-link-hover); }

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

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    color: var(--color-heading);
    line-height: 1.3;
}

h1 { font-size: 2.2rem; margin-bottom: 0.5em; }
h2 { font-size: 1.6rem; margin: 1.5em 0 0.5em; }
h3 { font-size: 1.3rem; margin: 1.2em 0 0.4em; }

/* ==================== LAYOUT ==================== */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }
.container-narrow { max-width: var(--max-width-narrow); }

/* ==================== HEADER ==================== */
.site-header {
    background: var(--color-bg-alt);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0.8rem 0;
}

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

.logo {
    display: flex;
    align-items: center;
}
.logo:hover { opacity: 0.85; }
.logo-img { height: 40px; width: auto; }

.main-nav {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.main-nav a {
    color: var(--color-text-muted);
    font-size: 0.95rem;
    transition: color 0.2s;
}
.main-nav a:hover { color: var(--color-heading); }

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}
.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-text);
    transition: transform 0.2s;
}

/* ==================== HERO ==================== */
.hero {
    background: linear-gradient(135deg, var(--color-bg-alt), #1a1040, var(--color-bg-alt));
    padding: 4rem 0;
    text-align: center;
    border-bottom: 1px solid var(--color-border);
}

.hero h1 {
    font-size: 2.8rem;
    color: var(--color-accent);
    margin-bottom: 0.5rem;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--color-text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* ==================== SECTIONS ==================== */
.categories-section, .posts-section, .related-posts {
    padding: 3rem 0;
}

.section-subtitle {
    color: var(--color-text-muted);
    margin-bottom: 2rem;
}

/* ==================== CATEGORIES GRID ==================== */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.category-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    transition: background 0.2s, border-color 0.2s;
}
.category-card:hover {
    background: var(--color-surface-hover);
    border-color: var(--color-primary);
    color: var(--color-heading);
}
.category-name { font-weight: 600; color: var(--color-heading); }
.category-count { font-size: 0.85rem; color: var(--color-text-muted); }

/* ==================== POSTS GRID ==================== */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.post-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}
.post-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.post-card-image {
    display: block;
    aspect-ratio: 16/9;
    overflow: hidden;
}
.post-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}
.post-card:hover .post-card-image img { transform: scale(1.05); }

.post-card-body { padding: 1.2rem; }
.post-card-body h3 { font-size: 1.15rem; margin-bottom: 0.5rem; }
.post-card-body h3 a { color: var(--color-heading); }
.post-card-body h3 a:hover { color: var(--color-primary); }
.post-card-body p {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-category {
    display: inline-block;
    font-size: 0.8rem;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.post-date { font-size: 0.8rem; color: var(--color-text-muted); }

/* ==================== PAGINATION ==================== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
    flex-wrap: wrap;
}
.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.4rem;
    height: 2.4rem;
    padding: 0 0.7rem;
    border-radius: var(--radius);
    background: var(--color-surface);
    color: var(--color-text);
    font-size: 0.9rem;
    transition: background 0.2s, color 0.2s;
}
.pagination-link:hover { background: var(--color-surface-hover); color: var(--color-heading); }
.pagination-current {
    background: var(--color-primary);
    color: #fff;
    font-weight: 600;
}
.pagination-prev, .pagination-next { font-weight: 500; }
.pagination-dots { color: var(--color-text-muted); padding: 0 0.3rem; }

/* ==================== POST SINGLE ==================== */
.post-single { padding: 2rem 0 3rem; }

.post-header { margin-bottom: 2rem; text-align: center; }
.post-header h1 { font-size: 2.4rem; margin-bottom: 0.5rem; }
.post-meta {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.post-featured-image {
    margin-bottom: 2rem;
    border-radius: var(--radius);
    overflow: hidden;
}

.post-content {
    font-size: 1.05rem;
    line-height: 1.8;
}
.post-content p { margin-bottom: 1.2em; }
.post-content h2 { margin-top: 2em; }
.post-content h3 { margin-top: 1.5em; }
.post-content ul, .post-content ol { padding-left: 1.5em; margin-bottom: 1.2em; }
.post-content li { margin-bottom: 0.4em; }
.post-content blockquote {
    border-left: 3px solid var(--color-primary);
    padding: 0.8em 1.2em;
    margin: 1.5em 0;
    background: var(--color-surface);
    border-radius: 0 var(--radius) var(--radius) 0;
    color: var(--color-accent);
    font-style: italic;
}
.post-content code {
    background: var(--color-surface);
    padding: 0.15em 0.4em;
    border-radius: 4px;
    font-size: 0.9em;
}
.post-content pre {
    background: var(--color-surface);
    padding: 1.2em;
    border-radius: var(--radius);
    overflow-x: auto;
    margin: 1.5em 0;
}
.post-content pre code { background: none; padding: 0; }
.post-content .responsive-img {
    border-radius: var(--radius);
    margin: 1.5em 0;
}

/* ==================== FAQ ==================== */
.post-faq { margin-top: 3rem; }
.post-faq h2 { margin-bottom: 1rem; }

.faq-item {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    margin-bottom: 0.8rem;
    overflow: hidden;
}
.faq-item summary {
    padding: 1rem 1.2rem;
    cursor: pointer;
    font-weight: 600;
    color: var(--color-heading);
    list-style: none;
}
.faq-item summary::before { content: '▸ '; color: var(--color-primary); }
.faq-item[open] summary::before { content: '▾ '; }
.faq-item p { padding: 0 1.2rem 1rem; color: var(--color-text); }

/* ==================== TAGS ==================== */
.post-tags {
    margin-top: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.tag {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    text-decoration: none;
    transition: border-color 0.2s, color 0.2s;
}
a.tag:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

/* ==================== SHARE ==================== */
.share-box {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
}
.share-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-right: 0.25rem;
}
.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 1.1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    line-height: 1;
    transition: filter 0.15s, transform 0.1s;
}
.share-btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.share-btn:active { transform: translateY(0); }
.share-whatsapp { background: #25d366; color: #fff; }
.share-facebook { background: #1877f2; color: #fff; }
.share-twitter  { background: #111; color: #fff; }
.share-copy     { background: var(--color-surface); color: var(--color-text); border: 1px solid var(--color-border); }

/* ==================== BREADCRUMB ==================== */
.breadcrumb-nav {
    padding: 1rem 0;
    max-width: var(--max-width);
    margin: 0 auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}
.breadcrumb {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    font-size: 0.85rem;
}
.breadcrumb-item + .breadcrumb-item::before {
    content: '›';
    margin-right: 0.3rem;
    color: var(--color-text-muted);
}
.breadcrumb-item a { color: var(--color-text-muted); }
.breadcrumb-item a:hover { color: var(--color-link); }
.breadcrumb-item.active { color: var(--color-text-muted); }

/* ==================== STATIC PAGES ==================== */
.static-page { padding: 3rem 0; }
.static-page h1 { margin-bottom: 1.5rem; }
.static-page h2 { margin-top: 2rem; margin-bottom: 0.8rem; }
.static-page p { margin-bottom: 1em; }

.btn {
    display: inline-block;
    background: var(--color-primary);
    color: #fff;
    padding: 0.6rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 600;
    transition: background 0.2s;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}
.btn:hover { background: var(--color-primary-hover); color: #fff; }

/* ==================== FORMULÁRIO DE CONTATO ==================== */
.contact-form { margin-top: 2rem; }
.form-group { margin-bottom: 1.2rem; }
.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.4rem;
    font-size: 0.95rem;
}
.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-bg);
    color: var(--color-text);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
}
.form-group textarea { resize: vertical; }
.alert {
    padding: 0.9rem 1.2rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    font-weight: 500;
}
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.alert-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

/* ==================== FOOTER ==================== */
.site-footer {
    background: var(--color-bg-alt);
    border-top: 1px solid var(--color-border);
    padding: 3rem 0 1.5rem;
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-about p {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-top: 0.5rem;
}

.footer-links, .footer-categories {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.footer-links h4, .footer-categories h4 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--color-heading);
}
.footer-links a, .footer-categories a {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}
.footer-links a:hover, .footer-categories a:hover { color: var(--color-link); }

.footer-bottom {
    border-top: 1px solid var(--color-border);
    padding-top: 1.5rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

/* ==================== BACK TO TOP ==================== */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 45px;
    height: 45px;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
    display: none;
    z-index: 99;
    box-shadow: var(--shadow);
    transition: background 0.2s;
}
.back-to-top:hover { background: var(--color-primary-hover); }

/* ==================== HUB / SPOKE (Topic Clusters) ==================== */
.hub-variations {
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: 8px;
}
.hub-variations h2 {
    margin-bottom: 1rem;
    font-size: 1.3rem;
}
.hub-variations-list {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 0.5rem;
}
.hub-variations-list li a {
    display: block;
    padding: 0.6rem 0.8rem;
    border-radius: 6px;
    color: var(--color-accent);
    text-decoration: none;
    transition: background 0.2s;
}
.hub-variations-list li a:hover {
    background: rgba(255,255,255,0.05);
    text-decoration: underline;
}
.spoke-hub-link {
    margin: 1.5rem 0;
    padding: 1rem 1.2rem;
    background: var(--color-bg-alt);
    border-left: 3px solid var(--color-accent);
    border-radius: 0 6px 6px 0;
}
.spoke-hub-link a {
    color: var(--color-accent);
    font-weight: 600;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .hero h1 { font-size: 2rem; }
    .hero { padding: 2.5rem 0; }

    .nav-toggle { display: flex; }
    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--color-bg-alt);
        border-bottom: 1px solid var(--color-border);
        flex-direction: column;
        padding: 1rem 1.5rem;
        gap: 0.8rem;
    }
    .main-nav.active { display: flex; }

    .posts-grid { grid-template-columns: 1fr; }
    .categories-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr; }

    .post-header h1 { font-size: 1.8rem; }

    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.4rem; }

    .hub-variations-list { grid-template-columns: 1fr; }
}
