/* =========================================================
   Endorsements Grid Block
   ========================================================= */

.endorsements-grid-block {
    width: 100%;
}

/* --- Filter Buttons --- */
.endorsements-grid__filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 28px;
}

.endorsement-filter {
    background: transparent;
    border: 2px solid #d0cec9;
    border-radius: 999px;
    padding: 8px 20px;
    font-family: var(--wp--preset--font-family--montserrat, sans-serif);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: var(--wp--preset--color--contrast, #1a2744);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    /* Prevent layout shift on hover — border is always 2px */
}

.endorsement-filter:hover {
    border-color: var(--wp--preset--color--contrast, #1a2744);
    transform: none !important;
    box-shadow: none !important;
}

.endorsement-filter.active {
    background: var(--wp--preset--color--custom-red, #8b1a1a);
    border-color: var(--wp--preset--color--custom-red, #8b1a1a);
    color: #fff;
}

/* --- Cards Grid --- */
.endorsements-grid__cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

/* --- Individual Card --- */
.endorsement-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #fff;
    border: 2px solid transparent;
    border-radius: 10px;
    padding: 14px 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
    animation: endorsement-fade-in 0.3s ease both;
}

.endorsement-card.is-winner {
    border-color: var(--wp--preset--color--custom-red, #8b1a1a);
}

/* --- Card Image --- */
.endorsement-card__img {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    overflow: hidden;
    background: #e0dedd;
}

.endorsement-card__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
}

.endorsement-card__img-placeholder {
    width: 100%;
    height: 100%;
    background: #ccc;
    border-radius: 50%;
}

/* --- Card Info --- */
.endorsement-card__info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.endorsement-card__name {
    font-family: var(--wp--preset--font-family--montserrat, sans-serif);
    font-size: 17px;
    font-weight: 700;
    color: #181a1c;
    line-height: 1.2;
}

.endorsement-card__office {
    font-family: var(--wp--preset--font-family--montserrat, sans-serif);
    font-size: 13px;
    font-weight: 500;
    color: #555;
    line-height: 1.3;
}

.endorsement-card__winner {
    font-family: var(--wp--preset--font-family--montserrat, sans-serif);
    font-size: 13px;
    font-weight: 700;
    color: var(--wp--preset--color--custom-red, #8b1a1a);
    line-height: 1.3;
}

/* --- Footer Button --- */
.endorsements-grid__footer {
    display: flex;
    justify-content: center;
    margin-top: 36px;
}

.endorsements-grid__footer.is-hidden {
    display: none;
}

.endorsements-view-all {
    display: inline-block;
    border: 2px solid var(--wp--preset--color--custom-red, #8b1a1a);
    border-radius: 999px;
    padding: 12px 32px;
    font-family: var(--wp--preset--font-family--montserrat, sans-serif);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--wp--preset--color--custom-red, #8b1a1a);
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.endorsements-view-all:hover {
    background: var(--wp--preset--color--custom-red, #8b1a1a);
    color: #fff;
}

/* --- Fade-in Animation --- */
@keyframes endorsement-fade-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Responsive --- */
@media (max-width: 900px) {
    .endorsements-grid__cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 580px) {
    .endorsements-grid__cards {
        grid-template-columns: 1fr;
    }

    .endorsement-filter {
        font-size: 12px;
        padding: 7px 14px;
    }

    .endorsement-card__name {
        font-size: 15px;
    }
}
