﻿/* ============================================
   CARD
   ============================================ */

.custom-card {
    position: relative;
    border: 0;
    border-radius: 0;
    overflow: hidden;
    background: #f5f5f5;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

    .custom-card:hover,
    .custom-card:focus-within {
        transform: translateY(-8px);
        box-shadow: 0 16px 32px rgba(0, 0, 0, 0.18);
    }

/* ============================================
   CLICKABLE CARD
   ============================================ */

.custom-card--clickable {
    cursor: pointer;
}

/* ============================================
   STRETCHED PRIMARY LINK
   ============================================ */

/*
    When whole-card clickability is enabled,
    the primary CTA link creates an invisible
    clickable layer over the card.

    The brochure CTA is positioned above this
    layer so it can still use a different URL.
*/
.custom-card-primary-stretched-link::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}


/* ============================================
   IMAGE
   ============================================ */

.card-square-image {
    aspect-ratio: 1 / 1;
    width: 100%;
    overflow: hidden;
    background: #ddd;
}

.card-square-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.45s ease;
}

.custom-card:hover .card-square-img,
.custom-card:focus-within .card-square-img {
    transform: scale(1.045);
}

.mhg-card-icon-panel {
    aspect-ratio: 1 / 1;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: #ff2a23;
    background: radial-gradient(circle at 50% 45%, #ffffff 0, #f8f8f8 50%, #eeeeee 100%);
}

.mhg-card-icon {
    font-size: clamp(5rem, 10vw, 8.5rem);
    line-height: 1;
    transition: transform 0.45s ease;
}

.custom-card:hover .mhg-card-icon,
.custom-card:focus-within .mhg-card-icon {
    transform: scale(1.08);
}


/* ============================================
   CARD BODY
   ============================================ */

.custom-card .card-body {
    background: #f5f5f5;
    padding: 2rem 1.5rem 2.5rem;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
}


/* ============================================
   TITLE
   ============================================ */

.custom-card .card-title {
    font-size: 1.45rem;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: #111;
    text-decoration: none;
    white-space: normal;
    overflow-wrap: anywhere;
    text-wrap: balance;
}


/* ============================================
   SUBTITLE
   ============================================ */

.custom-card .card-subtitle {
    font-size: 1rem;
    line-height: 1.6;
    color: #111;
    text-decoration: none;
    /*
        Consistent breathing room before
        the CTA area.
    */
    margin-bottom: 1.5rem;
}


/* ============================================
   BODY CONTENT
   ============================================ */

.custom-card .card-text {
    font-size: 1rem;
    line-height: 1.6;
    color: #111;
    text-decoration: none;
    margin-top: 1.25rem;
    margin-bottom: 1.5rem;
}


/* ============================================
   CTA GROUP
   ============================================ */

/*
    Push the entire CTA area to the bottom.

    This keeps buttons aligned between cards
    even when titles, subtitles, and body text
    have different lengths.
*/
.mhg-card-cta-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    margin-top: auto;
    position: relative;
    z-index: 2;
    align-items: center;
}

    .mhg-card-cta-group > .btn {
        width: min(100%, 20rem);
    }


/* ============================================
   INLINE DIAGONAL ARROW CTA
   ============================================ */

.card-inline-arrow {
    position: relative;
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-left: 0.45rem;
    vertical-align: -3px;
    color: #ff2a23;
    text-decoration: none;
    white-space: nowrap;
    transition: transform 0.2s ease, opacity 0.2s ease;
}


    /*
    Arrow shaft.
*/
    .card-inline-arrow::before {
        content: "";
        position: absolute;
        width: 12px;
        height: 2px;
        left: 2px;
        top: 8px;
        background-color: #ff2a23;
        border-radius: 999px;
        transform: rotate(-45deg);
        transform-origin: center;
    }


    /*
    Arrow head.
*/
    .card-inline-arrow::after {
        content: "";
        position: absolute;
        width: 7px;
        height: 7px;
        right: 1px;
        top: 1px;
        border-top: 2px solid #ff2a23;
        border-right: 2px solid #ff2a23;
        border-radius: 1px;
    }


    /* ============================================
   ARROW HOVER
   ============================================ */

    .custom-card:hover .card-inline-arrow,
    .card-inline-arrow:focus-visible {
        transform: translateX(3px) translateY(-3px);
    }


/* ============================================
   PRIMARY CTA
   MHG RED: #ff2a23
   ============================================ */

.mhg-card-primary-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    min-height: 3rem;
    padding: 0.85rem 1.5rem;
    border: 1px solid transparent;
    border-radius: 0.4rem;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    position: relative;
    z-index: 2;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.mhg-card-primary-cta--red {
    background-color: #ff2a23;
    border-color: #ff2a23;
}

.mhg-card-primary-cta--gray {
    background-color: #667085;
    border-color: #667085;
}

.mhg-card-primary-cta:hover,
.mhg-card-primary-cta:focus,
.mhg-card-primary-cta:active,
.mhg-card-primary-cta:visited {
    color: #ffffff;
    text-decoration: none;
}

.mhg-card-primary-cta--red:hover,
.mhg-card-primary-cta--red:focus-visible {
    background-color: #d9231d;
    border-color: #d9231d;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.16);
}

.mhg-card-primary-cta--gray:hover,
.mhg-card-primary-cta--gray:focus-visible {
    background-color: #4b5565;
    border-color: #4b5565;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.16);
}


/* ============================================
   SECONDARY BROCHURE CTA
   ============================================ */

.mhg-card-secondary-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    align-self: center;
    min-height: 3rem;
    padding: 0.8rem 1.5rem;
    background-color: #667085;
    border: 1px solid #6b7280;
    border-radius: 0.4rem;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    position: relative;
    /*
        Must remain above the stretched
        whole-card primary link.
    */
    z-index: 3;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}


/*
    Brochure icon.
*/
.mhg-card-secondary-cta-icon {
    flex: 0 0 auto;
    transition: transform 0.2s ease;
}


.mhg-card-secondary-cta:hover,
.mhg-card-secondary-cta:focus,
.mhg-card-secondary-cta:active,
.mhg-card-secondary-cta:visited {
    text-decoration: none;
    color: #ffffff;
}


/*
    Use the MHG red as the interaction color
    while keeping the normal state understated.
*/
.mhg-card-secondary-cta:hover,
.mhg-card-secondary-cta:focus-visible {
    background-color: #4b5565;
    border-color: #4b5565;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.10);
}

    .mhg-card-secondary-cta:hover
    .mhg-card-secondary-cta-icon,
    .mhg-card-secondary-cta:focus-visible
    .mhg-card-secondary-cta-icon {
        transform: translateY(2px);
    }


/* ============================================
   BACKGROUND VARIATIONS
   ============================================ */

.sf-card--light,
.sf-card--light .card-body {
    background: #f5f5f5;
}

.sf-card--dark,
.sf-card--dark .card-body {
    background: #222;
}

    .sf-card--dark .card-title,
    .sf-card--dark .card-subtitle,
    .sf-card--dark .card-text {
        color: #ffffff;
    }


    /* ============================================
   DARK BACKGROUND ARROW
   ============================================ */

    .sf-card--dark .card-inline-arrow::before {
        background-color: #ffffff;
    }

    .sf-card--dark .card-inline-arrow::after {
        border-top-color: #ffffff;
        border-right-color: #ffffff;
    }


    /* ============================================
   DARK BACKGROUND SECONDARY CTA
   ============================================ */

    .sf-card--dark .mhg-card-secondary-cta {
        background-color: transparent;
        border-color: #ffffff;
        color: #ffffff;
    }

        .sf-card--dark
        .mhg-card-secondary-cta:hover,
        .sf-card--dark
        .mhg-card-secondary-cta:focus-visible {
            background-color: #ffffff;
            border-color: #ffffff;
            color: #222;
        }


/* ============================================
   RESPONSIVE TITLE HANDLING
   ============================================ */

@media (max-width: 1400px) {

    .custom-card .card-title {
        font-size: 1.35rem;
    }
}


@media (max-width: 991.98px) {

    .custom-card .card-title {
        white-space: normal;
        font-size: 1.6rem;
    }
}


/* ============================================
   RESPONSIVE CTAs
   ============================================ */

@media (max-width: 576px) {

    .mhg-card-primary-cta,
    .mhg-card-secondary-cta {
        width: 100%;
        padding: 0.85rem 1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .custom-card,
    .card-square-img,
    .mhg-card-icon,
    .card-inline-arrow,
    .mhg-card-primary-cta,
    .mhg-card-secondary-cta {
        transition: none;
    }

        .custom-card:hover,
        .custom-card:focus-within,
        .custom-card:hover .card-square-img,
        .custom-card:focus-within .card-square-img,
        .custom-card:hover .mhg-card-icon,
        .custom-card:focus-within .mhg-card-icon {
            transform: none;
        }
}
