/* font style */
*{
    font-family: 'Manrope', serif;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-size: 13px;
}
html{
    height: 100%;
    overflow-y: scroll;
    -webkit-overflow-scrolling: touch;
}
body {
    
    width: 100%;
    height: 100%;
    margin: 0px auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: hsl(210, 46%, 95%);
}
article {
    display: flex;
    flex-direction: row;
    width: 765px;
    background-color: #ffffff;
    border-radius: 8px;
    figure {
        
        img{
            object-fit: fill;
            display: block;
            border-top-left-radius: 8px;
            border-bottom-left-radius: 8px;
        }
    }
    img.rounded {
        border-radius: 50%;
    }
    .share-btn {
        cursor: pointer;
        border-image: none;
        border-style: none;
        background-color: transparent;
        img {
        height: 40px;
        width: 40px;
        object-fit: none;
        border-radius: 50%;
        }
    }
    #author {
        display: flex;
        position: relative;
        flex-direction: row;
        align-items: center;
        justify-items: center;
        margin-top: 1rem;
        width: 100%;
        /* common attributes for img inside id #author*/
        
        #article-img{
            width: 280px;
            height: 295px;
        }
        #author-img{
            height: 55px;
            width: 55px;
        }
        #author-details{
            flex: 1 1 auto;
            padding: 0 1.5rem;
        }
        #share-icon {
            background-color: hsl(210, 46%, 95%);
        }
        #share-icon-inverted {
            background-color: hsl(214, 17%, 51%);
        }
        #share-btn-desktop img:last-child {
            display: none;
        }
        #share-btn-desktop:hover img:last-child {
            display: block;
        }
        #share-btn-desktop:hover img:first-child {
            display: none;
        }
        #share-btn-mobile{
            display: none;
        }
        #tooltip{
            display: block;
        }
        #tooltip.container{
            box-sizing: border-box;
            display: flex;
            justify-content: space-around;
            align-items: center;
            position: absolute;
            top: -54px;
            right: -75px;
            background-color: hsl(217, 19%, 35%);
            padding: 1rem;
            width: 200px;
            border-radius: 12px;
        }
        #tooltip::after {
            content: "";
            position: absolute;
            right: 82px;
            top: 40px;
            width: 0;
            height: 0;
            border-left: 15px solid transparent;
            border-right: 15px solid transparent;
            border-top: 15px solid hsl(217, 19%, 35%);
        }
        #tooltip.hidden{
            display: none;
        }
        #tooltip p {
            color: hsl(214, 17%, 51%);
            font-size: 0.813rem;
        }
        #tooltip img {
            height: 50%;
            width: 10%;
        }
    }
    #tooltip-mobile{
        display: none;
    }
    #tooltip-mobile.hidden{
        display:none;
    }
    #article-details{
        padding: 2rem 2.5em;
        display: grid;
        gap: .5rem;
    }
    h1 {
        font-size: 2em;
        color: hsl(217, 19%, 35%);
    }
    h2 {
        font-size: 1.17rem;
        color: hsl(217, 19%, 35%);
        font-weight: bold;
    }
    p {
        color: hsl(214, 17%, 51%);
    }
    
}


.attribution {
    font-size: 11px;
    text-align: center;
  }

.attribution a {
    color: hsl(228, 45%, 44%);
}

/****/
/* media queries*/

/* for small screens and mobile devices */
@media screen and (max-width:640px) and (min-width:320px){
    article {
        flex-direction: column;
        width: 280px;
        figure img {
            border-bottom-left-radius: 0;
            border-top-right-radius: 8px;
        }
        #article-details{
            gap: .75rem;
            padding-bottom: .75rem;
        }
        #author-mobile{
            display: block;
        }
        #article-img{
            width: 280px;
            height: 200px;
        }
        #author.hidden{
            display: none;
        }
        #author{
            #author-img{
                width: 35px;
                height: 35px;
            }
            #share-btn-desktop{
                display: none;
            }
            #share-btn-mobile{
                display: block;
                img {
                    width: 25px;
                    height: 25px;
                }
                border-radius: 50%;
            }
            #tooltip{
                display: none;
            }
            #share-btn-mobile:hover{
                background-color: hsl(214, 17%, 51%);
            }
            #share-btn-mobile img:last-child {
                display: none;
            }
            #share-btn-mobile:hover img:last-child {
                display: block;
            }
            #share-btn-mobile:hover img:first-child {
                display: none;
            }
        }
        
        #tooltip-mobile{
            display: flex;
            height: 55px;
            background-color: hsl(217, 19%, 35%);
            border-bottom-right-radius: 8px;
            border-bottom-left-radius: 8px;
            #tooltip-mobile-container{
                display: inline-flex;
                width: calc(100% * 2/3);
                gap: 1rem;
                align-items: center;
                justify-content: center;
            }
            #share-btn-active{
                width: calc(100%/3);
                img {
                    width: 35%;
                    height: 60%;
                    background-color: hsl(214, 17%, 51%);
                }
                border-radius: 50%;
            }
            p {
                color: hsl(214, 17%, 51%);
            }
            #tooltip-mobile-container img {
                height: 40%;
                width: 12%;
            }
        }
        h1{
            font-size: 1rem;
        }
        h2{
            font-size: .87rem;
        }
        p {
            font-size: .85rem;
        }
    }
}

/* for medium screens */
/* challenge didnt provide screen for medium screens so this will look similar but with some adjustments to fit in the screen  */
@media screen and (max-width:768px) and (min-width:641px){
    article {
        width: 620px;
        #article-img{
            width: 240px;
            height: 240px;
        }
        #author{
            #author-img{
                width: 35px;
                height: 35px;
            }
            #share-btn img{
                width: 25px;
                height: 25px;
            }
            #tooltip::after {
                content: "";
                position: absolute;
                right: 75px;
                top: 35px;
            }
        }
        h1{
            font-size: 1.3rem;
        }
        h2{
            font-size: 1rem;
        }
        p {
            font-size: .9rem;
        }
    }
}


/* colors */
.darkGrayishBlue {
    color: hsl(217, 19%, 35%);
}
.saturatedDarkBlue {
    color: hsl(214, 17%, 51%);
}
.grayishBlue {
    color: hsl(212, 23%, 69%);
}
.lightBlue {
    color: hsl(210, 46%, 95%);
}