/* ============================================================
   Final Exposer - Main Stylesheet
   Design inspired by finalexposer.in / FlatNews
   ============================================================ */

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --red:     #e8192c;
    --dark:    #1a1a2e;
    --mid:     #3a3a5c;
    --light:   #f5f5f7;
    --white:   #ffffff;
    --border:  #e0e0e0;
    --text:    #2d2d2d;
    --muted:   #777;
    --radius:  6px;
    --shadow:  0 2px 12px rgba(0,0,0,.08);
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Hind Siliguri', 'Roboto', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: var(--text);
    background: var(--light);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

/* ---------- Container ---------- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* ---------- Header ---------- */
.site-header {
    background: var(--dark);
    color: var(--white);
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    gap: 20px;
}
.site-title { font-size: 26px; font-weight: 700; letter-spacing: -.5px; }
.site-title a { color: var(--white); }
.site-title a:hover { color: #ff6b6b; }
.site-tagline { font-size: 12px; color: rgba(255,255,255,.6); margin-top: 2px; }

/* Nav */
.main-nav ul { list-style: none; display: flex; gap: 6px; }
.main-nav a {
    color: rgba(255,255,255,.85);
    font-size: 14px;
    font-weight: 500;
    padding: 7px 14px;
    border-radius: 4px;
    transition: background .2s;
}
.main-nav a:hover, .main-nav a.active { background: rgba(255,255,255,.15); color: #fff; }
.main-nav .admin-link {
    background: var(--red);
    color: #fff !important;
    border-radius: 4px;
}
.main-nav .admin-link:hover { background: #c0152a; }

/* ---------- Main ---------- */
.site-main { min-height: 70vh; padding: 30px 0 60px; }

/* ---------- Category Bar ---------- */
.category-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border);
}
.cat-btn {
    padding: 5px 14px;
    border: 1.5px solid var(--border);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--mid);
    background: var(--white);
    cursor: pointer;
    transition: all .2s;
}
.cat-btn:hover, .cat-btn.active {
    background: var(--dark);
    color: var(--white);
    border-color: var(--dark);
}

/* ---------- Section Heading ---------- */
.section-heading {
    font-size: 22px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 20px;
    padding-left: 12px;
    border-left: 4px solid var(--red);
}

/* ---------- Posts Grid ---------- */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
    margin-bottom: 40px;
}
.small-grid { grid-template-columns: repeat(3, 1fr); }

/* ---------- Post Card ---------- */
.post-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform .25s, box-shadow .25s;
}
.post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 28px rgba(0,0,0,.13);
}
.card-link { display: block; height: 100%; }

.card-thumb {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #eee;
}
.card-thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .4s;
}
.post-card:hover .card-thumb img { transform: scale(1.06); }
.card-thumb.no-img { background: linear-gradient(135deg, var(--dark), var(--mid)); }

.thumb-placeholder {
    width: 100%; height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--dark), var(--mid));
    color: rgba(255,255,255,.4);
    font-size: 48px;
    font-weight: 700;
}

.card-body { padding: 16px; }

.card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.cat-tag {
    background: var(--red);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 9px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: .4px;
    white-space: nowrap;
}
.post-date { font-size: 12px; color: var(--muted); }
.post-author { font-size: 12px; color: var(--muted); }

.card-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.45;
    color: var(--dark);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color .2s;
}
.post-card:hover .card-title { color: var(--red); }

.card-excerpt {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 10px;
}
.card-author { font-size: 12px; color: #aaa; }

/* ---------- Pagination ---------- */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 30px 0;
    flex-wrap: wrap;
}
.page-btn {
    padding: 8px 16px;
    border: 1.5px solid var(--border);
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    color: var(--mid);
    background: var(--white);
    transition: all .2s;
}
.page-btn:hover, .page-btn.active {
    background: var(--dark);
    color: var(--white);
    border-color: var(--dark);
}

/* ---------- No Posts ---------- */
.no-posts {
    text-align: center;
    padding: 80px 20px;
    color: var(--muted);
    font-size: 18px;
}

/* ---------- Single Post ---------- */
.single-container { padding: 30px 0 60px; }

.single-post {
    background: var(--white);
    border-radius: var(--radius);
    padding: 36px 40px;
    box-shadow: var(--shadow);
    margin-bottom: 40px;
}
.single-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.single-title {
    font-size: 30px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--dark);
    margin-bottom: 24px;
}
.single-thumb {
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 28px;
    max-height: 480px;
}
.single-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.single-content {
    font-size: 17px;
    line-height: 1.9;
    color: #333;
}
.single-content p  { margin-bottom: 18px; }
.single-content h2 { font-size: 24px; font-weight: 700; margin: 32px 0 14px; color: var(--dark); }
.single-content h3 { font-size: 20px; font-weight: 600; margin: 24px 0 10px; color: var(--dark); }
.single-content img { border-radius: var(--radius); margin: 20px 0; max-width: 100%; }
.single-content ul, .single-content ol { padding-left: 24px; margin-bottom: 18px; }
.single-content li { margin-bottom: 6px; }
.single-content a { color: var(--red); text-decoration: underline; }
.single-content blockquote {
    border-left: 4px solid var(--red);
    padding: 12px 20px;
    margin: 20px 0;
    background: #fff5f5;
    border-radius: 0 4px 4px 0;
    color: var(--mid);
    font-style: italic;
}

.single-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 36px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}
.back-btn {
    padding: 9px 20px;
    background: var(--dark);
    color: var(--white);
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    transition: background .2s;
}
.back-btn:hover { background: var(--red); }

/* ---------- Related Posts ---------- */
.related-section { margin-top: 10px; }

/* ---------- About Page ---------- */
.about-page {
    background: var(--white);
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow);
    max-width: 800px;
    margin: 0 auto;
}
.about-page h1, .about-page h2 { color: var(--dark); margin-bottom: 16px; }
.about-page p { margin-bottom: 16px; font-size: 17px; line-height: 1.8; color: #444; }

/* ---------- Footer ---------- */
.site-footer {
    background: var(--dark);
    color: rgba(255,255,255,.7);
    padding: 28px 0;
    margin-top: 40px;
}
.footer-inner { text-align: center; font-size: 14px; margin-bottom: 12px; }
.footer-inner p { margin: 4px 0; }
.footer-links { display: flex; justify-content: center; gap: 20px; font-size: 13px; }
.footer-links a { color: rgba(255,255,255,.6); transition: color .2s; }
.footer-links a:hover { color: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .posts-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .site-title { font-size: 20px; }
    .main-nav a { padding: 6px 10px; font-size: 13px; }
    .posts-grid, .small-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
    .single-post { padding: 22px 18px; }
    .single-title { font-size: 22px; }
    .single-content { font-size: 15px; }
    .card-thumb { height: 160px; }
}
@media (max-width: 540px) {
    .posts-grid, .small-grid { grid-template-columns: 1fr; }
    .header-top { flex-direction: column; align-items: flex-start; gap: 10px; }
    .main-nav ul { flex-wrap: wrap; gap: 4px; }
    .category-bar { gap: 6px; }
}
