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

$SiteShell->append('head', '
	<style type="text/css">
		.content { min-height: 60vh; min-height: calc(100vh - var(--header-height)); }
	</style>' . PHP_EOL);

# 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"];

$posts				= $sw->extend("posts")->type("article")->section($result["id"])->limit(48)->orderby(["modified_time" => "ASC", "created_time" => "ASC"])->posts();
$posts				= (new ComponentModule())->data($posts, "1:1")->markupHTML('
<div class="image-card" style="padding:0.6rem;" data-viewbox="<!--image_large-->">
	<a href="<!--url-->">
		<figure class="sw-ui-figure">
			<div class="sw-ui-media-wrapper">
				<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 <!--width--> <!--height-->"></svg>
				<img class="lazyload" src="<!--image_url-->" data-lazyload-placeholder="<!--thumb-->" data-lazyload-scheme="<!--image_scheme-->" alt="<!--image_alt-->">
			</div>
		</figure>
	</a>
</div>' . PHP_EOL);
?>
<div class="body padding 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">
				<div class="sw-ui-media-wrapper">
					<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="">
				</div>
			</figure>
		</div>
		<div style="flex: 1 1 360px;">
<?php e($result["content"] . PHP_EOL); ?>
		</div>
	</div>

	<div style="margin: 1rem auto 4rem auto;">
		<h2 style="font-size: 1.4rem; font-size: clamp(1.125rem, 4vw, 1.6rem); font-weight: 100; text-align: right; margin: 0 0 1rem 0;">Works</h2>
		<section class="sw-ui-gallery-wrapper" style="margin: 0 -0.6rem; width: auto;">
			<div class="flexbox-columns min-3-max-8 align-right">
<?php e($posts->cards(1500)); ?>
			</div>
		</section>
	</div>
</div>
<?php
$content = ob_get_clean();

$SiteShell->replace('article', PHP_EOL . $content);

