<?php
/**
 * Template part for displaying the header branding
 *
 * @package giornalismo
 */

namespace JM_Web_Development\Giornalismo;

if ( has_header_image() ) {
	$title_class = 'screen-reader-text';
} else {
	$title_class = '';
}

?>

<div class="site-branding">

	<?php
	if ( is_front_page() && is_home() ) {
		?>
		<h1 class="site-title <?php echo esc_attr( $title_class ); ?>"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
		<?php
	} else {
		?>
		<p class="site-title <?php echo esc_attr( $title_class ); ?>"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
		<?php
	}
	?>

	<?php
	$giornalismo_description = get_bloginfo( 'description', 'display' );
	if ( $giornalismo_description || is_customize_preview() ) {
		?>
		<p class="site-description <?php echo esc_attr( $title_class ); ?>">
			<?php echo $giornalismo_description; /* phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped */ ?>
		</p>
		<?php
	}
	?>
</div><!-- .site-branding -->
