/* ==========================================================================
   Widget 1: Service Cards Grid — Scoped Styles
   Prefix: gfw-sc-
   ========================================================================== */

/* Grid Container */
.gfw-sc-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    width: 100%;
}

/* Card */
.gfw-sc-card {
    position: relative;
    overflow: hidden;
    display: flex;
    height: 400px;
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
}

a.gfw-sc-card {
    color: inherit;
}

/* Background Image */
.gfw-sc-image {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    --gfw-scale: 1;
    --gfw-tx: 0px;
    --gfw-ty: 0px;
    transform: translate(var(--gfw-tx), var(--gfw-ty)) scale(var(--gfw-scale));
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
    z-index: 1;
}


/* Overlay */
.gfw-sc-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: rgba(11, 34, 57, 0.55);
    transition: background 0.4s ease;
    pointer-events: none;
}

/* Content */
.gfw-sc-content {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    width: 100%;
    padding: 28px 24px;
    box-sizing: border-box;
}

/* Icon */
.gfw-sc-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    transition: transform 0.3s ease;
}

.gfw-sc-icon i {
    font-size: 32px;
    color: #ffffff;
    transition: color 0.3s ease;
}

.gfw-sc-icon svg {
    width: 32px;
    height: 32px;
    fill: #ffffff;
    transition: fill 0.3s ease;
}

/* Title */
.gfw-sc-title {
    margin: 0 0 8px 0;
    padding: 0;
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.3;
    transition: color 0.3s ease;
}

/* Description */
.gfw-sc-desc {
    margin: 0;
    padding: 0;
    font-size: 14px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.85);
    transition: color 0.3s ease;
}

/* CTA Button */
.gfw-sc-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding: 8px 18px;
    background-color: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #ffffff;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    align-self: flex-start;
}

.gfw-sc-cta i {
    font-size: 11px;
    --gfw-ctx: 0px;
    transform: translateX(var(--gfw-ctx));
    transition: transform 0.3s ease;
}

.gfw-sc-cta:hover {
    background-color: rgba(255, 255, 255, 0.30);
}

.gfw-sc-cta:hover i {
    --gfw-ctx: 4px;
}


/* ==========================================================================
   Hover Effects — Controlled by prefix_class toggles
   ========================================================================== */

/* Image Zoom on Hover */
.gfw-hover-zoom-yes .gfw-sc-card:hover .gfw-sc-image {
    --gfw-scale: 1.08;
}


/* Overlay Darken on Hover */
.gfw-hover-darken-yes .gfw-sc-card:hover .gfw-sc-overlay {
    background: rgba(11, 34, 57, 0.75);
}

/* CTA Slide Up on Hover */
.gfw-hover-cta-slide-yes .gfw-sc-cta {
    opacity: 0;
    --gfw-cty: 16px;
    transform: translateY(var(--gfw-cty));
    transition: opacity 0.35s ease, transform 0.35s ease, background-color 0.3s ease;
}

.gfw-hover-cta-slide-yes .gfw-sc-card:hover .gfw-sc-cta {
    opacity: 1;
    --gfw-cty: 0;
}


/* ==========================================================================
   Last Row Logic & Centering
   ========================================================================== */

/* Centering Logic */
.gfw-sc-grid.logic-center {
    justify-content: center;
}

/* Orphan handling for 3-col */
@media (min-width: 1025px) {
    .gfw-sc-grid.logic-center[data-remainder="1"] .is-orphan {
        grid-column: 2; /* Center 1 orphan in 3 columns */
    }
    .gfw-sc-grid.logic-center[data-remainder="2"] .is-orphan:first-of-type {
        grid-column: 1 / span 1;
        margin-left: 50%; /* Offset to center two orphans */
    }
}

/* Orphan handling for 2-col */
@media (max-width: 1024px) and (min-width: 768px) {
    .gfw-sc-grid.logic-center[data-remainder="1"] .is-orphan {
        grid-column: 1 / span 2;
        justify-self: center;
        width: 50%; /* Center the single orphan across both columns */
    }
}

/* ==========================================================================
   Filler Card Styles
   ========================================================================== */
.gfw-sc-filler {
    background-color: #0b2239; /* Default fallback */
}

/* Overlay Presets */
.gfw-sc-card.overlay-dark .gfw-sc-overlay {
    background: rgba(0, 0, 0, 0.75);
}

.gfw-sc-card.overlay-light .gfw-sc-overlay {
    background: rgba(255, 255, 255, 0.85);
}

.gfw-sc-card.overlay-light .gfw-sc-title,
.gfw-sc-card.overlay-light .gfw-sc-desc {
    color: #0b2239;
}

.gfw-sc-card.overlay-light .gfw-sc-cta {
    background-color: #0b2239;
    color: #ffffff;
}

.gfw-sc-card.overlay-brand .gfw-sc-overlay {
    background: rgba(255, 184, 0, 0.9); /* Brand Gold */
}

.gfw-sc-card.overlay-brand .gfw-sc-title,
.gfw-sc-card.overlay-brand .gfw-sc-desc,
.gfw-sc-card.overlay-brand .gfw-sc-cta {
    color: #0b2239;
}

.gfw-sc-card.overlay-brand .gfw-sc-cta {
    background-color: rgba(11, 34, 57, 0.1);
}

/* ==========================================================================
   Responsive Defaults
   ========================================================================== */

@media (max-width: 1024px) {
    .gfw-sc-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .gfw-sc-grid {
        grid-template-columns: 1fr;
    }

    .gfw-sc-card {
        height: 320px;
    }

    .gfw-sc-content {
        padding: 20px 18px;
    }

    /* Disable filler span on mobile */
    .gfw-sc-filler {
        grid-column-start: auto !important;
    }
}
