<?php
$hero_image = HERO_IMG;
$bgStyle = '';
$bgUrl = !empty(HERO_BG)
    ? HERO_BG
    : 'templates/webengine/assets/img/hero-bg.webp';
$overlayPercent = defined('HERO_BG_OVERLAY') ? (int)HERO_BG_OVERLAY : 50;

// Keep safe range
if ($overlayPercent < 0) $overlayPercent = 0;
if ($overlayPercent > 90) $overlayPercent = 90;

$opacity = $overlayPercent / 100;

if (HERO_BG_OVERLAY_ACCENT == 1) {
    $overlay = "rgba(var(--we-accent-rgb), $opacity)";
} else {
    $overlay = "rgba(0,0,0, $opacity)";
}

$bgStyle = "background-image: linear-gradient($overlay, $overlay), url('" . htmlspecialchars($bgUrl, ENT_QUOTES, 'UTF-8') . "');"
          . "background-size:cover;"
          . "background-repeat:no-repeat;"
          . "background-position:top center;";
?>
<section id="hero" class="hero carousel carousel-fade" data-bs-ride="carousel" data-bs-interval="5000" style="<?= $bgStyle ?>">
    <div class="container d-flex flex-column" data-aos="zoom-out">
    <div class="carousel-inner">
      <div class="carousel-item active">
        <div class="container">
          <div class="row justify-content-center gy-6">

            <div class="col-lg-5 col-md-8">
              <img src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME; ?>/assets/img/hero-carousel/hero-carousel-1.svg" alt="" class="img-fluid img">
            </div>

            <div class="col-lg-9 text-center">
              <h1><?php echo TEXT_HERO_TITLE; ?></h1>
		<p><?php echo TEXT_HERO_SUBTITLE; ?></p>
            </div>

          </div>
        </div>
      </div><!-- End Carousel Item -->

      <div class="carousel-item">
        <div class="container">
          <div class="row justify-content-center gy-6">

            <div class="col-lg-5 col-md-8">
              <img src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME; ?>/assets/img/hero-carousel/hero-carousel-2.svg" alt="" class="img-fluid img">
            </div>

            <div class="col-lg-9  align-items-center text-center">
              <h2>At vero eos et accusamus</h2>
              <p>Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Temporibus autem quibusdam et aut officiis debitis aut.</p>

        <a href="featured_categories.php" class="btn btn-hero--accent btn-lg"><?php echo TEXT_GET_TICKETS; ?></a>
		&nbsp;
		<a href="login.php" class="btn btn-hero--secondary btn-lg"><?php echo TEXT_LOGIN; ?></a>

            </div>

          </div>
        </div>
      </div><!-- End Carousel Item -->

      <div class="carousel-item">
        <div class="container">
          <div class="row justify-content-center gy-6">

            <div class="col-lg-5 col-md-8">
              <img src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME; ?>/assets/img/hero-carousel/hero-carousel-3.svg" alt="" class="img-fluid img">
            </div>

            <div class="col-lg-9  align-items-center text-center">
              <h2>Temporibus autem quibusdam</h2>
              <p>Beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt omnis iste natus error sit voluptatem accusantium.</p>

        <a href="featured_categories.php" class="btn btn-hero--accent btn-lg"><?php echo TEXT_GET_TICKETS; ?></a>
		&nbsp;
		<a href="login.php" class="btn btn-hero--secondary btn-lg"><?php echo TEXT_LOGIN; ?></a>

            </div>

          </div>
        </div>
      </div><!-- End Carousel Item -->
    </div>
	</div>

    <a class="carousel-control-prev" href="#hero" role="button" data-bs-slide="prev">
      <span class="carousel-control-prev-icon bi bi-chevron-left" aria-hidden="true"></span>
    </a>

    <a class="carousel-control-next" href="#hero" role="button" data-bs-slide="next">
      <span class="carousel-control-next-icon bi bi-chevron-right" aria-hidden="true"></span>
    </a>

    <ol class="carousel-indicators"></ol>

</section><!-- End Hero Section -->