<script>
export let service = 'Lorem Ipsum';
export let serviceImage = '/default_image.jpg';
export let serviceImageAlt = 'Image';
export let imageOnRight = false;
</script>

<style>
.service{
    width: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.service-content{
    width: 100%;
    display: flex;
    flex-direction: column-reverse;
    gap: 2em;
}

.image-right{
    flex-direction: column-reverse;
}

.image{
    width: 100%;
}

.image>img{
    width: 100%;
    border-radius: 2em;
}

.service-text{
    width: 100%;
    font-size: 1.3em;
    color: #bcc0c2;
}

.service-name{
    text-transform: uppercase;
}

@media (min-width: 900px){

    .service-content{
        flex-direction: row;
    }

    .image-right{
        flex-direction: row-reverse;
    }
}

h2{
    font-size: 2em;
}
</style>

<div class="service">
    <div class="service-name">
        <h2>
            {service}
        </h2>
    </div>
    <div class="service-content" class:image-right={imageOnRight}>
        <div class="image">
            <img src={serviceImage} alt={serviceImageAlt}>
        </div>
        <div class="service-text">
            <slot />
        </div>
    </div>
</div>