/* =====================================================================
   KlinikPlus – "How it Works" MOBILE (generic / reusable)
   ---------------------------------------------------------------------
   The desktop "How it Works" layout is a 3-column grid
   (content | timeline | image) that cannot survive a phone width.
   On phones (<= 991px) it is replaced wholesale by `.hiw-mobile`:
   a vertical numbered timeline where every step is a card. Each
   description is clamped to 2 lines and expands when the card reaches
   the middle of the viewport (see how-it-works.js).

   This file is NOT scoped to any one page — include it on any page that
   renders the how-it-works section together with the `.hiw-mobile`
   partial. Large screens (>= 992px) are never affected.
   ===================================================================== */

/* The mobile timeline only ever renders below 992px. */
.hiw-mobile {
    display: none;
}

@media (max-width: 991px) {

    .how-it-works-section .how-it-works-container {
        display: none !important;
    }

    /* Drop the white panel so the white step cards read against the page. */
    .how-it-works-section .how-it-works-wrapper {
        background: transparent !important;
        border: none !important;
        border-radius: 0 !important;
        padding: 10px 0 20px !important;
    }

    .how-it-works-section .how-it-works-wrapper .text-center h2 {
        margin-bottom: 28px;
        position: relative;
        padding-bottom: 14px;
    }

    .how-it-works-section .how-it-works-wrapper .text-center h2::after {
        content: '';
        position: absolute;
        left: 50%;
        bottom: 0;
        transform: translateX(-50%);
        width: 52px;
        height: 4px;
        border-radius: 4px;
        background: #FF8E6C;
    }

    .hiw-mobile {
        display: flex;
        flex-direction: column;
        gap: 18px;
        padding: 0 2px;
    }

    .hiw-mobile-step {
        position: relative;
        display: grid;
        grid-template-columns: 44px 1fr;
        gap: 14px;
        align-items: center;
    }

    /* Dashed connector, split above/below the number so it bridges the gap
       between consecutive steps without needing a fixed card height. */
    .hiw-mobile-step::before,
    .hiw-mobile-step::after {
        content: '';
        position: absolute;
        left: 21px;
        width: 0;
        border-left: 2px dashed #FFC0A6;
    }

    .hiw-mobile-step::before {
        top: -18px;
        bottom: calc(50% + 24px);
    }

    .hiw-mobile-step::after {
        top: calc(50% + 24px);
        bottom: -18px;
    }

    .hiw-mobile-step:first-child::before,
    .hiw-mobile-step:last-child::after {
        display: none;
    }

    .hiw-mobile-num {
        position: relative;
        z-index: 1;
        width: 44px;
        height: 44px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #FFE8DF;
        color: #FF6B47;
        font-family: Outfit, sans-serif;
        font-size: 0.9375rem;
        font-weight: 700;
        transition: background 0.3s ease, color 0.3s ease;
    }

    .hiw-mobile-step.is-active .hiw-mobile-num {
        background: #FF8E6C;
        color: #FFF;
    }

    .hiw-mobile-card {
        background: #FFF;
        border: 1px solid transparent;
        border-radius: 16px;
        padding: 18px 18px 20px;
        box-shadow: 0 6px 22px rgba(20, 15, 45, 0.06);
        transition: border-color 0.3s ease, box-shadow 0.3s ease;
    }

    .hiw-mobile-step.is-active .hiw-mobile-card {
        border-color: #FFC0A6;
        box-shadow: 0 10px 28px rgba(255, 142, 108, 0.16);
    }

    .hiw-mobile-title {
        color: #140F2D;
        font-family: Outfit, sans-serif;
        font-size: 1.0625rem;
        font-weight: 700;
        line-height: 1.3;
        margin: 0 0 8px;
    }

    .hiw-mobile-desc {
        color: #6B7280;
        font-family: Outfit, sans-serif;
        font-size: 0.875rem;
        font-weight: 400;
        line-height: 1.6;
        margin: 0;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        overflow: hidden;
    }

    .hiw-mobile-step.is-active .hiw-mobile-desc {
        -webkit-line-clamp: unset;
        line-clamp: unset;
        overflow: visible;
    }
}
