/**
 * Homepage Team Grid CSS
 * Ensures the homepage team grid always shows 3 columns on desktop
 */

/* Homepage-specific settings - always 3 columns on desktop */
.section-operatives .team-grid .wp-block-post-template,
.section-operatives .wp-container-core-post-template-is-layout-1,
.home .section-operatives .team-grid .wp-block-post-template,
.home .section-operatives .wp-container-core-post-template-is-layout-1 {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: var(--wp--preset--spacing--30) !important;
}

/* Remove zoom effect on hover */
.section-operatives .wp-block-post.team:hover .wp-block-post-featured-image img,
.section-operatives .team-grid .wp-block-post:hover .wp-block-post-featured-image img,
.home .section-operatives .wp-block-post.team:hover .wp-block-post-featured-image img,
.home .section-operatives .team-grid .wp-block-post:hover .wp-block-post-featured-image img {
    transform: none !important;
}

/* Override existing zoom effect */
.section-operatives .wp-block-post.team .wp-block-post-featured-image img,
.section-operatives .team-grid .wp-block-post .wp-block-post-featured-image img,
.home .section-operatives .wp-block-post.team .wp-block-post-featured-image img,
.home .section-operatives .team-grid .wp-block-post .wp-block-post-featured-image img {
    transition: none !important;
}

/* Small screens - 2 columns (768px - 991px) */
@media (max-width: 991px) {
    .section-operatives .team-grid .wp-block-post-template,
    .section-operatives .wp-container-core-post-template-is-layout-1,
    .home .section-operatives .team-grid .wp-block-post-template,
    .home .section-operatives .wp-container-core-post-template-is-layout-1 {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

/* Mobile screens - 1 column (under 767px) */
@media (max-width: 767px) {
    .section-operatives .team-grid .wp-block-post-template,
    .section-operatives .wp-container-core-post-template-is-layout-1,
    .home .section-operatives .team-grid .wp-block-post-template,
    .home .section-operatives .wp-container-core-post-template-is-layout-1 {
        grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
        gap: var(--wp--preset--spacing--20) !important;
    }
    
    /* Adjust text size and positioning for better mobile display */
    .section-operatives .wp-block-post.team .wp-block-post-title,
    .section-operatives .team-grid .wp-block-post .wp-block-post-title,
    .home .section-operatives .wp-block-post.team .wp-block-post-title,
    .home .section-operatives .team-grid .wp-block-post .wp-block-post-title {
        font-size: 1.5rem;
        bottom: 35px;
        padding-left: 40px;
    }
    
    .section-operatives .wp-block-post.team .wp-block-childtheme-team-title,
    .section-operatives .team-grid .wp-block-post .wp-block-childtheme-team-title,
    .home .section-operatives .wp-block-post.team .wp-block-childtheme-team-title,
    .home .section-operatives .team-grid .wp-block-post .wp-block-childtheme-team-title {
        bottom: 10px;
        padding-left: 40px;
    }
    
    .section-operatives .wp-block-post.team:before,
    .section-operatives .team-grid .wp-block-post:before,
    .home .section-operatives .wp-block-post.team:before,
    .home .section-operatives .team-grid .wp-block-post:before {
        left: 15px;
        width: 16px;
        height: 32px;
    }
}

/* Fix for older browsers and fallback */
@supports not (display: grid) {
    .section-operatives .team-grid .wp-block-post-template.is-flex-container > li,
    .home .section-operatives .team-grid .wp-block-post-template.is-flex-container > li {
        width: calc(33.333% - 0.83333em) !important;
    }
    
    @media (max-width: 991px) {
        .section-operatives .team-grid .wp-block-post-template.is-flex-container > li,
        .home .section-operatives .team-grid .wp-block-post-template.is-flex-container > li {
            width: calc(50% - 0.625em) !important;
        }
    }
    
    @media (max-width: 767px) {
        .section-operatives .team-grid .wp-block-post-template.is-flex-container > li,
        .home .section-operatives .team-grid .wp-block-post-template.is-flex-container > li {
            width: 100% !important;
        }
    }
}

/* Keep other styling consistent with the main team page */
.section-operatives .wp-block-post.team,
.section-operatives .team-grid .wp-block-post,
.home .section-operatives .wp-block-post.team,
.home .section-operatives .team-grid .wp-block-post {
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 0;
    margin-bottom: 30px !important;
    z-index: 1;
}

/* Ensure proper positioning on homepage */
.section-operatives .wp-block-post-featured-image,
.home .section-operatives .wp-block-post-featured-image {
    position: relative !important;
    margin: 0 !important;
    overflow: hidden !important;
}