/* --- Global Container Padding for Page Alignment --- */
.hero, .category, .latest-posts, .popular-posts {
    max-width: 1300px;
    margin: 3rem auto;
    padding: 0 2rem;
    font-family: 'Segoe UI', sans-serif;
}

/* Image Reset inside layouts */
figure {
    overflow: hidden;
    background-color: #eaeaea; /* Temporary placeholder background */
    border-radius: 6px;
}
figure img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Generic Post Card Inner Elements styling */
.post-card h4, .latest-post-card h4, .popular-post-card h4 {
    color: #007bff;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
    margin: 0.8rem 0 0.4rem 0;
}
.post-card h3, .latest-post-card h3, .popular-post-card h3 {
    font-size: 1.1rem;
    color: #222;
    line-height: 1.4;
    margin-bottom: 0.6rem;
}
.post-card section p, .post-info p {
    font-size: 0.85rem;
    color: #666;
}
.post-card section span, .post-info span {
    font-weight: 600;
}


/* --- Global Premium Polish --- */
.hero {
    max-width: 1300px; /* Slightly wider for an expansive, luxurious feel */
    margin: 4rem auto;
    padding: 0 2rem;
    font-family: 'Inter', 'Segoe UI', sans-serif;
}

/* Base structural setup for text overlays */
.hero .post-card {
    position: relative;
    overflow: hidden;
    border-radius: 12px; /* Smooth elegant corners */
    background-color: #0b0b0b; /* Deep background layer so text remains readable */
    display: block;
    cursor: pointer;
}

/* Master figure styling for crisp zooms */
.hero .post-card figure {
    width: 100%;
    height: 100%;
    margin: 0;
    transition: transform 0.7s cubic-bezier(0.25, 1, 0.5, 1); /* Silk smooth zoom */
}

.hero .post-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0.75; /* Slightly muted for better text contrast */
    transition: opacity 0.5s ease, transform 0.7s ease;
}

/* Hover Zoom effect applied across elements */
.hero .post-card:hover figure{
    transform: scale(1.04);
}


/* ==========================================================================
   1. PREMIUM HERO SECTION (Text Over Images)
   ========================================================================== */
.hero {
    display: grid;
    grid-template-columns: 1fr 1.4fr 1fr;
    gap: 1.5rem;
}

/* Column row setups containing stacked small height posts */
.post-small-row {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.post-small-row .post-card {
    height: 220px; /* Enhanced tracking height for overlays */
}
.post-big-row .post-card {
    height: 465px; /* Perfect uniform alignment with stacked row layouts */
}

/* Elegant dark gradient sheet overlay behind text for flawless readability */
.hero .post-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.3) 50%, rgba(0, 0, 0, 0.1) 100%);
    z-index: 1;
    pointer-events: none;
}

/* Absolute Positioning text content over images */
.hero .post-card .card-content-wrapper { /* Wrap your card text inside a div with this class (see HTML hint below) */
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem;
    z-index: 2;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

/* Premium Typography refinements */
.hero .post-card h4 {
    color: #38bdf8; /* Premium Electric Cyan Sky shade */
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin: 0 0 0.5rem 0;
}

.hero .post-card h3 {
    color: #ffffff;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.8rem;
}
.post-small-row .post-card h3 { font-size: 1.15rem; }
.post-big-row .post-card h3 { font-size: 1.65rem; }

/* Meta details bottom alignment bar */
.hero .post-card section {
    display: flex;
    justify-content: space-between;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding-top: 0.6rem;
    margin-top: auto;
}
.hero .post-card section p {
    font-size: 0.8rem;
    color: #b9cbd6;
    margin: 0;
}


/* ==========================================================================
   2. CATEGORIES (Invisible Image by Default -> Visible on Hover)
   ========================================================================== */
.category {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1.5rem;
}

.category a {
    position: relative;
    overflow: hidden;
    height: 180px;
    border-radius: 20px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #0f172a;
    border: 1px solid rgba(255,255,255,0.08);

    text-decoration: none;

    transition: all .4s ease;
}

/* Dark overlay */
.category a::before {
    content: '';
    position: absolute;
    inset: 0;

    background:
        linear-gradient(
            to top,
            rgba(15,23,42,.8),
            rgba(15,23,42,.3)
        );

    z-index: 1;
    transition: all .4s ease;
}

/* Image */
.category a img {
    position: absolute;
    inset: 0;

    width: 100%;
    height: 100%;
    object-fit: cover;

    opacity: .6;
    transform: scale(1.08);

    transition:
        transform .6s ease,
        opacity .4s ease;
}

/* Title */
.category a h3 {
    position: relative;
    z-index: 2;

    color: white;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -.02em;

    padding: 12px 20px;
    border-radius: 999px;

    background: rgba(255,255,255,.08);
    backdrop-filter: blur(10px);

    transition: all .35s ease;
}

/* Hover */
.category a:hover {
    transform: translateY(-6px);

    border-color: rgba(99,102,241,.5);

    box-shadow:
        0 15px 35px rgba(0,0,0,.2),
        0 0 20px rgba(99,102,241,.15);
}

.category a:hover img {
    transform: scale(1.15);
    opacity: .85;
}

.category a:hover::before {
    background:
        linear-gradient(
            to top,
            rgba(79,70,229,.65),
            rgba(15,23,42,.2)
        );
}

.category a:hover h3 {
    background: rgba(255,255,255,.15);
    transform: scale(1.05);
}

/* ==========================================================================
   RESPONSIVE OVERLAY ADJUSTMENTS
   ========================================================================== */
@media (max-width: 992px) {
    .hero {
        grid-template-columns: 1fr;
    }
    .post-big-row .post-card {
        height: 350px;
    }
    .category {
        flex-direction: column;
    }
    .category a {
        height: 100px;
    }
}


/* ==========================================================================
   3. LATEST POSTS SECTION (4 Columns, Image takes half height)
   ========================================================================== */
.latest-posts {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

.latest-post-card {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;

    display: flex;
    flex-direction: column;

    border: 1px solid #e5e7eb;

    transition: all .35s ease;

    box-shadow:
        0 4px 12px rgba(15,23,42,.05);
}

.latest-post-card:hover {
    transform: translateY(-8px);

    box-shadow:
        0 20px 40px rgba(15,23,42,.12);
}

/* Image */

.latest-post-card figure {
    height: 240px;
    overflow: hidden;
    position: relative;
}

.latest-post-card figure img {
    width: 100%;
    height: 100%;
    object-fit: cover;

    transition: transform .7s ease;
}

.latest-post-card:hover figure img {
    transform: scale(1.08);
}

/* Category Badge */

.post-category-badge {
    position: absolute;
    top: 15px;
    left: 15px;

    padding: 6px 12px;

    border-radius: 999px;

    background: rgba(255,255,255,.9);

    backdrop-filter: blur(10px);

    font-size: .75rem;
    font-weight: 600;
    color: #4f46e5;
}

/* Content */

.latest-post-card .post-info {
    flex: 1;

    padding: 1.5rem;

    display: flex;
    flex-direction: column;
    gap: 12px;
}

.latest-post-card .post-info h3 {
    font-size: 1.15rem;
    line-height: 1.5;
    font-weight: 700;
    color: #0f172a;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;

    overflow: hidden;
}

.latest-post-card .post-info p {
    color: #64748b;
    font-size: .95rem;
    line-height: 1.7;

    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;

    overflow: hidden;
}

/* Date */

.post-date {
    font-size: .8rem;
    color: #94a3b8;
    font-weight: 500;
}

/* Footer Stats */

.latest-post-card .post-stats {
    display: flex;
    align-items: center;
    gap: 1rem;

    padding: 1rem 1.5rem;

    border-top: 1px solid #f1f5f9;

    color: #64748b;
    font-size: .85rem;
}

.latest-post-card .post-stats section {
    display: flex;
    align-items: center;
    gap: .35rem;
}

.latest-post-card .post-stats section:last-child {
    margin-left: auto;

    width: 36px;
    height: 36px;

    display: flex;
    justify-content: center;
    align-items: center;

    border-radius: 50%;

    cursor: pointer;

    transition: all .3s ease;
}

.latest-post-card .post-stats section:last-child:hover {
    background: #eef2ff;
    color: #4f46e5;
}


/* ==========================================================================
   4. POPULAR POSTS SECTION (2 Columns, Side-by-Side Content, Vertically Aligned Stats)
   ========================================================================== */
.popular-posts {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.75rem;
}

.popular-post-card {
    display: grid;
    grid-template-columns: 180px 1fr auto;
    gap: 1.5rem;

    background: #fff;

    border: 1px solid #e5e7eb;
    border-radius: 20px;

    overflow: hidden;

    transition: all .35s ease;

    box-shadow:
        0 4px 12px rgba(15,23,42,.05);
}

.popular-post-card:hover {
    transform: translateY(-6px);

    box-shadow:
        0 15px 35px rgba(15,23,42,.12);
}

/* Image */

.popular-post-card figure {
    position: relative;

    width: 180px;
    height: 180px;

    overflow: hidden;
}

.popular-post-card figure img {
    width: 100%;
    height: 100%;
    object-fit: cover;

    transition: transform .7s ease;
}

.popular-post-card:hover figure img {
    transform: scale(1.08);
}

/* Content */

.popular-post-card .post-info {
    display: flex;
    flex-direction: column;
    justify-content: center;

    padding: 1.25rem 0;
}

.popular-post-card .post-info .category {
    color: #4f46e5;
    font-size: .8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: .6rem;
}

.popular-post-card .post-info h3 {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.5;

    color: #0f172a;

    margin-bottom: .75rem;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;

    overflow: hidden;
}

.popular-post-card .post-info p {
    color: #64748b;
    font-size: .92rem;
    line-height: 1.7;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;

    overflow: hidden;
}

.popular-post-card .post-info .date {
    margin-top: .75rem;

    color: #94a3b8;
    font-size: .8rem;
}

/* Stats */

.popular-post-card .post-stats {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    gap: 1.2rem;

    padding: 1.5rem;

    border-left: 1px solid #f1f5f9;

    background: #fafafa;

    min-width: 75px;
}

.popular-post-card .post-stats section {
    display: flex;
    flex-direction: column;
    align-items: center;

    gap: .3rem;

    color: #64748b;

    font-size: .75rem;
    font-weight: 600;
}

.popular-post-card .post-stats i {
    font-size: 1rem;
}

.popular-post-card .post-stats section:last-child {
    width: 40px;
    height: 40px;

    border-radius: 50%;

    cursor: pointer;

    transition: all .3s ease;
}

.popular-post-card .post-stats section:last-child:hover {
    background: #eef2ff;
    color: #4f46e5;
}


/* ==========================================================================
   5. RESPONSIVE DESIGN BREAKPOINTS
   ========================================================================== */
@media (max-width: 992px) {
    .hero {
        grid-template-columns: 1fr; /* Stacks hero segments into one block */
    }
    .latest-posts {
        grid-template-columns: repeat(2, 1fr); /* 2 columns on tablets */
    }
    .popular-posts {
        grid-template-columns: 1fr; /* Single column on tablets/mobile */
    }

    .section-heading{
        text-align: center;
    }
}

@media (max-width: 576px) {
    .latest-posts {
        grid-template-columns: 1fr; /* Single column on mobile devices */
    }
    .popular-post-card {
        grid-template-columns: 1fr; /* Stacks image, details, and stats vertically */
        text-align: center;
    }
    .popular-post-card figure {
        width: 100%;
        height: 180px;
    }
    .popular-post-card .post-stats {
        flex-direction: row;
        border-left: none;
        border-top: 1px solid #eee;
        padding-left: 0;
        padding-top: 1rem;
        width: 100%;
        justify-content: space-around;
    }
    .popular-post-card .post-stats section {
        flex-direction: row;
        gap: 0.4rem;
    }

    .section-heading{
        text-align: center;
    }
}

.section-heading{
    font-size: 2rem;
    font-weight: 700;
    opacity: 0.8;
    max-width: 1200px;
    margin: 20px auto;
}


