/*======================================================
 * MMRISK HOME PAGE BLOG SECTION REDESIGN
 * Asymmetric grid layout with featured post emphasis.
 * Premium Tesla/Apple-inspired dark aesthetic.
 *======================================================*/

.home-blog-section {
    position: relative;
    padding: 120px 0;
    background-color: #0d0d0d;
    color: #fff;
    overflow: hidden;
}

/* Background effects */
.home-blog-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 30%, rgba(253, 199, 22, 0.03) 0%, transparent 50%),
                radial-gradient(circle at 80% 70%, rgba(253, 199, 22, 0.02) 0%, transparent 50%);
    pointer-events: none;
}

/* Grain texture overlay */
.home-blog-section::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    opacity: 0.5;
    z-index: 1;
}

.home-blog-section > div {
    position: relative;
    z-index: 2;
}

/* ---- Header ---- */
.blog-section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 48px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 24px;
}

.carousel-navigation {
    display: flex;
    gap: 12px;
}

.carousel-control {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-control:hover {
    background: rgba(253, 199, 22, 0.1);
    border-color: rgba(253, 199, 22, 0.3);
    color: #fdc716;
    transform: scale(1.05);
}

.carousel-control i {
    font-size: 24px;
}

.home-blog-section .section-subtitle {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #fdc716;
    margin-bottom: 20px;
}

.home-blog-section .section-title {
    font-size: clamp(2rem, 4vw, 2.75rem);
    line-height: 1.1;
    letter-spacing: -0.04em;
    font-weight: 800;
    color: #fff;
}

/* ---- Horizontal Carousel ---- */
.home-blog-carousel-wrapper {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.home-blog-carousel {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* IE and Edge */
    padding-bottom: 24px; /* Room for hover shadows */
}

.home-blog-carousel::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
}

.home-blog-card {
    flex: 0 0 380px; /* Fixed width for horizontal scrolling */
    scroll-snap-align: start;
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

@media (max-width: 768px) {
    .home-blog-card {
        flex: 0 0 85vw; /* Almost full width on mobile */
    }
    
    .blog-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 24px;
    }
}

/* Card Inner */
.blog-card-inner {
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 2;
}

.home-blog-card-img {
    position: relative;
    height: 240px;
    overflow: hidden;
}

.home-blog-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.home-blog-card:hover .home-blog-card-img img {
    transform: scale(1.05);
}

.home-blog-card-img-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.4) 100%);
}

.home-blog-card-category {
    position: absolute;
    top: 24px;
    left: 24px;
    padding: 6px 14px;
    background: rgba(253, 199, 22, 0.9);
    backdrop-filter: blur(8px);
    color: #000;
    font-size: 11px;
    font-weight: 700;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Content */
.home-blog-card-content {
    padding: 32px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.home-blog-card-date {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 12px;
    font-weight: 500;
}

.home-blog-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.01em;
    margin-bottom: 16px;
    color: #fff;
    transition: color 0.3s ease;
}

.home-blog-card:hover .home-blog-card-title {
    color: #fdc716;
}

.home-blog-card-excerpt {
    font-size: 0.95rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 24px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card-footer {
    margin-top: auto;
}

.home-blog-card-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    color: #fdc716;
    text-decoration: none;
    transition: gap 0.2s ease;
}

.home-blog-card-link:hover {
    gap: 12px;
}

/* Spotlight Effect */
.blog-card-spotlight {
    position: absolute;
    inset: 0;
    background: radial-gradient(
        600px circle at var(--card-glow-x, 50%) var(--card-glow-y, 50%),
        rgba(253, 199, 22, 0.06),
        transparent 40%
    );
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 1;
    pointer-events: none;
}

.home-blog-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(253, 199, 22, 0.2);
    transform: translateY(-4px);
}

.home-blog-card:hover .blog-card-spotlight {
    opacity: 1;
}

/* View All Link */
.blog-carousel-footer {
    margin-top: 32px;

}

.home-blog-section .btn-primary {
    display: inline-flex;
    align-items: center;
    padding: 16px 40px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
}

.home-blog-section .btn-primary:hover {
    background: #fff;
    color: #000;
    border-color: #fff;
    transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 1024px) {
    .home-blog-card:first-child {
        grid-column: span 12;
    }
    
    .home-blog-card {
        grid-column: span 6;
    }
}

@media (max-width: 768px) {
    .home-blog-card:first-child .blog-card-inner {
        flex-direction: column;
    }
    
    .home-blog-card:first-child .home-blog-card-content {
        padding: 32px;
    }
    
    .home-blog-card {
        grid-column: span 12;
    }

    .home-blog-section {
        padding: 80px 0;
    }
}
