/* =========================================================
   FAYADH WEBSITE — HOW IT WORKS
   The app's four booking steps: icon, number, title, text,
   with a dashed arrow between steps on wide screens. On
   phones each step is a compact row (icon beside the text).
========================================================= */


/* =========================================================
   1. SECTION
========================================================= */

.how-it-works {
    background: var(--background);
}


/* =========================================================
   2. STEPS
========================================================= */

.steps {
    /* Icon size and column gap: the arrows below are placed from these. */
    --step-icon: 84px;
    --step-gap: 32px;

    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));

    gap: var(--step-gap);

    list-style: none;
}

.step {
    position: relative;

    display: flex;
    flex-direction: column;
    align-items: center;

    text-align: center;
}


/* Icon (the app's icons include their own light-green circle) */

.step-icon {
    position: relative;

    width: var(--step-icon);
    height: var(--step-icon);

    flex-shrink: 0;
}

.step-icon img {
    width: 100%;
    height: 100%;
}


/* Step number badge */

.step-number {
    position: absolute;

    top: -2px;
    inset-inline-end: -2px;

    width: 26px;
    height: 26px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: var(--primary);
    color: var(--white);

    border: 3px solid var(--background);
    border-radius: 50%;

    font-family: var(--font-en);
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
}


/* Title & text (title in the brand colour, like the app) */

.step-title {
    margin-top: 14px;

    color: var(--primary);

    font-size: 16px;
    font-weight: 800;
    line-height: 1.3;
}

.step-text {
    max-width: 230px;

    margin-top: 6px;

    color: var(--text);

    font-size: 14px;
    line-height: 1.55;
}


/* =========================================================
   3. ARROWS BETWEEN STEPS
   The arrow's box fills the space between this step's icon
   and the next one (12px clear of each), level with the
   icons' centre; the SVG keeps its shape and centres itself
   in that box. It points the reading direction (flipped in
   Arabic).
     icon centred → its edge is 50% + icon / 2
     next icon starts at: 100% + gap + 50% - icon / 2
========================================================= */

.step-arrow {
    position: absolute;

    top: calc(var(--step-icon) / 2 - 20px);
    inset-inline-start: calc(50% + var(--step-icon) / 2 + 12px);

    width: calc(100% + var(--step-gap) - var(--step-icon) - 24px);
    height: 40px;

    color: var(--text-light);
}

html[dir="rtl"] .step-arrow {
    transform: scaleX(-1);
}


/* =========================================================
   4. RESPONSIVE
========================================================= */

@media (max-width: 1000px) {

    .steps {
        grid-template-columns: repeat(2, minmax(0, 1fr));

        row-gap: 32px;
    }

    .step-arrow {
        display: none;
    }

}

/* Phones: one step per row, icon beside the title and text. */

@media (max-width: 520px) {

    .steps {
        --step-icon: 64px;

        grid-template-columns: 1fr;

        row-gap: 20px;
    }

    .step {
        display: grid;
        grid-template-columns: var(--step-icon) minmax(0, 1fr);
        grid-template-rows: auto auto;

        column-gap: 16px;

        text-align: start;
    }

    .step-icon {
        grid-row: 1 / 3;
        align-self: center;
    }

    .step-title {
        margin-top: 0;

        align-self: end;
    }

    .step-text {
        max-width: none;

        margin-top: 4px;

        align-self: start;
    }

}
