/**
 * Taxonomy Masonry Grid Styles
 */

.taxonomy-masonry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin: 20px 0;
    padding: 0;
    align-items: start;
}


/* Masonry-like behavior using CSS Grid masonry (when supported) */
@supports (grid-template-rows: masonry) {
    .taxonomy-masonry-grid {
        grid-template-rows: masonry;
    }
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .taxonomy-masonry-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 18px;
    }
}

@media (max-width: 768px) {
    .taxonomy-masonry-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .taxonomy-masonry-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

/* Tile styles */
.taxonomy-tile {
    display: flex;
    flex-direction: column;
    position: relative;
    background-color: #207D6C; /* Fallback color */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    text-decoration: none;
    color: #fff !important;
    min-height: 200px;
    height: 100%;
    justify-content: center;
    align-items: center;
}

/* Overlay with primary color at 80% opacity */
.taxonomy-tile-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #207D6C;
    opacity: 0.8;
    z-index: 1;
    transition: opacity 0.3s ease;
}

.taxonomy-tile:hover .taxonomy-tile-overlay {
    opacity: 0.7;
}

.taxonomy-tile:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    text-decoration: none;
}

.taxonomy-tile-content {
    position: relative;
    z-index: 2;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
    justify-content: center;
    align-items: center;
    text-align: center;
    width: 100%;
}

.taxonomy-tile-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff !important;
    line-height: 1.3;
}

.taxonomy-tile-description {
    margin: 0;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9) !important;
    line-height: 1.5;
}

.taxonomy-tile-count {
    display: inline-block;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8) !important;
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

/* Alternative masonry layout using CSS columns for better browser support */
.taxonomy-masonry-grid.columns-fallback {
    column-count: 3;
    column-gap: 20px;
    display: block;
}

.taxonomy-masonry-grid.columns-fallback .taxonomy-tile {
    break-inside: avoid;
    margin-bottom: 20px;
    display: inline-block;
    width: 100%;
}

@media (max-width: 1024px) {
    .taxonomy-masonry-grid.columns-fallback {
        column-count: 2;
    }
}

@media (max-width: 768px) {
    .taxonomy-masonry-grid.columns-fallback {
        column-count: 1;
    }
}


