/* ============ Bhauu Blogs - Public Styles ============ */
:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --text: #1f2937;
    --text-light: #6b7280;
    --bg: #f9fafb;
    --card: #ffffff;
    --border: #e5e7eb;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.05);
}

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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.7;
}

img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* ---------- Header ---------- */
.site-header {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 14px;
    padding-bottom: 14px;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand-mark {
    width: 38px; height: 38px;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    color: #fff;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-size: 1.2rem;
}
.site-nav { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.site-nav > a { color: var(--text); font-weight: 500; }
.site-nav > a:hover { color: var(--primary); text-decoration: none; }
.nav-toggle { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; }

.search-form { display: flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; background: var(--bg); }
.search-form input { border: none; background: none; padding: 8px 14px; outline: none; width: 160px; }
.search-form button { border: none; background: none; padding: 8px 12px; cursor: pointer; }

/* ---------- Hero / Featured ---------- */
.hero { margin-top: 28px; }
.featured-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-auto-rows: 220px;
    gap: 16px;
}
.featured-main { grid-row: span 2; }
.featured-card { position: relative; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.featured-card a { display: block; height: 100%; }
.featured-card img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.featured-card:hover img { transform: scale(1.04); }
.featured-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,.78) 10%, rgba(0,0,0,.05) 65%);
    display: flex; flex-direction: column; justify-content: flex-end;
    padding: 20px; color: #fff;
}
.featured-overlay h2 { font-size: 1.15rem; line-height: 1.35; margin: 8px 0 4px; }
.featured-main .featured-overlay h2 { font-size: 1.6rem; }
.featured-overlay .meta { font-size: .8rem; opacity: .85; }

/* ---------- Layout ---------- */
.content-with-sidebar {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 36px;
    margin: 40px auto 60px;
    align-items: start;
}
.section-title {
    font-size: 1.5rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--primary);
    display: inline-block;
}
.archive-desc { color: var(--text-light); margin-bottom: 20px; }
.empty-note { color: var(--text-light); padding: 30px 0; }

/* ---------- Post cards ---------- */
.post-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.post-grid.grid-3 { grid-template-columns: repeat(3, 1fr); }
.post-card {
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform .25s, box-shadow .25s;
    display: flex;
    flex-direction: column;
}
.post-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.card-thumb { aspect-ratio: 16/9; overflow: hidden; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-body h3 { font-size: 1.1rem; line-height: 1.4; }
.card-body h3 a { color: var(--text); }
.card-body h3 a:hover { color: var(--primary); text-decoration: none; }
.card-body p { color: var(--text-light); font-size: .92rem; flex: 1; }
.meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: .8rem; color: var(--text-light); }

.badge {
    display: inline-block;
    background: var(--primary);
    color: #fff !important;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .4px;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 999px;
    width: fit-content;
}
.badge:hover { background: var(--primary-dark); text-decoration: none; }

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: 8px; margin-top: 32px; flex-wrap: wrap; }
.page-link {
    padding: 8px 14px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-weight: 500;
}
.page-link:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.page-link.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- Sidebar ---------- */
.sidebar { display: flex; flex-direction: column; gap: 24px; }
.widget { background: var(--card); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.widget-title { font-size: 1.05rem; margin-bottom: 14px; padding-bottom: 8px; border-bottom: 2px solid var(--primary); display: inline-block; }
.popular-list { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.popular-list a { display: flex; gap: 12px; align-items: center; color: var(--text); }
.popular-list a:hover { text-decoration: none; color: var(--primary); }
.popular-list img { width: 64px; height: 48px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.popular-list strong { font-size: .88rem; line-height: 1.35; display: block; }
.popular-list small { color: var(--text-light); }
.cat-list { list-style: none; }
.cat-list li { padding: 7px 0; border-bottom: 1px dashed var(--border); }
.cat-list li:last-child { border-bottom: none; }
.cat-list a { color: var(--text); display: flex; justify-content: space-between; }
.cat-list a:hover { color: var(--primary); text-decoration: none; }
.cat-list span { color: var(--text-light); }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-pill {
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 4px 12px;
    border-radius: 999px;
    font-size: .82rem;
    color: var(--text);
}
.tag-pill:hover { background: var(--primary); border-color: var(--primary); color: #fff; text-decoration: none; }

/* ---------- Single post ---------- */
.single-post { max-width: 800px; margin: 40px auto 60px; }
.post-header { text-align: center; margin-bottom: 28px; }
.post-header h1 { font-size: 2.2rem; line-height: 1.25; margin: 14px 0 12px; }
.post-header .meta { justify-content: center; }
.post-hero-img { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 28px; }
.post-content { font-size: 1.08rem; }
.post-content p { margin-bottom: 1.2em; }
.post-content h2, .post-content h3 { margin: 1.6em 0 .6em; line-height: 1.3; }
.post-content ul, .post-content ol { margin: 0 0 1.2em 1.4em; }
.post-content img { border-radius: 10px; margin: 1em auto; }
.post-content blockquote {
    border-left: 4px solid var(--primary);
    background: var(--card);
    padding: 14px 20px;
    margin: 1.2em 0;
    border-radius: 0 10px 10px 0;
    color: var(--text-light);
    font-style: italic;
}
.post-content pre {
    background: #1f2937; color: #e5e7eb;
    padding: 16px; border-radius: 10px;
    overflow-x: auto; margin: 1.2em 0;
    font-size: .9rem;
}
.post-content code { background: #eef2ff; color: var(--primary-dark); padding: 2px 6px; border-radius: 5px; font-size: .9em; }
.post-content pre code { background: none; color: inherit; padding: 0; }
.post-tags { margin: 28px 0 0; }

.share-bar {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    margin: 28px 0;
    padding: 14px 18px;
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    font-size: .9rem;
}
.share-bar span { font-weight: 600; }
.share-bar a { font-weight: 500; }

.author-box {
    display: flex; gap: 16px; align-items: center;
    background: var(--card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    margin: 28px 0;
}
.author-avatar, .comment-avatar {
    width: 52px; height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    color: #fff;
    display: grid; place-items: center;
    font-size: 1.3rem; font-weight: 700;
    flex-shrink: 0;
}
.author-box p { color: var(--text-light); font-size: .92rem; }

.related-posts { margin: 40px 0; }
.related-posts h3 { margin-bottom: 16px; }

/* ---------- Comments ---------- */
.comments { margin-top: 44px; }
.comments h3 { margin-bottom: 20px; }
.comment { display: flex; gap: 14px; margin-bottom: 22px; }
.comment-avatar { width: 44px; height: 44px; font-size: 1.1rem; }
.comment-body { flex: 1; }
.comment-head { display: flex; gap: 10px; align-items: baseline; }
.comment-head small { color: var(--text-light); }
.comment-body p { font-size: .95rem; margin: 4px 0 6px; }
.comment-reply { margin-top: 16px; margin-bottom: 0; }
.reply-btn { background: none; border: none; color: var(--primary); cursor: pointer; font-size: .82rem; font-weight: 600; padding: 0; }

.comment-form { background: var(--card); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); margin-top: 30px; }
.comment-form h4 { margin-bottom: 14px; }
.replying-note { font-size: .85rem; color: var(--text-light); margin-bottom: 10px; }
.replying-note button { background: none; border: none; color: #dc2626; cursor: pointer; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.comment-form input, .comment-form textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
    background: var(--bg);
}
.comment-form input:focus, .comment-form textarea:focus { outline: 2px solid var(--primary); border-color: transparent; }
.comment-form textarea { margin-bottom: 14px; resize: vertical; }
.hp-field { position: absolute !important; left: -9999px !important; height: 0; width: 0; opacity: 0; }

.btn {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 11px 24px;
    border-radius: 8px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
}
.btn:hover { background: var(--primary-dark); text-decoration: none; }

/* ---------- Alerts ---------- */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: .92rem; }
.alert-success { background: #dcfce7; color: #166534; }
.alert-error { background: #fee2e2; color: #991b1b; }

/* ---------- 404 ---------- */
.error-box { text-align: center; padding: 80px 20px; }
.error-box h1 { font-size: 5rem; color: var(--primary); }
.error-box p { color: var(--text-light); margin: 10px 0 24px; }

/* ---------- Footer ---------- */
.site-footer { background: #111827; color: #d1d5db; margin-top: auto; }
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 36px;
    padding: 44px 20px;
}
.site-footer h3, .site-footer h4 { color: #fff; margin-bottom: 12px; }
.site-footer p { font-size: .9rem; color: #9ca3af; }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { color: #9ca3af; font-size: .9rem; }
.footer-links a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid #1f2937; padding: 16px 0; font-size: .85rem; }
.footer-bottom .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.admin-link { color: #6b7280; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .content-with-sidebar { grid-template-columns: 1fr; }
    .featured-grid { grid-template-columns: 1fr; grid-auto-rows: 240px; }
    .featured-main { grid-row: span 1; }
    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 640px) {
    .post-grid, .post-grid.grid-3 { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .nav-toggle { display: block; }
    .site-nav { display: none; width: 100%; flex-direction: column; align-items: flex-start; gap: 12px; padding: 10px 0; }
    .site-nav.open { display: flex; }
    .search-form input { width: 100%; }
    .post-header h1 { font-size: 1.6rem; }
}
