/* ============================================================
   Blog Styles — Bharat Infra Consultancy
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── Variables ─────────────────────────────────────────────── */
:root {
    --navy: #14213d;
    --black: #000000;
    --amber: #fca311;
    --grey: #e5e5e5;
    --white: #ffffff;
    --text-dark: #1a1a2e;
    --text-mid: #4a4a6a;
    --text-light: #888;
    --radius: 8px;
    --shadow: 0 4px 24px rgba(20, 33, 61, 0.10);
    --shadow-hover: 0 12px 40px rgba(20, 33, 61, 0.18);
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font: 'Inter', sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font);
    color: var(--text-dark);
    background: var(--white);
    line-height: 1.7;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ── Hero ──────────────────────────────────────────────────── */
.blog-hero {
    background: linear-gradient(135deg, var(--navy) 60%, #1e3a5f 100%);
    padding: 100px 0 60px;
    text-align: center;
    color: var(--white);
}

.blog-hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 16px;
}

.blog-hero p {
    font-size: 1.125rem;
    opacity: 0.8;
    max-width: 600px;
    margin: 0 auto 40px;
}

/* ── Breadcrumb ────────────────────────────────────────────── */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.breadcrumb a {
    color: var(--amber);
}

.breadcrumb span {
    opacity: 0.5;
}

/* ── Search & Filter ───────────────────────────────────────── */
.blog-controls {
    background: var(--grey);
    padding: 28px 0;
    border-bottom: 1px solid #d5d5e5;
}

.blog-controls-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.search-form {
    display: flex;
    flex: 1;
    min-width: 220px;
    background: var(--white);
    border: 2px solid transparent;
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color var(--transition);
}

.search-form:focus-within {
    border-color: var(--amber);
}

.search-form input {
    flex: 1;
    padding: 12px 16px;
    border: none;
    outline: none;
    font-family: var(--font);
    font-size: 0.95rem;
    color: var(--text-dark);
}

.search-form button {
    padding: 12px 20px;
    background: var(--navy);
    color: var(--white);
    border: none;
    cursor: pointer;
    font-size: 1rem;
    transition: background var(--transition);
}

.search-form button:hover {
    background: var(--amber);
}

.cat-filter {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.cat-btn {
    padding: 8px 18px;
    border: 2px solid var(--navy);
    border-radius: 100px;
    background: transparent;
    color: var(--navy);
    font-family: var(--font);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    display: inline-block;
}

.cat-btn:hover,
.cat-btn.active {
    background: var(--navy);
    color: var(--white);
}

/* ── Blog Grid ─────────────────────────────────────────────── */
.blog-section {
    padding: 64px 0;
    background: #f8f9fc;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    margin-bottom: 48px;
}

/* ── Blog Card ─────────────────────────────────────────────── */
.blog-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    transition: transform var(--transition), box-shadow var(--transition);
}

.blog-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

.card-img {
    height: 220px;
    overflow: hidden;
    background: var(--grey);
    position: relative;
}

.card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    loading: lazy;
}

.blog-card:hover .card-img img {
    transform: scale(1.06);
}

.card-img .no-img {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--navy), #1e3a5f);
    color: rgba(255, 255, 255, 0.3);
    font-size: 3rem;
}

.card-body {
    padding: 28px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-category {
    display: inline-block;
    background: rgba(252, 163, 17, 0.12);
    color: var(--amber);
    border: 1px solid rgba(252, 163, 17, 0.3);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 100px;
    margin-bottom: 14px;
}

.card-title {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 12px;
    color: var(--navy);
}

.card-excerpt {
    font-size: 0.9rem;
    color: var(--text-mid);
    line-height: 1.65;
    flex: 1;
    margin-bottom: 20px;
}

.card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 18px;
}

.card-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.read-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--navy);
    color: var(--white);
    padding: 10px 22px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all var(--transition);
    align-self: flex-start;
}

.read-more:hover {
    background: var(--amber);
    color: var(--black);
    gap: 12px;
}

/* ── Empty State ───────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 80px 24px;
    color: var(--text-mid);
}

.empty-state .icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-state h3 {
    font-size: 1.4rem;
    margin-bottom: 8px;
    color: var(--navy);
}

/* ── Pagination ────────────────────────────────────────────── */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 6px;
    border: 2px solid var(--grey);
    font-size: 0.9rem;
    font-weight: 600;
    transition: all var(--transition);
    color: var(--navy);
}

.pagination a:hover {
    background: var(--navy);
    color: var(--white);
    border-color: var(--navy);
}

.pagination span.current {
    background: var(--navy);
    color: var(--white);
    border-color: var(--navy);
}

.pagination .dots {
    border: none;
    color: var(--text-light);
    pointer-events: none;
}

/* ── Single Post ───────────────────────────────────────────── */
.post-hero {
    height: 480px;
    position: relative;
    overflow: hidden;
    background: var(--navy);
}

.post-hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.45;
}

.post-hero-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.1) 60%);
    padding: 56px;
}

.post-hero-content {
    color: var(--white);
    max-width: 820px;
}

.post-hero-content .category-tag {
    background: var(--amber);
    color: var(--black);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 5px 14px;
    border-radius: 100px;
    display: inline-block;
    margin-bottom: 16px;
}

.post-hero-content h1 {
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 16px;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 24px;
    font-size: 0.875rem;
    opacity: 0.8;
    flex-wrap: wrap;
}

.post-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ── Post Layout ───────────────────────────────────────────── */
.post-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 48px;
    padding: 64px 0;
    align-items: flex-start;
}

/* ── Post Content ──────────────────────────────────────────── */
.post-content {
    background: var(--white);
    border-radius: var(--radius);
    padding: 48px;
    box-shadow: var(--shadow);
}

.post-content h2 {
    font-size: 1.6rem;
    color: var(--navy);
    margin: 36px 0 16px;
    font-weight: 700;
}

.post-content h3 {
    font-size: 1.25rem;
    color: var(--navy);
    margin: 28px 0 12px;
    font-weight: 600;
}

.post-content p {
    margin-bottom: 20px;
    color: var(--text-mid);
    font-size: 1.05rem;
    line-height: 1.8;
}

.post-content ul,
.post-content ol {
    margin: 0 0 20px 24px;
    color: var(--text-mid);
    font-size: 1.05rem;
    line-height: 1.8;
}

.post-content blockquote {
    border-left: 4px solid var(--amber);
    margin: 28px 0;
    padding: 16px 24px;
    background: rgba(252, 163, 17, 0.05);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-style: italic;
    color: var(--text-mid);
}

.post-content img {
    border-radius: var(--radius);
    margin: 24px 0;
    box-shadow: var(--shadow);
}

.post-content a {
    color: var(--amber);
    text-decoration: underline;
}

.post-content code {
    background: var(--grey);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.9em;
}

/* ── Share Buttons ─────────────────────────────────────────── */
.share-section {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--grey);
}

.share-section h4 {
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-mid);
    margin-bottom: 16px;
}

.share-btns {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 600;
    transition: all var(--transition);
    cursor: pointer;
}

.share-linkedin {
    background: #0a66c2;
    color: #fff;
}

.share-facebook {
    background: #1877f2;
    color: #fff;
}

.share-whatsapp {
    background: #25d366;
    color: #fff;
}

.share-twitter {
    background: #000;
    color: #fff;
}

.share-btn:hover {
    opacity: 0.85;
    transform: translateY(-2px);
}

/* ── Back Button ───────────────────────────────────────────── */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--navy);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 10px 20px;
    border: 2px solid var(--navy);
    border-radius: var(--radius);
    margin-bottom: 32px;
    transition: all var(--transition);
}

.back-btn:hover {
    background: var(--navy);
    color: var(--white);
}

/* ── Sidebar ───────────────────────────────────────────────── */
.post-sidebar {
    position: sticky;
    top: 100px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.sidebar-widget {
    background: var(--white);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow);
}

.sidebar-widget h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--navy);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--amber);
    display: inline-block;
}

.recent-post-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--grey);
}

.recent-post-item:last-child {
    border-bottom: none;
}

.recent-thumb {
    width: 64px;
    height: 64px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--grey);
}

.recent-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recent-info h4 {
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 4px;
}

.recent-info h4 a:hover {
    color: var(--amber);
}

.recent-info span {
    font-size: 0.775rem;
    color: var(--text-light);
}

.category-list {
    list-style: none;
}

.category-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--grey);
    font-size: 0.9rem;
}

.category-list li:last-child {
    border-bottom: none;
}

.category-list a:hover {
    color: var(--amber);
}

.category-list .count {
    background: var(--grey);
    color: var(--text-mid);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 100px;
}

/* ── Related Posts ─────────────────────────────────────────── */
.related-posts {
    background: #f8f9fc;
    padding: 64px 0;
}

.related-posts h2 {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--navy);
    margin-bottom: 36px;
    text-align: center;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

/* ── No-Image fallback ─────────────────────────────────────── */
.post-hero-noimg {
    height: 280px;
    background: linear-gradient(135deg, var(--navy), #1e3a5f);
    display: flex;
    align-items: flex-end;
    padding: 40px 56px;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .post-layout {
        grid-template-columns: 1fr;
    }

    .post-sidebar {
        position: static;
    }

    .related-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .post-hero-overlay {
        padding: 36px;
    }
}

@media (max-width: 640px) {
    .blog-grid {
        grid-template-columns: 1fr;
    }

    .blog-controls-inner {
        flex-direction: column;
        align-items: stretch;
    }

    .search-form {
        min-width: 0;
    }

    .post-hero {
        height: 360px;
    }

    .post-content {
        padding: 28px;
    }

    .related-grid {
        grid-template-columns: 1fr;
    }

    .card-body {
        padding: 20px;
    }

    .post-hero-overlay {
        padding: 24px;
    }
}

/* ── Animations ────────────────────────────────────────────── */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.blog-card {
    animation: fadeInUp 0.4s ease both;
}

.blog-card:nth-child(2) {
    animation-delay: 0.1s;
}

.blog-card:nth-child(3) {
    animation-delay: 0.2s;
}

.blog-card:nth-child(4) {
    animation-delay: 0.3s;
}

.blog-card:nth-child(5) {
    animation-delay: 0.4s;
}

.blog-card:nth-child(6) {
    animation-delay: 0.5s;
}

/* ── Utility ───────────────────────────────────────────────── */
.text-center {
    text-align: center;
}

.section-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--navy);
    margin-bottom: 8px;
}

.section-sub {
    color: var(--text-mid);
    font-size: 1rem;
    margin-bottom: 40px;
}