/* ---------- Services Section: Responsive grid (overflow fixed) ---------- */
.services {
    background: linear-gradient(180deg, #f3f6f4 0%, #eef4ef 100%);
    padding: 1.25rem;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(16, 40, 20, 0.06);
    margin-bottom: 2rem;
    border: 1px solid rgba(20, 70, 40, 0.04);
    box-sizing: border-box;
}

.services h2 {
    font-size: clamp(1.05rem, 2.2vw, 1.35rem);
    color: #123d27;
    margin-bottom: 0.9rem;
    text-align: center;
    letter-spacing: 0.2px;
}

/* Core grid: always constrained to column width (width:100%) and stretch items */
.services-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    align-items: stretch;
    justify-items: stretch;    /* important: cells stretch to column width */
    width: 100%;               /* crucial: grid cannot exceed the left-column width */
    box-sizing: border-box;
}

/* Card: fill grid cell but never exceed it */
.service-card {
    width: 100%;
    max-width: 100%;           /* prevent card exceeding grid cell/column */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    text-align: center;
    padding: 0.9rem;
    min-height: 92px;
    border-radius: 12px;
    color: #ffffff;
    font-weight: 700;
    font-size: clamp(0.95rem, 1.9vw, 1.05rem);
    text-decoration: none;
    box-shadow: 0 6px 18px rgba(9, 40, 20, 0.06);
    transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
    border: 1px solid rgba(255,255,255,0.08);
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}

.service-card .icon {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.18);
    font-size: 1.05rem;
    color: #fff;
    flex-shrink: 0;
}

.service-card span { display: block; word-break: break-word; }

.service-card:hover,
.service-card:focus {
    transform: translateY(-6px);
    box-shadow: 0 14px 30px rgba(9, 40, 20, 0.12);
    z-index: 2;
    outline: none;
    filter: saturate(1.06);
}

/* Color palettes */
.bg-1 { background: linear-gradient(135deg, #1d73b2 0%, #1173a8 100%); }
.bg-2 { background: linear-gradient(135deg, #155932 0%, #1e8a5f 100%); }
.bg-3 { background: linear-gradient(135deg, #b55b26 0%, #d46b2e 100%); }
.bg-4 { background: linear-gradient(135deg, #6a3d9a 0%, #7f59b7 100%); }
.bg-5 { background: linear-gradient(135deg, #c0392b 0%, #e74c3c 100%); }
.bg-6 { background: linear-gradient(135deg, #2a7fdf 0%, #2ba0d9 100%); }

/* ---------------- Responsive breakpoints ---------------- */

/* Very small screens: 2 columns as requested */
@media (max-width: 479px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
    }
    .service-card {
        min-height: 80px;
        padding: 0.7rem;
        max-width: 260px;
        font-size: clamp(13px, 3.2vw, 16px);
    }
    .service-card .icon { width:44px; height:44px; }
}

/* Small → Medium: 3 cards per row */
/*@media (min-width: 480px) and (max-width: 900px) {*/
@media (min-width: 480px) and (max-width: 992px) {
    .services-grid {
        grid-template-columns: repeat(3, minmax(140px, 1fr));
        gap: 0.8rem;
    }
    .service-card { max-width: 300px; min-height: 88px; }
}
/* Medium → Desktop: 3 columns with slightly larger cells */
@media (min-width: 992px) and (max-width: 1199px) {

    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
    }
    .service-card {
        min-height: 80px;
        padding: 0.7rem;
        max-width: 260px;
        font-size: clamp(13px, 3.2vw, 16px);
    }
    .service-card .icon { width:44px; height:44px; }
}

/* Large screens: allow auto-fit but keep cards capped and stretched within column */
@media (min-width: 1200px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
    }
    .service-card {
        min-height: 80px;
        padding: 0.7rem;
        max-width: 260px;
        font-size: clamp(13px, 3.2vw, 16px);
    }
    .service-card .icon { width:44px; height:44px; }
}

/* If only one card, center it */
.services-grid > .service-card:only-child {
    max-width: 720px;
    margin-inline: auto;
    justify-self: center;
}

/* Accessibility: focus-visible */
.service-card:focus-visible {
    outline: 3px solid rgba(255,255,255,0.12);
    outline-offset: 4px;
}

.services-note {
    font-size: 0.9rem;
    color: #224a33;
    margin-top: 0.9rem;
    text-align: center;
}
.feedback-header {
    display: block;               /* behaves like the old div */
    text-decoration: none;        /* remove underline */
    color: inherit;               /* keep same color */
    cursor: pointer;
}
.feedback-header:hover {
    opacity: 0.8;                 /* optional hover effect */
}