<?php
/**
 * Store credentials and brand activity.
 *
 * @package Fragrance_Trade
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

$store_brand   = fragrance_trade_get_mod( 'store_brand', __( '康得新 KDX', 'fragrance-trade' ) );
$authorization = fragrance_trade_get_mod( 'store_authorization', __( '官方授权至尊服务店', 'fragrance-trade' ) );

$credentials = array(
	array(
		'image'       => 'store/kdx-logo.jpg',
		'title'       => $store_brand,
		'description' => sprintf(
			/* translators: %s: store's primary brand. */
			__( '门店主营 %s 汽车膜产品与施工服务。', 'fragrance-trade' ),
			$store_brand
		),
		'alt'         => __( 'KDX 品牌标识', 'fragrance-trade' ),
		'width'       => 1600,
		'height'      => 1472,
		'contain'     => true,
	),
	array(
		'image'       => 'store/authorization.jpg',
		'title'       => $authorization,
		'description' => sprintf(
			/* translators: 1: brand, 2: authorization level. */
			__( '%1$s %2$s，具体授权范围与有效期以证书原件为准。', 'fragrance-trade' ),
			$store_brand,
			$authorization
		),
		'alt'         => __( 'KDX 汽车膜授权服务店证书', 'fragrance-trade' ),
		'width'       => 1600,
		'height'      => 1199,
		'contain'     => true,
	),
	array(
		'image'       => 'store/award.jpg',
		'title'       => __( '赛事荣誉', 'fragrance-trade' ),
		'description' => __( '2026 KDX 全国百强直播 PK 赛第一季“魄界王者”荣誉。', 'fragrance-trade' ),
		'alt'         => __( 'KDX 全国百强直播 PK 赛魄界王者奖杯', 'fragrance-trade' ),
		'width'       => 900,
		'height'      => 1600,
		'contain'     => false,
	),
	array(
		'image'       => 'store/brand-event.jpg',
		'title'       => __( '品牌交流活动', 'fragrance-trade' ),
		'description' => __( '参加 KDX 品牌活动，了解产品与施工服务信息。', 'fragrance-trade' ),
		'alt'         => __( 'KDX 品牌活动现场', 'fragrance-trade' ),
		'width'       => 1600,
		'height'      => 1066,
		'contain'     => false,
	),
);
?>
<section class="b2b-section credentials-section" aria-labelledby="credentials-title">
	<div class="container">
		<div class="section-heading text-center mx-auto">
			<p class="section-eyebrow"><?php esc_html_e( '品牌与门店资料', 'fragrance-trade' ); ?></p>
			<h2 id="credentials-title"><?php esc_html_e( '资质与荣誉', 'fragrance-trade' ); ?></h2>
			<p class="section-lead"><?php esc_html_e( '通过门店授权、品牌活动与赛事记录，了解门店的实际经营与服务背景。', 'fragrance-trade' ); ?></p>
		</div>
		<div class="credentials-grid mt-5">
			<?php foreach ( $credentials as $credential ) : ?>
				<article class="credential-card">
					<a
						class="credential-media<?php echo $credential['contain'] ? ' is-contain' : ''; ?>"
						href="<?php echo esc_url( fragrance_trade_asset_uri( 'images/' . $credential['image'] ) ); ?>"
						target="_blank"
						rel="noopener noreferrer"
						aria-label="<?php echo esc_attr( sprintf( __( '查看%s大图', 'fragrance-trade' ), $credential['title'] ) ); ?>"
					>
						<img
							src="<?php echo esc_url( fragrance_trade_asset_uri( 'images/' . $credential['image'] ) ); ?>"
							alt="<?php echo esc_attr( $credential['alt'] ); ?>"
							width="<?php echo esc_attr( $credential['width'] ); ?>"
							height="<?php echo esc_attr( $credential['height'] ); ?>"
							loading="lazy"
							decoding="async"
						>
					</a>
					<div class="credential-body">
						<h3><?php echo esc_html( $credential['title'] ); ?></h3>
						<p><?php echo esc_html( $credential['description'] ); ?></p>
					</div>
				</article>
			<?php endforeach; ?>
		</div>
	</div>
</section>
