<?php
/**
 * Functions and definitions
 *
 * @link https://developer.wordpress.org/themes/basics/theme-functions/
 *
 * @package bondspace
 * @since 1.0.0
 */

/**
 * Enqueue the CSS files.
 *
 * @since 1.0.0
 *
 * @return void
 */
function bondspace_styles() {
	wp_enqueue_style(
		'bondspace-style',
		get_stylesheet_uri(),
		[],
		wp_get_theme()->get( 'Version' )
	);
}
add_action( 'wp_enqueue_scripts', 'bondspace_styles' );

/**
 * Register block styles.
 */

if ( ! function_exists( 'bondspace_block_styles' ) ) :
	/**
	 * Register custom block styles
	 *
	 * @since Bondspace 1.0.0
	 * @return void
	 */
	function bondspace_block_styles() {
		register_block_style(
			'core/list',
			array(
				'name'         => 'checkmark-list',
				'label'        => __( 'Checkmark', 'bondspace' ),
				/*
				 * Styles for the custom checkmark list block style
				 */
				'inline_style' => '
				ul.is-style-checkmark-list {
					list-style-type: "\2713";
				}

				ul.is-style-checkmark-list li {
					padding-inline-start: 1ch;
				}',
			)
		);
		register_block_style(
			'core/navigation-link',
			array(
				'name'         => 'arrow-link',
				'label'        => __( 'With arrow', 'bondspace' ),
				/*
				 * Styles for the custom arrow nav link block style
				 */
				'inline_style' => '
				.is-style-arrow-link .wp-block-navigation-item__label:after {
					content: "\2197";
					padding-inline-start: 0.25rem;
					vertical-align: middle;
					text-decoration: none;
					display: inline-block;
				}',
			)
		);

		
    	}
	endif;

add_action( 'init', 'bondspace_block_styles' );


/**
 * Register pattern categories.
 */

if ( ! function_exists( 'bondspace_pattern_categories' ) ) :
	/**
	 * Register pattern categories
	 *
	 * @since Bondspace
	 * @return void
	 */
	function bondspace_pattern_categories() {

		register_block_pattern_category(
			'bondspace_page',
			array(
				'label'       => _x( 'Pages', 'Block pattern category', 'bondspace' ),
				'description' => __( 'A collection of full page layouts.', 'bondspace' ),
			)
		);
	}
endif;

add_action( 'init', 'bondspace_pattern_categories' );