/*
Theme Name: Brainx Lite
Theme URI: https://brainx.click
Author: Brainx Team
Description: Lightweight, fast, and SEO-optimized news theme.
Version: 5.0.0
License: GNU General Public License v2
Text Domain: brainx
*/

/* === CSS VARIABLES === */
:root {
    --primary: #e31b23;
    --primary-dark: #b31217;
    --bg-main: #f8fafc;
    --bg-alt: #ffffff;
    --surface: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow: 0 2px 8px rgba(0,0,0,0.06);
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --radius: 10px;
}

[data-theme="dark"] {
    --bg-main: #0f172a;
    --bg-alt: #1e293b;
    --surface: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: #334155;
    --shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* === BASE STYLES === */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-body);
    color: var(--text-main);
    background: var(--bg-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; transition: 0.3s; }
img { max-width: 100%; height: auto; display: block; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }

/* === HEADER === */
.site-header {
    background: var(--surface);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
}

.logo h1 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 800;
}

.logo h1 a { color: var(--text-main); }
.logo h1 span { color: var(--primary); }

.main-navigation ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.main-navigation a {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.main-navigation a:hover { color: var(--primary); }

.header-actions {
    display: flex;
    gap: 0.5rem;
}

.glass-btn, .icon-btn {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius);
    transition: 0.3s;
}

.glass-btn:hover, .icon-btn:hover { background: var(--bg-main); }

[data-theme="dark"] .sun-icon,
[data-theme="light"] .moon-icon { display: none; }

/* Search Form */
.inline-search-wrap {
    display: none;
    background: var(--bg-main);
    padding: 1rem 0;
    border-top: 1px solid var(--border);
}

.inline-search-wrap.active { display: block; }

.search-form-inline {
    display: flex;
    gap: 0.5rem;
}

.search-input-inline {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text-main);
    font-size: 1rem;
}

.search-submit-inline {
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
}

/* === BREADCRUMBS === */
.breadcrumb-nav {
    padding: 1rem 0;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.breadcrumb-nav a { color: var(--primary); font-weight: 600; }
.breadcrumb-nav .sep { margin: 0 0.5rem; }

/* === MAIN LAYOUT === */
.main-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
    padding: 2rem 0;
}

@media (max-width: 900px) {
    .main-layout { grid-template-columns: 1fr; }
}

/* === HERO GRID === */
.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 300px 200px;
    gap: 1rem;
    margin-bottom: 2rem;
}

.hero-big {
    grid-column: 1 / -1;
    grid-row: 1;
}

.hero-small { grid-row: 2; }

.card {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumb-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: white;
}

.cat-tag {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.thumb-overlay h2 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    line-height: 1.3;
}

/* === NEWS LIST === */
.section-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--primary);
    display: inline-block;
}

.list-item {
    display: flex;
    gap: 1rem;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border);
}

.post-thumbnail-mini {
    width: 200px;
    height: 130px;
    border-radius: var(--radius);
    overflow: hidden;
    flex-shrink: 0;
}

.post-thumbnail-mini img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.item-content { flex: 1; }

.cat-link a {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.875rem;
}

.item-content h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    margin: 0.5rem 0;
    line-height: 1.4;
}

.entry-meta {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.entry-excerpt {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* === SINGLE POST === */
.single-post-content {
    background: var(--surface);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.entry-header-single { margin-bottom: 1.5rem; }

.entry-header-single h1 {
    font-family: var(--font-heading);
    font-size: 2rem;
    line-height: 1.3;
    margin: 1rem 0;
}

.featured-image-single {
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.entry-content {
    font-size: 1.1rem;
    line-height: 1.8;
}

.entry-content p { margin-bottom: 1.5rem; }

/* === SIDEBAR === */
.widget-area { position: sticky; top: 100px; }

.widget {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.widget-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
}

.mini-post {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

.mini-post:last-child { border-bottom: none; }

.mini-thumb {
    width: 70px;
    height: 70px;
    border-radius: var(--radius);
    overflow: hidden;
    flex-shrink: 0;
}

.mini-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mini-info h4 {
    font-size: 0.95rem;
    line-height: 1.4;
    margin-bottom: 0.25rem;
}

.mini-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* === FOOTER === */
.site-footer {
    background: var(--surface);
    padding: 3rem 0 1rem;
    margin-top: 3rem;
    border-top: 1px solid var(--border);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .footer-grid { grid-template-columns: 1fr; }
}

.footer-section h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.footer-section p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.footer-links {
    list-style: none;
}

.footer-links li { margin-bottom: 0.5rem; }

.footer-links a {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.footer-links a:hover { color: var(--primary); }

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* === PAGINATION === */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.pagination a, .pagination span {
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text-main);
}

.pagination .current {
    background: var(--primary);
    color: white;
}

/* === MOBILE MENU === */
@media (max-width: 768px) {
    .main-navigation { display: none; }
    
    .hero-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }
    
    .hero-big, .hero-small { grid-column: 1; grid-row: auto; }
    
    .list-item { flex-direction: column; }
    
    .post-thumbnail-mini {
        width: 100%;
        height: 200px;
    }
    
    .single-post-content { padding: 1rem; }
    
    .entry-header-single h1 { font-size: 1.5rem; }
}
