<script lang="ts">
	import type { Profile } from '$lib/types/data';

	let { name, title, anchorId, text, imageUrl }: Profile = $props();
</script>

<section id={anchorId}>
	<div>
		<div class="image-wrapper">
			<img src={imageUrl} alt="">
		</div>
		<h1>{name}</h1>
		<p class="title">{title}</p>
		<p class="text">{text}</p>
	</div>
</section>

<style>
    section {
        padding: 5rem 1rem;
        text-align: center;
        background-image: linear-gradient(
                var(--color-body-background) 0%,
                var(--color-profile-background-secondary) 100%
        );

        @media (min-width: 768px) {
            padding: 5rem;
        }
    }

    div {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: center;
        gap: 1rem;

        margin-inline: auto;
        max-width: 40rem;
    }

    .image-wrapper {
        display: flex;
        width: 12rem;
        aspect-ratio: 1 / 1;
        padding: 0.25rem;
        border-radius: 100%;
        background-image: linear-gradient(
                to right,
                var(--color-profile-image-background-primary) 0%,
                var(--color-profile-image-background-secondary) 100%
        );
    }

    img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 100%;
    }

    h1 {
        margin: unset;
        color: transparent;
        font-size: 2.25rem;
        background-image: var(--color-headline-background-image);
        background-clip: text;

        @media (min-width: 768px) {
            font-size: 3.75rem;
        }
    }

    .title {

        margin: unset;
        margin-bottom: 1rem;
        color: var(--color-profile-title-text);
        font-size: 1.25rem;

        @media (min-width: 768px) {
            font-size: 1.5rem;
        }
    }

    .text {
        margin: unset;
        color: var(--color-profile-text);
        font-size: 1.125rem;
        line-height: 1.625;
				text-wrap: pretty;
				text-wrap: balance;

        @media (min-width: 768px) {
            font-size: 1.25rem;
        }
    }
</style>