/* Uniform height for query block post cards - FIXED VERSION - POSTS ONLY */

/* Make the post template grid items equal height - POSTS ONLY */
.wp-block-query .wp-block-post-template.is-layout-grid .wp-block-post.post {
    display: flex;
    height: 100%;
}

.wp-block-query .wp-block-post-template.is-layout-grid:has(.wp-block-post.post) {
    display: grid;
    align-items: stretch;
}

/* Ensure all post cards have the same height - POSTS ONLY */
.wp-block-query .wp-block-post-template .wp-block-post.post .wp-block-columns.are-vertically-aligned-center {
    height: 100% !important;
    min-height: 200px !important;
    align-items: stretch !important;
}

/* Make sure the image column takes full height and removes vertical centering - POSTS ONLY */
.wp-block-query .wp-block-post-template .wp-block-post.post .wp-block-columns .wp-block-column:first-child.is-vertically-aligned-center {
    display: flex !important;
    align-items: stretch !important;
    align-self: stretch !important;
}

/* Featured image should fill full height - override all inline styles - POSTS ONLY */
.wp-block-query .wp-block-post-template .wp-block-post.post .wp-block-columns .wp-block-post-featured-image[style] {
    height: 100% !important;
    aspect-ratio: unset !important;
    width: 100% !important;
    display: flex !important;
    margin: 0 !important;
}

/* Links inside featured image should take full height - POSTS ONLY */
.wp-block-query .wp-block-post-template .wp-block-post.post .wp-block-columns .wp-block-post-featured-image a[style] {
    height: 100% !important;
    width: 100% !important;
    display: flex !important;
}

/* Images should fill the container completely - override inline styles - POSTS ONLY */
.wp-block-query .wp-block-post-template .wp-block-post.post .wp-block-columns .wp-block-post-featured-image img[style],
.wp-block-query .wp-block-post-template .wp-block-post.post .wp-block-columns .wp-block-post-featured-image .default-post-thumbnail {
    height: 100% !important;
    width: 100% !important;
    object-fit: cover !important;
    display: block !important;
    border-top-left-radius: 10px !important;
    border-bottom-left-radius: 10px !important;
}

/* More specific override for inline styled images - POSTS ONLY */
.wp-block-query .wp-block-post-template .wp-block-post.post .wp-block-columns .wp-block-post-featured-image img[style*="height"] {
    height: 100% !important;
}

.wp-block-query .wp-block-post-template .wp-block-post.post .wp-block-columns .wp-block-post-featured-image img[style*="width"] {
    width: 100% !important;
}

/* Ensure content column also stretches - POSTS ONLY */
.wp-block-query .wp-block-post-template .wp-block-post.post .wp-block-columns .wp-block-column:last-child.is-vertically-aligned-center {
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
}

/* Target the specific figure element styling - POSTS ONLY */
.wp-block-query .wp-block-post-template .wp-block-post.post figure.wp-block-post-featured-image.aligncenter[style*="aspect-ratio"] {
    aspect-ratio: unset !important;
    height: 100% !important;
}

.wp-block-query .wp-block-post-template .wp-block-post.post figure.wp-block-post-featured-image.aligncenter[style*="height"] {
    height: 100% !important;
}

/* Override any WordPress core aspect ratio constraints - POSTS ONLY */
.wp-block-query .wp-block-post-template .wp-block-post.post .wp-block-post-featured-image[style*="aspect-ratio:auto"] {
    aspect-ratio: unset !important;
}

/* Hover effects for post cards - POSTS ONLY */
.wp-block-query .wp-block-post-template .wp-block-post.post .wp-block-columns {
    transition: box-shadow 0.3s ease, transform 0.2s ease !important;
}

.wp-block-query .wp-block-post-template .wp-block-post.post .wp-block-columns:hover {
    box-shadow: 0px 8px 25px 0 rgba(0, 0, 0, 0.15) !important;
    transform: translateY(-2px) !important;
}

/* Tablet and mobile breakpoints - earlier breakpoint - POSTS ONLY */
@media (max-width: 900px) {
    /* Force single column layout earlier - POSTS ONLY */
    .wp-block-query .wp-block-post-template.columns-2:has(.wp-block-post.post) {
        grid-template-columns: 1fr !important;
    }
}

/* Mobile responsive adjustments - KEEP SIDE BY SIDE LAYOUT - POSTS ONLY */
@media (max-width: 900px) {
    .wp-block-query .wp-block-post-template .wp-block-post.post .wp-block-columns {
        min-height: 180px !important;
        flex-direction: row !important;
        align-items: stretch !important;
        flex-wrap: nowrap !important;
        overflow: hidden !important;
    }
    
    /* Image column should maintain its width but be shorter - POSTS ONLY */
    .wp-block-query .wp-block-post-template .wp-block-post.post .wp-block-columns .wp-block-column:first-child.is-vertically-aligned-center {
        flex: 0 0 33.33% !important;
        max-width: 33.33% !important;
        min-width: 33.33% !important;
        height: 100% !important;
    }
    
    /* Set consistent height for mobile images - fill container height - POSTS ONLY */
    .wp-block-query .wp-block-post-template .wp-block-post.post .wp-block-columns .wp-block-post-featured-image[style] {
        height: 100% !important;
        width: 100% !important;
        min-height: 180px !important;
    }
    
    .wp-block-query .wp-block-post-template .wp-block-post.post .wp-block-columns .wp-block-post-featured-image a[style] {
        height: 100% !important;
        width: 100% !important;
        min-height: 180px !important;
    }
    
    .wp-block-query .wp-block-post-template .wp-block-post.post .wp-block-columns .wp-block-post-featured-image img[style],
    .wp-block-query .wp-block-post-template .wp-block-post.post .wp-block-columns .wp-block-post-featured-image .default-post-thumbnail {
        border-radius: 10px 0 0 10px !important;
        height: 100% !important;
        width: 100% !important;
        min-height: 180px !important;
        object-fit: cover !important;
    }
    
    /* Content column adjustments - POSTS ONLY */
    .wp-block-query .wp-block-post-template .wp-block-post.post .wp-block-columns .wp-block-column:last-child.is-vertically-aligned-center {
        flex: 1 1 66.66% !important;
        max-width: 66.66% !important;
        min-width: 0 !important;
        overflow: hidden !important;
        word-wrap: break-word !important;
        padding-top: var(--wp--preset--spacing--20) !important;
        padding-bottom: var(--wp--preset--spacing--20) !important;
        padding-left: var(--wp--preset--spacing--20) !important;
        padding-right: var(--wp--preset--spacing--20) !important;
    }
    
    /* Better text wrapping for mobile - POSTS ONLY */
    .wp-block-query .wp-block-post-template .wp-block-post.post .wp-block-columns .wp-block-column:last-child .wp-block-post-title {
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        hyphens: auto !important;
        line-height: 1.3 !important;
        margin-bottom: 0.5rem !important;
    }
    
    .wp-block-query .wp-block-post-template .wp-block-post.post .wp-block-columns .wp-block-column:last-child .wp-block-post-date {
        margin-bottom: 0.5rem !important;
    }
    
    .wp-block-query .wp-block-post-template .wp-block-post.post .wp-block-columns .wp-block-column:last-child .wp-block-read-more {
        margin-top: auto !important;
    }
}