/* Instagram's current profile grid: three columns, portrait 3:4 tiles, a 2px seam,
   no radius, and no outer gutter — the sheet runs edge to edge like the reference.
   Only grids carrying --portrait are touched, so Explore, Search and the Creators
   listing keep their existing rhythm. */

.mtv-mediagrid--portrait {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2px;
    /* .mtv-main keeps 14px of gutter at 640px and below; the grid gives that back. */
    margin: 0 -14px 18px;
    width: auto;
}

@media (min-width: 641px) {
    .mtv-mediagrid--portrait {
        /* Mirrors app.css's .mtv-main gutter so the sheet stays flush with the column. */
        margin-left: calc(-1 * clamp(14px, 2.5vw, 36px));
        margin-right: calc(-1 * clamp(14px, 2.5vw, 36px));
    }
}

.mtv-mediagrid--portrait .mtv-mediatile,
.cp__grid.mtv-mediagrid--portrait .mtv-mediatile {
    aspect-ratio: 3 / 4;
    border-radius: 0;
    overflow: hidden;
}

.mtv-mediagrid--portrait .mtv-mediatile img,
.mtv-mediagrid--portrait .mtv-mediatile video,
.cp__grid.mtv-mediagrid--portrait .mtv-mediatile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* A press state on a phone, since the tile now navigates instead of opening a gallery. */
@media (hover: none) {
    .mtv-mediagrid--portrait .mtv-mediatile {
        -webkit-tap-highlight-color: transparent;
        transition: opacity .12s ease;
    }
    .mtv-mediagrid--portrait .mtv-mediatile:active { opacity: .82; }
}

/* The cue goes where the reference puts it: the top-right corner, small and white,
   legible on any picture without a plate behind it. */
.mtv-mediatile__cue {
    position: absolute;
    top: 7px;
    right: 7px;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 3px;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .6);
    pointer-events: none;
}

.mtv-mediatile__cue svg {
    width: 15px;
    height: 15px;
    fill: #fff;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .55));
}
