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

/* ===========================
========== PRESETS ===========
=========================== */

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

/* ===========================
========== TYPOGRAPHY ===========
=========================== */

h2{
    font-family: 'Manrope';
    font-size: 1.2rem;
    font-weight: 700;
}

h3{
    font-family: 'Manrope';
    font-size: 0.8rem;
    font-weight: 500;
}

span{
    font-family: 'Manrope';
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.2rem;
}

/* ===========================
========== UNIVERSAL ===========
=========================== */

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

html,
body {
    height:100%;
    width: 100%;
}

body{
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ===========================
========== LAYOUT ===========
=========================== */

main{
    height: 40%;
    width: 55%;
    overflow: visible;
}

.container{
    height: 100%;
    width: 100%;
    display: flex;
    flex: auto;
    border-radius: 1em;
    overflow: visible;
}

.card-img{
    height: 100%;
    width: 80%;
    overflow: hidden;
    border-bottom-left-radius: 1em;
    border-top-left-radius: 1em;
}

.card-img img{
    height: 100%;
    width: 100%;
    object-fit: cover;
}

.content{
    margin: 2em;
    overflow: visible;
}

.content-details{
    margin-bottom: 1em;
}
.content-details h2, h3{
    margin-bottom: 0.75em;
}

.author{
    display: flex;
    align-items: center;
    position: relative;
    overflow: visible;
}

.author-icon{
    border-radius: 50%;
    width: 10%;
    height: 10%;
    object-fit: cover;
}
.author-info{
    margin-left: 1.5em;
    height: 80%;
}
.author-name{
    font-weight: 700;
    margin: 0;
    padding: 0;
}
.date-posted{
    margin: 0;
    padding: 0;
}

.share-btn{
    margin-left: auto;
    margin-right: 1em;
    height: 2.5em;
    width: 2.5em;
    border-radius: 50%;
    border: none;
    cursor: pointer;
}
.share-btn img{
    object-fit: cover;
}


.share-popup{
    display: none;
    position: absolute;
    bottom: 100%;
    right: 0;
    z-index: 1;
    background-color: var(--very-dark-grayish-blue);
    color: white;
    padding: 1em 1.5em 1em 1.5em;
    transform: translate(40%, -20%); 
    border-radius: 1em;
}
.share-popup::after{
    content: "";
    border-width: 8px ;
    border-style: solid;
    border-color: var(--very-dark-grayish-blue) transparent transparent transparent;
    position: absolute;
    top: 100%;
    right: 50%;
}
.share-popup img{
    height: 1em;
    width: 1em;
    cursor: pointer;
    margin-left: 1em;
}
.share-popup span{
    text-align: center;
}

/* ===========================
========== COLORS ===========
=========================== */

body{
    background-color: var(--light-grayish-blue);
}
.container{
    background-color: white;
}

.content-details h2{
    color: var(--very-dark-grayish-blue);
}
.content-details h3{
    color: var(--desat-dark-blue);
}

.author-name{
    color: var(--very-dark-grayish-blue);
}
.date-posted{
    color: var(--grayish-blue);
}

.share-popup span{
    color: var(--light-grayish-blue);
}

/* ===========================
========== EFFECTS ===========
=========================== */

.share-btn:hover{
    transition-duration: 0.2s;
    transform: scale(1.2);
}

/* ===========================
========== MEDIA-QUERIES ===========
=========================== */

@media screen and (min-width:601px) and (max-width: 900px){
    main{
        width: 80%;
    }
}

@media screen and (max-width: 600px){
    main{
        height: 90%;
        width: 90%;
    }
    .container{
        flex-direction: column;
    }
    .card-img{
        height: 80%;
        width: 100%;
        overflow: hidden;
        border-bottom-left-radius: 0em;
        border-top-left-radius: 1em;
        border-top-right-radius: 1em;
    }
}