/*---*\
Course Cards
Half text / half image block for the Situational Leadership® Model section.
Features a gradient heading, description, button list, graph image,
and interactive quadrant tooltips.

KEY FEATURES:
- Extends half-and-half + contained-image-text component styles
- Mobile-first stacked layout, side-by-side on desktop
- Uses existing .btn-list for outlined button styling
- Gradient h2 inherited from global typography
- Quadrant hotspot toggles with floating tooltip popups

DEPENDENCIES:
- fx_half_image_text (half-image-text.css)
- fx_contained_image_text (contained-image-text.css)
\*---*/

/* ==========================================================================
   BASE STYLES - MOBILE FIRST
   ========================================================================== */

.course-cards .half-and-half-image {
    height: auto;
    overflow: visible;
}

.course-cards__title {
    margin-bottom: 20px;
}

.course-cards__description {
    color: #6B6B6B;
    margin-bottom: 20px;
}

.course-cards__description p:last-child {
    margin-bottom: 0;
}

.course-cards__buttons {
    margin-bottom: 30px;
}

.course-cards__graph-wrap {
    position: relative;
    margin-bottom: 20px;
}

.course-cards__image-col,
.course-cards__image {
    position: relative;
}

.half-and-half-image .course-cards__image .course-cards__img {
    width: auto;
    height: auto;
    display: block;
    position: static;
}

.course-cards__img-mobile .course-cards__img {
    display: block;
    height: auto;
}

.course-cards.image-block-right .half-and-half-image {
    padding-left: 0;
}

@media (max-width: 767px) {
    .course-cards__image-col {
        width: fit-content;
        margin-left: auto;
        margin-right: auto;
    }
}

.course-cards__img-desktop {
    display: none;
}

@media( max-width: 767px ) {
    .course-cards.image-block-right .half-and-half-image {
        padding-left: 0;
    }
}

@media (min-width: 768px) {
    .course-cards__img-mobile {
        display: none;
    }

    .course-cards__img-desktop {
        display: block;
    }

   .half-and-half-image .course-cards__image .course-cards__img {
        width: 100%;
        height: auto;
        display: block;
        position: static;
    }
}

.course-cards__bottom-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.course-cards__pr-hotspot {
    position: relative;
    flex-shrink: 0;
}

.course-cards__pr-toggle {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    padding: 0;
    border: none;
    background: transparent;
    color: #12284C;
    cursor: pointer;
    transition: color 0.2s ease-in-out;
}

.course-cards__pr-toggle svg {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
}

.course-cards__readiness-link {
    color: #000000;
    font-size: 18px;
    font-weight: 700;
    text-decoration: underline;
    pointer-events: none;
}

/*------------------------------------*\
    READINESS TABLE
\*------------------------------------*/

.course-cards__readiness-table {
    margin-top: 15px;
}

.course-cards__readiness-table table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.course-cards__readiness-table th {
    padding: 6px 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    text-align: center;
    color: #000;
    border: 1px solid #000;
}

.course-cards__readiness-table td {
    padding: 10px 8px;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    color: #fff;
    border: 1px solid #000;
}

.course-cards__copyright {
    margin-top: 10px;
    font-size: 10px;
    line-height: 1.4;
    color: #6B6B6B;
    text-align: center;
}

/*------------------------------------*\
    QUADRANT HOTSPOTS
\*------------------------------------*/

.course-cards__hotspot {
    position: absolute;
    z-index: 5;
}

.course-cards__hotspot.is-open {
    z-index: 20;
}

.course-cards__hotspot--top-left {
    top: 18%;
    left: 17%;
}

.course-cards__hotspot--top-right {
    top: 18%;
    left: 85%;
}

.course-cards__hotspot--bottom-left {
    top: 75%;
    left: 42%;
}

.course-cards__hotspot--bottom-right {
    top: 75%;
    left: 59%;
}

.course-cards__hotspot-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0;
    position: relative;
    z-index: 2;
    animation: courseCardsPulse 2s ease-in-out infinite;
}

@keyframes courseCardsPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
    }
}

.course-cards__hotspot--top-left .course-cards__hotspot-toggle {
    color: #089CD6;
}

.course-cards__hotspot--top-right .course-cards__hotspot-toggle {
    color: #F26B21;
}

.course-cards__hotspot--bottom-left .course-cards__hotspot-toggle {
    color: #E80A8C;
}

.course-cards__hotspot--bottom-right .course-cards__hotspot-toggle {
    color: #20A94A;
}

.course-cards__hotspot-toggle:hover,
.course-cards__hotspot.is-open .course-cards__hotspot-toggle {
    animation-play-state: paused;
}

.course-cards__hotspot-toggle svg {
    width: 38px;
    height: 38px;
}

/*------------------------------------*\
    TOOLTIP
\*------------------------------------*/

.course-cards__tooltip {
    position: absolute;
    width: 100%;
    max-width: 414px;
    min-width:414px;
    background: #ffffff;
    border-radius: 4px;
    box-shadow: 0 2px 7px rgba(0, 0, 0, 0.12);
    padding: 21px 18px;
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease-in-out, visibility 0.25s ease-in-out;
    pointer-events: none;
}

.course-cards__tooltip.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Direction: tooltip opens to the RIGHT of the icon */
.course-cards__tooltip--dir-right {
    left: calc(100% + 18px);
    right: auto;
}

/* Direction: tooltip opens to the LEFT of the icon */
.course-cards__tooltip--dir-left {
    right: calc(100% + 18px);
    left: auto;
}

.course-cards__tooltip-arrow {
    position: absolute;
    width: 18px;
    height: 20px;
}

/* Arrow on the LEFT side of tooltip (points left toward icon) */
.course-cards__tooltip--dir-right .course-cards__tooltip-arrow {
    left: -12px;
}

.course-cards__tooltip--dir-right .course-cards__tooltip-arrow::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    border-width: 10px 12px 10px 0;
    border-style: solid;
    border-color: transparent #ffffff transparent transparent;
    filter: drop-shadow(-2px 0 2px rgba(0, 0, 0, 0.06));
}

/* Arrow on the RIGHT side of tooltip (points right toward icon) */
.course-cards__tooltip--dir-left .course-cards__tooltip-arrow {
    right: -12px;
}

.course-cards__tooltip--dir-left .course-cards__tooltip-arrow::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    border-width: 10px 0 10px 12px;
    border-style: solid;
    border-color: transparent transparent transparent #ffffff;
    filter: drop-shadow(2px 0 2px rgba(0, 0, 0, 0.06));
}

/* Direction: tooltip opens ABOVE the icon */
.course-cards__tooltip--dir-top {
    bottom: calc(100% + 14px);
    left: 50%;
    transform: translateX(-50%);
}

.course-cards__tooltip--dir-top .course-cards__tooltip-arrow {
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    top: auto;
}

.course-cards__tooltip--dir-top .course-cards__tooltip-arrow::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    border-width: 12px 10px 0 10px;
    border-style: solid;
    border-color: #ffffff transparent transparent transparent;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.06));
}

.course-cards__tooltip-title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 15px;
    background: linear-gradient(90deg, #12284C 0%, #089CD6 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: block;
}

.course-cards__tooltip-desc {
    font-size: 16px;
    line-height: 1.5;
    color: #6B6B6B;
    margin-bottom: 15px;
}

.course-cards__tooltip-links {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
    row-gap: 15px;
}

.course-cards__tooltip-links a {
    font-size: 16px;
    color: #089CD6;
    text-decoration: underline;
    text-decoration-thickness: 10%;
    border-bottom: none;
}

/*------------------------------------*\
    MOBILE TOOLTIP CARD
\*------------------------------------*/

.course-cards__mobile-tooltip {
    position: relative;
    display: none;
    background: #ffffff;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
    padding: 18px 16px;
    margin-top: 15px;
}

.course-cards__mobile-tooltip.is-visible {
    display: block;
}

.course-cards__mobile-tooltip-card {
    display: none;
}

.course-cards__mobile-tooltip-card.is-active {
    display: block;
}

.course-cards__mobile-tooltip-close {
    position: absolute;
    top: 14px;
    right: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
}

.course-cards__mobile-tooltip-close svg {
    width: 18px;
    height: 18px;
}

@media (max-width: 767px) {
    .course-cards__hotspot-toggle {
        width: 26px;
        height: 26px;
    }

    .course-cards__hotspot-toggle svg {
        width: 26px;
        height: 26px;
    }

    .course-cards__tooltip {
        display: none !important;
    }
}

@media (min-width: 768px) {
    .course-cards__mobile-tooltip {
        display: none !important;
    }
}

/* ==========================================================================
   TABLET BREAKPOINT (768px+)
   ========================================================================== */

@media (min-width: 768px) {
    .course-cards__title {
        margin-bottom: 30px;
    }

    .course-cards__description {
        margin-bottom: 30px;
    }

    .course-cards__readiness-link {
        font-size: 20px;
    }

    .course-cards__tooltip {
        width: 100%;
        max-width: 414px;
        min-width:414px;
    }

    .course-cards__readiness-table th {
        font-size: 12px;
    }

    .course-cards__readiness-table td {
        font-size: 18px;
    }

    .course-cards__copyright {
        font-size: 11px;
    }
}

/* ==========================================================================
   DESKTOP BREAKPOINT (1200px+)
   ========================================================================== */

@media (min-width: 1200px) {
    .course-cards .half-and-half-image {
        display: flex;
        flex-direction: column;
        justify-content: center;
        overflow: visible;
    }

    .course-cards__description {
        margin-bottom: 35px;
    }

    .course-cards__buttons {
        margin-bottom: 0;
    }

    .course-cards__graph-wrap {
        margin-bottom: 15px;
    }

    .course-cards__tooltip {
        width: 100%;
        max-width: 414px;
        min-width:414px;
    }

    .course-cards__pr-toggle:hover {
        color: #089CD6;
    }

    .course-cards__tooltip-links a:hover {
        color: #0575A1;
    }

    .course-cards__hotspot-toggle:hover {
        transform: scale(1.15);
    }

    .course-cards .image-block-right .half-and-half-image {
        padding-left: 0;
    }
}
