/* How It Works block (blocks/how-it-works) */
.how-it-works {
    padding: 3rem 1rem;
    text-align: center;
}
/* Scoped as ".how-it-works .how-it-works-title" (not just ".how-it-works-title")
   so this reliably beats the theme's ".post-content h2, .post-content h3"
   and ".post-content P" rules in style.css / responsive.css, which target
   these same h2/h3/p tags with higher specificity - without editing those
   shared stylesheets. */
.how-it-works .how-it-works-title {
    color: #fff;
    font-weight: 800;
    font-size: 30px;
    margin: 0 0 2.5rem;
}
.how-it-works-steps {
    display: flex;
    align-items: stretch;
    justify-content: center;
    max-width: 960px;
    margin: 0 auto;
    /* Grows the gap under the title by the same amount the images below are
       pulled up via --how-it-works-media-overlap-desktop, so a bigger overlap
       never crowds the heading. Defaults to 0 (no change) when unset. */
    margin-top: calc(var(--how-it-works-media-overlap-desktop, 0px) / 2);
}
.how-it-works-step {
    flex: 1 1 0;
    max-width: 380px;
    background: #0B0B0C;
    border: 1px solid #E2C562;
    border-radius: 20px;
    padding: 2.5rem 1.5rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.how-it-works-step-media {
    position: relative;
    display: flex;
    justify-content: center;
    margin-bottom: 1.75rem;
    inline-size: 100%;
    /* Negative margin-top lets the image poke out above the card's top
       border; set via the block's "Image Overlap (Desktop)" field
       (0 = no overlap). */
    margin-top: calc(-1 * var(--how-it-works-media-overlap-desktop, 0px));
}
.how-it-works-step-image {
    inline-size: 100%;
    block-size: auto;
    display: block;
    border-radius: 12px;
}
.how-it-works-step-placeholder {
    block-size: 130px;
    background-color: #b9b9b9;
    background-image: repeating-conic-gradient(#a8a8a8 0% 25%, #c7c7c7 0% 50%);
    background-size: 20px 20px;
}
.how-it-works-step-number {
    position: absolute;
    inset-block-end: -16px;
    inset-inline-start: 50%;
    transform: translateX(-50%);
    inline-size: 32px;
    block-size: 32px;
    border-radius: 50%;
    background: #E2C562;
    color: #101828;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 24px;
}
.how-it-works-step-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    inline-size: 100%;
}
.how-it-works .how-it-works-step-title {
    color: #E2C562;
    font-weight: 700;
    font-size: 24px;
    text-transform: uppercase;
    letter-spacing: .02em;
    margin: 0 0 .625rem;
}
.how-it-works .how-it-works-step-desc {
    color: #C9C9C9;
    font-size: 16px;
    line-height: 1.5;
}
.how-it-works .how-it-works-step-desc p {
    margin: 0 0 .5rem;
    font-size: inherit;
    line-height: inherit;
}
.how-it-works-step-desc p:last-child {
    margin-bottom: 0;
}
.how-it-works-arrow {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    padding: 0 1rem;
}
.how-it-works-arrow-icon {
    display: block;
    inline-size: 32px;
    block-size: auto;
}
.how-it-works-arrow-icon-down {
    display: none;
}

/* Tablet/mobile: stack the steps, lay each card out as image-left/text-right,
   and swap the connector arrow icon from right-pointing to down-pointing. */
@media (max-width: 768px) {
    /* Cards switch to an image-left/text-right row here, so the overlap
       effect switches to the block's separate "Image Overlap (Mobile)"
       field/variable instead of the desktop one (0 = no overlap). */
    .how-it-works-steps {
        flex-direction: column;
        align-items: stretch;
        margin-top: calc(var(--how-it-works-media-overlap-mobile, 0px) / 2);
    }
    .how-it-works-step {
        max-width: 100%;
        min-height: 128px;
        flex-direction: row;
        align-items: center;
        text-align: left;
        gap: 1rem;
        padding: 1.25rem 1.25rem 1.25rem 0;
    }
    .how-it-works-step-media {
        inline-size: auto;
        flex: 0 0 auto;
        margin-bottom: 0;
        margin-top: calc(-1 * var(--how-it-works-media-overlap-mobile, 0px));
    }
    .how-it-works-step-image,
    .how-it-works-step-placeholder {
        inline-size: 130px;
        block-size: 130px;
    }
    .how-it-works-step-image {
        object-fit: cover;
    }
    .how-it-works-step-content {
        inline-size: auto;
        flex: 1 1 auto;
        align-items: flex-start;
        text-align: left;
    }
    .how-it-works-arrow {
        padding: .6rem 0;
    }
    .how-it-works-arrow-icon {
        inline-size: 24px;
    }
    .how-it-works-arrow-icon-right {
        display: none;
    }
    .how-it-works-arrow-icon-down {
        display: block;
    }
}

/* Mobile (matches the theme's established ≤576px breakpoint) */
@media (max-width: 576px) {
    .how-it-works .how-it-works-title {
        font-size: 20px;
        margin-bottom: 1.5rem;
    }
    .how-it-works-step {
        max-width: 282px;
        margin-inline: auto;
        padding: 1rem .5rem 1rem 0;
        gap: 0;
    }
    .how-it-works-step-image,
    .how-it-works-step-placeholder {
        inline-size: 115px;
        block-size: 115px;
    }
    .how-it-works-step-number {
        inline-size: 26px;
        block-size: 26px;
        font-size: 20px;
        inset-block-end: -10px;
    }
    .how-it-works-step-content {
        align-items: center;
        text-align: center;
    }
    .how-it-works .how-it-works-step-title {
        font-size: 20px;
        margin-bottom: .375rem;
    }
    .how-it-works .how-it-works-step-desc {
        font-size: 14px;
    }
}
