<?php
/**
 * Legible Theme functions and definitions
 *
 * @link https://developer.wordpress.org/themes/basics/theme-functions/
 *
 * @package Legible
 * @since Legible 1.0
 */


if ( ! function_exists( 'legible_support' ) ) :

	/**
	 * Sets up theme defaults and registers support for various WordPress features.
	 *
	 * @since Legible 1.0
	 *
	 * @return void
	 */
	function legible_support() {

		// Make theme available for translation.
		load_theme_textdomain( 'legible' );

		// Add support for block styles.
		add_theme_support( 'wp-block-styles' );

		// Enqueue editor styles.
		add_editor_style( 'style.css' );

	}

endif;

add_action( 'after_setup_theme', 'legible_support' );

if ( ! function_exists( 'legible_styles' ) ) :

	/**
	 * Enqueue styles.
	 *
	 * @since Legible 1.0
	 *
	 * @return void
	 */
	function legible_styles() {

		// Register theme stylesheet.
		wp_register_style(
			'legible-style',
			get_template_directory_uri() . '/style.css',
			array(),
			wp_get_theme()->get( 'Version' )
		);

		// Enqueue theme stylesheet.
		wp_enqueue_style( 'legible-style' );

	}

endif;

add_action( 'wp_enqueue_scripts', 'legible_styles' );
