/* =========================================================
 * Custom Services Grid — Styles
 * VA4U brand: teal/green #1aab5f, navy #14213D
 * ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ---------- Wrapper & Grid ---------- */
.csg-wrapper {
    width: 100%;
    box-sizing: border-box;
}

.csg-grid {
    display: grid;
    grid-template-columns: repeat(var(--csg-cols, 3), 1fr);
    column-gap: 20px;
    row-gap: 20px;
    box-sizing: border-box;
}

@media (max-width: 1024px) {
    .csg-grid { grid-template-columns: repeat(var(--csg-cols-tab, 2), 1fr); }
}

@media (max-width: 767px) {
    .csg-grid { grid-template-columns: repeat(var(--csg-cols-mob, 1), 1fr); }
}

/* ---------- Card base ---------- */
.csg-card {
    position: relative;
    display: block;
    background-color: #ffffff;
    border: 1.5px solid #1aab5f;
    border-radius: 10px;
    padding: 28px 24px;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    box-sizing: border-box;
    transition:
        transform       0.38s cubic-bezier(0.34, 1.26, 0.64, 1),
        box-shadow      0.38s cubic-bezier(0.34, 1.26, 0.64, 1),
        border-color    0.28s ease,
        background-color 0.28s ease;
    will-change: transform;
}

/* Content must sit above pseudo-elements */
.csg-card-inner,
.csg-card-fill {
    position: relative;
    z-index: 1;
}

/* ---------- Slide-fill overlay ---------- */
.csg-card-fill {
    position: absolute;
    inset: 0;
    background: linear-gradient(160deg, #f0fdf4 0%, #dcfce7 100%);
    transform: translateY(101%);
    transition: transform 0.48s cubic-bezier(0.22, 1, 0.36, 1);
    border-radius: inherit;
    pointer-events: none;
    z-index: 1;
}

/* ---------- Card inner content ---------- */
.csg-card-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    z-index: 2;
}

/* Title row: title on left, arrow on right */
.csg-card-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.csg-card-body {
    flex: 1;
}

/* ---------- Title ---------- */
.csg-card-title {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.3;
    color: #14213D;
    margin: 0;
    letter-spacing: -0.01em;
    transition: color 0.25s ease;
}

/* ---------- Description ---------- */
.csg-card-desc {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 14px;
    line-height: 1.65;
    color: #4b5563;
    margin: 0;
    font-weight: 400;
    transition: color 0.25s ease;
}

/* ---------- Arrow icon (top-right of title row) ---------- */
.csg-arrow {
    color: #1aab5f;
    font-size: 22px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    position: relative;
    margin-top: 2px; /* optical alignment with title cap-height */
    transition:
        transform 0.38s cubic-bezier(0.34, 1.56, 0.64, 1),
        color     0.25s ease;
}

/* Circle that expands behind the arrow on hover */
.csg-arrow::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    translate: -50% -50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(26, 171, 95, 0.12);
    transition:
        width  0.4s cubic-bezier(0.34, 1.26, 0.64, 1),
        height 0.4s cubic-bezier(0.34, 1.26, 0.64, 1);
    z-index: -1;
}

.csg-arrow svg {
    display: block;
}


/* =========================================================
 * HOVER ANIMATION — LIFT (default)
 * ========================================================= */
.csg-anim-lift .csg-card:hover {
    transform: translateY(-8px) scale(1.01);
    border-color: #0d9e52;
    box-shadow:
        0 16px 40px rgba(26, 171, 95, 0.22),
        0 6px 16px rgba(26, 171, 95, 0.12),
        0 2px 4px rgba(0, 0, 0, 0.04);
    background-color: #f0fdf4;
}

.csg-anim-lift .csg-card:hover .csg-card-title {
    color: #0d9e52;
    letter-spacing: 0.005em;
}

.csg-anim-lift .csg-card:hover .csg-arrow {
    transform: scale(1.2);
    color: #0d9e52;
}

.csg-anim-lift .csg-card:hover .csg-arrow::before {
    width: 40px;
    height: 40px;
}


/* =========================================================
 * HOVER ANIMATION — GLOW
 * ========================================================= */
.csg-anim-glow .csg-card {
    transition:
        box-shadow       0.42s ease,
        border-color     0.3s ease,
        background-color 0.3s ease,
        transform        0.42s cubic-bezier(0.34, 1.26, 0.64, 1);
}

.csg-anim-glow .csg-card:hover {
    border-color: #0d9e52;
    background-color: #f9fffe;
    transform: scale(1.02);
    box-shadow:
        0 0 0 4px rgba(26, 171, 95, 0.18),
        0 0 32px rgba(26, 171, 95, 0.28),
        0 8px 24px rgba(0, 0, 0, 0.06);
}

.csg-anim-glow .csg-card:hover .csg-card-title {
    color: #0d9e52;
}

.csg-anim-glow .csg-card:hover .csg-arrow {
    transform: scale(1.2);
    color: #0d9e52;
}

.csg-anim-glow .csg-card:hover .csg-arrow::before {
    width: 40px;
    height: 40px;
}

/* Pulsing glow keyframe */
.csg-anim-glow .csg-card:hover {
    animation: csg-pulse-glow 2s ease-in-out infinite;
}

@keyframes csg-pulse-glow {
    0%, 100% {
        box-shadow:
            0 0 0 4px rgba(26, 171, 95, 0.18),
            0 0 32px rgba(26, 171, 95, 0.28),
            0 8px 24px rgba(0, 0, 0, 0.06);
    }
    50% {
        box-shadow:
            0 0 0 6px rgba(26, 171, 95, 0.24),
            0 0 48px rgba(26, 171, 95, 0.38),
            0 8px 24px rgba(0, 0, 0, 0.06);
    }
}


/* =========================================================
 * HOVER ANIMATION — SLIDE FILL
 * ========================================================= */
.csg-anim-slide-fill .csg-card:hover .csg-card-fill {
    transform: translateY(0);
}

.csg-anim-slide-fill .csg-card:hover {
    border-color: #0d9e52;
    box-shadow:
        0 10px 28px rgba(26, 171, 95, 0.18),
        0 4px 10px rgba(26, 171, 95, 0.10);
    transform: translateY(-4px);
}

.csg-anim-slide-fill .csg-card:hover .csg-card-title {
    color: #0d9e52;
}

.csg-anim-slide-fill .csg-card:hover .csg-arrow {
    transform: scale(1.2);
    color: #0d9e52;
}

.csg-anim-slide-fill .csg-card:hover .csg-arrow::before {
    width: 40px;
    height: 40px;
}


/* =========================================================
 * HOVER ANIMATION — TILT
 * 3D perspective tilt — driven via JS mousemove
 * ========================================================= */
.csg-anim-tilt .csg-card {
    transform-style: preserve-3d;
    perspective: 900px;
    transition:
        box-shadow   0.3s ease,
        border-color 0.25s ease;
}

.csg-anim-tilt .csg-card:hover {
    border-color: #0d9e52;
    box-shadow:
        0 24px 48px rgba(26, 171, 95, 0.2),
        0 8px 20px rgba(0, 0, 0, 0.10);
}

.csg-anim-tilt .csg-card:hover .csg-card-title {
    color: #0d9e52;
}

.csg-anim-tilt .csg-card:hover .csg-arrow {
    transform: scale(1.2);
    color: #0d9e52;
}

.csg-anim-tilt .csg-card:hover .csg-arrow::before {
    width: 40px;
    height: 40px;
}


/* =========================================================
 * ENTRANCE ANIMATION — fade + slide up + scale on scroll
 * ========================================================= */
.csg-card.csg-hidden {
    opacity: 0;
    transform: translateY(32px) scale(0.94);
    transition:
        opacity   0.6s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.csg-card.csg-visible {
    opacity: 1;
    transform: translateY(0) scale(1) !important;
}

/* Lift hover still works after reveal */
.csg-anim-lift .csg-card.csg-visible:hover {
    transform: translateY(-8px) scale(1.01) !important;
}

.csg-anim-slide-fill .csg-card.csg-visible:hover {
    transform: translateY(-4px) scale(1) !important;
}

.csg-anim-glow .csg-card.csg-visible:hover {
    transform: scale(1.02) !important;
}


/* =========================================================
 * REDUCED MOTION
 * ========================================================= */
@media (prefers-reduced-motion: reduce) {
    .csg-card,
    .csg-card-fill,
    .csg-arrow,
    .csg-arrow::before,
    .csg-card-title {
        transition: none !important;
        animation: none !important;
    }
    .csg-card.csg-hidden {
        opacity: 1;
        transform: none !important;
    }
}
