/* Enhanced Masonry Portfolio Styles */

/* Masonry Grid Container */
.masonry-grid {
    max-width: 100%;
    margin: 0 auto;
}

/* Individual Masonry Items - Set widths for proper column layout */
.masonry-item {
    width: calc(33.333% - 10px); /* 3 columns on desktop with gutter compensation */
    opacity: 1; /* Show immediately, no fade animation */
}

/* Responsive widths */
@media (max-width: 991px) {
    .masonry-item {
        width: calc(50% - 8px); /* 2 columns on tablet */
    }
}

@media (max-width: 575px) {
    .masonry-item {
        width: 100%; /* 1 column on mobile */
    }
}

/* Card Styling */
.masonry-item .card {
    margin-bottom: 15px;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: #fff;
    position: relative;
}

/* Simple loading skeleton for lazy-loaded cards */
.masonry-item .card-loading {
    background: #f5f5f5;
    min-height: 200px;
}

.masonry-item .card-loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    border: 2px solid #c3a689;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.6s linear infinite;
    z-index: 1;
}

.masonry-item .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* Image Styling */
.masonry-item .card img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.masonry-item .card:hover img {
    transform: scale(1.05);
}

/* Responsive Adjustments */
@media (max-width: 991px) {
    .masonry-item .card {
        margin-bottom: 12px;
    }
}

@media (max-width: 575px) {
    .masonry-item .card {
        margin-bottom: 10px;
        border-radius: 4px;
    }
}

/* Ensure portfolio section is positioned and visible */
#portfolio {
    position: relative;
    min-height: 200px;
    visibility: visible !important;
    opacity: 1 !important;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
