:root {
    --white: hsl(0, 0%, 100%);
    --lightGrayishBlue: hsl(210, 46%, 95%);
    --grayishBlue: hsl(212, 23%, 69%);
    --desaturatedDarkBlue: hsl(214, 17%, 51%);
    --veryDarkGrayishBlue: hsl(217, 19%, 35%);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--lightGrayishBlue);
    display: flex;
    font-family: 'Manrope', sans-serif;
    font-size: 0.813rem;
    height: 100vh;
} 

/* Card content */
#card-container {
    background-color: var(--white);
    border-radius: 0.5rem;
    box-shadow: 0.5rem 0.5rem 3rem rgba(72, 85, 106, 0.1);
    margin: auto;
    width: 22rem;
}

#card-image-container {
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
    height: 14.5rem;
    overflow: hidden;
}

#card-image {
    display: block;
    height: auto;
    object-fit: cover;
    width: 100%;
}

#content-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#card-text {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 2rem 2rem 0rem 2rem;
}

h1 {
    color: var(--veryDarkGrayishBlue);
    font-weight: 700;
    font-size: 1.1rem;
}

#card-text p {
    color:  var(--desaturatedDarkBlue);
    font-weight: 500;
    line-height: 1.3rem;
    padding-right: 2rem;
}

/* Footer content */
.card-footer {
    background-color: var(--white);
    border-bottom-left-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
    display: flex;
    flex-direction: row;
    height: 4.5rem;
    justify-content: space-between;
    padding: 2rem 2rem;
}

.card-footer.share-active { background-color: var(--veryDarkGrayishBlue); }

.profile {
    align-items: center;
    display: flex;
    flex-direction: row;
    gap: 1rem;
}

#avatar-image {
    border-radius: 100%;
    display: block;
    width: 2.5rem;
}

#name { color: var(--veryDarkGrayishBlue); margin-bottom: 0.2rem; }
#date { color: var(--grayishBlue); font-weight: 500; }

/* Share button */
.share-button {
    align-self: center;
    background-color: var(--lightGrayishBlue);
    border: none;
    border-radius: 100%;
    cursor: pointer;
    height: 2rem;
    width: 2rem;
}

.share-button-active { background-color: var(--desaturatedDarkBlue); }
.share-icon { fill: var(--desaturatedDarkBlue); }
.share-icon-active { fill: var(--white); }

/* Share container */
.share-popover {
    align-items: center;
    display: flex;
    flex-direction: row;
    gap: 1rem;
    justify-content: center;
}

.share-popover span { color: var(--grayishBlue); letter-spacing: 0.3rem; }

.hidden { display: none !important; } /* !important overrides a style */

/* Desktop version */
@media screen and (min-width: 48rem) {
    #card-container {
        box-shadow: 0.5rem 2rem 1.875rem rgba(72, 85, 106, 0.1);
        display: flex;
        flex-direction: row;
        position: relative;
        width: 42rem;
    }

    #card-image-container {
        border-top-right-radius: 0;
        border-bottom-left-radius: 0.5rem;
        height: auto;
        overflow: hidden;
        width: 50%;
    }

    #card-image {
        height: 100%;
        object-fit: cover;
        object-position: left;
        width: 100%;
    }

    #content-container {
        gap: 0;
        padding-bottom: 0.875rem;
        width: 80%;
    }

    h1 { padding-right: 1.5rem; }
    #card-text p { padding-right: 0; }


    .share-popover {
        background-color: var(--veryDarkGrayishBlue);
        border-radius: 0.5rem;
        box-shadow: 0.5rem 0.5rem 1.5rem rgba(72, 85, 106, 0.15);
        display: flex;
        gap: 1rem;
        padding: 0.875rem 2.15rem;
        position: absolute;
        transform: translate(13.25rem, -5.5rem);
    }
    
    /* Arrow */
    .share-popover::after {
        border-color: var(--veryDarkGrayishBlue) transparent transparent transparent;
        border-width: 0.875rem;
        border-style: solid;
        content: "";
        position: absolute;
        top: 3.23rem;
    }

    .share-popover.show { display: flex; }
    .profile.hidden { display: flex !important; }
    .card-footer.share-active { background-color: transparent; }
}