<?= $this->extend('App\Views\website\index') ?>
<?= $this->section('content') ?>
	<section class="about-hero" style="background: linear-gradient(rgba(17, 26, 76, 0.8), rgba(17, 26, 76, 0.8)), url('<?= $singlePost->photo;?>')">
	<div class="container">
		<h3 data-aos="fade-up"><?= $singlePost->title ?></h3>
		<nav class="breadcrumb" data-aos="fade-up">
			<small style="font-size:12px;"><a href="<?= base_url(); ?>">Home</a> &raquo; <a href="<?= base_url('news-blog'); ?>">News</a> &raquo; <span class="ms-2"><?= $singlePost->title ?></span></small>
		</nav>
	</div>
	</section>
	<section class="news-area">
		<div class="container">
			<div class="row">
				<div class="col-md-8">
					<div class="content-block">
							<div class="card mb-lg-4 mb-3 shadow-sm border-0 fade-up">
								<a href="#"><img src="<?= $singlePost->photo;?>" alt="<?= $singlePost->title ?>" class="img-fluid" /></a>
								<div class="card-body border-0">
									<div class="meta">
										<ul>
											<li><i class="bi bi-calendar"></i>&nbsp; <?= date('jS, F Y', strtotime($singlePost->published_date)); ?>											</li>
											<li> <i class="bi bi-person"></i>&nbsp; UCOLD</li>
											<li><i class="bi bi-collection"></i> &nbsp; <?= $singlePost->category;?>  </li>
										</ul>
									</div>
									<h3><?= $singlePost->title;?></h3>
									<div class="article-details"></div>
									<?= $singlePost->content;?>
									 
									<!-- social media sharing !-->
									<div class="d-flex justify-content-center bd-highlight mb-1">
											<div class="bd-highlight p-1">
												<small class="text-muted">share this article</small>
											</div>
											<div class="bd-highlight p-1">
												<a class="btn btn-sm btn-facebook" href="https://www.facebook.com/sharer/sharer.php?u=<?= base_url('posts/'.$singlePost->category_alias.'/'.$singlePost->alias) ?>" target="_blank" rel="noopener noreferrer" title="Facebook">
												<small>Share on <i class="bi bi-facebook"></i> </small>
												</a>
											</div><!-- Facebook !-->
											<div class="bd-highlight p-1">
												<a class="btn btn-sm btn-twitter" href="https://twitter.com/intent/tweet?url=<?= base_url('posts/'.$singlePost->category_alias.'/'.$singlePost->alias) ?>&text=<?= $singlePost->title; ?>" target="_blank" rel="noopener noreferrer" title="X">
												<small> Share on <i class="bi bi-twitter-x"></i></small>
												</a>
											</div><!-- Twitter !-->
											<div class="bd-highlight p-1">
												<a class="btn btn-sm btn-whatsapp" href="whatsapp://send?text=Check out this product: <?= $singlePost->title; ?> - <?= base_url('posts/'.$singlePost->category_alias.'/'.$singlePost->alias) ?>" data-action="share/whatsapp/share" title="WhatsApp">
												<small><i class="bi bi-whatsapp"></i> WhatsApp</small>
												</a>
											</div><!-- WhatsApp !-->
									</div><!-- social sharing !-->
								</div>
							</div>
					</div>
				</div>
				<div class="col-md-4">
					<div class="sticky-sidebar py-1">
						<div class="card card-body alert-light border-0 related-news mb-3 fade-up">
						<h3>Related News</h3>
							<?php foreach($relatedPosts as $r):?>
							<a href="<?= base_url('posts/'.$r->category_alias.'/'.$r->alias) ?>" >
							<div class="d-flex bd-highlight mb-2">
								<div class="bd-highlight p-1"><img src="<?= $r->photo;?>" alt="<?= $r->title;?>"></div>
								<div class="bd-highlight p-1"><h5><?= $r->title;?></h5></div>
							</div>
							</a>
							<?php endforeach;?>
						</div>
						<div class="card card-body home-directory shadow fade-up mb-3">
								<h2>Become a Member</h2>
								<h6>Uganda Committee on Large Dams (UCOLD)</h6>
								<img src="<?= base_url();?>/assets/images/features.png" alt="Member">
								<p>Safe Dams, Save Lives.</p>
								<a href="<?= base_url('become-member');?>" class="btn btn-warning">Register Now</a>
						</div><!-- Directory banner !-->
						 
					</div><!-- steaky area !-->
				</div>
			</div>
		</div>

	</section>
	
<?= $this->endSection() ?>