<?php
$base_dir = __DIR__ . '/Base';
$static_url = '/Resido/assets'; // Ensure this is the correct path

// Include the common navlink content
ob_start();
include "$base_dir/navbar.php"; // This file contains the shared navlink content
$navlink_content = ob_get_clean(); // Capture the navlink content
$page= 'nav';
$fpage= 'foot';

// Optionally define the Hero block content
ob_start();

$title = isset($_GET['title']) ? $_GET['title'] : '';

$blogs = [
    [
        'id' => 1,
        'img' => '/img/p-11.jpg', 
        'date' => '30 july 2025', 
        'title' => 'Why people choose listio for own properties', 
        'desc' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore.', 
        'btn' => 'Continue', 
    ],
    [
        'id' => 2,
        'img' => '/img/p-8.jpg', 
        'date' => '10 August 2025', 
        'title' => 'List of benifits and impressive Resido services', 
        'desc' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore.', 
        'btn' => 'Continue', 
    ],
    [
        'id' => 3,
        'img' => '/img/p-10.jpg', 
        'date' => '30 Sep 2025', 
        'title' => 'What people says about listio properties', 
        'desc' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore.', 
        'btn' => 'Continue', 
	],
	[
        'id' => 4,
        'img' => '/img/p-11.jpg', 
        'date' => '30 july 2025', 
        'title' => 'Why people choose listio for own properties1', 
        'desc' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore.', 
        'btn' => 'Continue', 
    ],
    [
        'id' => 5,
        'img' => '/img/p-8.jpg', 
        'date' => '10 August 2025', 
        'title' => 'List of benifits and impressive Resido services1', 
        'desc' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore.', 
        'btn' => 'Continue', 
    ],
    [
        'id' => 6,
        'img' => '/img/p-10.jpg', 
        'date' => '30 Sep 2025', 
        'title' => 'What people says about listio properties1', 
        'desc' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore.', 
        'btn' => 'Continue', 
    ]
];

$article = null;
if ($title === '') {
    $article = $blogs;

} else {
    // Search for the article by slugified title
    foreach ($blogs as $item) {
        $slugifiedTitle = str_replace(' ', '-', strtolower($item['title']));
        if ($slugifiedTitle === $title) {
            $article = $item;
            break;
        }
    }
}

if ($article === null) {
    echo "Article not found.";
    exit;
}
?>
			
<div class="blog-page">
<!-- ============================ Page Title Start================================== -->
<div class="page-title">
	<div class="container">
		<div class="row">
			<div class="col-lg-12 col-md-12">
				
				<h2 class="ipt-title">Blog Detail</h2>
				<span class="ipn-subtitle">See Our Latest Articles & News</span>
				
			</div>
		</div>
	</div>
</div>
<!-- ============================ Page Title End ================================== -->

<!-- ============================ Agency List Start ================================== -->
<section class="gray-simple">

	<div class="container">
	
		<!-- row Start -->
		<div class="row">
		
			<!-- Blog Detail -->
			<div class="col-lg-8 col-md-12 col-sm-12 col-12">
				<div class="blog-details single-post-item format-standard">
					<div class="post-details">
					
						<div class="post-featured-img">
							<img class="img-fluid" src="<?php echo !empty($article['img']) ? $static_url . $article['img'] : $static_url . '/img/p-1.jpg'; ?>" alt="">
						</div>
						
						<div class="post-top-meta">
							<ul class="meta-comment-tag">
								<li><a href="#"><span class="icons"><i class="ti ti-user"></i></span>by Rosalina Doe</a></li>
								<li><a href="#"><span class="icons"><i class="ti ti-comment-alt"></i></span>45 Comments</a></li>
							</ul>
						</div>
						<h2 class="post-title">
							<?php 
								if (!empty($article['title'])) {
										echo $article['title']; 
								} else {
									echo 'Lorem ipsum dolor sit amet, cons pisicing elit, sed do.'; 
								}
							?>
						</h2>
						<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut 
							labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto 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. Neque porro quisquam est, qui dolorem. <br><br> Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto 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.</p>
						<blockquote>
							<span class="icon"><i class="fas fa-quote-left"></i></span>
							<p class="text">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
								tem
							ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ullamco laboris nisi ut aliquip ex ea commodo onsequat.</p>
							<h5 class="name">- Rosalina Pong</h5>
						</blockquote>
						<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
							incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud
							exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure
							dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
							Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt
							mollit anim id est laborum. Sed ut perspiciatis unde omnis iste natus error sit
							voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo
							inventore veritatis et quasi architecto 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. Neque porro quisquam est, qui
							dolorem. <br><br>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum
							dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
							culpa qui officia deserunt mollit anim id est laborum. Sed ut perspiciatis unde omnis
							iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam,
							eaque ipsa quae ab illo inventore veritatis et quasi architecto 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.</p>
						<div class="post-bottom-meta">
							<div class="post-tags">
								<h4 class="pbm-title">Related Tags</h4>
								<ul class="list">
									<li><a href="#">organic</a></li>
									<li><a href="#">Foods</a></li>
									<li><a href="#">tasty</a></li>
								</ul>
							</div>
							<div class="post-share">
								<h4 class="pbm-title">Social Share</h4>
								<ul class="list">
									<li><a href="#"><i class="fab fa-facebook-f"></i></a></li>
									<li><a href="#"><i class="fab fa-twitter"></i></a></li>
									<li><a href="#"><i class="fab fa-linkedin-in"></i></a></li>
									<li><a href="#"><i class="fab fa-vk"></i></a></li>
									<li><a href="#"><i class="fab fa-tumblr"></i></a></li>
								</ul>
							</div>
						</div>
						<div class="single-post-pagination">
							<div class="prev-post">
								<a href="#">
									<div class="title-with-link">
										<span class="intro">Prev Post</span>
										<h3 class="title">Tips on Minimalist</h3>
									</div>
								</a>
							</div>
							<div class="post-pagination-center-grid">
								<a href="#"><i class="ti ti-layout-grid3"></i></a>
							</div>
							<div class="next-post">
								<a href="#">
									<div class="title-with-link">
										<span class="intro">Next Post</span>
										<h3 class="title">Less Is More</h3>
									</div>
								</a>
							</div>
						</div>
						
					</div>
				</div>
				
				<!-- Author Detail -->
				<div class="blog-details single-post-item format-standard">
					
					<div class="posts-author">
						<span class="img"><img class="img-fluid" src="<?php echo $static_url; ?>/img/user-1.jpg" alt=""></span>
						<h3 class="pa-name">Rosalina William</h3>
						<ul class="social-links">
							<li><a href="#"><i class="fab fa-facebook-f"></i></a></li>
							<li><a href="#"><i class="fab fa-twitter"></i></a></li>
							<li><a href="#"><i class="fab fa-behance"></i></a></li>
							<li><a href="#"><i class="fab fa-youtube"></i></a></li>
							<li><a href="#"><i class="fab fa-linkedin-in"></i></a></li>
						</ul>
						<p class="pa-text">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna
						aliqua. Ut enim ad minim veniam, quis nostrud
						exercitation ullamco laboris nisi ut aliquip ex ea commodo.</p>
					</div>
					
				</div>
				
				<!-- Blog Comment -->
				<div class="blog-details single-post-item format-standard">
					
					<div class="comment-area">
						<div class="all-comments">
							<h3 class="comments-title">05 Comments</h3>
							<div class="comment-list">
								<ul>
									<li class="single-comment">
										<article>
											<div class="comment-author">
												<img src="<?php echo $static_url; ?>/img/user-1.jpg" alt="">
											</div>
											<div class="comment-details">
												<div class="comment-meta">
													<div class="comment-left-meta">
														<h4 class="author-name">Rosalina Kelian <span class="selected"><i class="fas fa-bookmark"></i></span></h4>
														<div class="comment-date">19th May 2025</div>
													</div>
													<div class="comment-reply">
														<a href="#" class="reply"><span class="icona"><i class="ti ti-back-left"></i></span> Reply</a>
													</div>
												</div>
												<div class="comment-text">
													<p>Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim laborumab.
														perspiciatis unde omnis iste natus error.</p>
												</div>
											</div>
										</article>
										<ul class="children">
											<li class="single-comment">
												<article>
													<div class="comment-author">
														<img src="<?php echo $static_url; ?>/img/user-2.jpg" alt="">
													</div>
													<div class="comment-details">
														<div class="comment-meta">
															<div class="comment-left-meta">
																<h4 class="author-name">Rosalina Kelian</h4>
																<div class="comment-date">19th May 2025</div>
															</div>
															<div class="comment-reply">
																<a href="#" class="reply"><span class="icons"><i class="ti ti-back-left"></i></span> Reply</a>
															</div>
														</div>
														<div class="comment-text">
															<p>Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim laborumab.
																perspiciatis unde omnis iste natus error.</p>
														</div>
													</div>
												</article>
												<ul class="children">
													<li class="single-comment">
														<article>
															<div class="comment-author">
																<img src="<?php echo $static_url; ?>/img/user-4.jpg" alt="">
															</div>
															<div class="comment-details">
																<div class="comment-meta">
																	<div class="comment-left-meta">
																		<h4 class="author-name">Rosalina Kelian</h4>
																		<div class="comment-date">19th May 2025</div>
																	</div>
																	<div class="comment-reply">
																		<a href="#" class="reply"><span class="icons"><i class="ti ti-back-left"></i></span> Reply</a>
																	</div>
																</div>
																<div class="comment-text">
																	<p>Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim laborumab.
																		perspiciatis unde omnis iste natus error.</p>
																</div>
															</div>
														</article>
													</li>
												</ul>
											</li>
										</ul>
									</li>
									<li class="single-comment">
										<article>
											<div class="comment-author">
												<img src="<?php echo $static_url; ?>/img/user-5.jpg" alt="">
											</div>
											<div class="comment-details">
												<div class="comment-meta">
													<div class="comment-left-meta">
														<h4 class="author-name">Rosalina Kelian</h4>
														<div class="comment-date">19th May 2025</div>
													</div>
													<div class="comment-reply">
														<a href="#" class="reply"><span class="icons"><i class="ti ti-back-left"></i></span> Reply</a>
													</div>
												</div>
												<div class="comment-text">
													<p>Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim laborumab.
														perspiciatis unde omnis iste natus error.</p>
												</div>
											</div>
										</article>
									</li>
								</ul>
							</div>
						</div>
						<div class="comment-box submit-form">
							<h3 class="reply-title">Post Comment</h3>
							<div class="comment-form">
								<form action="#">
									<div class="row">
										<div class="col-lg-6 col-md-6 col-sm-12">
											<div class="form-group">
												<input type="text" class="form-control" placeholder="Your Name">
											</div>
										</div>
										<div class="col-lg-6 col-md-6 col-sm-12">
											<div class="form-group">
												<input type="text" class="form-control" placeholder="Your Email">
											</div>
										</div>
										<div class="col-lg-12 col-md-12 col-sm-12">
											<div class="form-group">
												<textarea name="comment" class="form-control" cols="30" rows="6" placeholder="Type your comments...."></textarea>
											</div>
										</div>
										<div class="col-lg-12 col-md-12 col-sm-12">
											<div class="form-group">
												<a href="#" class="btn btn-primary rounded full-width">Submit Now</a>
											</div>
										</div>
									</div>
								</form>
							</div>
						</div>
					</div>
					
				</div>
				
				
			</div>
			
			<!-- Single blog Grid -->
			<div class="col-lg-4 col-md-12 col-sm-12 col-12">
				
				<!-- Searchbard -->
				<div class="single-widgets widget_search">
					<h4 class="title">Search</h4>
					<form class="sidebar-search-form">
						<input type="search" name="search" placeholder="Search..">
						<button type="submit"><i class="fa-solid fa-magnifying-glass"></i></button>
					</form>
				</div>

				<!-- Categories -->
				<div class="single-widgets widget_category">
					<h4 class="title">Categories</h4>
					<ul>
						<li><a href="#">Lifestyle <span>09</span></a></li>
						<li><a href="#">Travel <span>12</span></a></li>
						<li><a href="#">Fashion <span>19</span></a>
						</li><li><a href="#">Branding <span>17</span></a></li>
						<li><a href="#">Music <span>10</span></a></li>
					</ul>
				</div>
				
				<!-- Trending Posts -->
				<div class="single-widgets widget_thumb_post">
					<h4 class="title">Trending Posts</h4>
					<ul>
						
						<!-- trending-posts code  -->
						<?php
							include "$base_dir/Components/Pages/trending-posts.php";
						?>

					</ul>
				</div>
				
				<!-- Tags Cloud -->
				<div class="single-widgets widget_tags">
					<h4 class="title">Tags Cloud</h4>
					<ul>
						<li><a href="#">Lifestyle</a></li>
						<li><a href="#">Travel</a></li>
						<li><a href="#">Fashion</a></li>
						<li><a href="#">Branding</a></li>
						<li><a href="#">Music</a></li>
					</ul>
				</div>
				
			</div>
			
		</div>
		<!-- /row -->					
		
	</div>
			
</section>
<!-- ============================ Agency List End ================================== -->

<!-- ============================ Call To Action ================================== -->
<section class="bg-primary call-to-act-wrap">
	<div class="container">
		
		<!-- estate-agent code  -->
		<?php
			include "$base_dir/Components/Home/estate-agent.php";
		?>

	</div>
</section>
<!-- ============================ Call To Action End ================================== -->


</div>

<?php
$hero_content = ob_get_clean(); // Capture the hero content

// Include the base template
include "$base_dir/style/base.php";
?>