/* ===== How I work ===== */
.how-i-work {
    background: var(--cream);
}

.steps {
    list-style: none;
    counter-reset: step;
    display: grid;
    gap: 2.5rem;
    margin-top: 3rem;
    position: relative;
}

.step {
    counter-increment: step;
    position: relative;
    z-index: 1;
}

/* The numbered circle */
.step::before {
    content: counter(step);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background: var(--sage);
    color: var(--off-white);
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
}

.step h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.step p {
    line-height: 1.6;
}

/* ===== Phones and tablets: a timeline down the left ===== */
@media (max-width: 1023px) {
    .steps {
        text-align: left;
    }

    .step {
        display: grid;
        grid-template-columns: 3.5rem 1fr;
        column-gap: 1.25rem;
    }

    .step::before {
        grid-row: span 2;   /* circle sits beside the heading AND the words */
    }

    .step h3 {
        padding-top: 0.75rem;   /* lines the heading up with the circle */
    }

    /* Dotted line from each circle down to the next one */
    .step:not(:last-child)::after {
        content: "";
        position: absolute;
        z-index: -1;                       /* behind the circles */
        left: calc(1.75rem - 1px);         /* middle of the circle */
        top: 3.5rem;                       /* bottom of this circle */
        height: calc(100% - 3.5rem + 2.5rem);   /* down to the next circle */
        border-left: 2px dashed var(--sage);
        opacity: 0.4;
    }
}

/* ===== Wide screens: four steps in a row ===== */
@media (min-width: 1024px) {
    .steps {
        grid-template-columns: repeat(4, 1fr);
    }

    .step::before {
        margin: 0 auto 1rem;
    }

    .step p {
        max-width: 18rem;
        margin: 0 auto;
    }

    /* Dotted line joining the circles */
    .steps::before {
        content: "";
        position: absolute;
        top: 1.75rem;
        left: 12.5%;
        right: 12.5%;
        border-top: 2px dashed var(--sage);
        opacity: 0.4;
    }
}