@charset "UTF-8";

/**
 * Modern Blog Cards - E-commerce Style
 * 
 * Purpose: Professional blog card design for home page
 * Features:
 * - Modern card layout
 * - Fully responsive
 * - Hover effects
 * - Image optimization
 * - Professional typography
 * 
 * @version 1.0.0
 * @date 2026-01-25
 */

/* ============================================================
   BLOG SECTION CONTAINER
   ============================================================ */

.nx-blog-section {
    padding: 4rem 0;
    background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
}

@media (max-width: 991px) {
    .nx-blog-section {
        padding: 3rem 0;
    }
}

.nx-blog-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ============================================================
   BLOG SECTION HEADER
   ============================================================ */

.nx-blog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    gap: 1rem;
}

@media (max-width: 576px) {
    .nx-blog-header {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 2rem;
    }
}

.nx-blog-title {
    font-size: 2.75rem;
    font-weight: 800;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', system-ui, sans-serif;
    color: #1d1d1f;
    margin: 0;
    letter-spacing: -0.03em;
    line-height: 1.1;
    background: linear-gradient(135deg, #1d1d1f 0%, #4a4a4a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    display: inline-block;
}

.nx-blog-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--bs-primary, #0d6efd), transparent);
    border-radius: 2px;
}

@media (max-width: 768px) {
    .nx-blog-title {
        font-size: 2.25rem;
        letter-spacing: -0.025em;
    }
    
    .nx-blog-title::after {
        width: 50px;
        height: 3px;
        bottom: -6px;
    }
}

@media (max-width: 576px) {
    .nx-blog-title {
        font-size: 1.875rem;
        letter-spacing: -0.02em;
    }
    
    .nx-blog-title::after {
        width: 40px;
        height: 3px;
        bottom: -5px;
    }
}

.nx-blog-see-more {
    padding: 0.75rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    background: var(--bs-primary, #0d6efd);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.nx-blog-see-more:hover {
    background: var(--bs-primary, #0d6efd);
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(13, 110, 253, 0.3);
    color: #ffffff;
}

.nx-blog-see-more:active {
    transform: translateY(0);
}

/* ============================================================
   BLOG CARDS GRID
   ============================================================ */

.nx-blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

/* Large screens */
@media (min-width: 1200px) {
    .nx-blog-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2.5rem;
    }
}

/* Medium-large screens */
@media (min-width: 992px) and (max-width: 1199px) {
    .nx-blog-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
}

/* Tablets */
@media (min-width: 768px) and (max-width: 991px) {
    .nx-blog-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

/* Small tablets and large phones */
@media (min-width: 576px) and (max-width: 767px) {
    .nx-blog-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
    }
}

/* Mobile phones */
@media (max-width: 575px) {
    .nx-blog-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* Extra small devices */
@media (max-width: 375px) {
    .nx-blog-grid {
        gap: 1.25rem;
    }
}

/* ============================================================
   BLOG CARD
   ============================================================ */

.nx-blog-card {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid rgba(0, 0, 0, 0.06);
    position: relative;
    cursor: pointer;
}

.nx-blog-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    border-color: rgba(13, 110, 253, 0.2);
}

.nx-blog-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--bs-primary, #0d6efd), #6366f1, var(--bs-primary, #0d6efd));
    background-size: 200% auto;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.nx-blog-card:hover::before {
    opacity: 1;
    animation: gradient-shift 3s ease infinite;
}

/* ============================================================
   BLOG CARD IMAGE
   ============================================================ */

.nx-blog-card-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 aspect ratio for better image display */
    overflow: hidden;
    background: linear-gradient(135deg, #f5f5f7 0%, #e8e8ed 50%, #fafafa 100%);
    border-radius: 16px 16px 0 0;
    isolation: isolate;
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Responsive aspect ratios */
@media (min-width: 1200px) {
    .nx-blog-card-image-wrapper {
        padding-top: 55%; /* Slightly taller on large screens */
    }
}

@media (min-width: 992px) and (max-width: 1199px) {
    .nx-blog-card-image-wrapper {
        padding-top: 56.25%; /* Standard 16:9 */
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .nx-blog-card-image-wrapper {
        padding-top: 58%; /* Slightly taller on tablets */
        min-height: 180px;
    }
}

@media (min-width: 576px) and (max-width: 767px) {
    .nx-blog-card-image-wrapper {
        padding-top: 60%; /* Taller on small tablets */
        min-height: 200px;
    }
}

.nx-blog-card-image-link {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
    overflow: hidden;
    z-index: 1;
}

.nx-blog-card-image {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), 
                filter 0.4s ease,
                opacity 0.4s ease;
    display: block;
    will-change: transform;
    filter: brightness(1) contrast(1) saturate(1);
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    max-width: 100%;
    max-height: 100%;
}

.nx-blog-card:hover .nx-blog-card-image {
    transform: translate(-50%, -50%) scale(1.05);
    filter: brightness(1.05) contrast(1.05) saturate(1.05);
}

/* Responsive image sizing */
@media (max-width: 991px) {
    .nx-blog-card:hover .nx-blog-card-image {
        transform: translate(-50%, -50%) scale(1.03); /* Less zoom on tablets */
    }
}

@media (max-width: 576px) {
    .nx-blog-card:hover .nx-blog-card-image {
        transform: translate(-50%, -50%) scale(1.02); /* Minimal zoom on mobile */
    }
}

.nx-blog-card-image-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, 
        rgba(0, 0, 0, 0) 0%, 
        rgba(0, 0, 0, 0.02) 50%,
        rgba(0, 0, 0, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 2;
}

.nx-blog-card:hover .nx-blog-card-image-wrapper::before {
    opacity: 1;
}

.nx-blog-card-image-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(13, 110, 253, 0.1) 0%, 
        transparent 50%,
        rgba(13, 110, 253, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 2;
}

.nx-blog-card:hover .nx-blog-card-image-wrapper::after {
    opacity: 1;
}

/* Image loading state */
.nx-blog-card-image[data-src] {
    opacity: 0;
    transition: opacity 0.5s ease;
    background: linear-gradient(135deg, #f5f5f7 0%, #e8e8ed 100%);
}

.nx-blog-card-image.lazyloaded {
    opacity: 1;
    background: transparent;
}

/* Better image quality on high DPI screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .nx-blog-card-image {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Image placeholder shimmer effect */
.nx-blog-card-image-wrapper:has(.nx-blog-card-image[data-src]:not(.lazyloaded)) {
    background: linear-gradient(90deg, 
        #f5f5f7 0%, 
        #e8e8ed 50%, 
        #f5f5f7 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* ============================================================
   BLOG CARD CONTENT
   ============================================================ */

.nx-blog-card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

@media (max-width: 576px) {
    .nx-blog-card-content {
        padding: 1.25rem;
    }
}

.nx-blog-card-date {
    font-size: 0.8125rem;
    color: #6e6e73;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.nx-blog-card-date-icon {
    width: 14px;
    height: 14px;
    color: var(--bs-primary, #0d6efd);
    flex-shrink: 0;
}

.nx-blog-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1d1d1f;
    margin: 0 0 1rem 0;
    line-height: 1.4;
    letter-spacing: -0.01em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s ease;
}

.nx-blog-card:hover .nx-blog-card-title {
    color: var(--bs-primary, #0d6efd);
}

@media (max-width: 576px) {
    .nx-blog-card-title {
        font-size: 1.125rem;
    }
}

.nx-blog-card-title-link {
    color: inherit;
    text-decoration: none;
    display: block;
}

.nx-blog-card-title-link:hover {
    color: var(--bs-primary, #0d6efd);
}

.nx-blog-card-excerpt {
    font-size: 0.9375rem;
    color: #6e6e73;
    line-height: 1.6;
    margin-bottom: 1.25rem;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.nx-blog-card-excerpt p {
    margin: 0;
}

.nx-blog-card-excerpt * {
    font-size: inherit;
    color: inherit;
    line-height: inherit;
}

/* ============================================================
   BLOG CARD FOOTER / READ MORE
   ============================================================ */

.nx-blog-card-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.nx-blog-card-read-more {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--bs-primary, #0d6efd);
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
}

.nx-blog-card-read-more::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--bs-primary, #0d6efd);
    transition: width 0.3s ease;
}

.nx-blog-card-read-more:hover {
    color: var(--bs-primary, #0d6efd);
    gap: 0.75rem;
}

.nx-blog-card-read-more:hover::after {
    width: 100%;
}

.nx-blog-card-read-more-icon {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.nx-blog-card-read-more:hover .nx-blog-card-read-more-icon {
    transform: translateX(4px);
}

/* ============================================================
   RESPONSIVE ADJUSTMENTS
   ============================================================ */

@media (max-width: 576px) {
    .nx-blog-card-image-wrapper {
        padding-top: 62.5%; /* 16:10 aspect ratio on mobile for better visibility */
        border-radius: 12px 12px 0 0;
        min-height: 180px;
    }
    
    .nx-blog-card-excerpt {
        -webkit-line-clamp: 2;
    }
}

/* Extra small devices */
@media (max-width: 375px) {
    .nx-blog-card-image-wrapper {
        padding-top: 65%; /* Even taller on very small screens */
        min-height: 160px;
    }
}

/* ============================================================
   ACCESSIBILITY
   ============================================================ */

.nx-blog-card:focus-within {
    outline: 2px solid var(--bs-primary, #0d6efd);
    outline-offset: 4px;
    border-radius: 16px;
}

.nx-blog-card-read-more:focus-visible {
    outline: 2px solid var(--bs-primary, #0d6efd);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nx-blog-card {
    animation: fadeInUp 0.6s ease-out;
}

.nx-blog-card:nth-child(1) { animation-delay: 0.1s; }
.nx-blog-card:nth-child(2) { animation-delay: 0.2s; }
.nx-blog-card:nth-child(3) { animation-delay: 0.3s; }

@keyframes gradient-shift {
    0% {
        background-position: 0% center;
    }
    50% {
        background-position: 100% center;
    }
    100% {
        background-position: 0% center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .nx-blog-card {
        animation: none;
    }
    
    .nx-blog-card-image {
        transition: none;
    }
    
    .nx-blog-card::before {
        animation: none;
    }
}
