<?php
// Reusable "En savoir plus" button component
// Usage: get_template_part('template-parts/components/read-more', null, [
//   'href' => 'https://...',
//   'label' => __('En savoir plus', 'laurentperrier'),
//   'aria_label' => sprintf(__('En savoir plus sur : %s', 'laurentperrier'), '...'),
//   'class' => 'btn btn-underline dark inline-flex items-center gap-2',
// ]);

$href       = isset($args['href']) ? $args['href'] : '#';
$label      = isset($args['label']) ? $args['label'] : __('En savoir plus', 'laurentperrier');
$aria_label = isset($args['aria_label']) ? $args['aria_label'] : $label;
$class      = isset($args['class']) ? $args['class'] : 'btn btn-underline dark inline-flex items-center gap-2';
?>
<a href="<?php echo esc_url($href); ?>" class="<?php echo esc_attr($class); ?>" aria-label="<?php echo esc_attr($aria_label); ?>">
    <span class="flex gap-3 items-center text-sm font-heading font-medium uppercase tracking-[0.08125rem] text-black group">
        <svg xmlns="http://www.w3.org/2000/svg" width="29" height="29" viewBox="0 0 29 29" fill="none" aria-hidden="true" focusable="false" class="group-hover:fill-black transition-colors duration-300 ease-in-out">
            <path d="M21.415 14.3946C21.6103 14.1993 21.6103 13.8827 21.415 13.6875L18.233 10.5055C18.0378 10.3102 17.7212 10.3102 17.5259 10.5055C17.3307 10.7007 17.3307 11.0173 17.5259 11.2126L20.3544 14.041L17.5259 16.8694C17.3307 17.0647 17.3307 17.3813 17.5259 17.5765C17.7212 17.7718 18.0378 17.7718 18.233 17.5765L21.415 14.3946ZM7.02051 14.041V14.541H21.0615V14.041V13.541H7.02051V14.041Z" fill="black" class="group-hover:fill-white transition-colors duration-300 ease-in-out" />
            <circle cx="14.041" cy="14.041" r="13.541" stroke="black" class="group-hover:stroke-white transition-colors duration-300 ease-in-out" />
        </svg>
        <?php echo esc_html($label); ?>
    </span>
</a>
