.timberin-instagram-popup-feed {
    box-sizing: border-box;
    width: 100%;
    color: #2f2118;
    font-family: Arial, Helvetica, sans-serif;
}

.timberin-instagram-popup-feed *,
.timberin-instagram-popup-feed *::before,
.timberin-instagram-popup-feed *::after {
    box-sizing: border-box;
}

.timberin-instagram-popup-feed .ti-ig-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    margin: 0;
    padding: 0;
}

.timberin-instagram-popup-feed .ti-ig-tile {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    min-width: 0;
    border: 1px solid rgba(111, 67, 39, 0.16);
    border-radius: 9px;
    background: #f4ede6;
    color: inherit;
    text-decoration: none;
    isolation: isolate;
}

.timberin-instagram-popup-feed .ti-ig-tile::before {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(180deg, transparent 60%, rgba(35, 21, 13, 0.22));
    content: "";
    opacity: 0;
    transition: opacity 180ms ease;
}

.timberin-instagram-popup-feed .ti-ig-tile:hover::before,
.timberin-instagram-popup-feed .ti-ig-tile:focus-visible::before {
    opacity: 1;
}

.timberin-instagram-popup-feed .ti-ig-tile:focus-visible {
    outline: 3px solid #a95b2b;
    outline-offset: 2px;
}

.timberin-instagram-popup-feed .ti-ig-tile img {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    object-fit: cover;
    transform: scale(1.001);
    transition: transform 200ms ease;
}

.timberin-instagram-popup-feed .ti-ig-tile:hover img,
.timberin-instagram-popup-feed .ti-ig-tile:focus-visible img {
    transform: scale(1.035);
}

.timberin-instagram-popup-feed .ti-ig-media-icon {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    display: grid;
    width: 26px;
    height: 26px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 999px;
    background: rgba(47, 33, 24, 0.72);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.timberin-instagram-popup-feed .ti-ig-media-icon--play::after {
    display: block;
    width: 0;
    height: 0;
    margin-left: 2px;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 8px solid #fff;
    content: "";
}

.timberin-instagram-popup-feed .ti-ig-media-icon--carousel::before,
.timberin-instagram-popup-feed .ti-ig-media-icon--carousel::after {
    position: absolute;
    width: 10px;
    height: 10px;
    border: 1.5px solid #fff;
    border-radius: 2px;
    content: "";
}

.timberin-instagram-popup-feed .ti-ig-media-icon--carousel::before {
    transform: translate(-2px, 2px);
}

.timberin-instagram-popup-feed .ti-ig-media-icon--carousel::after {
    transform: translate(2px, -2px);
}

.timberin-instagram-popup-feed .ti-ig-fallback {
    display: flex;
    min-height: 240px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 13px;
    padding: 30px 24px;
    border: 1px solid #ead9ca;
    border-radius: 12px;
    background: linear-gradient(145deg, #fff 0%, #fffaf3 100%);
    text-align: center;
}

.timberin-instagram-popup-feed .ti-ig-fallback p {
    max-width: 310px;
    margin: 0;
    color: #4d3b31;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.45;
}

.timberin-instagram-popup-feed .ti-ig-fallback a {
    color: #7d421f;
    font-size: 14px;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.timberin-instagram-popup-feed .ti-ig-fallback a:focus-visible {
    outline: 3px solid #a95b2b;
    outline-offset: 4px;
}

.timberin-instagram-popup-feed .ti-ig-camera {
    position: relative;
    display: block;
    width: 42px;
    height: 42px;
    border: 3px solid #8a4b22;
    border-radius: 12px;
}

.timberin-instagram-popup-feed .ti-ig-camera::before {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #8a4b22;
    content: "";
}

.timberin-instagram-popup-feed .ti-ig-camera span {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    border: 3px solid #8a4b22;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.timberin-instagram-popup-feed .ti-ig-sr-only {
    position: absolute !important;
    overflow: hidden !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    border: 0 !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
}

.timberin-social-popup__feed:has(.timberin-instagram-popup-feed) {
    overflow: visible !important;
    height: auto !important;
}

@media (max-width: 540px) {
    .timberin-instagram-popup-feed .ti-ig-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    .timberin-instagram-popup-feed .ti-ig-tile {
        border-radius: 7px;
    }

    .timberin-instagram-popup-feed .ti-ig-fallback {
        min-height: 210px;
        padding: 24px 18px;
    }
}

/*
 * The retained TimberIN popup shell has a legacy <=380px rule that fixes the
 * former iframe frame to 225px and hides overflow. The governed grid is taller
 * (three two-column rows), so release that obsolete iframe-only constraint and
 * let Popup Builder's existing outer content scroller own short viewports.
 */
@media (max-width: 380px) {
    html body #sgpb-popup-dialog-main-div-wrapper .timberin-social-popup__feed:has(.timberin-instagram-popup-feed) {
        height: auto !important;
        min-height: 0 !important;
        overflow: visible !important;
    }

    html body #sgpb-popup-dialog-main-div-wrapper .timberin-social-popup__feed .timberin-instagram-popup-feed {
        height: auto !important;
        min-height: 0 !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .timberin-instagram-popup-feed .ti-ig-tile,
    .timberin-instagram-popup-feed .ti-ig-tile::before,
    .timberin-instagram-popup-feed .ti-ig-tile img {
        transition: none;
    }
}
