<?php
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) { exit; }

$wte_heading   = get_theme_mod( 'wte_greeting_heading', __( '代表よりご挨拶', 'wte_' ) );
$wte_body      = get_theme_mod( 'wte_greeting_body', '' );
$wte_signature = get_theme_mod( 'wte_greeting_signature', '' );
$wte_image     = get_theme_mod( 'wte_greeting_image', '' );

if ( ! $wte_body ) { return; }
?>
<section id="wte-greeting" class="wte-section wte-section--greeting">
	<div class="wte-container">
		<header class="wte-section__header">
			<h2 class="wte-section__heading"><?php echo esc_html( $wte_heading ); ?></h2>
		</header>
		<div class="wte-greeting<?php echo $wte_image ? ' wte-greeting--has-image' : ''; ?>">
			<?php if ( $wte_image ) : ?>
				<div class="wte-greeting__image-wrap">
					<img src="<?php echo esc_url( $wte_image ); ?>" alt="" class="wte-greeting__image" loading="lazy" width="480" height="360">
				</div>
			<?php endif; ?>
			<div class="wte-greeting__text">
				<p class="wte-greeting__body"><?php echo nl2br( esc_html( $wte_body ) ); ?></p>
				<?php if ( $wte_signature ) : ?>
					<p class="wte-greeting__signature"><?php echo esc_html( $wte_signature ); ?></p>
				<?php endif; ?>
			</div>
		</div>
	</div>
</section>
