@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@300;500;700&display=swap');
@import url('reset.css');

:root {
    /* Colors */
    --very-dark-grayish-blue: hsl(217, 19%, 35%);
    --desaturated-dark-blue: hsl(214, 17%, 51%);
    --grayish-blue: hsl(212, 23%, 69%);
    --light-grayish-blue: hsl(210, 46%, 95%);

    /* Typography */
    --font-body-size: 13px;
    --font-family-heading: 'Manrope';
    --font-weight-medium: 300;
    --font-weight-bold: 700;
}

body {
    font-family: 'Manrope';
    color: var(--very-dark-grayish-blue);
    font-weight: var(--font-weight-medium);
    display: grid;
    align-items: center;
    justify-content: center;
    background-color: var(--grayish-blue);
}

.bold {
    font-weight: var(--font-weight-bold);
}

h1 {
    margin-bottom: 1rem;
}

article {
    display: grid;
    grid-template-columns: 0.5fr 0.75fr;
    align-items: center;
    gap: 7rem;
    background-color: var(--light-grayish-blue);
    border-radius: 1rem;
    margin: 2rem;

    & img {
        border-top-left-radius: 1rem;
        border-bottom-left-radius: 1rem;
    }

    & p {
        max-width: 43ch;
    }

    & .right {
        /* width: fit-content; */
        padding-right: 3rem;
    }

    & .article-footer {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-top: 2rem;
    }
}

h1 {
    max-width: 28ch;
}

.avatar {
    border-radius: 100%;
    height: 4rem;
}

.user {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.img-wrapper {
    background-color: var(--grayish-blue);
    padding: 1rem;
    border-radius: 100%;
    position: relative;
}

.img-crop {
    max-width: revert;
    overflow: hidden;
    width: 120%;
    height: 100%;

    & img {
        max-width: revert;
        width: 120%;
        object-fit: cover;
        height: 100%;
    }
}

#share {
    position: relative;
}

.shareOptions {
    visibility: hidden;
    position: absolute;
    display: flex;
    background-color: var(--desaturated-dark-blue);
    gap: 1rem;
    bottom: 150%;
    transform: translateX(-50%);
    padding: 1rem;
    color: white;
    border-radius: 1rem;
    font-size: small;
    font-weight: 300;
    letter-spacing: 1.2ch;
    min-width: 12rem;
}

.shareOptions::after {
    content: 'e';
    rotate: 270deg;
    clip-path: polygon(100% 0%, 50% 50%, 100% 100%);
    position: absolute;
    background-color: var(--desaturated-dark-blue);
    top: 90%;
    left: 50%;
}

#share:hover .shareOptions {
    visibility: visible;
    z-index: 2;
    overflow: visible;
}

@media screen and (max-width: 900px) {
    body {
        height: 100%;
    }

    article {
        margin-top: 3rem;
        grid-template-columns: 1fr;
        border-radius: 1rem;

        & img {
            border-bottom-left-radius: 0;
            border-top-right-radius: 1rem;
        }

        gap: 1rem;

        & .right {
            margin: 1rem;
            margin-left: 3rem;
            margin-right: 3rem;
            margin-bottom: 2rem;
        }
    }

    .img-crop {
        max-width: 100%;
        width: 100%;

        & img {
            display: block;
            max-width: 100%;
            width: 100%;
        }
    }
}