<?php

require_once __DIR__ . '/_cms_helpers.php';

$sectionConfig =
    ecms_get_section_config('venue');

if (empty($sectionConfig['enabled'])) {
    return;
}

$lang =
    $lang ?? 'en';

$currentSection =
    $currentSection ?? [];

$currentContent =
    $currentContent ?? [];

$venueTitle =
    $lang === 'ar'
    ? (
        $currentContent['title_ar']
        ?? 'موقع المؤتمر'
    )
    : (
        $currentContent['title_en']
        ?? 'Conference Venue'
    );

$venueSubtitle =
    $lang === 'ar'
    ? (
        $currentContent['subtitle_ar']
        ?? 'وجهة أكاديمية عالمية'
    )
    : (
        $currentContent['subtitle_en']
        ?? 'A World-Class Academic Destination'
    );

$venueDesc =
    $lang === 'ar'
    ? (
        $currentContent['body_ar']
        ?? 'استمتع بتجربة مؤتمر احترافية ضمن بيئة أكاديمية حديثة تجمع الباحثين والخبراء من مختلف أنحاء العالم.'
    )
    : (
        $currentContent['body_en']
        ?? 'Experience a professional conference atmosphere within a modern academic environment connecting scholars and experts worldwide.'
    );

$venueImage =
    $currentContent['image_path']
    ?? $conference['venue_image']
    ?? $conference['banner_path']
    ?? '';

?>

<section

id="venue"

class="
pcb-section
pcb-venue-section

<?= pcb_h(
$currentSection['theme_name']
?? ''
) ?>

<?= pcb_h(
$currentSection['custom_css_class']
?? ''
) ?>
"

<?php if(!empty($venueImage)): ?>

style="
background-image:
linear-gradient(
rgba(15,23,42,.82),
rgba(15,23,42,.82)
),
url('<?= pcb_h(
ec_media_url($venueImage)
) ?>');
background-size:cover;
background-position:center;
"

<?php endif; ?>

>

<div class="container">

<div class="row align-items-center g-5">

<div class="col-lg-6">

<div class="pcb-section-badge">

<i class="fa fa-location-dot"></i>

<?= pcb_h(
$lang === 'ar'
? 'مقر المؤتمر'
: 'Conference Venue'
) ?>

</div>

<h2 class="pcb-section-title mt-4">

<?= pcb_h($venueTitle) ?>

</h2>

<h3 class="pcb-section-subtitle">

<?= pcb_h($venueSubtitle) ?>

</h3>

<p class="pcb-section-text">

<?= pcb_h($venueDesc) ?>

</p>

<div class="row g-3 mt-4">

<div class="col-md-6">

<div class="pcb-mini-stat">

<i class="fa fa-earth-americas"></i>

42+

<span>

<?= pcb_h(
$lang === 'ar'
? 'دولة مشاركة'
: 'Participating Countries'
) ?>

</span>

</div>

</div>

<div class="col-md-6">

<div class="pcb-mini-stat">

<i class="fa fa-users"></i>

120+

<span>

<?= pcb_h(
$lang === 'ar'
? 'باحث وخبير'
: 'Researchers & Experts'
) ?>

</span>

</div>

</div>

</div>

</div>

<div class="col-lg-6">

<div class="pcb-venue-visual">

<div class="pcb-venue-overlay"></div>

<div class="pcb-venue-content">

<div class="pcb-venue-label">

<?= pcb_h(
$lang === 'ar'
? 'مؤتمر دولي'
: 'International Conference'
) ?>

</div>

<h3>

<?= pcb_h(
$lang === 'ar'
? (
$conference['title_ar']
?? $conference['title']
?? ''
)
: (
$conference['title_en']
?? $conference['title']
?? ''
)
) ?>

</h3>

<p>

<?= pcb_h(
$conference['short_name']
?? ''
) ?>

</p>

</div>

</div>

</div>

</div>

</div>

</section>
