/**
 * The story of the home page ([bmfaq_story]). Follows the home page: Roboto,
 * section headings of 52px with the key words in blue, the gradient pill
 * buttons, the light blue of the site. The block has no background of its
 * own, it takes the one of the Elementor section it stands in.
 */

.bmfaq-story {
    --st-text: #292E33;
    --st-muted: #5E6674;
    --st-blue: #0161F6;
    --st-blue-dk: #002EB8;
    --st-blue-bg: #E7F1FF;
    --st-line: #DDE6F5;
    --st-ez: cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 1140px;
    margin: 0 auto;
    padding: 80px 0;
    color: var(--st-text);
    font-family: Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.bmfaq-story *,
.bmfaq-story *::before,
.bmfaq-story *::after {
    box-sizing: border-box;
}

.bmfaq-story .bmfaq-story__title {
    max-width: 960px;
    margin: 0 auto 56px;
    padding: 0;
    color: var(--st-text);
    font-family: inherit;
    font-size: clamp(30px, 3.7vw, 52px);
    font-weight: 400;
    line-height: 1.12;
    text-align: center;
}

.bmfaq-story__title span,
.bmfaq-story__question span,
.bmfaq-story__cap span:not(.bmfaq-story__num) {
    color: var(--st-blue);
}

.bmfaq-story__panel {
    margin: 0;
}

.bmfaq-story__pic {
    overflow: hidden;
    border: 1px solid var(--st-line);
    border-radius: 16px;
    background: #FFFFFF;
}

.bmfaq-story__pic img {
    display: block;
    width: 100%;
    height: auto;
}

.bmfaq-story .bmfaq-story__cap {
    margin: 14px 0 0;
    color: var(--st-text);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.55;
}

.bmfaq-story__num {
    display: inline-flex;
    min-width: 24px;
    height: 24px;
    margin-right: 10px;
    padding: 0 6px;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--st-blue-bg);
    color: var(--st-blue);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    vertical-align: 2px;
}

.bmfaq-story .bmfaq-story__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    border-radius: 40px;
    background: linear-gradient(120deg, #1350BE 0%, #3184F2 100%);
    color: #FFFFFF;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    transition: all .3s;
}

/* The hover of the site buttons (Login, Hire Directly): the gradient turns darker and wider */
.bmfaq-story .bmfaq-story__btn:hover,
.bmfaq-story .bmfaq-story__btn:focus-visible {
    background: linear-gradient(140deg, #002EB8 0%, #338CFF 100%);
    color: #FFFFFF;
}

.bmfaq-story .bmfaq-story__btn:focus-visible,
.bmfaq-story__arrow:focus-visible,
.bmfaq-story__track:focus-visible {
    outline: 2px solid var(--st-blue);
    outline-offset: 3px;
}

.bmfaq-story__note {
    color: var(--st-muted);
    font-size: 15px;
    line-height: 1.4;
}

/* ------------------------------------------------------------ comic page */

/* The problem: four panels in a row */
.bmfaq-story__problem {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
}

.bmfaq-story__dots {
    display: none;
}

/* The turn: the big panel and the question */
.bmfaq-story__turn {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: 56px;
    align-items: center;
    margin: 72px 0;
}

.bmfaq-story .bmfaq-story__question {
    margin: 0;
    color: var(--st-text);
    font-size: clamp(24px, 2.7vw, 38px);
    font-weight: 400;
    line-height: 1.28;
}

/* The answer: two wide panels */
.bmfaq-story__answer {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.bmfaq-story__answer .bmfaq-story__cap {
    font-size: 17px;
}

.bmfaq-story__cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px 20px;
    margin-top: 56px;
}

/* ------------------------------------------------------------ slider */

/*
 * A compact strip, not a screen of its own: the heading, a row of four and a
 * half square pictures and their captions. The block has no padding, the
 * Elementor container gives the room around it.
 */
.bmfaq-story--slider {
    --st-size: clamp(180px, 25vh, 220px);
    padding: 0;
}

.bmfaq-story--slider .bmfaq-story__title {
    margin-bottom: 24px;
    font-size: clamp(28px, 3.1vw, 44px);
    line-height: 1.12;
}

.bmfaq-story--slider .bmfaq-story__cap {
    margin-top: 10px;
    font-size: 15px;
    line-height: 1.5;
}

.bmfaq-story--slider .bmfaq-story__num {
    min-width: 22px;
    height: 22px;
    margin-right: 8px;
    font-size: 11px;
}

/* The edges fade out where there is more to scroll; the classes come from the script */
.bmfaq-story__viewport {
    --st-fade-l: 0px;
    --st-fade-r: 80px;
    position: relative;
}

.bmfaq-story__viewport:not(.is-start) {
    --st-fade-l: 80px;
}

.bmfaq-story__viewport.is-end {
    --st-fade-r: 0px;
}

.bmfaq-story__track {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding: 2px 0 6px;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 var(--st-fade-l), #000 calc(100% - var(--st-fade-r)), transparent 100%);
    mask-image: linear-gradient(to right, transparent 0, #000 var(--st-fade-l), #000 calc(100% - var(--st-fade-r)), transparent 100%);
}

.bmfaq-story__track::-webkit-scrollbar {
    display: none;
}

/* One panel per swipe: the scroll always stops at the next one */
.bmfaq-story__slide {
    flex: 0 0 var(--st-size);
    margin: 0;
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

.bmfaq-story__slide--wide {
    flex-basis: calc(var(--st-size) * 2);
}

.bmfaq-story__slide .bmfaq-story__pic img {
    height: var(--st-size);
    object-fit: cover;
}

.bmfaq-story__slide--turn .bmfaq-story__cap {
    font-weight: 500;
}

/* The arrows lie on the pictures, at their middle (the script measures it) */
.bmfaq-story .bmfaq-story__arrow {
    position: absolute;
    top: var(--st-arrow-top, calc(var(--st-size) / 2));
    z-index: 2;
    display: inline-flex;
    width: 48px;
    height: 48px;
    margin: 0;
    padding: 0;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: #FFFFFF;
    color: var(--st-blue);
    box-shadow: 0 10px 28px -8px rgba(0, 46, 184, .5), 0 0 0 1px rgba(1, 97, 246, .14);
    cursor: pointer;
    transform: translateY(-50%);
    transition: background-color .3s, color .3s, opacity .2s, visibility .2s;
}

.bmfaq-story__arrow--prev {
    left: 14px;
}

.bmfaq-story__arrow--next {
    right: 14px;
}

.bmfaq-story .bmfaq-story__arrow:hover:not(:disabled) {
    background: var(--st-blue);
    color: #FFFFFF;
}

/* At an end the arrow that leads nowhere goes away */
.bmfaq-story .bmfaq-story__arrow:disabled {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

.bmfaq-story__arrow--prev svg {
    transform: rotate(180deg);
}

/* ------------------------------------------------------------ smaller screens */

@media (max-width: 1023px) {
    .bmfaq-story {
        padding: 64px 0;
    }

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

    .bmfaq-story__turn {
        grid-template-columns: 1fr;
        gap: 24px;
        margin: 48px 0;
    }

    .bmfaq-story__turn .bmfaq-story__panel {
        max-width: 520px;
    }

    .bmfaq-story__answer {
        grid-template-columns: 1fr;
        gap: 32px;
    }
}

@media (max-width: 1024px) {
    /* The Elementor header paints every link dark here, the buttons keep their colours */
    .bmfaq-story a.bmfaq-story__btn {
        color: #FFFFFF !important;
    }
}

@media (max-width: 767px) {
    .bmfaq-story {
        padding: 48px 0;
    }

    .bmfaq-story .bmfaq-story__title {
        margin-bottom: 32px;
    }

    /* On a phone the problem is a swipe, one panel at a time, the next one peeks */
    .bmfaq-story__problem {
        display: flex;
        gap: 14px;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scroll-snap-type: x mandatory;
        padding-bottom: 4px;
        scrollbar-width: none;
    }

    .bmfaq-story__problem::-webkit-scrollbar {
        display: none;
    }

    .bmfaq-story__problem .bmfaq-story__panel {
        flex: 0 0 84%;
        scroll-snap-align: start;
        scroll-snap-stop: always;
    }

    .bmfaq-story__dots {
        display: flex;
        justify-content: center;
        gap: 6px;
        margin-top: 14px;
    }

    .bmfaq-story__dots i {
        width: 6px;
        height: 6px;
        border-radius: 3px;
        background: var(--st-line);
        transition: width 200ms var(--st-ez), background-color 200ms var(--st-ez);
    }

    .bmfaq-story__dots i.is-active {
        width: 18px;
        background: var(--st-blue);
    }

    .bmfaq-story__turn {
        margin: 40px 0;
    }

    .bmfaq-story__cta {
        flex-direction: column;
        margin-top: 40px;
    }

    .bmfaq-story__cta .bmfaq-story__btn {
        width: 100%;
    }

    .bmfaq-story--slider {
        --st-size: 64vw;
        padding: 0;
    }

    .bmfaq-story--slider .bmfaq-story__title {
        margin-bottom: 18px;
        font-size: 26px;
    }

    .bmfaq-story__track {
        gap: 14px;
    }

    .bmfaq-story__viewport {
        --st-fade-r: 40px;
    }

    .bmfaq-story__viewport:not(.is-start) {
        --st-fade-l: 40px;
    }

    /* On a phone every panel is a square, a wide picture sits whole in it */
    .bmfaq-story__slide,
    .bmfaq-story__slide--wide {
        flex-basis: 64%;
    }

    .bmfaq-story__slide .bmfaq-story__pic img {
        height: auto;
        aspect-ratio: 1 / 1;
    }

    .bmfaq-story__slide--wide .bmfaq-story__pic img {
        object-fit: contain;
    }

    .bmfaq-story .bmfaq-story__arrow {
        width: 44px;
        height: 44px;
    }

    .bmfaq-story__arrow--prev {
        left: 8px;
    }

    .bmfaq-story__arrow--next {
        right: 8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bmfaq-story__track {
        scroll-behavior: auto;
    }

    .bmfaq-story *,
    .bmfaq-story *::before,
    .bmfaq-story *::after {
        transition: none !important;
    }
}
