/**
 * Improved styles for clickable project groups with responsive layout
 */
.project-group {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    will-change: transform;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 350px;
    padding: 15px 10px !important;
}

/* Project card hover effect */
.project-group:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* Ensure the image container has consistent height on desktop */
.project-group figure.wp-block-post-featured-image {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 80px;
    margin: 10px auto !important;
    width: 80%;
}

/* Ensure images maintain aspect ratio within their container */
.project-group figure.wp-block-post-featured-image img {
    max-height: 100%;
    width: auto !important; /* Force width to be auto */
    max-width: 100%; /* Ensure image doesn't overflow container */
    object-fit: contain !important; /* Ensure proper scaling */
}

/* Remove the height: 100% from featured image links */
.project-group .wp-block-post-featured-image a {
    height: auto !important;
    width: 100% !important;
    display: flex;
    justify-content: center;
}

/* Style the title area with consistent height */
.project-group h2.wp-block-post-title {
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 5px 0 !important;
    text-align: center;
}

/* Style the excerpt area with consistent height */
.project-group .wp-block-post-excerpt {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-height: 60px;
    margin: 5px 0 !important;
}

.project-group .wp-block-post-excerpt p {
    margin: auto 0 !important;
}

/* Position "Learn more" link at the bottom */
.project-group .wp-block-read-more {
    margin-top: 10px !important;
    display: inline-block;
    position: relative;
    z-index: 2;
}

/* Ensure that links inside the card maintain their normal styling */
.project-group a {
    position: relative;
    z-index: 2;
}

/* Ensure that text links still show their normal hover state */
.project-group a:hover {
    text-decoration: underline;
}

/* Adjust vertical spacing between elements */
.project-group > * {
    margin-top: 5px !important;
    margin-bottom: 5px !important;
}

/* Force WordPress block margins to be smaller */
.project-group .wp-block-post-title,
.project-group .wp-block-post-excerpt,
.project-group .wp-block-read-more {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* Responsive grid layout adjustments */
@media screen and (max-width: 1200px) {
    /* 3 columns on medium screens */
    .wp-container-core-post-template-is-layout-1 {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}

@media screen and (max-width: 768px) {
    /* 2 columns on small screens */
    .wp-container-core-post-template-is-layout-1 {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
    
    .project-group h2.wp-block-post-title {
        font-size: 0.9rem !important; /* Smaller font on mobile */
    }
    
    .project-group .wp-block-post-excerpt p {
        font-size: 0.8rem !important; /* Smaller excerpt text on mobile */
    }
}

/* Mobile styles */
@media screen and (max-width: 480px) {
    /* 1 column on very small screens */
    .wp-container-core-post-template-is-layout-1 {
        grid-template-columns: 1fr !important;
    }
    
    .project-group {
        min-height: 300px; /* Shorter cards on very small screens */
    }
    
    /* Allow natural height on mobile */
    .project-group figure.wp-block-post-featured-image {
        height: auto;
        width: 80%;
    }
    
    /* Ensure images are properly sized on mobile */
    .project-group figure.wp-block-post-featured-image img {
        max-height: none;
        width: auto !important;
        max-width: 100%;
    }
}