/* ── Palette (dark + green) ───────────────────────────── */
:root {
    --accent:       #10b981;
    --accent-hover: #059669;
    --accent-light: #064e3b;
    --accent-text:  #34d399;
    --bg:           #0f172a;
    --panel:        #1e293b;
    --panel-2:      #263548;
    --ink:          #e2e8f0;
    --muted:        #94a3b8;
    --border:       #2d3f55;
    --shadow:       0 1px 4px rgba(0,0,0,.4), 0 4px 20px rgba(16,185,129,.08);
}

/* ── Base ─────────────────────────────────────────────── */
body        { background: var(--bg); color: var(--ink); }
a           { color: var(--accent-text); }
a:hover     { color: var(--accent); }

/* ── Bootstrap dark overrides ─────────────────────────── */
.card           { background: var(--panel); border-color: var(--border); }
.card-footer    { border-color: var(--border); }
.list-group-item { background: var(--panel); border-color: var(--border); }
.form-control, .form-select {
    background: var(--panel-2);
    border-color: var(--border);
    color: var(--ink);
}
.form-control:focus, .form-select:focus {
    background: var(--panel-2);
    border-color: var(--accent);
    color: var(--ink);
    box-shadow: 0 0 0 .2rem rgba(16,185,129,.25);
}
.input-group-text { background: var(--panel-2); border-color: var(--border); color: var(--muted); }

/* ── Accent buttons ───────────────────────────────────── */
.btn-accent {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.btn-accent:hover, .btn-accent:focus {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: #fff;
}
.text-accent  { color: var(--accent-text) !important; }
.badge-accent { background: var(--accent); color: #fff; border-radius: .5rem; }
.badge-category {
    background: var(--accent-light);
    color: var(--accent-text);
    font-weight: 600;
    border-radius: .4rem;
    font-size: .72rem;
}
.letter-spacing-1 { letter-spacing: .06em; }

/* ── Navbar ───────────────────────────────────────────── */
.site-navbar {
    background: rgba(15,23,42,.92) !important;
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}
.site-navbar .navbar-brand { color: var(--ink); font-size: 1.15rem; }
.site-navbar .nav-link     { color: var(--muted); font-size: .9rem; }
.site-navbar .nav-link:hover { color: var(--accent-text); }
.site-navbar .navbar-toggler-icon {
    filter: invert(1);
}
.brand-icon {
    width: 36px; height: 36px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 10px;
    background: var(--accent-light);
    color: var(--accent-text);
    font-size: 1.15rem;
}

/* ── Hero ─────────────────────────────────────────────── */
.hero-section {
    background: linear-gradient(135deg, #0a1f14 0%, #0f172a 50%, #0a1628 100%);
    border-bottom: 1px solid var(--border);
}
.hero-section h1 { color: var(--ink); }

/* ── Cards ────────────────────────────────────────────── */
.card {
    border-radius: 1rem;
    box-shadow: var(--shadow);
    transition: transform .15s ease, box-shadow .15s ease;
}
.article-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 24px rgba(16,185,129,.18);
}
.article-card-img {
    height: 190px;
    object-fit: cover;
    border-radius: 1rem 1rem 0 0;
}
.article-row-card   { border-radius: 1rem; overflow: hidden; }
.article-row-img    { width: 100%; height: 100%; min-height: 140px; object-fit: cover; display: block; }

/* ── Article page ─────────────────────────────────────── */
.article-featured-img {
    max-height: 420px;
    object-fit: cover;
    border-radius: 1rem;
    box-shadow: var(--shadow);
}
.article-content { line-height: 1.8; font-size: 1.05rem; }
.article-content pre {
    position: relative; margin: 1.5rem 0; padding: 0;
    overflow: auto; border: 1px solid var(--border);
    border-radius: .75rem; background: #0d1b2a;
}
.article-content pre code.hljs,
.article-content pre code {
    display: block; margin-left: 3.5rem;
    padding: 1rem 1.1rem; font-size: .9rem; line-height: 1.6;
}
.article-content .code-line-numbers {
    position: absolute; top: 0; left: 0;
    width: 3.5rem; height: 100%;
    padding: 1rem .75rem; border-right: 1px solid var(--border);
    color: var(--muted); background: #0a1520;
    text-align: right; font-size: .9rem; line-height: 1.6;
    white-space: pre; user-select: none;
}
.article-content :not(pre) > code {
    padding: .15rem .4rem; border-radius: .35rem;
    background: var(--accent-light); color: var(--accent-text); font-size: .9em;
}
.article-content .table-wrap { overflow-x: auto; margin: 1.25rem 0; }
.article-content .table-wrap table {
    width: 100%; border-collapse: collapse;
    border: 1px solid var(--border); border-radius: .75rem; overflow: hidden;
}
.article-content .table-wrap th,
.article-content .table-wrap td {
    padding: .75rem .9rem; border-bottom: 1px solid var(--border);
    text-align: left; vertical-align: top;
}
.article-content .table-wrap thead th { background: var(--accent-light); color: var(--accent-text); }

/* ── Sidebar ──────────────────────────────────────────── */
.sidebar-category-link { color: var(--ink); transition: background .12s; }
.sidebar-category-link:hover { background: var(--accent-light); color: var(--accent-text); }

/* ── Footer ───────────────────────────────────────────── */
.site-footer { background: var(--panel); border-top: 1px solid var(--border); }
.hover-accent:hover { color: var(--accent-text) !important; }

/* ── Newsletter ───────────────────────────────────────── */
.newsletter-card { background: var(--accent-light); border: 1px solid #065f46; }
.newsletter-feedback.is-success { color: #34d399; }
.newsletter-feedback.is-error   { color: #f87171; }

/* ── Pagination ───────────────────────────────────────── */
.page-link { background: var(--panel-2); border-color: var(--border); color: var(--ink); }
.page-link:hover { background: var(--accent-light); color: var(--accent-text); border-color: var(--accent); }
.page-item.disabled .page-link { background: var(--panel); color: var(--muted); }

/* ── Hero article ─────────────────────────────────────── */
.article-hero-img {
    height: 280px;
    object-fit: cover;
    border-radius: 1rem 1rem 0 0;
}
.article-side-img {
    border-radius: 1rem 0 0 1rem;
    min-height: 90px;
}

/* ── Light theme overrides ────────────────────────────── */
[data-bs-theme="light"] {
    --bg:      #f8f9fb;
    --panel:   #ffffff;
    --panel-2: #f1f5f9;
    --ink:     #1e293b;
    --muted:   #64748b;
    --border:  #e2e8f0;
    --shadow:  0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(16,185,129,.07);
    --accent-light: #d1fae5;
    --accent-text:  #059669;
}
[data-bs-theme="light"] body        { background: var(--bg); }
[data-bs-theme="light"] .site-navbar { background: rgba(255,255,255,.92) !important; }
[data-bs-theme="light"] .hero-section {
    background: linear-gradient(135deg, #d1fae5 0%, #f8f9fb 60%, #ecfdf5 100%);
}
[data-bs-theme="light"] .site-footer { background: #fff; }
[data-bs-theme="light"] .newsletter-card { background: #d1fae5; border-color: #6ee7b7; }
[data-bs-theme="light"] .article-content pre { background: #f8fafc; }
[data-bs-theme="light"] .article-content .code-line-numbers { background: #f1f5f9; color: #64748b; }
[data-bs-theme="light"] .article-content :not(pre) > code { background: #d1fae5; color: #059669; }
[data-bs-theme="light"] .badge-category { background: #d1fae5; color: #059669; }

/* ── Dark theme overrides ─────────────────────────────── */
[data-bs-theme="dark"] {
    --bg:      #0f172a;
    --panel:   #1e293b;
    --panel-2: #263548;
    --ink:     #e2e8f0;
    --muted:   #94a3b8;
    --border:  #2d3f55;
    --shadow:  0 1px 4px rgba(0,0,0,.4), 0 4px 20px rgba(16,185,129,.08);
    --accent-light: #064e3b;
    --accent-text:  #34d399;
}
[data-bs-theme="dark"] body         { background: var(--bg); }
[data-bs-theme="dark"] .site-navbar { background: rgba(15,23,42,.92) !important; }
[data-bs-theme="dark"] .hero-section {
    background: linear-gradient(135deg, #0a1f14 0%, #0f172a 50%, #0a1628 100%);
}
[data-bs-theme="dark"] .site-footer { background: var(--panel); }
[data-bs-theme="dark"] .newsletter-card { background: var(--accent-light); border-color: #065f46; }
[data-bs-theme="dark"] .article-content pre { background: #0d1b2a; }
[data-bs-theme="dark"] .article-content .code-line-numbers { background: #0a1520; color: var(--muted); }
[data-bs-theme="dark"] .article-content :not(pre) > code { background: var(--accent-light); color: var(--accent-text); }
[data-bs-theme="dark"] .badge-category { background: var(--accent-light); color: var(--accent-text); }

/* ── Imagens proporção 3:2 ────────────────────────────── */
.article-hero-img,
.article-card-img,
.article-side-grid-img {
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
}
.article-hero-img       { border-radius: 1rem 1rem 0 0; }
.article-card-img       { border-radius: 1rem 1rem 0 0; }
.article-side-grid-img  { border-radius: 1rem 1rem 0 0; }

.article-side-thumb {
    border-radius: 1rem 0 0 1rem;
    min-height: 72px;
    display: block;
}
