<div role="main" class="main main-blog">
	<?php echo view('Modules\Blog\Views\view_blog_menu'); ?>

	<section class="pt-3 pt-lg-5 mb-0 mb-lg-5 d-none d-lg-flex">
		<div class="container-md">
			<div class="row">
				<div class="col-12 mb-3 mb-lg-5 col-blog-image">
					<img class="img-fluid rounded-4 shadow-sm" src="<?php echo PUBLICURL . 'uploads/upload_cad_blog/item_' . $blog->id . '/' . $blog->subimagem; ?>" alt="<?php echo $blog->titulo; ?>">
				</div>

				<div class="col-12 col-blog-info position-relative">
					<h1 class="m-0 mb-4 p-0 text-13 lh-1 ls-1 font-weight-bold txt-app-custom-color-duo">
						<?php echo $blog->titulo; ?>
					</h1>

					<h2 class="m-0 mb-3 p-0 text-5 lh-1 ls-1 font-weight-bold">
						<?php echo $blog->subtitulo; ?>
					</h2>

					<div class="text-4 mb-4 d-flex text-black justify-content-start align-items-center">
						<span class="day"><?php echo date('d', strtotime($blog->data)); ?>.</span>
						<span class="month"><?php echo date('m', strtotime($blog->data)); ?>.</span>
						<span class="year"><?php echo date('Y', strtotime($blog->data)); ?></span>
					</div>

					<p class="m-0 mb-4 p-0 text-5 text-black text-justify">
						<?php echo nl2br($blog->descricao); ?>
					</p>
				</div>
			</div>
		</div>
	</section>

	<section class="pt-3 pt-lg-5 mb-0 mb-lg-5 d-flex d-lg-none">
		<div class="container-md">
			<div class="row">
				<div class="col-12 mb-3 mb-lg-5 col-blog-image">
					<img class="img-fluid rounded-4 shadow-sm" src="<?php echo PUBLICURL . 'uploads/upload_cad_blog/item_' . $blog->id . '/' . $blog->subimagem; ?>" alt="<?php echo $blog->titulo; ?>">
				</div>

				<div class="col-12">
					<h1 class="m-0 mb-4 p-0 text-8 lh-1 ls-1 font-weight-bold txt-app-custom-color-duo">
						<?php echo $blog->titulo; ?>
					</h1>

					<h2 class="m-0 mb-3 p-0 text-5 lh-1 ls-1 font-weight-bold">
						<?php echo $blog->subtitulo; ?>
					</h2>

					<div class="text-4 mb-4 d-flex text-black justify-content-start align-items-center">
						<span class="day"><?php echo date('d', strtotime($blog->data)); ?>.</span>
						<span class="month"><?php echo date('m', strtotime($blog->data)); ?>.</span>
						<span class="year"><?php echo date('Y', strtotime($blog->data)); ?></span>
					</div>

					<p class="m-0 mb-4 p-0 text-5 text-black text-justify">
						<?php echo nl2br($blog->descricao); ?>
					</p>
				</div>
			</div>
		</div>
	</section>

	<?php $conteudoExtra = @unserialize(base64_decode($blog->extra)); ?>

	<?php if($conteudoExtra AND !empty($conteudoExtra)) { ?>
		<section class="">
			<div class="container-md">
				<?php foreach($conteudoExtra as $key => $conteudo) { ?>
					<div class="row my-3 my-lg-5">
						<?php if ($key % 2 == 0) { ?>

							<?php if(isset($conteudo['imagem']) AND !empty($conteudo['imagem'])) { ?>
								<div class="col-12 col-lg-4 d-flex justify-content-center align-items-center order-0 order-lg-0 mb-4 mb-lg-0">
									<img class="img-fluid rounded-4" src="<?php echo PUBLICURL . 'uploads/upload_cad_blog/item_' . $blog->id . '/' . $conteudo['imagem']; ?>">
								</div>
							<?php } ?>

							<div class="<?php if(isset($conteudo['imagem']) AND !empty($conteudo['imagem'])) { echo 'col-12 col-lg-8 ps-lg-5'; } else { echo 'col-12 col-lg-12'; } ?> order-1 order-lg-1">
								<h2 class="m-0 mb-4 p-0 text-6 lh-1 ls-1 font-weight-bold txt-app-custom-color-duo">
									<?php echo $conteudo['titulo']; ?>
								</h2>

								<p class="m-0 mb-4 p-0 text-5 text-black text-justify">
									<?php echo nl2br($conteudo['descricao']); ?>
								</p>
							</div>
						<?php } else { ?>
							<div class="<?php if(isset($conteudo['imagem']) AND !empty($conteudo['imagem'])) { echo 'col-12 col-lg-8'; } else { echo 'col-12 col-lg-12'; } ?> pe-0 pe-lg-5 order-1 order-lg-0">
								<h2 class="m-0 mb-4 p-0 text-6 lh-1 ls-1 font-weight-bold txt-app-custom-color-duo">
									<?php echo $conteudo['titulo']; ?>
								</h2>

								<p class="m-0 mb-4 p-0 text-5 text-black text-justify">
									<?php echo nl2br($conteudo['descricao']); ?>
								</p>
							</div>

							<?php if(isset($conteudo['imagem']) AND !empty($conteudo['imagem'])) { ?>
								<div class="col-lg-4 d-flex justify-content-center align-items-center order-0 order-lg-1 mb-4 mb-lg-0">
									<img class="img-fluid rounded-4" src="<?php echo PUBLICURL . 'uploads/upload_cad_blog/item_' . $blog->id . '/' . $conteudo['imagem']; ?>">
								</div>
							<?php } ?>

						<?php } ?>
					</div>
				<?php } ?>
			</div>
		</section>
	<?php } ?>

	<?php if(isset($blog->video_code) AND !empty($blog->video_code)) { ?>
		<section class="mb-5 mt-5 mt-lg-0">
			<div class="container">
				<div class="row">
					<div class="col">
						<div class="embed-responsive embed-responsive-16by9">
							<iframe class="w-100 rounded-4" height="550" frameborder="0" allowfullscreen="" src="https://www.youtube.com/embed/<?php echo $blog->video_code; ?>?showinfo=0&amp;wmode=opaque"></iframe>
						</div>
					</div>
				</div>
			</div>
		</section>
	<?php } ?>
</div>