
/* Portfolio Image Fix - Prevent Stretching */
.portfolio-style-2-section .featured-thumbnail {
    position: relative;
    width: 100%;
    padding-bottom: 75%; /* 4:3 Aspect Ratio - adjust as needed (100% = square, 56.25% = 16:9) */
    overflow: hidden;
    background: #f5f5f5;
}

.portfolio-style-2-section .featured-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Maintains aspect ratio, crops if needed */
    object-position: center;
    transition: transform 0.5s ease, opacity 0.3s ease;
}

.portfolio-style-2-section .featured-imagebox {
    margin-bottom: 30px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: #fff;
}

.portfolio-style-2-section .featured-imagebox:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.portfolio-style-2-section .featured-imagebox:hover .featured-thumbnail img {
    transform: scale(1.1);
}

/* Overlay Improvements */
.portfolio-style-2-section .cmt-box-view-overlay {
    background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,0.7) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.portfolio-style-2-section .featured-imagebox:hover .cmt-box-view-overlay {
    opacity: 1;
}

.portfolio-style-2-section .cmt-media-link a {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    width: 50px;
    height: 50px;
    line-height: 50px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.portfolio-style-2-section .cmt-media-link a:hover {
    background: #fff;
    transform: scale(1.1);
    color: #000;
}

.portfolio-style-2-section .featured-title h5 {
    margin: 0;
    font-weight: 600;
    color: #fff;
}

.portfolio-style-2-section .featured-title h5 a {
    color: #fff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.portfolio-style-2-section .featured-title h5 a:hover {
    color: #ffd700;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .portfolio-style-2-section .featured-thumbnail {
        padding-bottom: 70%; /* Slightly different ratio for mobile */
    }
    
    .portfolio-style-2-section .cmt-box-col-wrapper {
        margin-bottom: 20px;
    }
}

@media (max-width: 576px) {
    .portfolio-style-2-section .featured-thumbnail {
        padding-bottom: 65%;
    }
}

/* Loading Animation */
.portfolio-style-2-section .featured-imagebox {
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
}

.portfolio-style-2-section .featured-imagebox:nth-child(1) { animation-delay: 0.1s; }
.portfolio-style-2-section .featured-imagebox:nth-child(2) { animation-delay: 0.2s; }
.portfolio-style-2-section .featured-imagebox:nth-child(3) { animation-delay: 0.3s; }
.portfolio-style-2-section .featured-imagebox:nth-child(4) { animation-delay: 0.4s; }
.portfolio-style-2-section .featured-imagebox:nth-child(5) { animation-delay: 0.5s; }
.portfolio-style-2-section .featured-imagebox:nth-child(6) { animation-delay: 0.6s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Section Spacing */
.portfolio-style-2-section {
    padding: 80px 0;
}

.portfolio-style-2-section .container {
    max-width: 1200px;
}
