/* Project Masonry Block Frontend Styles */

.mdsa-project-masonry-block {
    padding: 0px 0px;
    background: #fff;
}

.mdsa-project-masonry-block .section-title {
    text-align: left;
    margin: 20px 0;
    font-size: 36px;
    font-weight: 300;
   
    position: relative;
}
/*
.mdsa-project-masonry-block .section-title:after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: #007cba;
    margin: 20px auto 0;
}
*/
/* Masonry Grid Container */
.projects-masonry-grid {
    transition: all 0.3s ease;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    grid-gap: 10px;
    align-items: start;
    position: relative;
    padding-bottom: 100px;
}

/* Project Item */
.project-item {
    padding: 5px;
    margin-bottom: 0px;
    transition: all 0.4s ease;
    break-inside: avoid;
    opacity: 1;
    transform: scale(1);
    position: relative;
}

@media (max-width: 768px) {
    .project-item {
        padding: 0px;
    }
}

/* Project Link - Makes entire item clickable */
.project-link {
    display: block;
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
}

/* CSS-only filtering states */
.project-item {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.project-item.filtered-out {
    display: none;
}

.project-item.filtered-in {
    display: block;
    opacity: 1;
    transform: scale(1);
    animation: fadeInScale 0.4s ease forwards;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.project-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.project-item:hover .project-image {
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

/* Project Image Container - 4:3 Aspect Ratio */
.project-image {
    position: relative;
    overflow: hidden;
    border-radius: 0px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    aspect-ratio: 4 / 3;
    width: 100%;
}

.project-image:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.3s ease;
}

.project-item:hover .project-image img {
    transform: scale(1.05);
}

/* Project Overlay */
.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
   /* margin: 5px !important; */
    padding: 20px !important;
    
   
}



.project-item:hover .project-overlay {
    opacity: 1;
   
}

/* Overlay Content */
.project-overlay-content {
    text-align: center;
    color: white;
    max-width: 100%;
}

/* Project Title in Overlay */
.project-overlay-content .project-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.3;
    color: white;
    transition: color 0.3s ease;
}

.project-link:hover .project-overlay-content .project-title {
   /* color: #a0cdee; */
}

/* Project Terms (Tags & Categories) */
.project-overlay-content .project-terms {
    margin-bottom: 12px;
    font-size: 12px;
}

.project-terms .project-tags,
.project-terms .project-categories {
    margin-bottom: 6px;
    line-height: 1.4;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
}

.project-terms .terms-label {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    margin-right: 6px;
    font-size: 11px;
    text-transform: lowercase;
    letter-spacing: 0.5px;
}

.project-terms .term-item {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 2px 8px;
    border-radius: 0px;
    font-size: 11px;
    margin-right: 4px;
    margin-bottom: 3px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.project-terms .tag-item {
    background: rgba(0, 124, 186, 0.3);
    border-color: rgba(0, 124, 186, 0.5);
}

.project-terms .category-item {
   /* background: rgba(255, 165, 0, 0.3);
    border-color: rgba(255, 165, 0, 0.5);
    */
    background: rgb(160 205 238 / 16%);
    border-color: rgb(160 205 238);
}

/* Project Location */
.project-overlay-content .project-location {
    font-size: 14px;
    margin-bottom: 15px;
    opacity: 0.9;
   /* text-transform: lowercase; */
    font-style: italic;
}

/* Project Excerpt */
.project-overlay-content .project-excerpt {
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 20px;
    opacity: 0.9;
}

/* Overlay Actions */
.project-overlay-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10;
    opacity: 0;
    transition: all 0.3s ease;
}

.project-item:hover .project-overlay-actions {
    opacity: 1;
}

.project-overlay-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.project-overlay-actions a:hover {
    background: #007cba;
    transform: scale(1.1);
    border-color: #007cba;
    color: white;
}

.project-overlay-actions i {
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 768px) {

    .mdsa-project-masonry-block {
        padding: 0px 30px;
        background: #fff;
    }

    .projects-masonry-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        grid-gap: 8px;
    }

    .mdsa-project-masonry-block .container{
        padding: 0;
    }
    /*
    .mdsa-project-masonry-block .section-title {
        font-size: 28px;
        margin-bottom: 30px;
    }
        */
    
    .project-overlay-content .project-title {
        font-size: 16px;
    }
    
    .project-terms .terms-label {
        font-size: 10px;
    }
    
    .project-terms .term-item {
        font-size: 10px;
        padding: 1px 6px;
        margin-right: 3px;
    }
    
    .project-overlay-actions {
        gap: 6px;
        top: 8px;
        right: 8px;
    }
    
    .project-overlay-actions a {
        width: 32px;
        height: 32px;
    }
    
    .project-overlay-actions i {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .mdsa-project-masonry-block {
        padding: 0px 15px;
        background: #fff;
    }

    .projects-masonry-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        grid-gap: 6px;
    }
    /*
    .mdsa-project-masonry-block .section-title {
        font-size: 24px;
        margin-bottom: 25px;
    }
        */
    
    .project-overlay-content .project-title {
        font-size: 14px;
    }
    
    .project-terms .terms-label {
        font-size: 9px;
    }
    
    .project-terms .term-item {
        font-size: 9px;
        padding: 1px 5px;
        margin-right: 2px;
    }
    
    .project-overlay-content .project-location {
        font-size: 12px;
    }
    
    .project-overlay-content .project-excerpt {
        font-size: 12px;
    }
}

/* No Projects Message */
.no-projects {
    text-align: center;
    padding: 50px 20px;
    color: #666;
    font-style: italic;
}

/* Filter Container Styles */
.filterable-grid {
    position: relative;
}

.filterable-item {
    /* Additional styles for filterable items can go here */
}

/* Filter Buttons Styles */
.project-filters {
    text-align: center;
    margin-bottom: 40px;
}

.filter-buttons {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;

    
}

.filter-item {
    margin: 0;
}

.filter-link {
    display: inline-block;
    padding: 10px 20px;
    background: #fff;
    color: #333;
    text-decoration: none;
    border-radius: 0px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid #d8d8d8;
}

.filter-link:hover {
    background: #007cba;
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,124,186,0.3);
}

.filter-link.active {
    background: #007cba;
    color: white;
   
}

/* Filter Button Responsive */
@media (max-width: 768px) {
    .filter-buttons {
        /*
        flex-direction: column;
        align-items: center;
        */
        gap: 8px;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }
    
    .filter-link {
        padding: 8px 16px;
        font-size: 13px;
    }

    .filter-buttons li a{
        width: 100%;
    }

    .project-overlay {
        position: relative;
        text-align: center;
        max-width: 100%;
        opacity: 1;
        justify-content: flex-start;
        background: none;
    }

    .project-overlay-content {
        text-align: center;
 
        max-width: 100%;
        position: relative;
    }

    .project-overlay-content .project-title{
        color: #444;
        text-align: left;
        font-size: 18px;
        line-height: 1.1;
        letter-spacing: -0.5px;
        margin: 0;
    }

    .project-overlay-content .project-location{
        color: #888;
        text-align: left;
        margin: 0;
    }
    
    
}

@media (max-width: 480px) {
    

    .filter-buttons li a{
        width: 100%;
    }
    
    .filter-link {
        padding: 10px 20px;
        font-size: 14px;
        min-width: 120px;
    }

   

}

/* Filter Animation */
.project-item {
    transform-origin: center;
}

.project-item.animate-in {
    animation: fadeInScale 0.4s ease forwards;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Loading State for Filtering */
.projects-masonry-grid.filtering {
    pointer-events: none;
}

.projects-masonry-grid.filtering::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 10;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
} 

/* Touch Device Styles */
/*
@media (hover: none) and (pointer: coarse) {
    .projects-masonry-grid .project-overlay-content {
        text-align: center;
        color: #9C27B0;
        max-width: 100%;
        position: relative;
    }
} 
    */

/* Disable hover effects on mobile and iPad */
@media (max-width: 768px) {
    .project-item:hover {
        transform: none !important;
        box-shadow: none !important;
    }
    
    .project-item:hover .project-image {
        box-shadow: 0 4px 15px rgba(0,0,0,0.1) !important;
    }
    
    .project-item:hover .project-image img {
        transform: none !important;
    }
    
    .project-image:hover {
        box-shadow: 0 4px 15px rgba(0,0,0,0.1) !important;
    }
    
    .project-item:hover .project-overlay {
        opacity: 0.5 !important;
    }
    
    .project-item:hover .project-overlay-actions {
        opacity: 0.5 !important;
    }
    
    /* Make overlay content always visible on mobile for accessibility */
    .project-overlay {
        opacity: 0.8 !important;
        background: #fff !important;
    }
    
    .project-overlay-actions {
        opacity: 1 !important;
    }
}



	/* Disable project image hover effects on mobile/iPad */
	.project-image:hover > img {
		opacity: 1 !important;
	}
	
	.project-image:hover > .link-icon {
		left: 0 !important;
		opacity: 0 !important;
	}
	
	.project-image:hover > .pp-icon {
		right: 0 !important;
		opacity: 0 !important;
	}
	
	/* Keep icons visible but static on mobile */
	.project-image .link-icon,
	.project-image .pp-icon {
		opacity: 1 !important;
		left: 15% !important;
	}
	
	.project-image .pp-icon {
		right: 15% !important;
		left: auto !important;
	}
}
