html, body {
    margin: 0;
    padding: 0;
    height: 100%;
}

html {
    background-color: hsl(210, 46%, 95%);
    overflow: hidden;
    font-family: 'Manrope', sans-serif;
    color: hsl(217, 19%, 35%);
}

h1, h2, h3, h4, h5, h6 {
    margin: 0;
}


/**
 * https://stackoverflow.com/questions/826782/how-to-disable-text-selection-highlighting
 */
.noselect {
    -webkit-touch-callout: none; /* iOS Safari */
    -webkit-user-select: none; /* Safari */
    -moz-user-select: none; /* Old versions of Firefox */
    -ms-user-select: none; /* Internet Explorer/Edge */
    user-select: none; /* Non-prefixed version, currently supported by Chrome, Edge, Opera and Firefox */
}

.content {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/**
 * Help to set divs inline, with flexbox container and one child with fixed widtch:
 * https://stackoverflow.com/questions/29885284/how-to-set-a-fixed-width-column-with-css-flexbox
 */
.card {
    background: #ffffff;
    border-radius: 8px;
    width: 900px;
    display: flex;
    flex-flow: row;
    align-items: stretch;
}

.card-title {
    font-size: 1.5rem;
    font-weight: 700;
}

.left {
    flex: 0 0 325px;
}

.left img {
    width: 100%;
    height: 100%;
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.right {
    flex: 1;
}

.right .container {
    padding: 2rem 4rem 2rem 3rem;
    position: relative;
}

.right .container p {
    font-size: 13px;
}

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

.author-container {
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.author-container img {
    border-radius: 50%;
    width: 50px;
    height: 50px;
}

.author {
    margin-left: 1rem;
}

.author span{
    display: block;
    font-size: 13px;
    color: hsl(212, 23%, 69%);
}

.share-container {
    position: relative;
}

.share {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background-color: hsl(210, 46%, 95%);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.mobile-popover {
    display: none;
}

/**
 * Center an absolute div
 * https://stackoverflow.com/questions/8508275/how-to-center-a-position-absolute-element
 */
.popover {
    position: absolute;
    background-color: hsl(217, 19%, 35%);
    border-radius: 10px;
    padding: 1rem 2.5rem;
    display: none;
    justify-content: flex-start;
    align-items: center;
    top: -5rem;
    left: 50%;
    transform: translate(-50%, 0);
}

.popover.active {
    display: flex;
}

.popover:after
{
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translate(-50%, 0);
    border-style: solid;
    border-width: 10px 10px 0;
    border-color: hsl(217, 19%, 35%) transparent;
    display: block;
    width: 0;
    z-index: 1;
}

.popover span,
.mobile-popover span {
    letter-spacing: 3px;
    text-transform: uppercase;
    color: hsl(214, 17%, 51%);
    margin-right: 1rem;
}

.icons-container {
    display: flex;
    align-items: center;
}

.icons-container a,
.mobile-popover a {
    text-decoration: none;
    border: none;
    height: 20px;
    width: 20px;
}

.icons-container a:hover,
.mobile-popover a:hover {
    text-decoration: none;
}

.icons-container a:not(:last-child),
.mobile-popover a:not(:last-child) {
    margin-right: 1rem;
}

.icons-container a img,
.mobile-popover a img
{
    width: 20px;
    height: 20px;
}

.attribution {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translate(-50%, 0);
}

/* Medium devices (landscape tablets, 840px and up) */
@media only screen and (max-width: 840px) {
    .card {
        flex-flow: column;
        padding: 1rem;
        margin: 0 .5rem;
    }

    .left img {
        border-top-left-radius: 0;
        border-bottom-left-radius: 0;
    }

    .popover {
        transform: translate(-90%, 0);
    }

    .popover:after
    {
        left: 90%;
    }
}

/* Small devices (portrait tablets and large phones, 550px and up) */
@media only screen and (max-width: 550px) {
    .card {
        padding: 0;
        margin: 0 2rem;
    }

    .card-title {
        font-size: 16px;
    }

    .left {
        flex: 0;
    }

    .left img {
        border-top-left-radius: 8px;
        border-top-right-radius: 8px;
    }

    .right .container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
        padding-bottom: 1rem;
    }

    .right .container p {
        margin-bottom: 1.5rem;
    }

    .attribution {
        display: none;
    }

    .mobile-popover {
        position: absolute;
        left: 0;
        bottom: 0;
        right: 0;
        height: 80px;
        padding: 0 1.5rem;
        background-color: hsl(217, 19%, 35%);
        align-items: center;
        justify-content: space-between;
        border-bottom-left-radius: 8px;
        border-bottom-right-radius: 8px;
    }

    .mobile-popover.active {
        display: flex;
    }

    .mobile-popover.active .share {
        background-color: hsl(214, 17%, 51%);
        color: hsl(210, 46%, 95%);
    }

    .mobile-popover.active .share img {
        filter: brightness(0) invert(1);
    }
}
