/* ==========================================
   ADVANCED 3D BLOG GRID LAYOUT
   Dramatic Visual Transformation
========================================== */

.blog-grid-container {
    max-width: 1400px;
    margin: 4rem auto;
    padding: 0 2rem;
    perspective: 1500px;
}

/* MAIN GRID - Enhanced with clear visual changes */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 3rem;
    margin: 3rem 0;
}

/* COMPLETELY REDESIGNED 3D CARD */
.blog-post-card {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0.05) 100%);
    backdrop-filter: blur(25px);
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0;
    overflow: hidden;
    position: relative;
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    flex-direction: column;
    height: 100%;
    transform-style: preserve-3d;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.1),
        0 5px 20px rgba(79, 172, 254, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* DRAMATIC 3D HOVER EFFECT - YOU'LL SEE THIS! */
.blog-post-card:hover {
    transform: 
        translateY(-15px) 
        rotateX(5deg) 
        rotateY(2deg) 
        scale(1.03);
    box-shadow: 
        0 30px 60px rgba(79, 172, 254, 0.3),
        0 20px 40px rgba(106, 90, 205, 0.2),
        0 10px 20px rgba(255, 107, 107, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

/* ANIMATED GRADIENT BORDER */
.blog-post-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 28px;
    padding: 2px;
    background: linear-gradient(135deg, 
        #4FACFE 0%, 
        #6A5ACD 50%, 
        #FF6B6B 100%);
    mask: linear-gradient(#fff 0 0) content-box, 
          linear-gradient(#fff 0 0);
    mask-composite: exclude;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, 
                  linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.blog-post-card:hover::before {
    opacity: 1;
    animation: borderGlow 2s ease-in-out infinite;
}

@keyframes borderGlow {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* 3D IMAGE TRANSFORM */
.post-thumbnail {
    position: relative;
    overflow: hidden;
    height: 260px;
    transform-style: preserve-3d;
}

.post-thumbnail::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, 
        transparent 0%, 
        rgba(0, 0, 0, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.blog-post-card:hover .post-thumbnail::after {
    opacity: 1;
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform: scale(1.1);
}

.blog-post-card:hover .post-thumbnail img {
    transform: scale(1.15) rotate(1deg);
    filter: brightness(1.1) contrast(1.1) saturate(1.2);
}

/* FLOATING 3D ELEMENTS - VISIBLE ANIMATIONS */
.card-3d-elements {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.floating-orb {
    position: absolute;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #4FACFE, #6A5ACD);
    border-radius: 50%;
    opacity: 0.1;
    filter: blur(10px);
    animation: float3D 6s ease-in-out infinite;
}

.floating-orb:nth-child(1) {
    top: 10%;
    left: 5%;
    animation-delay: 0s;
}

.floating-orb:nth-child(2) {
    top: 60%;
    right: 5%;
    animation-delay: -2s;
    background: linear-gradient(135deg, #FF6B6B, #FFA500);
    width: 60px;
    height: 60px;
}

.floating-orb:nth-child(3) {
    bottom: 20%;
    left: 15%;
    animation-delay: -4s;
    background: linear-gradient(135deg, #6A5ACD, #4FACFE);
    width: 40px;
    height: 40px;
}

@keyframes float3D {
    0%, 100% {
        transform: translate3d(0, 0, 0) rotate(0deg);
    }
    33% {
        transform: translate3d(10px, -15px, 20px) rotate(120deg);
    }
    66% {
        transform: translate3d(-5px, 10px, 10px) rotate(240deg);
    }
}

/* ENHANCED CARD CONTENT */
.post-content {
    padding: 2.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 2;
    transform-style: preserve-3d;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
    transform: translateZ(30px);
}

.post-date {
    background: linear-gradient(135deg, #4FACFE, #6A5ACD);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-weight: 700;
    font-size: 0.75rem;
    box-shadow: 0 8px 20px rgba(79, 172, 254, 0.4);
    transform: translateZ(40px);
    transition: transform 0.3s ease;
}

.blog-post-card:hover .post-date {
    transform: translateZ(40px) scale(1.05);
}

.post-category {
    background: linear-gradient(135deg, #FF6B6B, #FFA500);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-weight: 700;
    font-size: 0.75rem;
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.4);
    transform: translateZ(40px);
    transition: transform 0.3s ease;
}

.blog-post-card:hover .post-category {
    transform: translateZ(40px) scale(1.05);
}

.blog-post-card h3 {
    margin: 0 0 1.5rem 0;
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.3;
    color: var(--text-primary);
    transform: translateZ(35px);
}

.blog-post-card h3 a {
    color: inherit;
    text-decoration: none;
    background: linear-gradient(135deg, #2D3748 0%, #4FACFE 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: all 0.4s ease;
    display: inline-block;
}

.blog-post-card:hover h3 a {
    background: linear-gradient(135deg, #4FACFE 0%, #FF6B6B 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    transform: translateX(8px);
}

.post-excerpt {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.7;
    flex-grow: 1;
    transform: translateZ(25px);
    font-size: 1rem;
}

/* ADVANCED 3D BUTTON */
.read-more-btn {
    background: linear-gradient(135deg, #4FACFE 0%, #6A5ACD 100%);
    color: white;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    border: none;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 
        0 10px 30px rgba(79, 172, 254, 0.4),
        0 5px 15px rgba(106, 90, 205, 0.3);
    align-self: flex-start;
    text-decoration: none;
    display: inline-block;
    transform-style: preserve-3d;
    transform: translateZ(50px);
}

.read-more-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.4), 
        transparent);
    transition: left 0.6s ease;
}

.read-more-btn:hover {
    transform: 
        translateY(-5px) 
        translateZ(60px) 
        scale(1.08);
    box-shadow: 
        0 20px 40px rgba(79, 172, 254, 0.6),
        0 10px 25px rgba(106, 90, 205, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    letter-spacing: 3px;
}

.read-more-btn:hover::before {
    left: 100%;
}

/* GRID LAYOUT VARIATIONS */
.blog-grid.masonry {
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    grid-auto-rows: masonry;
    align-items: start;
}

/* FEATURED POST STYLES */
.blog-grid.featured-first .blog-post-card:first-child {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    min-height: 450px;
}

.blog-grid.featured-first .blog-post-card:first-child:hover {
    transform: 
        translateY(-20px) 
        rotateX(3deg) 
        rotateY(1deg) 
        scale(1.02);
}

.blog-grid.featured-first .blog-post-card:first-child .post-thumbnail {
    height: 100%;
    min-height: 400px;
}

/* PAGINATION 3D */
.blog-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin: 4rem 0 2rem;
    perspective: 1000px;
}

.pagination-btn {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    padding: 1rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transform-style: preserve-3d;
}

.pagination-btn:hover {
    transform: 
        translateY(-3px) 
        rotateX(5deg) 
        scale(1.05);
    background: linear-gradient(135deg, #4FACFE, #6A5ACD);
    color: white;
    box-shadow: 0 15px 35px rgba(79, 172, 254, 0.4);
}

/* LOADING ANIMATION */
@keyframes cardRise {
    0% {
        opacity: 0;
        transform: 
            translateY(60px) 
            rotateX(20deg) 
            scale(0.9);
        filter: blur(10px);
    }
    100% {
        opacity: 1;
        transform: 
            translateY(0) 
            rotateX(0) 
            scale(1);
        filter: blur(0);
    }
}

.blog-post-card {
    animation: cardRise 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.blog-post-card:nth-child(1) { animation-delay: 0.1s; }
.blog-post-card:nth-child(2) { animation-delay: 0.2s; }
.blog-post-card:nth-child(3) { animation-delay: 0.3s; }
.blog-post-card:nth-child(4) { animation-delay: 0.4s; }
.blog-post-card:nth-child(5) { animation-delay: 0.5s; }
.blog-post-card:nth-child(6) { animation-delay: 0.6s; }

/* RESPONSIVE DESIGN */
@media (max-width: 768px) {
    .blog-grid-container {
        padding: 0 1rem;
        margin: 2rem auto;
    }
    
    .blog-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .blog-post-card:hover {
        transform: translateY(-8px) scale(1.02);
    }
    
    .post-content {
        padding: 2rem;
    }
    
    .card-3d-elements {
        display: none;
    }
}

/* DARK MODE ENHANCEMENT */
@media (prefers-color-scheme: dark) {
    .blog-post-card {
        background: linear-gradient(135deg, 
            rgba(255, 255, 255, 0.05) 0%,
            rgba(255, 255, 255, 0.02) 100%);
        box-shadow: 
            0 10px 40px rgba(0, 0, 0, 0.3),
            0 5px 20px rgba(79, 172, 254, 0.1),
            inset 0 1px 0 rgba(255, 255, 255, 0.1);
    }
    
    .blog-post-card:hover {
        box-shadow: 
            0 30px 60px rgba(79, 172, 254, 0.2),
            0 20px 40px rgba(106, 90, 205, 0.15),
            0 10px 20px rgba(255, 107, 107, 0.1),
            inset 0 1px 0 rgba(255, 255, 255, 0.2);
    }
}