<?php
/*
{
	"id" : "artist-profile",
	"category": "container",
	"name": "Artist Profile"
}
*/

if (!is_file(__DIR__ . "/image-card-image.html"))
	exit( pathinfo(__FILE__, PATHINFO_FILENAME) . ": template not found." );

$SiteShell->append('head', '
	<style type="text/css">
		.content { padding: 0 2rem 2rem 2rem; min-height: 70vh; }

		.modern-minimal--cards-portfolio {
			position: relative;
			display: flex;
			justify-content: flex-end;
			align-content: center;
			flex-wrap: wrap;
			padding: 1.5rem 0;
			margin: -0.6rem;
		}
		.modern-minimal--cards-portfolio .card figure {
			border-radius: 0;
		}
	</style>
');

# render content
ob_start();

$image				= get_image(["size" => 400, "image_path" => $result["cover"]["o"] ?? "contents/not-found.png", "crop" => "1:1" ]);
$thumb				= $result["cover"]["t"]["o"] ?? $image["tiny"]["thumb_url"];
?>

		<div class="body content revoscroll" data-revoscroll="anim: fade-left; duration: 0.5; delay: 0.25; ease: ease-in-out;">
			<h1 style="font-size: 2rem; font-size: clamp(1.5rem, 4vw, 2rem); font-weight: 100; margin: 1rem 0;"><?php e($result['title']); ?></h1>

			<div style="display: flex; flex-wrap: wrap; gap: 2rem; gap: clamp(2rem, 8vw, 4rem);">
				<div style="flex: 1 1 360px; padding: 1rem 0;">
					<figure class="sw-ui-figure">
						<svg aria-hidden="true" viewBox="0 0 1 1"></svg>
						<img src="<?php e($image["url"]); ?>" class="lazyload" data-lazyload-placeholder="<?php e($thumb); ?>" data-lazyload-scheme="<?php e($image["scheme"]); ?>" alt="">
					</figure>
				</div>
				<div style="flex: 1 1 360px;">
<?php e($result["content"] . PHP_EOL); ?>
				</div>
			</div>

			<div style="margin: 1rem 0 4rem 0;">
				<h2 style="font-size: 1.4rem; font-size: clamp(1.125rem, 4vw, 1.6rem); font-weight: 100; text-align: right;">Works</h2>
<?php
$posts				= $sw->type("article")->limit(48)->posts();
$posts				= (new ComponentModule())->data($posts, "1:1")->markupFile( __DIR__ . "/image-card-image.html" );

e('<section class="modern-minimal--cards-portfolio">' . PHP_EOL);
e($posts->cards(1500));
e('</section>' . PHP_EOL);
?>
			</div>
		</div>

<?php
$content = ob_get_clean();
$SiteShell->replace('article', PHP_EOL . $content);
$SiteShell->render();

