<?php
  
// ================================
// HowCan Theme Functions
// Register Block Patterns
// ================================

function howcan_register_block_patterns() {
    if ( function_exists( 'register_block_pattern' ) ) {
        foreach ( glob( get_template_directory() . '/patterns/*.php' ) as $pattern_file ) {
            register_block_pattern(
                basename( $pattern_file, '.php' ),
                include $pattern_file
            );
        }
    }
}
add_action( 'init', 'howcan_register_block_patterns' );
// ================================
// HowCan Theme Functions
// register custom block style
// ================================

function howcan_register_custom_block_styles() {
    // Paragraph – Highlight
    register_block_style(
        'core/paragraph',
        array(
            'name'  => 'highlight-yellow',
            'label' => __( 'Highlight Yellow', 'howcan' ),
            'inline_style' => '.wp-block-paragraph.is-style-highlight-yellow { background-color: #fff3cd; padding: 1rem; border-left: 5px solid #ffc107; }',
        )
    );

    // Button – Outline Primary
    register_block_style(
        'core/button',
        array(
            'name'  => 'outline-primary',
            'label' => __( 'Outline Primary', 'howcan' ),
            'inline_style' => '.wp-block-button.is-style-outline-primary .wp-block-button__link { border: 2px solid #0d6efd; color: #0d6efd; background: transparent; }',
        )
    );

    // Image – Shadow
    register_block_style(
        'core/image',
        array(
            'name'  => 'shadow',
            'label' => __( 'Drop Shadow', 'howcan' ),
            'inline_style' => '.wp-block-image.is-style-shadow img { box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15); }',
        )
    );

    // Quote – Fancy Border
    register_block_style(
        'core/quote',
        array(
            'name'  => 'fancy-border',
            'label' => __( 'Fancy Border', 'howcan' ),
            'inline_style' => '.wp-block-quote.is-style-fancy-border { border-left: 4px solid #0d6efd; padding-left: 1rem; font-style: italic; }',
        )
    );
}
add_action( 'init', 'howcan_register_custom_block_styles' );
// custom block style end 

?>