/* ===================================
   COMMUNITY HIGHLIGHTS (6-COLUMN) STYLES
   =================================== */

.wp-block-acf-atax-community-highlights .community-highlights-section {
    width: 100%;
    background: #EDEFF5; /* Light gray background to match other blocks */
    padding: 72px 20px 72px 20px;
}

.community-highlights-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.community-highlights-eyebrow {
    font-size: 18px;
    letter-spacing: 0.08em;
    color: #354477;
    font-weight: 700;
    text-align: center;
    font-family: 'Montserrat', sans-serif;
}

.community-highlights-heading {
    font-size: 48px;
    font-weight: 700;
    color: #354477; /* Primary heading color aligns with brand */
    text-align: center;
    margin: 0;
    font-family: 'Montserrat', sans-serif;
}

.community-highlights-description {
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    text-align: center;
    font-size: 16px;
    font-weight: 400; /* Regular per request */
    color: var(--primary-color, #354477); /* Primary color */
    font-family: 'Montserrat', sans-serif;
    line-height: 1.6;
}

.community-highlights-description p {
    font-size: 16px;
    font-weight: 400; /* Regular per request */
    color: var(--primary-color, #354477); /* Primary color */
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    line-height: 1.6;
}

/* Carousel viewport/track showing 3 items */
.community-highlights-viewport {
    overflow: hidden;
    width: 100%;
    margin-top: 32px;
}

.community-highlights-track {
    display: flex;
    width: 100%;
    will-change: transform;
    transition: transform 400ms ease;
    gap: 0;
}

.community-highlight-card {
    position: relative;
    border-radius: 0; /* No radius */
    overflow: hidden;
    min-height: 520px; /* Reduced height per request */
    width: 33.3333%; /* fallback */
    flex: 0 0 33.3333%; /* force 3 visible items */
    display: flex;
    align-items: flex-end;
}

.community-highlight-card-media {
    position: absolute;
    inset: 0;
}

.community-highlight-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Bottom → up gradient: primary at bottom to transparent top */
.community-highlight-card-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, rgba(15, 40, 105, 0) 0%, rgba(15, 40, 105, 0.85) 100%);
    height: 60%;
}

.community-highlight-card-content {
    position: relative;
    z-index: 2;
    color: #fff;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.community-highlight-card-name { font-size: 22px; font-weight: 700; margin: 0; font-family: 'Montserrat', sans-serif; }
.community-highlight-card-location { font-size: 14px; font-weight: 400; margin: 0; opacity: 0.9; font-family: 'Montserrat', sans-serif; }
.community-highlight-desc { 
    font-size: 16px; font-weight: 400; margin: 0; font-family: 'Montserrat', sans-serif; 
    line-height: 24px; overflow: hidden; max-height: 48px; position: relative;
    transition: max-height 1500ms linear; /* slow, linear expand/collapse */
    will-change: max-height;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
}


.community-highlight-desc::after { content: ''; }

.community-highlight-card.is-expanded .community-highlight-desc { 
    max-height: 500px; 
    -webkit-line-clamp: unset; line-clamp: unset; /* reveal full text */
}

/* During collapse, keep unclamped while max-height animates back down */
.community-highlight-card.is-collapsing .community-highlight-desc {
    max-height: 48px;
    -webkit-line-clamp: unset; line-clamp: unset;
}


/* No gradient overlay to toggle on hover */

.community-highlight-card-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    text-decoration: underline;
    font-weight: 600;
}

.community-highlight-card-link:hover {
    opacity: 0.9;
}

.community-highlight-card-link-icon {
    width: 16px;
    height: 16px;
    display: block;
}

/* Controls */
.community-highlights-controls { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 16px; }
.community-highlights-controls-left { display: flex; align-items: center; gap: 8px; }
.community-highlights-controls-right { display: flex; align-items: center; gap: 8px; }

.community-highlights-prev,
.community-highlights-next {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: 1px solid rgba(53,68,119,0.25);
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.community-highlights-dots { display: inline-flex; gap: 8px; }
.community-highlights-dots button {
    width: 6px; height: 6px; border-radius: 999px; border: 0; background: #C6CFEE; padding: 0; cursor: pointer;
}
.community-highlights-dots button[aria-current="true"] { background: #354477; width: 8px; height: 8px; }

/* Desktop: 3 per page; Mobile: 1 per page */
@media (max-width: 767px) {
    .community-highlights-heading { 
        font-size: 36px; 
    }
    .community-highlight-card { width: 100%; flex-basis: 100%; }
}
