/* lib/styles/components/service_pillars_section.css */

/* Section Background: 
  Using a soft grey to contrast with the white cards, elevating the premium feel.
*/
.service-pillars-section {
    background-color: rgba(29, 118, 112, 0.05);
    padding: var(--space-3xl) 0;
    position: relative;
    overflow-x: hidden;
}

.service-pillars-section__header {
    text-align: center;
    margin-bottom: var(--space-3xl);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.service-pillars-section__eyebrow {
    font-family: var(--font-heading);
    font-size: var(--fs-small);
    font-weight: var(--fw-bold);
    color: var(--color-support-gold);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: var(--space-sm);
}

/* Update the Service Pillars Title */
.service-pillars-section__title {
    margin-top: 0;
    color: var(--color-justice-blue);
    font-size: var(--fs-fluid-section-title);
}

.service-pillars-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2xl);
}

/* =========================================
   Base Card Styles
   ========================================== */
.service-pillar-card {
    display: flex;
    background-color: var(--color-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
    min-height: 400px;
}

.service-pillar-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

/* =========================================
   Image Section (40%)
   ========================================== */
.service-pillar-card__image-wrapper {
    position: relative;
    width: 40%;
    overflow: hidden;
    flex-shrink: 0;
}

.service-pillar-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.service-pillar-card:hover .service-pillar-card__image {
    transform: scale(1.08);
}

/* Gold Accent Line along the diagonal cut */
.service-pillar-card__accent-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: var(--color-support-gold);
    z-index: 2;
}

/* =========================================
   Content Section (60%)
   ========================================== */
.service-pillar-card__content {
    width: 60%;
    padding: var(--space-3xl);
    display: flex;
    flex-direction: column;
    justify-content: center;
    background-color: var(--color-white);
    position: relative;
    z-index: 1;
    /* Keeps content above the image wrapper */
}

.service-pillar-card__title {
    color: var(--color-justice-blue);
    font-size: var(--fs-h2);
    margin-bottom: var(--space-md);
}

.service-pillar-card__desc {
    color: var(--color-neutral-navy);
    font-size: var(--fs-h4);
    line-height: 1.6;
    margin-bottom: var(--space-xl);
    max-width: 65ch;
}

/* Custom CTA Link Styling */
.service-pillar-card__link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--color-guidance-teal);
    font-weight: var(--fw-bold);
    font-size: var(--fs-body);
    text-decoration: none;
    transition: color var(--transition-fast), gap var(--transition-fast);
    width: fit-content;
}

.service-pillar-card:hover .service-pillar-card__link,
.service-pillar-card__link:hover {
    color: var(--color-justice-blue);
    gap: var(--space-md);
    /* Creates the forward-motion feel on the arrow */
}

.service-pillar-card__link-text {
    position: relative;
}

.service-pillar-card__link-text::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 100%;
    height: 1px;
    background-color: currentColor;
    opacity: 0.3;
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform var(--transition-fast);
}

.service-pillar-card__link:hover .service-pillar-card__link-text::after {
    transform: scaleX(1);
}

.service-pillar-card__link-icon {
    font-size: 0.9em;
}

/* =========================================
   Diagonal Split Logic (Z-Pattern)
   ========================================== */

/* Image Left Layout */
.service-pillar-card--img-left {
    flex-direction: row;
}

.service-pillar-card--img-left .service-pillar-card__image-wrapper {
    /* Angled cut on the right side of the image */
    clip-path: polygon(0 0, 100% 0, calc(100% - 60px) 100%, 0 100%);
}

.service-pillar-card--img-left .service-pillar-card__accent-line {
    right: 0;
    /* Skew matches the clip-path angle */
    transform-origin: bottom right;
    transform: skewX(-8deg);
}

/* Image Right Layout */
.service-pillar-card--img-right {
    flex-direction: row-reverse;
}

.service-pillar-card--img-right .service-pillar-card__image-wrapper {
    /* Angled cut on the left side of the image */
    clip-path: polygon(60px 0, 100% 0, 100% 100%, 0 100%);
}

.service-pillar-card--img-right .service-pillar-card__accent-line {
    left: 0;
    /* Skew matches the clip-path angle */
    transform-origin: bottom left;
    transform: skewX(-8deg);
}

/* =========================================
   Responsive Fallbacks
   ========================================== */
@media (max-width: 1024px) {
    .service-pillar-card__content {
        padding: var(--space-2xl);
    }

    .service-pillar-card__title {
        font-size: var(--fs-h3);
    }
}

@media (max-width: 768px) {

    /* Stack everything vertically on mobile/tablet */
    .service-pillar-card,
    .service-pillar-card--img-left,
    .service-pillar-card--img-right {
        flex-direction: column !important;
        min-height: auto;
    }

    .service-pillar-card__image-wrapper {
        width: 100% !important;
        height: 250px;
        clip-path: none !important;
        /* Remove diagonal split */
    }

    .service-pillar-card__accent-line {
        /* Convert the accent line to a bottom border for the image */
        top: auto;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 4px;
        transform: none !important;
    }

    .service-pillar-card__content {
        width: 100% !important;
        padding: var(--space-xl);
    }

    .service-pillars-list {
        gap: var(--space-xl);
    }
}