:root {
    --navbar-height: 90px;
}

/* Final authoritative mobile hero override to ensure a dark, cohesive appearance */
@media (max-width: 768px) {
    .blog-hero {
        background: linear-gradient(180deg, rgba(3,10,25,0.88) 0%, rgba(6,18,36,0.88) 60%, rgba(8,26,46,0.92) 100%),
                                url('images/Blog%20Cover%201%20(1).webp') center/cover no-repeat !important;
        background-attachment: scroll !important;
        background-size: cover !important;
        background-blend-mode: multiply !important;
        color: #ffffff !important;
    }

    .blog-hero::before {
        background: linear-gradient(rgba(0,0,0,0.65), rgba(0,0,0,0.55)) !important;
        opacity: 1 !important;
        z-index: 2 !important;
    }

    .blog-hero::after {
        opacity: 0.18 !important;
    }

    .blog-hero-content,
    .blog-hero-content h1,
    .blog-hero-content p,
    .hero-badge {
        z-index: 3 !important;
        color: #ffffff !important;
        -webkit-text-fill-color: #ffffff !important;
        text-shadow: 0 8px 20px rgba(0,0,0,0.75) !important;
    }
}


/* Mobile hero: match card image tones with a darker bluish gradient */
@media (max-width: 768px) {
    .blog-hero {
        /* use mobile-optimized image and a bluish multiply gradient for richer tones */
        background: linear-gradient(180deg, rgba(4,12,28,0.65) 0%, rgba(6,24,44,0.65) 60%, rgba(10,34,56,0.75) 100%),
                    url('images/Blog%20Cover%201%20(1).webp') center/cover no-repeat;
        background-attachment: scroll;
        background-blend-mode: multiply;
        color: #ffffff;
    }

    .blog-hero::before {
        /* subtle bluish highlights instead of a full gray overlay */
        background: radial-gradient(circle at 18% 40%, rgba(59,130,246,0.12) 0%, transparent 35%),
                    radial-gradient(circle at 82% 80%, rgba(99,102,241,0.06) 0%, transparent 35%);
        opacity: 1;
        z-index: 1;
        mix-blend-mode: screen;
    }

    .blog-hero::after {
        opacity: 0.18;
    }

    .blog-hero-content h1,
    .blog-hero-content p,
    .hero-badge {
        color: #ffffff !important;
        -webkit-text-fill-color: #ffffff !important;
        text-shadow: 0 6px 18px rgba(2,6,12,0.7);
    }

    .blog-hero-content {
        z-index: 2;
    }
}

@media (max-width: 768px) {
    :root {
        --navbar-height: 80px;
    }
}

body {
    background-color: var(--background);
    color: var(--text-color);
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
}

/* Hero Section */
.blog-hero {
    position: relative;
    width: 100%;
    min-height: 100vh;        /* ✅ full viewport */
    height: 100vh;
    padding: 4rem 2rem;
    padding-top: calc(var(--navbar-height) + 2rem); /* content offset only */
    background:
        linear-gradient(135deg, rgba(20, 20, 30, 0.88) 0%,
                                 rgba(30, 35, 45, 0.82) 50%,
                                 rgba(25, 30, 40, 0.85) 100%),
        url('images/Blog Cover 1 (1).webp') center/cover no-repeat;
    background-attachment: fixed;
    color: white;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    margin: 0;
}

/* Animated background elements */
.blog-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(59, 130, 246, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(147, 197, 253, 0.1) 0%, transparent 50%);
    animation: pulse 8s ease-in-out infinite;
}

.blog-hero::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(147, 197, 253, 0.2) 0%, rgba(59, 130, 246, 0.1) 40%, transparent 70%);
    border-radius: 50%;
    opacity: 0.8;
    animation: float 15s ease-in-out infinite;
}

/* Additional decorative elements */
.blog-hero-content::before {
    content: '';
    position: absolute;
    top: 50%;
    left: -15%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(34, 211, 238, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    transform: translateY(-50%);
    animation: float 20s ease-in-out infinite reverse;
    z-index: 0;
}

.blog-hero-content {
    position: relative;
    max-width: 900px;
    z-index: 2;
    animation: slideUpFade 1s ease-out;
    text-align: center;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Hero Image Section */
.blog-hero-image {
    display: none;
}

/* Hero Graphic Container */
.hero-graphic-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Concentric Circles */
.graphic-circle-outer {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(147, 197, 253, 0.05));
    display: flex;
    align-items: center;
    justify-content: center;
    animation: rotateClockwise 20s linear infinite;
    box-shadow: 0 0 80px rgba(59, 130, 246, 0.3);
}

.graphic-circle-middle {
    width: 75%;
    height: 75%;
    border-radius: 50%;
    background: linear-gradient(225deg, rgba(99, 102, 241, 0.15), rgba(59, 130, 246, 0.08));
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(147, 197, 253, 0.3);
    animation: rotateCounterClockwise 15s linear infinite;
}

.graphic-circle-inner {
    width: 70%;
    height: 70%;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.2), rgba(59, 130, 246, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(147, 197, 253, 0.4);
    box-shadow: inset 0 0 60px rgba(59, 130, 246, 0.2);
}

/* Circuit Icon in Center */
.graphic-icon {
    position: relative;
    width: 150px;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Circuit Lines */
.circuit-line {
    position: absolute;
    background: linear-gradient(90deg, transparent, rgba(147, 197, 253, 0.8), transparent);
    animation: pulse 2s ease-in-out infinite;
}

.circuit-line-1 {
    width: 80px;
    height: 3px;
    top: 30%;
    left: 10%;
    transform: rotate(45deg);
    animation-delay: 0s;
}

.circuit-line-2 {
    width: 60px;
    height: 3px;
    top: 50%;
    right: 15%;
    transform: rotate(-30deg);
    animation-delay: 0.5s;
}

.circuit-line-3 {
    width: 70px;
    height: 3px;
    bottom: 25%;
    left: 15%;
    transform: rotate(-45deg);
    animation-delay: 1s;
}

.circuit-line-4 {
    width: 50px;
    height: 3px;
    top: 60%;
    right: 20%;
    transform: rotate(60deg);
    animation-delay: 1.5s;
}

/* Circuit Dots */
.circuit-dot {
    position: absolute;
    width: 12px;
    height: 12px;
    background: rgba(147, 197, 253, 0.9);
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.8),
                0 0 40px rgba(59, 130, 246, 0.4);
    animation: glowPulse 2s ease-in-out infinite;
}

.dot-1 {
    top: 20%;
    left: 20%;
    animation-delay: 0s;
}

.dot-2 {
    top: 25%;
    right: 25%;
    animation-delay: 0.3s;
}

.dot-3 {
    bottom: 30%;
    left: 25%;
    animation-delay: 0.6s;
}

.dot-4 {
    bottom: 25%;
    right: 20%;
    animation-delay: 0.9s;
}

.dot-5 {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    animation-delay: 1.2s;
}

.dot-6 {
    top: 70%;
    left: 50%;
    animation-delay: 1.5s;
}

/* Floating Particles */
.graphic-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: rgba(147, 197, 253, 0.6);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
    animation: floatParticle 4s ease-in-out infinite;
}

.particle-1 {
    top: 10%;
    left: 20%;
    animation-delay: 0s;
    animation-duration: 3s;
}

.particle-2 {
    top: 30%;
    right: 15%;
    animation-delay: 0.5s;
    animation-duration: 4s;
}

.particle-3 {
    bottom: 20%;
    left: 15%;
    animation-delay: 1s;
    animation-duration: 3.5s;
}

.particle-4 {
    top: 60%;
    right: 25%;
    animation-delay: 1.5s;
    animation-duration: 4.5s;
}

.particle-5 {
    bottom: 40%;
    left: 30%;
    animation-delay: 2s;
    animation-duration: 3s;
}

.particle-6 {
    top: 80%;
    right: 30%;
    animation-delay: 2.5s;
    animation-duration: 4s;
}

.hero-badge {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin: 0 auto 1.5rem auto;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    animation: slideUpFade 1s ease-out 0.2s both;
    color: #ffffff;
    text-align: center;
}

.blog-hero-content h1 {
    font-size: 4rem;
    margin: 0 auto 1.5rem auto;
    line-height: 1.1;
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff 0%, #e0f2fe 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: slideUpFade 1s ease-out 0.4s both;
    text-shadow: 0 0 40px rgba(147, 197, 253, 0.3);
    text-align: center;
    width: 100%;
}

.blog-hero-content p {
    font-size: 1.2rem;
    max-width: 650px;
    line-height: 1.7;
    margin: 0 auto 2.5rem auto;
    color: rgba(226, 232, 240, 0.95);
    animation: slideUpFade 1s ease-out 0.6s both;
    text-align: center;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    animation: slideUpFade 1s ease-out 0.8s both;
    width: 100%;
}

.hero-buttons .btn {
    padding: 1rem 2.5rem;
    font-size: 1.05rem;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.hero-buttons .btn.primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.hero-buttons .btn.primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(59, 130, 246, 0.4);
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

/* Animations */
@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-30px) rotate(5deg);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes rotateClockwise {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes rotateCounterClockwise {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(-360deg);
    }
}

@keyframes glowPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.2);
    }
}

@keyframes floatParticle {
    0%, 100% {
        transform: translateY(0) translateX(0);
        opacity: 0.3;
    }
    25% {
        transform: translateY(-15px) translateX(10px);
        opacity: 0.8;
    }
    50% {
        transform: translateY(-25px) translateX(-5px);
        opacity: 1;
    }
    75% {
        transform: translateY(-15px) translateX(-10px);
        opacity: 0.8;
    }
}

/* Section Header */
.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--dark-color);
    font-weight: 700;
}

.section-header p {
    font-size: 1.1rem;
    color: var(--light-text);
    max-width: 600px;
    margin: 0 auto;
}

/* Blog Articles Section */
.blog-articles {
    position: relative;
    padding: 120px 0;
    background: #FFFFFF;
    overflow: hidden;
    z-index: 5;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
}

/* ============================================
   BLOG CARDS VIEW - Full width container
   ============================================ */
.blog-cards-view {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
    padding: 0 6%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    box-sizing: border-box;
}

/* ============================================
   RESPONSIVE: Mobile - Reduce padding for more card space
   ============================================ */
@media (max-width: 768px) {
    .blog-cards-view {
        padding: 0 3%;
    }
}

.blog-articles-title {
    font-size: 42px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: #1A1A1A;
    margin: 0 auto 60px auto;
    padding-bottom: 24px;
    text-align: center;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.08),
                 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: opacity 0.6s cubic-bezier(0.25, 0.1, 0.25, 1),
                transform 0.6s cubic-bezier(0.25, 0.1, 0.25, 1);
    position: relative;
    display: inline-block;
    background: linear-gradient(135deg, #1A1A1A 0%, rgba(26, 26, 26, 0.95) 50%, #1A1A1A 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: #1A1A1A;
}

.blog-articles-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(31, 98, 204, 0.6), transparent);
    border-radius: 2px;
}

/* ============================================
   CAROUSEL CONTAINER - Full width with proper spacing
   ============================================ */
/* Blog Carousel Wrapper */
.blog-carousel-container {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    cursor: grab;
    isolation: isolate;
}

.blog-carousel-container:active {
    cursor: grabbing;
}

/* Fade gradients at edges */
.blog-carousel-container::before,
.blog-carousel-container::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 100px;
    z-index: 6;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.blog-carousel-container::before {
    left: 0;
    background: linear-gradient(to right, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0.8) 30%, rgba(255, 255, 255, 0) 100%);
    opacity: 0; /* Default: hidden at start */
}

.blog-carousel-container::after {
    right: 0;
    background: linear-gradient(to left, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0.8) 30%, rgba(255, 255, 255, 0) 100%);
}

.blog-carousel-container.at-start::before {
    opacity: 0 !important;
}

.blog-carousel-container.at-end::after {
    opacity: 0 !important;
}

/* Show left fade when not at start */
.blog-carousel-container:not(.at-start)::before {
    opacity: 1;
}

/* Hide fade gradients when there's only one card */
.blog-carousel-container:has(.blog-carousel-track:not(:has(.blog-card-link:nth-child(2))))::before,
.blog-carousel-container:has(.blog-carousel-track:not(:has(.blog-card-link:nth-child(2))))::after {
    display: none;
}

/* Desktop: Ensure left fade is always hidden by default on page load */
@media (min-width: 769px) {
    .blog-carousel-container::before {
        opacity: 0;
    }
    
    .blog-carousel-container:not(.at-start):not(.at-end)::before {
        opacity: 1;
    }
}

/* ============================================
   CAROUSEL TRACK - Full width utilization
   ============================================ */
/* Blog Carousel Track */
.blog-carousel-track {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 20px 0;
    cursor: inherit;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    justify-content: flex-start;
    align-items: flex-start;
    width: 100%;
    min-width: 100%;
}

/* When there's only one card, center it */
.blog-carousel-track:not(:has(.blog-card-link:nth-child(2))) {
    justify-content: center;
}

.blog-carousel-track::-webkit-scrollbar {
    display: none;
}

/* ============================================
   MODERN BLOG CARD STYLING - REBUILT (FIXED FOR VISIBILITY)
   ============================================
   Changes made:
   - Increased card height: 580px (desktop) to ensure all content is visible
   - Fixed image height: 240px (desktop) for better image visibility
   - Content area: auto height with proper padding
   - Added line clamping for titles (2 lines) and descriptions (3 lines)
   - Removed restrictive max-height to allow content to display properly
   - Override conflicting styles from style.css that set percentage-based widths
   - Added comments to track all responsive changes
   ============================================ */
/* ============================================
   OVERRIDE: Remove conflicting percentage-based widths from style.css
   ============================================ */
.blog-carousel-track .blog-card {
    flex: 0 0 auto !important;
    min-width: 380px !important;
    max-width: 380px !important;
}

/* ============================================
   BLOG CARD - Fixed dimensions with proper overflow handling
   ============================================ */
/* Blog Card - Fixed dimensions for consistent sizing with proper content visibility */
.blog-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 380px;
    max-width: 380px;
    min-height: 580px;
    flex-shrink: 0;
}

.blog-card:hover {
    transform: translateY(-8px);
    border-color: rgba(31, 98, 204, 0.25);
    box-shadow: 0 12px 40px rgba(31, 98, 204, 0.18);
}

/* ============================================
   CAROUSEL ARROW BUTTONS - Hidden on all devices
   ============================================ */
/* Blog Carousel Arrow Buttons */
.blog-carousel-btn {
    display: none !important;
}

/* ============================================
   MOBILE DRAG INDICATORS - Show swipe hints
   ============================================ */
.mobile-drag-indicator {
    display: none; /* Hidden by default (desktop) */
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(66, 133, 244, 0.9);
    font-size: 14px;
    font-weight: 600;
    align-items: center;
    gap: 6px;
    z-index: 30;
    pointer-events: none; /* Don't block card interactions */
    transition: opacity 0.4s ease, visibility 0.4s ease;
    background: rgba(255, 255, 255, 0.95);
    padding: 8px 12px;
    border-radius: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.mobile-drag-left {
    left: 8px;
}

.mobile-drag-right {
    right: 8px;
}

.mobile-drag-indicator i {
    font-size: 16px;
    color: rgba(66, 133, 244, 1);
}

.drag-hint {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #2c3e50;
    font-weight: 600;
}

/* Animate indicators with subtle pulse effect */
@keyframes pulse-indicator {
    0%, 100% { 
        opacity: 1; 
        transform: translateY(-50%) scale(1); 
    }
    50% { 
        opacity: 0.75; 
        transform: translateY(-50%) scale(0.96); 
    }
}

.mobile-drag-indicator {
    animation: pulse-indicator 2.5s ease-in-out infinite;
}

/* When indicators are hidden */
.mobile-drag-indicator[style*="opacity: 0"],
.blog-carousel-container.at-start .mobile-drag-left,
.blog-carousel-container.at-end .mobile-drag-right {
    animation: none; /* Stop animation when hidden */
}

/* Carousel arrow buttons - hidden */
.blog-carousel-arrow-left,
.blog-carousel-arrow-right {
    display: none !important;
}

/* ============================================
   CARD SCROLL SNAP ALIGNMENT - Desktop
   ============================================ */
.blog-card-link {
    scroll-snap-align: start;
}

/* ============================================
   CARD IMAGE SECTION - Increased height with overflow control
   ============================================ */
.blog-card-image {
    position: relative;
    width: 100%;
    height: 240px;
    min-height: 240px;
    overflow: hidden;
    background: linear-gradient(135deg, #f0f4f8 0%, #e2e8f0 100%);
    flex-shrink: 0;
    /* Ensure image container clips properly */
    border-radius: 16px 16px 0 0;
}

.blog-card-image img {
    width: 100%;
    height: 100%;
    /* Use cover on desktop, but contain will be overridden on mobile */
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease, filter 0.3s ease;
    /* Scale from center to prevent edge cropping */
    transform-origin: center center;
    /* Ensure image stays within bounds */
    will-change: transform;
}

/* ============================================
   RESPONSIVE: Mobile - Use contain with flexible height to prevent cropping and extra space
   ============================================ */
@media (max-width: 768px) {
    .blog-card-image {
        height: auto !important; /* Flexible height based on image */
        min-height: auto !important;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .blog-card-image img {
        object-fit: contain !important; /* Show full image without cropping */
        object-position: center center;
        height: auto !important; /* Let image maintain aspect ratio */
        max-height: 400px; /* Maximum height to prevent too large images */
    }
    
    .blog-card-image-second img {
        object-fit: contain !important; /* Show full image */
        object-position: center center;
        height: auto !important; /* Let image maintain aspect ratio */
        max-height: 400px; /* Maximum height */
    }
}

/* ============================================
   CARD IMAGE HOVER - Subtle zoom effect without cropping
   ============================================ */
.blog-card:hover .blog-card-image img {
    /* Very subtle scale to prevent logo/elements from being cropped */
    /* Using 1.01 (1% zoom) instead of 1.05 to keep all content visible */
    transform: scale(1.01);
    /* Optional: Add slight brightness for visual feedback */
    filter: brightness(1.05);
}

/* ============================================
   SECOND CARD IMAGE POSITIONING - Match logo position with first card
   ============================================ */
/* Adjust Blog2Cover.webp image positioning to match first card's logo placement */
/* This ensures the LIT logo in top-right corner is positioned exactly like the first card */
.blog-card-image-second img {
    /* Position image to show logo in top-right corner like first card */
    /* Using percentage values: 70% horizontal (right side), 10% vertical (top area) */
    /* Fine-tuned to match first card's logo spacing from edges */
    object-position: 70% 10%;
    /* Ensure cover maintains aspect ratio while showing logo area */
    object-fit: cover;
}

.blog-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(31, 98, 204, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    /* Ensure overlay doesn't block arrow buttons */
    z-index: 1;
    pointer-events: none; /* Allow clicks to pass through overlay */
}

.blog-card:hover .blog-card-overlay {
    opacity: 1;
}

.read-more-btn {
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.read-more-btn i {
    transition: transform 0.3s ease;
}

.blog-card:hover .read-more-btn i {
    transform: translateX(5px);
}

/* ============================================
   CARD CONTENT SECTION - Auto height for proper content visibility
   ============================================ */
.blog-card-content {
    padding: 1.75rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    min-height: 320px;
    overflow: visible;
}

.blog-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    align-items: center;
    flex-shrink: 0;
}

.blog-card-meta span:first-child {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.blog-card-meta .tag {
    background: rgba(31, 98, 204, 0.1);
    padding: 0.3rem 0.9rem;
    border-radius: 999px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary-color);
    font-weight: 600;
    white-space: nowrap;
}

/* ============================================
   CARD TITLE - Line clamping for consistent height
   ============================================ */
.blog-card-content h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--dark-color);
    font-weight: 600;
    line-height: 1.4;
    text-align: left;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
    min-height: 3.5rem;
    max-height: 3.5rem;
}

/* ============================================
   CARD DESCRIPTION - Line clamping for consistent height
   ============================================ */
.blog-card-content p {
    color: var(--light-text);
    line-height: 1.6;
    font-size: 0.9rem;
    text-align: left;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    margin: 0;
}

/* Blog Single View */
.blog-single-view {
    max-width: 1000px;
    margin: 0 auto;
    animation: fadeIn 0.3s ease;
    position: relative;
    box-sizing: border-box;
}

.blog-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: white;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 2rem;
    font-family: 'Poppins', sans-serif;
}

.blog-back-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateX(-5px);
}

.blog-back-btn i {
    transition: transform 0.3s ease;
}

.blog-back-btn:hover i {
    transform: translateX(-3px);
}

.blog-single-content {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

/* ============================================
   BLOG SINGLE IMAGE - Full image display without cropping
   ============================================ */
.blog-single-image {
    width: 100%;
    /* allow the image to determine height for responsive scaling */
    height: auto;
    overflow: visible;
    background: linear-gradient(135deg, #f0f4f8 0%, #e2e8f0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 30px 0 30px;
}

.blog-single-image img {
    width: 100%;
    height: auto;
    object-fit: contain;
    object-position: center;
    border-radius: 8px;
    display: block;
    max-width: 100%;
}

/* ============================================
   RESPONSIVE: Desktop - Allow image to scale naturally
   ============================================ */
/* Keep a max height on larger screens while allowing natural scaling */
@media (min-width: 992px) {
    .blog-single-image {
        max-height: 600px;
        padding: 30px;
    }

    .blog-single-image img {
        height: auto;
        max-height: 540px;
        object-fit: contain;
    }
}

.blog-single-article {
    padding: 3rem;
}

.blog-single-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    font-size: 0.9rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    align-items: center;
}

.blog-single-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.blog-single-meta .tag {
    background: rgba(31, 98, 204, 0.1);
    padding: 0.4rem 1rem;
    border-radius: 999px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary-color);
    font-weight: 600;
}

.blog-single-article h1 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--dark-color);
    font-weight: 700;
    line-height: 1.2;
    text-align: left;
}

.blog-article-content {
    color: var(--light-text);
    line-height: 1.8;
    font-size: 1.05rem;
}

.blog-article-content p {
    margin-bottom: 1.5rem;
}

.blog-article-content ul,
.blog-article-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.blog-article-content li {
    margin-bottom: 0.75rem;
}

.blog-article-content h2 {
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-top: 3rem;
    margin-bottom: 1.25rem;
    line-height: 1.25;
    text-align: left;
}

.blog-article-content h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    line-height: 1.3;
    text-align: left;
}

.blog-article-content h4 {
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--dark-color);
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    line-height: 1.4;
    text-align: left;
}

.blog-article-content strong {
    color: var(--dark-color);
    font-weight: 600;
}

.blog-article-content a {
    color: #1f62cc;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border-bottom: 1px solid transparent;
}

.blog-article-content a:hover {
    color: #1d4ed8;
    border-bottom: 1px solid #1d4ed8;
}

.blog-article-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.blog-article-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: var(--dark-color);
    background: rgba(31, 98, 204, 0.05);
    border-radius: 8px;
    font-size: 1.1rem;
}

.blog-single-cta {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(15, 23, 42, 0.1);
}

/* CTA Section */
.cta {
    padding: 5rem 5%;
    background: linear-gradient(135deg, #1f62cc 0%, #1d4ed8 100%);
    color: white;
    text-align: center;
}

.cta-content {
    max-width: 800px;
    margin: 0 auto;
}

.cta-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.cta-content p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 992px) {
    .blog-cards-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 2rem;
    }

    .blog-single-article {
        padding: 2rem;
    }

    .blog-single-article h1 {
        font-size: 2.4rem;
        text-align: left;
    }

    .blog-article-content h2 {
        font-size: 1.9rem;
    }

    .blog-article-content h3 {
        font-size: 1.65rem;
    }

    /* ============================================
       RESPONSIVE: Tablet - Allow image to scale naturally
       ============================================ */
    .blog-single-image {
        max-height: 500px;
        padding: 25px;
    }

    .blog-single-image img {
        max-height: 450px;
        object-fit: contain;
    }
}

@media (max-width: 1024px) {
    .blog-hero {
        padding: 4rem 2rem;
        padding-top: calc(4rem + var(--navbar-height));
        background-attachment: scroll;
    }

    .blog-hero-content {
        max-width: 100%;
        text-align: center;
    }

    .hero-graphic-container {
        max-width: 380px;
        margin: 0 auto;
    }
    
    .graphic-icon {
        width: 120px;
        height: 120px;
    }

    .blog-articles {
        padding: 100px 0;
    }

    .blog-articles-title {
        font-size: 38px;
    }

    /* ============================================
       RESPONSIVE: Tablet - Increased height for content visibility
       ============================================ */
    /* Override conflicting percentage-based widths from style.css */
    .blog-carousel-track .blog-card {
        flex: 0 0 auto !important;
        min-width: 350px !important;
        max-width: 350px !important;
    }

    .blog-card {
        min-width: 350px;
        max-width: 350px;
        min-height: 560px;
        border-radius: 16px;
        overflow: hidden;
    }

    .blog-card-link {
        width: 350px;
        min-width: 350px;
        max-width: 350px;
        /* min-height: 560px; */
    }

    .blog-card-image {
        height: 220px;
        min-height: 220px;
        border-radius: 16px 16px 0 0 !important;
        overflow: hidden;
    }

    .blog-card-content {
        min-height: 300px;
        padding: 1.5rem;
        overflow: visible;
    }

    .blog-card-content h3 {
        font-size: 1.15rem;
        min-height: 3.5rem;
    }
}

@media (max-width: 768px) {
    .grid-2x2 {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            grid-template-rows: repeat(2, auto);
            gap: 16px;
    }
    .blog-hero {
        /* padding: 8rem 1.5rem 4rem; */
        background-attachment: scroll;
    }
    
    .blog-hero::after,
    .blog-hero-content::before {
        opacity: 0.4;
        width: 300px;
        height: 300px;
    }

    .blog-hero-content {
        text-align: center;
    }

    .hero-badge {
        font-size: 0.8rem;
        padding: 0.4rem 1rem;
    }

    .blog-hero-content h1 {
        font-size: 2.5rem;
        margin: 0 0 1rem 0;
    }
    
    .blog-hero-content p {
        font-size: 1rem;
        margin-bottom: 1.75rem;
        max-width: 100%;
    }

    .hero-buttons {
        justify-content: center;
    }

    .hero-buttons .btn {
        padding: 0.85rem 2rem;
        font-size: 1rem;
    }

    .hero-graphic-container {
        max-width: 320px;
    }
    
    .graphic-icon {
        width: 100px;
        height: 100px;
    }
    
    .circuit-line {
        height: 2px;
    }
    
    .circuit-dot {
        width: 10px;
        height: 10px;
    }
    
    .dot-5 {
        width: 12px;
        height: 12px;
    }

    .blog-articles {
        padding: 90px 0;
    }

    .blog-articles-title {
        font-size: 36px;
        margin-bottom: 40px;
        padding-bottom: 20px;
    }

    .blog-articles-title::after {
        width: 70px;
        height: 3px;
    }

    /* ============================================
       RESPONSIVE: Mobile carousel container - Remove carousel, use vertical layout
       ============================================ */
    .blog-carousel-container {
        padding: 0;
        width: 100%;
        max-width: 100%;
        display: block;
        position: relative;
        overflow: visible;
    }
    
    /* ============================================
       RESPONSIVE: Mobile - Hide all carousel navigation elements
       ============================================ */
    .blog-carousel-arrow-left,
    .blog-carousel-arrow-right,
    .mobile-drag-indicator {
        display: none !important;
    }
    
    /* Hide carousel fade gradients on mobile */
    .blog-carousel-container::before,
    .blog-carousel-container::after {
        display: none !important;
    }

    /* ============================================
       RESPONSIVE: Mobile - Vertical card layout (no carousel)
       ============================================ */
    .blog-carousel-track {
        display: flex;
        flex-direction: column;
        gap: 24px;
        width: 100%;
        overflow: visible;
        scroll-snap-type: none;
        cursor: default;
        padding: 0;
        margin: 0;
        box-sizing: border-box;
    }
    
    .blog-carousel-track:active {
        cursor: default;
    }

    /* ============================================
       RESPONSIVE: Mobile - Cards take full width in vertical stack
       ============================================ */
    .blog-carousel-track .blog-card {
        flex: 0 0 auto;
        min-width: 100% !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    .blog-card-link {
        min-width: 100% !important;
        max-width: 100% !important;
        width: 100% !important;
        flex-shrink: 0;
        scroll-snap-align: none;
        scroll-snap-stop: auto;
    }

    /* ============================================
       RESPONSIVE: Mobile - Add defined border and touch feedback
       ============================================ */
    .blog-card {
        min-width: 100%;
        max-width: 100%;
        width: 100%;
        min-height: auto;
        height: auto;
        display: flex;
        flex-direction: column;
        /* Add visible border for separation */
        border: 1px solid rgba(0, 0, 0, 0.12) !important;
        border-radius: 16px !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
        /* Ensure card doesn't clip content */
        overflow: hidden;
        /* Smooth transition for touch effects */
        transition: all 0.3s ease !important;
    }

    .blog-card-link {
        min-width: 100%;
        max-width: 100%;
        min-height: auto;
        height: auto;
        display: flex;
        flex-direction: column;
        /* Ensure link doesn't clip content */
        overflow: visible;
        /* Enable touch feedback */
        -webkit-tap-highlight-color: rgba(31, 98, 204, 0.1);
    }
    
    /* Touch feedback using :active state on link (works on mobile) */
    .blog-card-link:active .blog-card {
        border-color: rgba(31, 98, 204, 0.4) !important;
        box-shadow: 0 6px 16px rgba(31, 98, 204, 0.2) !important;
        transform: translateY(-3px) !important;
        background-color: rgba(31, 98, 204, 0.02) !important;
    }
    
    /* Fallback for hover devices (tablets with mouse) */
    @media (hover: hover) and (pointer: fine) {
        .blog-card-link:hover .blog-card {
            border-color: rgba(31, 98, 204, 0.3) !important;
            box-shadow: 0 6px 16px rgba(31, 98, 204, 0.15) !important;
            transform: translateY(-4px) !important;
        }
    }

    /* ============================================
       RESPONSIVE: Mobile - Flexible height to fit image without extra space
       ============================================ */
    .blog-card-image {
        height: auto !important; /* Flexible height based on image */
        min-height: auto !important;
        max-height: none !important;
        flex-shrink: 0;
        /* Ensure border radius on top corners */
        border-radius: 16px 16px 0 0 !important;
        overflow: hidden;
        /* Let image determine height */
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Prevent image cropping - show full image with flexible height */
    .blog-card-image img {
        object-fit: contain !important; /* Show full image without cropping */
        object-position: center center;
        width: 100%;
        height: auto !important; /* Let image maintain aspect ratio */
        max-height: 400px; /* Maximum height to prevent too large images */
        display: block;
        border-radius: 16px 16px 0 0;
    }
    
    /* Second card image - also use contain with flexible height */
    .blog-card-image-second img {
        object-fit: contain !important; /* Show full image without cropping */
        object-position: center center;
        height: auto !important; /* Let image maintain aspect ratio */
        max-height: 400px; /* Maximum height to prevent too large images */
    }

    /* ============================================
       RESPONSIVE: Mobile - Ensure all text is visible with proper spacing
       ============================================ */
    .blog-card-content {
        padding: 1.5rem;
        min-height: auto;
        overflow: visible;
        display: flex;
        flex-direction: column;
        flex: 1;
        gap: 0.75rem; /* Add gap between children for proper spacing */
    }

    .blog-card-content h3 {
        font-size: 1.2rem;
        min-height: auto;
        /* Remove line clamp to show full title */
        -webkit-line-clamp: unset !important;
        display: block !important;
        overflow: visible !important;
        text-overflow: unset !important;
        line-height: 1.4;
        margin-bottom: 0 !important; /* No margin needed when description is hidden */
        margin-top: 0;
        padding-bottom: 0;
        /* Ensure title is fully visible */
        max-height: none !important;
        height: auto !important;
        white-space: normal !important;
    }

    .blog-card-content p {
        /* Remove line clamp to show full description */
        -webkit-line-clamp: unset;
        display: block;
        overflow: visible;
        text-overflow: unset;
        line-height: 1.5;
        margin-top: 0 !important; /* Ensure no top margin that could cause overlap */
        margin-bottom: 0;
        padding-top: 0;
    }
    
    /* Ensure meta section has proper spacing */
    .blog-card-content .blog-card-meta {
        margin-bottom: 0.75rem;
    }

    /* Stronger dark overlay and text contrast on smaller screens */
    .blog-hero::before {
        /* add a dark linear overlay on top of the existing decorative gradients */
        background: linear-gradient(rgba(0,0,0,0.55), rgba(0,0,0,0.55)),
                    radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
                    radial-gradient(circle at 80% 80%, rgba(59, 130, 246, 0.06) 0%, transparent 50%),
                    radial-gradient(circle at 40% 20%, rgba(147, 197, 253, 0.05) 0%, transparent 50%);
        z-index: 1;
        opacity: 1;
    }

    .blog-hero::after {
        opacity: 0.35;
    }

    /* Ensure hero text is solid white on small screens for legibility */
    .blog-hero-content h1 {
        -webkit-text-fill-color: #ffffff !important;
        -webkit-background-clip: initial !important;
        background: none !important;
        color: #ffffff !important;
        text-shadow: 0 2px 12px rgba(0,0,0,0.6);
    }

    .blog-hero-content p,
    .hero-badge {
        color: rgba(255,255,255,0.95) !important;
    }

    /* ============================================
       RESPONSIVE: Mobile - Allow image to scale naturally
       ============================================ */
    .blog-single-image {
        max-height: 300px;
        padding: 15px;
    }

    .blog-single-image img {
        max-height: 270px;
        object-fit: contain;
    }

    .blog-single-article {
        padding: 1.5rem;
    }

    .blog-single-article h1 {
        font-size: 1.4rem !important;
        text-align: left;
    }

    .blog-article-content h2 {
        font-size: 1.25rem !important;
    }

    .blog-article-content h3 {
        font-size: 1.15rem !important;
    }

    .blog-article-content h4 {
        font-size: 1.05rem !important;
    }

    .blog-back-btn {
        padding: 0.65rem 1.25rem;
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
    }

    .cta {
        padding: 4rem 1.5rem;
    }

    .cta-content h2 {
        font-size: 2rem;
    }

    .cta-content p {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .blog-hero {
        /* padding: 7rem 1.25rem 3.5rem; */
        background-attachment: scroll;
    }

    .hero-badge {
        font-size: 0.75rem;
        padding: 0.35rem 0.85rem;
    }
    
    .blog-hero-content h1 {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    .blog-hero-content p {
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
    }

    .hero-buttons .btn {
        padding: 0.75rem 1.75rem;
        font-size: 0.95rem;
    }

    .hero-graphic-container {
        max-width: 260px;
    }

    .graphic-icon {
        width: 80px;
        height: 80px;
    }

    .particle {
        width: 6px;
        height: 6px;
    }

    .blog-articles {
        padding: 70px 0;
    }

    .blog-articles-title {
        font-size: 32px;
        margin-bottom: 35px;
        padding-bottom: 18px;
    }

    .blog-articles-title::after {
        width: 60px;
    }

    /* ============================================
       RESPONSIVE: Small mobile - Vertical card layout (no carousel)
       ============================================ */
    .blog-carousel-container {
        padding: 0;
        width: 100%;
        display: block;
        position: relative;
    }

    /* Hide all carousel navigation on small mobile */
    .blog-carousel-arrow-left,
    .blog-carousel-arrow-right,
    .mobile-drag-indicator {
        display: none !important;
    }

    .blog-carousel-btn {
        width: 42px;
        height: 42px;
    }

    .blog-carousel-btn i {
        font-size: 16px;
    }

    .blog-carousel-arrow-left {
        left: 5px;
    }

    .blog-carousel-arrow-right {
        right: 5px;
    }

    /* ============================================
       RESPONSIVE: Small Mobile - Add defined border and touch feedback
       ============================================ */
    .blog-card {
        min-width: 100%;
        max-width: 100%;
        width: 100%;
        min-height: auto;
        height: auto;
        /* Defined border for card separation */
        border: 1px solid rgba(0, 0, 0, 0.12) !important;
        border-radius: 16px !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
        overflow: hidden !important;
        transition: all 0.3s ease !important;
    }
    
    .blog-card-link {
        -webkit-tap-highlight-color: rgba(31, 98, 204, 0.1);
    }
    
    /* Touch feedback for small mobile */
    .blog-card-link:active .blog-card {
        border-color: rgba(31, 98, 204, 0.4) !important;
        box-shadow: 0 6px 16px rgba(31, 98, 204, 0.2) !important;
        transform: translateY(-3px) !important;
        background-color: rgba(31, 98, 204, 0.02) !important;
    }
    
    @media (hover: hover) and (pointer: fine) {
        .blog-card-link:hover .blog-card {
            border-color: rgba(31, 98, 204, 0.3) !important;
            box-shadow: 0 6px 16px rgba(31, 98, 204, 0.15) !important;
            transform: translateY(-4px) !important;
        }
    }

    .blog-card-image {
        height: 200px;
        min-height: 200px;
        border-radius: 16px 16px 0 0 !important;
        overflow: hidden;
    }

    .blog-card-content {
        min-height: 300px;
        padding: 1.5rem;
        overflow: visible;
    }

    .blog-card-content h3 {
        font-size: 1.1rem;
        min-height: 3.2rem;
    }
    
    /* ============================================
       RESPONSIVE: Small mobile - Vertical card layout (no carousel)
       ============================================ */
    .blog-carousel-track {
        display: flex;
        flex-direction: column;
        gap: 24px;
        width: 100%;
        overflow: visible;
        scroll-snap-type: none;
        cursor: default;
        padding: 0;
        margin: 0;
    }
    
    .blog-carousel-track:active {
        cursor: default;
    }

    /* ============================================
       RESPONSIVE: Small mobile - Cards take full width in vertical stack
       ============================================ */
    .blog-carousel-track .blog-card {
        flex: 0 0 auto;
        min-width: 100% !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    .blog-card-link {
        min-width: 100% !important;
        max-width: 100% !important;
        width: 100% !important;
        flex-shrink: 0;
        scroll-snap-align: none;
        scroll-snap-stop: auto;
    }

    .blog-card-content h3 {
        font-size: 1.2rem;
    }
}

/* Ensure blog card images are flexible on mobile and strengthen hero gradient */
@media (max-width: 768px) {
    /* let the card image flow naturally instead of forcing a fixed aspect */
    .blog-card-image {
        aspect-ratio: unset;
        height: 250px;
        min-height: 250px;
        padding: 0;
        border-radius: 16px 16px 0 0 !important;
        overflow: hidden;
        /* Remove background gradient - images should show through */
        background: transparent !important;
    }
    
    .blog-card-image img {
        display: block !important;
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }

    .blog-card-image img {
        width: 100%;
        height: auto;
        object-fit: cover;
        object-position: center;
        display: block;
        max-width: 100%;
    }

    /* ensure cards occupy available width with defined borders and touch feedback */
    .blog-card {
        min-width: 100%;
        max-width: 100%;
        border: 1px solid rgba(0, 0, 0, 0.12) !important;
        border-radius: 16px !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
        overflow: hidden !important;
        transition: all 0.3s ease !important;
    }

    .blog-card-link {
        min-width: 100%;
        max-width: 100%;
        -webkit-tap-highlight-color: rgba(31, 98, 204, 0.1);
    }
    
    /* Touch feedback on tap */
    .blog-card-link:active .blog-card {
        border-color: rgba(31, 98, 204, 0.4) !important;
        box-shadow: 0 6px 16px rgba(31, 98, 204, 0.2) !important;
        transform: translateY(-3px) !important;
        background-color: rgba(31, 98, 204, 0.02) !important;
    }
    
    @media (hover: hover) and (pointer: fine) {
        .blog-card-link:hover .blog-card {
            border-color: rgba(31, 98, 204, 0.3) !important;
            box-shadow: 0 6px 16px rgba(31, 98, 204, 0.15) !important;
            transform: translateY(-4px) !important;
        }
    }

    /* stronger dark background for hero on mobile (higher contrast) */
    .blog-hero {
        background: linear-gradient(180deg, rgba(2,6,23,0.98), rgba(12,16,22,0.98)),
                                url('images/Blog Cover 1 (1).webp') center/cover no-repeat;
        background-attachment: scroll;
        background-blend-mode: overlay;
    }

    .blog-hero::before {
        background: linear-gradient(rgba(0,0,0,0.85), rgba(0,0,0,0.7));
        opacity: 1;
        z-index: 2;
    }

    .blog-hero::after {
        opacity: 0.25;
    }

    .blog-hero-content {
        z-index: 3;
    }
}

/* ============================================
   COMPREHENSIVE MOBILE RESPONSIVE ENHANCEMENTS
   ============================================ */

/* Prevent horizontal scroll */
body, html {
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
}

/* Touch-friendly interactive elements */
@media (max-width: 768px) {
  button, a, input, select, textarea {
    min-height: 44px;
    min-width: 44px;
  }
  
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  textarea,
  select {
    font-size: 16px;
  }
  
  .blog-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .blog-card {
    margin-bottom: 1.5rem;
    border: 1px solid rgba(0, 0, 0, 0.12) !important;
    border-radius: 16px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
    overflow: hidden !important;
    transition: all 0.3s ease !important;
  }
  
  .blog-card-link {
    -webkit-tap-highlight-color: rgba(31, 98, 204, 0.1);
  }
  
  /* Touch feedback */
  .blog-card-link:active .blog-card {
    border-color: rgba(31, 98, 204, 0.4) !important;
    box-shadow: 0 6px 16px rgba(31, 98, 204, 0.2) !important;
    transform: translateY(-3px) !important;
    background-color: rgba(31, 98, 204, 0.02) !important;
  }
  
  @media (hover: hover) and (pointer: fine) {
    .blog-card-link:hover .blog-card {
      border-color: rgba(31, 98, 204, 0.3) !important;
      box-shadow: 0 6px 16px rgba(31, 98, 204, 0.15) !important;
      transform: translateY(-4px) !important;
    }
  }
  
  .blog-card-image {
    height: 200px;
    border-radius: 16px 16px 0 0 !important;
    overflow: hidden;
  }
  
  .blog-content {
    padding: 1.5rem 1rem;
  }
  
  .blog-back-btn {
    width: 100%;
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .blog-card-image {
    height: 180px;
    border-radius: 16px 16px 0 0 !important;
    overflow: hidden;
  }
  
  .blog-content {
    padding: 1.25rem 0.875rem;
  }

  /* Ensure proper spacing on very small screens */
  .blog-single-view {
    padding-top: calc(var(--navbar-height) + 2rem) !important;
  }

  .blog-single-image {
    max-height: 250px;
    padding: 10px;
  }

  .blog-single-image img {
    max-height: 230px;
  }
}

/* Mobile hero: ensure a dark, high-contrast gradient over the background image */
@media (max-width: 768px) {
    .blog-hero {
        background: linear-gradient(180deg, rgba(6,8,15,0.96), rgba(20,24,30,0.96)),
                                url('images/Blog Cover 1 (1).webp') center/cover no-repeat;
        background-attachment: scroll;
        background-blend-mode: multiply;
    }

    .blog-hero::before {
        /* solid dark overlay to ensure text contrast */
        background: linear-gradient(rgba(0,0,0,0.65), rgba(0,0,0,0.55));
        opacity: 1;
        z-index: 2;
    }

    .blog-hero::after {
        opacity: 0.25;
    }

    /* ensure content sits above the overlay */
    .blog-hero-content {
        z-index: 3;
    }

    /* ============================================
       RESPONSIVE: Mobile - Show images properly (not hidden)
       ============================================ */
    /* Use img tag for proper image display on mobile - same images as desktop */
    .blog-card-image {
        background: transparent !important; /* Remove background that might cover images */
    }

    /* ============================================
       RESPONSIVE: Mobile - Show images without cropping
       ============================================ */
    .blog-card-image img {
        display: block !important; /* Show images */
        visibility: visible !important;
        width: 100% !important;
        height: 100% !important;
        opacity: 1 !important;
        object-fit: contain !important; /* Show full image without cropping */
        object-position: center center !important;
    }
    
    .blog-card-image-second img {
        object-fit: contain !important; /* Show full image */
        object-position: center center !important;
    }
}

/* Justify article text on small screens for better reading flow */
@media (max-width: 768px) {
    .blog-article-content,
    .blog-article-content p,
    .blog-article-content ul,
    .blog-article-content ol {
        text-align: justify;
        text-justify: inter-word;
        hyphens: auto;
    }
    /* prevent extremely long words from breaking layout */
    .blog-article-content img {
        max-width: 100%;
        height: auto;
    }
}

/* ============================================
   RESPONSIVE: Mobile - Ensure images are fully visible
   ============================================ */
@media (max-width: 768px) {
    /* ============================================
       RESPONSIVE: Mobile - Ensure images are visible
       ============================================ */
    /* ============================================
       RESPONSIVE: Mobile - Increase height and prevent cropping
       ============================================ */
    .blog-card-image {
        height: 280px; /* Increased height to show more of image */
        min-height: 280px;
        overflow: hidden;
        padding: 0;
        border-radius: 16px 16px 0 0 !important;
        /* Remove background gradient that might cover images */
        background: transparent !important;
        display: block;
        flex-shrink: 0;
        position: relative;
    }

    /* ============================================
       RESPONSIVE: Mobile - Flexible height to fit image without extra space
       ============================================ */
    .blog-card-image img {
        width: 100%;
        height: auto !important; /* Let image maintain aspect ratio */
        max-height: 400px; /* Maximum height to prevent too large images */
        /* Use contain to show full image without cropping */
        object-fit: contain !important;
        object-position: center center;
        display: block !important;
        position: relative;
        z-index: 1;
    }
    
    /* Ensure second card image shows full image with flexible height */
    .blog-card-image-second img {
        object-fit: contain !important; /* Show full image */
        object-position: center center;
        height: auto !important; /* Let image maintain aspect ratio */
        max-height: 400px; /* Maximum height to prevent too large images */
    }
    
    /* Ensure overlay doesn't hide image */
    .blog-card-overlay {
        z-index: 2;
    }
}

/* =========================================
   🔒 FINAL AUTHORITATIVE HERO HEIGHT LOCK
   ========================================= */

.blog-hero {
  height: 100vh !important;
  min-height: 100vh !important;
}

/* Mobile: content offset ONLY, never height math */
@media (max-width: 768px) {
  .blog-hero {
    height: 100vh !important;
    min-height: 100vh !important;

    /* compensate for navbar safely */
    padding-top: calc(var(--navbar-height) + 1.5rem) !important;
    padding-bottom: 2rem !important;

    background-attachment: scroll !important;
  }
}

/* =========================================
   MOBILE HERO VERTICAL CENTER ALIGNMENT
   ========================================= */

@media (max-width: 768px) {
  .blog-hero {
    display: flex !important;
    flex-direction: column;
    justify-content: center !important;  /* ✅ vertical center */
    align-items: center !important;

    padding-top: var(--navbar-height) !important; /* minimal offset */
    padding-bottom: 2rem !important;
    text-align: center;
  }

  .blog-hero-content {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
  }
}

/* Blog detail page fix for fixed navbar */
.blog-single-view,
.blog-hero {
  padding-top: calc(var(--navbar-height) + 2rem);
  margin-top: 0;
}

/* ===== SMART CENTERING FOR BLOG META ON MOBILE ===== */
@media (max-width: 768px) {

    /* Fix blog single view spacing for mobile - ensure image is below navbar */
    .blog-single-view {
        padding-top: calc(var(--navbar-height) + 2rem) !important;
        margin-top: 0 !important;
    }

    .blog-single-content {
        margin-top: 0 !important;
    }
    
    .blog-single-image {
        margin-top: 0 !important;
    }

    /* ============================================
       MOBILE: Hide description, adjust card height for visibility
       ============================================ */
    /* ============================================
       RESPONSIVE: Mobile - Show all text content
       ============================================ */
    /* ============================================
       RESPONSIVE: Mobile - Hide description text
       ============================================ */
    .blog-card-content p {
        display: none !important; /* Hide description on mobile */
    }

    .blog-card-content h3 {
        font-size: 1.1rem !important;
        min-height: auto;
        -webkit-line-clamp: unset; /* Show full title */
        overflow: visible;
        line-height: 1.4;
        margin-bottom: 0 !important; /* No bottom margin needed when description is hidden */
        padding-bottom: 0;
    }
    
    /* Ensure proper spacing for meta section */
    .blog-card-content .blog-card-meta {
        margin-bottom: 0.75rem !important;
    }

    /* Adjust card height to accommodate all content with borders and touch feedback */
    .blog-card {
        min-height: auto;
        height: auto;
        border: 1px solid rgba(0, 0, 0, 0.12) !important;
        border-radius: 16px !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
        overflow: hidden !important;
        transition: all 0.3s ease !important;
    }

    .blog-card-link {
        min-height: 400px;
        -webkit-tap-highlight-color: rgba(31, 98, 204, 0.1);
    }
    
    /* Touch feedback on tap */
    .blog-card-link:active .blog-card {
        border-color: rgba(31, 98, 204, 0.4) !important;
        box-shadow: 0 6px 16px rgba(31, 98, 204, 0.2) !important;
        transform: translateY(-3px) !important;
        background-color: rgba(31, 98, 204, 0.02) !important;
    }
    
    @media (hover: hover) and (pointer: fine) {
        .blog-card-link:hover .blog-card {
            border-color: rgba(31, 98, 204, 0.3) !important;
            box-shadow: 0 6px 16px rgba(31, 98, 204, 0.15) !important;
            transform: translateY(-4px) !important;
        }
    }

    .blog-card-content {
        min-height: 160px;
        overflow: visible;
    }

  .blog-single-meta {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: center;        /* center when wrapping */
    gap: 8px 14px;
    margin-bottom: 14px !important;
    text-align: center;             /* key for wrapped lines */
  }

  .blog-single-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    line-height: 1.35;
    white-space: normal;            /* allow wrapping */
    justify-content: center;
  }

  /* Tag pill centered and compact */
  .blog-single-meta .tag {
    flex-basis: auto;
    padding: 4px 14px;
    font-size: 0.7rem;
    border-radius: 999px;
    margin-top: 6px;
  }
}

/* ============================================
   CARD LINK WRAPPER - Fixed width, auto height for content visibility
   ============================================ */
/* Remove underline from clickable blog cards */
.blog-card-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  width: 380px;
  min-width: 380px;
  max-width: 380px;
  /* min-height: 580px; */
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.blog-card-link * {
  text-decoration: none !important;
}

/* Add hover and touch effects to card link for better UX */
.blog-card-link {
  -webkit-tap-highlight-color: rgba(31, 98, 204, 0.1);
  cursor: pointer;
}

/* Desktop hover effect */
.blog-card-link:hover .blog-card {
  border-color: rgba(31, 98, 204, 0.3) !important;
  box-shadow: 0 6px 16px rgba(31, 98, 204, 0.15) !important;
  transform: translateY(-4px) !important;
}

/* Mobile/Desktop active/tap effect */
.blog-card-link:active .blog-card {
  border-color: rgba(31, 98, 204, 0.4) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 16px rgba(31, 98, 204, 0.2) !important;
  background-color: rgba(31, 98, 204, 0.02) !important;
}

/* ============================================
   FINAL OVERRIDE: Ensure blog content never hides behind navbar
   ============================================ */
@media (max-width: 768px) {
  /* Force proper spacing for blog single pages on mobile */
  body .blog-single-view {
    padding-top: 112px !important;
    min-height: calc(100vh - 112px);
  }
  
  body .blog-single-content {
    margin-top: 0 !important;
  }
  
  body .blog-single-image {
    margin-top: 0 !important;
  }
}

/* For smaller mobile devices like iPhone SE */
@media (max-width: 480px) {
  body .blog-single-view {
    padding-top: 100px !important;
    min-height: calc(100vh - 100px);
  }
}

/* ============================================
   GLOBAL: Ensure touch feedback works on all devices
   ============================================ */
/* Enable touch feedback globally for card links */
a.blog-card-link {
  -webkit-tap-highlight-color: rgba(31, 98, 204, 0.1);
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

/* Ensure cards are tappable on touch devices */
@media (pointer: coarse) {
  .blog-card-link:active .blog-card {
    border-color: rgba(31, 98, 204, 0.5) !important;
    box-shadow: 0 8px 20px rgba(31, 98, 204, 0.25) !important;
    transform: translateY(-3px) !important;
    background-color: rgba(31, 98, 204, 0.03) !important;
  }
}
