/*
 * Gallery Masonry Grid Styles
 * Custom CSS for Pinterest-style masonry gallery layout
 */

/* Main gallery container */
.masonry-gallery {
    margin: 0 -10px;
    clear: both;
}

/* Individual grid items */
.grid-item {
    width: 33.333%; /* 3 columns on desktop */
    float: left;
    padding: 10px;
    box-sizing: border-box;
}

/* Grid item link wrapper */
.grid-item a {
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

/* Grid item images */
.grid-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.4s ease;
}

/* Hover effect on link */
.grid-item a:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transform: translateY(-4px);
}

/* Image zoom effect on hover */
.grid-item a:hover img {
    transform: scale(1.05);
}

/* Overlay effect on hover */
.grid-item a::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(40, 87, 33, 0.7); /* Green overlay matching your brand */
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.grid-item a:hover::after {
    opacity: 1;
}

/* Zoom icon on hover */
.grid-item a::before {
    content: '+';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    color: #fff;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.3s ease 0.1s;
    font-weight: 300;
    line-height: 1;
}

.grid-item a:hover::before {
    opacity: 1;
}

/* Responsive breakpoints */

/* Large tablets and small desktops */
@media (max-width: 1200px) {
    .grid-item {
        width: 33.333%; /* Keep 3 columns */
    }
}

/* Tablets */
@media (max-width: 991px) {
    .grid-item {
        width: 50%; /* 2 columns on tablets */
    }
}

/* Mobile devices */
@media (max-width: 767px) {
    .grid-item {
        width: 50%; /* 2 columns on larger phones */
    }
    
    .masonry-gallery {
        margin: 0 -5px;
    }
    
    .grid-item {
        padding: 5px;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .grid-item {
        width: 100%; /* 1 column on small phones */
    }
}

/* Animation for grid items on load */
.grid-item {
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

.grid-item:nth-child(1) { animation-delay: 0.1s; }
.grid-item:nth-child(2) { animation-delay: 0.15s; }
.grid-item:nth-child(3) { animation-delay: 0.2s; }
.grid-item:nth-child(4) { animation-delay: 0.25s; }
.grid-item:nth-child(5) { animation-delay: 0.3s; }
.grid-item:nth-child(6) { animation-delay: 0.35s; }
.grid-item:nth-child(n+7) { animation-delay: 0.4s; }

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

/* Fancybox customizations for gallery */
.fancybox-slide--image {
    padding: 44px 0;
}

.fancybox-caption {
    background: rgba(40, 87, 33, 0.9);
    color: #fff;
    font-size: 14px;
    padding: 15px;
}

/* Loading state */
.masonry-gallery.is-loading .grid-item {
    opacity: 0.3;
}

/* Print styles */
@media print {
    .grid-item {
        width: 50%;
        page-break-inside: avoid;
    }
    
    .grid-item a::before,
    .grid-item a::after {
        display: none;
    }
}

