<?php

function pagodapress_enqueue_styles() {
    // Enqueue the main stylesheet
    wp_enqueue_style('pagodapress-style', get_stylesheet_uri());
}
add_action('wp_enqueue_scripts', 'pagodapress_enqueue_styles');

function pagodapress_enqueue_editor_styles() {
    // Enqueue the main stylesheet and editor-specific stylesheet for the block editor
    wp_enqueue_style('pagodapress-style', get_stylesheet_uri());
}
add_action( 'enqueue_block_assets', function () {
	wp_enqueue_style( 'pagodapress-style', get_stylesheet_uri() );
} );


// // Register custom block: Social Share
// function pagodapress_register_social_share_block() {
// 	// Try child/active theme first.
// 	$dir = trailingslashit( get_stylesheet_directory() ) . 'blocks/social-share';
// 	if ( ! file_exists( $dir . '/block.json' ) ) {
// 		// Fallback to parent theme (in case you placed blocks in the parent).
// 		$dir = trailingslashit( get_template_directory() ) . 'blocks/social-share';
// 	}

// 	if ( ! file_exists( $dir . '/block.json' ) ) {
// 		error_log( '[pagodapress] Social Share block not registered. Missing block.json at: ' . $dir );
// 		return;
// 	}

// 	error_log( '[pagodapress] Registering Social Share from: ' . $dir );
// 	register_block_type( $dir );
// }
// add_action( 'init', 'pagodapress_register_social_share_block' );




require_once get_template_directory() . '/inc/theme-info.php';


/**
 * Admin menu highlight (global).
 */
add_action( 'admin_enqueue_scripts', function () {
	$css = '
		#menu-appearance li:last-child a{
			background:#1a7f37 !important;
			color:#fff !important;
		}
		#menu-appearance li:last-child a .wp-menu-name,
		#menu-appearance li:last-child a .wp-menu-image:before{
			color:#fff !important;
		}
	';
	wp_register_style( 'pagoda_press-admin', false );
	wp_enqueue_style( 'pagoda_press-admin' );
	wp_add_inline_style( 'pagoda_press-admin', $css );
} );
