/* TuttoMobili - Feed Instagram v3 */

.tm-instagram {
    padding: 56px 20px 64px;
    background: #fff;
}

.tm-instagram__wrap {
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
}

.tm-instagram__profile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 0 4px 28px;
}

.tm-instagram__profile-main {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.tm-instagram__logo {
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    border: 1px solid #dbdbdb;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 25px;
    background: #fff;
}

.tm-instagram__profile-text {
    min-width: 0;
}

.tm-instagram__profile-text h2 {
    margin: 0 0 4px;
    font-size: 22px;
    line-height: 1.2;
    font-weight: 500;
    color: #262626;
    overflow-wrap: anywhere;
}

.tm-instagram__profile-text span {
    display: block;
    font-size: 14px;
    color: #737373;
}

.tm-instagram__follow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 90px;
    padding: 8px 18px;
    border-radius: 8px;
    background: #0095f6;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
}

.tm-instagram__follow:hover {
    background: #1877f2;
    color: #fff;
}

.tm-instagram__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    border-top: 1px solid #dbdbdb;
    padding-top: 4px;
}

.tm-instagram__item {
    position: relative;
    display: block;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #efefef;
}

.tm-instagram__item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .22s ease;
}

.tm-instagram__media-icon {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: rgba(0,0,0,.45);
    font-size: 12px;
    z-index: 2;
}

.tm-instagram__hover {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.28);
    color: #fff;
    font-size: 31px;
    opacity: 0;
    transition: opacity .18s ease;
}

.tm-instagram__item:hover .tm-instagram__hover,
.tm-instagram__item:focus-visible .tm-instagram__hover {
    opacity: 1;
}

.tm-instagram__item:hover img {
    transform: scale(1.015);
}

.tm-instagram__item:focus-visible {
    outline: 2px solid #262626;
    outline-offset: 2px;
}

.tm-instagram__footer {
    text-align: center;
    padding-top: 24px;
}

.tm-instagram__footer a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #262626;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.tm-instagram__footer a:hover {
    text-decoration: underline;
}

@media (max-width: 767.98px) {
    .tm-instagram {
        padding: 36px 0 44px;
    }

    .tm-instagram__profile {
        padding: 0 14px 22px;
    }

    .tm-instagram__logo {
        flex-basis: 44px;
        width: 44px;
        height: 44px;
        font-size: 21px;
    }

    .tm-instagram__profile-text h2 {
        font-size: 17px;
    }

    .tm-instagram__profile-text span {
        font-size: 12px;
    }

    .tm-instagram__follow {
        min-width: 72px;
        padding: 8px 12px;
    }

    .tm-instagram__grid {
        gap: 2px;
        padding-top: 2px;
    }

    .tm-instagram__media-icon {
        top: 7px;
        right: 7px;
        width: 24px;
        height: 24px;
        font-size: 10px;
    }

    .tm-instagram__hover {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tm-instagram__item img,
    .tm-instagram__hover {
        transition: none;
    }
}
