:root {
    --brand-red: #ff4b42;
    --brand-red-dark: #e0392f;
    --dark-bg: #0f0f13;
    --panel-bg: #1f2937;
    --text-light: #eeeeee;
    --text-muted: #a4b0be;
    --text-body: #333;
    --border-color: #e5e7eb;
    --success: #10b981;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text-body);
    background: #f7f7f9;
    line-height: 1.6;
}

h1, h2, h3, h4, .brand {
    font-family: 'Poppins', 'Inter', sans-serif;
    font-weight: 700;
}

a { color: var(--brand-red); text-decoration: none; }
a:hover { color: var(--brand-red-dark); }

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

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.site-header {
    background: var(--dark-bg);
    padding: 18px 0;
    position: sticky;
    top: 0;
    z-index: 50;
}

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

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    color: var(--text-light);
}

.brand img { height: 32px; width: auto; }

.brand .accent { color: var(--brand-red); }

.site-nav { display: flex; gap: 24px; flex-wrap: wrap; }

.site-nav a {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 14px;
}

.site-nav a:hover, .site-nav a.active { color: var(--text-light); }

.search-form { display: flex; }

.search-form input {
    background: #292f3d;
    border: 1px solid #374151;
    color: var(--text-light);
    padding: 8px 12px;
    border-radius: 6px 0 0 6px;
    font-size: 14px;
    width: 180px;
}

.search-form button {
    background: var(--brand-red);
    border: none;
    color: #fff;
    padding: 0 14px;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
}

/* Hero */
.hero {
    background: linear-gradient(135deg, var(--dark-bg) 0%, #1a1a22 100%);
    color: var(--text-light);
    padding: 56px 0;
    text-align: center;
}

.hero h1 { font-size: 32px; margin: 0 0 12px; }
.hero p { color: var(--text-muted); max-width: 600px; margin: 0 auto; }

/* Layout */
.page { padding: 40px 0 60px; }

.category-chips {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 32px;
}

.chip {
    background: #fff;
    border: 1px solid var(--border-color);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 13px;
    color: var(--text-body);
}

.chip:hover, .chip.active {
    background: var(--brand-red);
    border-color: var(--brand-red);
    color: #fff;
}

.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.post-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: transform .15s, box-shadow .15s;
}

.post-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(0,0,0,.08);
}

.post-card .thumb {
    aspect-ratio: 16/9;
    background: #eee;
    position: relative;
    overflow: hidden;
}

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

.badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--brand-red);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 9px;
    border-radius: 999px;
    text-transform: uppercase;
}

.play-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.25);
}

.play-icon::before {
    content: '';
    width: 0; height: 0;
    border-left: 18px solid #fff;
    border-top: 11px solid transparent;
    border-bottom: 11px solid transparent;
    margin-left: 4px;
}

.post-card .body { padding: 18px; flex: 1; display: flex; flex-direction: column; }

.post-card .category { font-size: 12px; font-weight: 600; color: var(--brand-red); text-transform: uppercase; margin-bottom: 6px; }

.post-card h3 { font-size: 17px; margin: 0 0 8px; color: #111; }

.post-card p { font-size: 14px; color: #666; flex: 1; margin: 0 0 12px; }

.post-meta { font-size: 12px; color: #999; display: flex; justify-content: space-between; }

.empty-state { text-align: center; padding: 60px 20px; color: #888; }

/* Post detail */
.post-detail { max-width: 760px; margin: 0 auto; }
.post-detail .category { color: var(--brand-red); font-weight: 600; font-size: 13px; text-transform: uppercase; }
.post-detail h1 { font-size: 30px; margin: 8px 0 12px; }
.post-detail .post-meta { margin-bottom: 24px; color: #888; font-size: 14px; }
.post-detail .cover { border-radius: 10px; margin-bottom: 28px; }
.post-detail .content { font-size: 16px; color: #222; }
.post-detail .content img { border-radius: 8px; margin: 16px 0; }
.post-detail .content h2, .post-detail .content h3 { margin-top: 28px; }
.video-embed { position: relative; padding-bottom: 56.25%; height: 0; margin-bottom: 28px; border-radius: 10px; overflow: hidden; background: #000; }
.video-embed iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }

.back-link { display: inline-block; margin-bottom: 20px; font-size: 14px; color: #666; }

/* Footer */
.site-footer {
    background: var(--dark-bg);
    color: var(--text-muted);
    padding: 32px 0;
    margin-top: 60px;
    text-align: center;
    font-size: 13px;
}
.site-footer .brand { justify-content: center; margin-bottom: 10px; }

/* Pagination */
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 40px; }
.pagination a, .pagination span {
    padding: 8px 14px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-body);
    background: #fff;
}
.pagination a:hover { border-color: var(--brand-red); color: var(--brand-red); }
.pagination .current { background: var(--brand-red); color: #fff; border-color: var(--brand-red); }

/* Admin */
.admin-body { background: #f1f2f6; font-family: 'Inter', sans-serif; }

.admin-login {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--dark-bg);
}

.admin-login-box {
    background: #171720;
    padding: 40px;
    border-radius: 12px;
    width: 100%;
    max-width: 360px;
    text-align: center;
}

.admin-login-box img { height: 40px; margin: 0 auto 20px; }

.admin-login-box h1 { color: var(--text-light); font-size: 20px; margin-bottom: 24px; }

.form-group { margin-bottom: 16px; text-align: left; }
.form-group label { display: block; font-size: 13px; margin-bottom: 6px; font-weight: 500; }
.admin-login-box .form-group label { color: var(--text-muted); }

.form-control {
    width: 100%;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid #374151;
    font-size: 14px;
    background: #fff;
}

.admin-login-box .form-control { background: #22222c; border-color: #374151; color: var(--text-light); }

.btn {
    display: inline-block;
    background: var(--brand-red);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
}
.btn:hover { background: var(--brand-red-dark); color: #fff; }
.btn-secondary { background: #6b7280; }
.btn-secondary:hover { background: #4b5563; }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-danger { background: #dc2626; }

.error-msg { background: #fee2e2; color: #b91c1c; padding: 10px 14px; border-radius: 6px; font-size: 13px; margin-bottom: 16px; }
.success-msg { background: #d1fae5; color: #047857; padding: 10px 14px; border-radius: 6px; font-size: 13px; margin-bottom: 16px; }

.admin-shell { display: flex; min-height: 100vh; }

.admin-sidebar {
    width: 220px;
    background: var(--dark-bg);
    color: var(--text-light);
    padding: 20px 0;
    flex-shrink: 0;
}

.admin-sidebar .brand { padding: 0 20px 20px; font-size: 16px; }
.admin-sidebar .brand img { height: 26px; }

.admin-sidebar nav a {
    display: block;
    padding: 12px 20px;
    color: var(--text-muted);
    font-size: 14px;
    border-left: 3px solid transparent;
}
.admin-sidebar nav a:hover, .admin-sidebar nav a.active {
    background: #1a1a22;
    color: var(--text-light);
    border-left-color: var(--brand-red);
}

.admin-main { flex: 1; padding: 28px 32px; }

.admin-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.admin-topbar h1 { font-size: 22px; margin: 0; }

.card { background: #fff; border-radius: 10px; padding: 24px; border: 1px solid var(--border-color); }

table { width: 100%; border-collapse: collapse; }
table th, table td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--border-color); font-size: 14px; }
table th { font-size: 12px; text-transform: uppercase; color: #888; }

.status-tag { font-size: 11px; padding: 3px 9px; border-radius: 999px; font-weight: 600; text-transform: uppercase; }
.status-publicado { background: #d1fae5; color: #047857; }
.status-rascunho { background: #fef3c7; color: #92400e; }

.actions { display: flex; gap: 8px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

textarea.form-control { min-height: 320px; font-family: monospace; resize: vertical; }

@media (max-width: 768px) {
    .site-nav { display: none; }
    .admin-shell { flex-direction: column; }
    .admin-sidebar { width: 100%; }
    .form-row { grid-template-columns: 1fr; }
}
