.instagram-container {
    max-width: 93.5rem;
    margin: 0 auto;
    height: 100%;
}

.btn {
    display: inline-block;
    font: inherit;
    background: none;
    border: none;
    color: inherit;
    padding: 0;
    cursor: pointer;
}

    .btn:focus {
        outline: 0.5rem auto #4d90fe;
    }

.visually-hidden {
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
}

/* Profile Section */

.instagram-profile {
    padding: 5rem 0;
}

    .instagram-profile::after {
        content: "";
        display: block;
        clear: both;
    }

.instagram-profile-image {
    float: left;
    width: calc(33.333% - 1rem);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 3rem;
}

    .instagram-profile-image img {
        border-radius: 50%;
    }

.instagram-profile-user-settings,
.instagram-profile-stats,
.instagram-profile-bio {
    float: left;
    width: calc(66.666% - 2rem);
}

.instagram-profile-user-settings {
    margin-top: 1.1rem;
}

.instagram-profile-user-name {
    display: inline-block;
    font-size: 3.2rem;
    font-weight: 300;
}

.instagram-profile-edit-btn {
    font-size: 1.4rem;
    line-height: 1.8;
    border: 0.1rem solid #dbdbdb;
    border-radius: 0.3rem;
    padding: 0 2.4rem;
    margin-left: 2rem;
}

.instagram-profile-settings-btn {
    font-size: 2rem;
    margin-left: 1rem;
}

.instagram-profile-stats {
    margin-top: 2.3rem;
}

    .instagram-profile-stats li {
        display: inline-block;
        font-size: 1.6rem;
        line-height: 1.5;
        margin-right: 4rem;
        cursor: pointer;
    }

        .instagram-profile-stats li:last-of-type {
            margin-right: 0;
        }

.instagram-profile-bio {
    font-size: 1.6rem;
    font-weight: 400;
    line-height: 1.5;
    margin-top: 2.3rem;
}

.instagram-profile-real-name,
.instagram-profile-stat-count,
.instagram-profile-edit-btn {
    font-weight: 600;
}

/* Gallery Section */

.instagram-gallery {
    display: flex;
    flex-wrap: wrap;
    margin: -1rem -1rem;
    padding-bottom: 3rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.instagram-gallery-item {
    position: relative;
    flex: 1 0 22rem;
    margin: 1rem;
    color: #fff;
    cursor: pointer;
}

    .instagram-gallery-item:hover .instagram-gallery-item-info,
    .instagram-gallery-item:focus .instagram-gallery-item-info {
        display: flex;
        justify-content: center;
        align-items: center;
        position: absolute;
        top: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.3);
    }

.instagram-gallery-item-info {
    display: none;
}

    .instagram-gallery-item-info li {
        display: inline-block;
        font-size: 1.7rem;
        font-weight: 600;
    }

.instagram-gallery-item-likes {
    margin-right: 2.2rem;
}

.instagram-gallery-item-type {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2.5rem;
    text-shadow: 0.2rem 0.2rem 0.2rem rgba(0, 0, 0, 0.1);
}

.fa-clone,
.fa-comment {
    transform: rotateY(180deg);
}

.instagram-gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Loader */

.loader {
    width: 5rem;
    height: 5rem;
    border: 0.6rem solid #999;
    border-bottom-color: transparent;
    border-radius: 50%;
    margin: 0 auto;
    animation: loader 500ms linear infinite;
}

/* Media Query */

@@media screen and (max-width: 40rem) {
    .instagram-profile {
        display: flex;
        flex-wrap: wrap;
        padding: 4rem 0;
    }

        .instagram-profile::after {
            display: none;
        }

    .instagram-profile-image,
    .instagram-profile-user-settings,
    .instagram-profile-bio,
    .instagram-profile-stats {
        float: none;
        width: auto;
    }

        .instagram-profile-image img {
            width: 7.7rem;
        }

    .instagram-profile-user-settings {
        flex-basis: calc(100% - 10.7rem);
        display: flex;
        flex-wrap: wrap;
        margin-top: 1rem;
    }

    .instagram-profile-user-name {
        font-size: 2.2rem;
    }

    .instagram-profile-edit-btn {
        order: 1;
        padding: 0;
        text-align: center;
        margin-top: 1rem;
    }

    .instagram-profile-edit-btn {
        margin-left: 0;
    }

    .instagram-profile-bio {
        font-size: 1.4rem;
        margin-top: 1.5rem;
    }

    .instagram-profile-edit-btn,
    .instagram-profile-bio,
    .instagram-profile-stats {
        flex-basis: 100%;
    }

    .instagram-profile-stats {
        order: 1;
        margin-top: 1.5rem;
    }

        .instagram-profile-stats ul {
            display: flex;
            text-align: center;
            padding: 1.2rem 0;
            border-top: 0.1rem solid #dadada;
            border-bottom: 0.1rem solid #dadada;
        }

        .instagram-profile-stats li {
            font-size: 1.4rem;
            flex: 1;
            margin: 0;
        }

    .instagram-profile-stat-count {
        display: block;
    }
}
