/* Modern Other Groups & Services section
   Scoped to .home-groups-modern so it does not alter other homepage cards. */

.home-groups-modern {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 8% 8%, rgba(46, 139, 87, 0.08), transparent 30%),
        radial-gradient(circle at 92% 88%, rgba(16, 63, 44, 0.06), transparent 30%),
        #f7faf8;
}

.home-groups-modern::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(15, 61, 43, 0.022) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 61, 43, 0.022) 1px, transparent 1px);
    background-size: 38px 38px;
    mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent);
}

.home-groups-modern .container {
    position: relative;
    z-index: 1;
}

.home-groups-modern-heading {
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 42px;
}

.home-groups-modern-heading h2 {
    margin: 8px 0 10px;
    color: #0c241a;
    font-size: clamp(2.1rem, 4vw, 3.25rem);
    line-height: 1.03;
    letter-spacing: -0.045em;
}

.home-groups-modern-heading p {
    max-width: 660px;
    margin: 0 auto;
    color: #637269;
    font-size: 1.05rem;
    line-height: 1.7;
}

.friends-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    align-items: stretch;
}

.friend-card {
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(18, 65, 47, 0.10);
    border-radius: 20px;
    box-shadow: 0 12px 34px rgba(16, 48, 36, 0.075);
    transition:
        transform 0.22s ease,
        box-shadow 0.22s ease,
        border-color 0.22s ease;
}

.friend-card:hover {
    transform: translateY(-6px);
    border-color: rgba(46, 139, 87, 0.28);
    box-shadow: 0 20px 46px rgba(16, 48, 36, 0.13);
}

.friend-card-media {
    position: relative;
    height: 190px;
    display: grid;
    place-items: center;
    overflow: hidden;
    padding: 30px;
    text-decoration: none;
    background:
        radial-gradient(circle at 50% 20%, rgba(255, 255, 255, 0.95), transparent 55%),
        linear-gradient(145deg, #edf4f0, #e4eee8);
}

.friend-card-media::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 38%;
    pointer-events: none;
    background: linear-gradient(to top, rgba(8, 36, 25, 0.06), transparent);
}

.friend-card-media img {
    position: relative;
    z-index: 1;
    max-width: 78%;
    max-height: 120px;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform 0.28s ease;
}

.friend-card-media-wide img {
    max-width: 90%;
    max-height: 125px;
}

.friend-card:hover .friend-card-media img {
    transform: scale(1.045);
}

.friend-card-media-photo {
    padding: 0;
    background: #dfe9e3;
}

.friend-card-media-photo img {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: cover;
}

.friend-card-badge {
    position: absolute;
    z-index: 3;
    top: 14px;
    left: 14px;
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 10px;
    border: 1px solid rgba(19, 72, 51, 0.12);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.94);
    color: #1f6f4d;
    box-shadow: 0 4px 14px rgba(11, 41, 30, 0.08);
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.055em;
    text-transform: uppercase;
    backdrop-filter: blur(8px);
}

.friend-card-badge-service {
    color: #7b5b13;
    border-color: rgba(162, 119, 22, 0.18);
    background: rgba(255, 249, 233, 0.96);
}

.friend-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 24px;
}

.friend-card-kicker {
    display: block;
    margin-bottom: 7px;
    color: #2e8b57;
    font-size: 0.73rem;
    font-weight: 800;
    letter-spacing: 0.075em;
    text-transform: uppercase;
}

.friend-card h3 {
    margin: 0 0 10px;
    color: #101b16;
    font-size: 1.22rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.friend-card p {
    margin: 0;
    color: #657168;
    font-size: 0.94rem;
    line-height: 1.65;
}

.friend-card p strong {
    color: #164b35;
}

.friend-card-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: auto;
    padding-top: 22px;
}

.friend-card-actions-split {
    justify-content: space-between;
}

.friend-card-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 44px;
    padding: 10px 16px;
    border-radius: 999px;
    background: #113f2d;
    color: #fff;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 800;
    box-shadow: 0 8px 18px rgba(17, 63, 45, 0.14);
    transition:
        background 0.18s ease,
        transform 0.18s ease,
        box-shadow 0.18s ease;
}

.friend-card-primary span {
    font-size: 1.05rem;
    line-height: 1;
    transition: transform 0.18s ease;
}

.friend-card-primary:hover {
    background: #2e8b57;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(46, 139, 87, 0.22);
}

.friend-card-primary:hover span {
    transform: translateX(3px);
}

.friend-card-primary-service {
    background: #8a6a20;
}

.friend-card-primary-service:hover {
    background: #a47d22;
}

.friend-card-secondary {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    color: #1c6948;
    text-decoration: none;
    font-size: 0.86rem;
    font-weight: 800;
}

.friend-card-secondary:hover {
    color: #0b3e2a;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.friend-card-service {
    border-color: rgba(150, 112, 27, 0.13);
}

@media (max-width: 1050px) {
    .friends-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 22px;
    }

    .friend-card-media {
        height: 205px;
    }
}

@media (max-width: 640px) {
    .home-groups-modern-heading {
        margin-bottom: 30px;
    }

    .friends-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .friend-card {
        border-radius: 17px;
    }

    .friend-card-media {
        height: 200px;
    }

    .friend-card-body {
        padding: 21px;
    }

    .friend-card-actions,
    .friend-card-actions-split {
        align-items: stretch;
        flex-direction: column;
    }

    .friend-card-primary,
    .friend-card-secondary {
        width: 100%;
        justify-content: center;
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .friend-card,
    .friend-card-media img,
    .friend-card-primary,
    .friend-card-primary span {
        transition: none;
    }

    .friend-card:hover,
    .friend-card-primary:hover {
        transform: none;
    }
}
