Showing the current post number and all post number on slider

Hello everyone.
I am using the bricks slider for one of my pages.
I am querying a custom post type with a meta value, which working greate.

My issue is that I want to show the current post number and all the post numbers on each slide. For example on the first slide I want to show 1(current slide number) out of 20 (all queried slide number), the second slide should show 2 out of 20, etc.

I used the following code but it shows all the queried post on every slide so the first slide has:
Slide 1 out of 20
Slide 2 out of 20
Slide 3 out of 20
Slide 4 out of 20
Slide 5 out of 20
Slide 6 out of 20
Slide 7 out of 20
Slide 8 out of 20
Slide 9 out of 20
Slide 10 out of 20
Slide 11 out of 20
Slide 12 out of 20
Slide 13 out of 20
Slide 14 out of 20
Slide 15 out of 20
Slide 16 out of 20
Slide 17 out of 20
Slide 18 out of 20
Slide 19 out of 20
Slide 20 out of 20

<?php
// Modify these variables to match your specific post type, meta key, and meta value or category
$post_type = 'portfolio';
$meta_key = 'featured';

// Example custom query arguments
$query_args = array(
    'post_type'      => $post_type,
    'posts_per_page' => -1, // Get all posts
    'meta_query'     => array(
        array(
            'key'   => $meta_key,
            'value' => '1', // Modify this value accordingly
        ),
    ),
);

// Create a new WP_Query instance with the custom query arguments
$query = new WP_Query($query_args);

// Check if there are posts in the query
if ($query->have_posts()) {
    // Output content for each post
    while ($query->have_posts()) {
        $query->the_post();

        // Get the current post position in the loop
        $current_position = $query->current_post + 1;

        // Output content for the current slide
        ?>
        <div class="your-slider-slide-content">
            <p>Slide <?php echo $current_position; ?> out of <?php echo $query->post_count; ?></p>
            <!-- Add other content or information as needed -->
        </div>
        <?php
    }

    // Reset the query to restore the original query
    wp_reset_postdata();
} else {
    // No posts found
    echo 'No posts found.';
}
?>

Is there anyway to fix this to only show the current number on each slide and not everything?

Thank you in advance,
Tamás