.post-media-gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .85rem;
    width: 100%;
    min-width: 0;
}

.post-media-gallery[data-count="1"] {
    grid-template-columns: minmax(0, 1fr);
}

.post-media-gallery[hidden] {
    display: none;
}

.post-media-item {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
}

.post-media-gallery .post-media-asset {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    max-height: 30rem;
    object-fit: contain;
    border-radius: .65rem;
    background: #eef2f7;
}

.post-media-item.is-removed .post-media-asset {
    opacity: .35;
}

[data-post-media-preview] {
    width: 100%;
    padding: 1rem;
}

@media (max-width: 575.98px) {
    .post-media-gallery {
        grid-template-columns: minmax(0, 1fr);
    }
}

.post-media-stack {
    width: 100%;
    min-width: 0;
}

.post-media-stack-trigger {
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #142b55;
    text-align: left;
    cursor: pointer;
    font: inherit;
}

.post-media-stack-trigger:focus-visible {
    outline: 3px solid #2769cf;
    outline-offset: -4px;
}

.post-media-stack-trigger:disabled { cursor: default; }
.post-media-stack [hidden] { display: none; }

.post-media-stack-deck {
    position: relative;
    display: block;
    isolation: isolate;
    touch-action: pan-y pinch-zoom;
}

.post-media-stack:not([data-count="1"]) .post-media-stack-deck {
    margin: 1rem 1rem 0 0;
}

.post-media-stack-layer {
    display: block;
    overflow: hidden;
    border: 2px solid #fff;
    border-radius: .85rem;
    background: #e5edf6;
    box-shadow: 0 3px 12px rgb(18 42 80 / 12%);
}

.post-media-stack-front {
    position: relative;
    z-index: 2;
    aspect-ratio: 16 / 9;
}

.post-media-stack-back {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.post-media-stack-back-1 {
    z-index: 1;
    transform: translate(6px, -5px) rotate(1deg);
}

.post-media-stack-back-2 {
    z-index: 0;
    transform: translate(11px, -10px) rotate(1.5deg);
}

.post-media-stack .post-media-stack-asset {
    display: block;
    width: 100%;
    height: 100%;
    max-height: none;
    border-radius: 0;
    object-fit: contain;
    background: #edf2f8;
}

.post-media-stack-back .post-media-stack-asset {
    object-fit: cover;
}

.post-media-stack-count {
    position: absolute;
    right: .7rem;
    bottom: .7rem;
    z-index: 3;
    padding: .3rem .65rem;
    border: 1px solid rgb(255 255 255 / 35%);
    border-radius: 2rem;
    color: #fff;
    background: rgb(10 25 49 / 85%);
    font-size: .8rem;
    font-weight: 600;
}

.post-media-stack-video-placeholder {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    background: #334155;
    color: #fff;
}

.post-media-stack-caption {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .5rem;
    padding: .65rem .15rem .1rem;
    font-size: .85rem;
    font-weight: 600;
}

.post-media-inline-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 4;
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border: 1px solid rgb(255 255 255 / 65%);
    border-radius: 50%;
    color: #fff;
    background: rgb(15 23 42 / 85%);
    font: inherit;
    font-size: 1.65rem;
    line-height: 1;
    cursor: pointer;
}

.post-media-inline-arrow:hover {
    background: #334155;
}

.post-media-inline-arrow:focus-visible,
.post-media-inline-thumb:focus-visible {
    outline: 3px solid #2769cf;
    outline-offset: 3px;
}

.post-media-inline-previous { left: .6rem; }
.post-media-inline-next { right: .6rem; }
.post-media-inline-hint { color: #64748b; font-weight: 400; }

.post-media-inline-thumbnails {
    position: relative;
    display: flex;
    gap: .6rem;
    overflow-x: auto;
    overscroll-behavior: contain;
    padding: .5rem .15rem;
    scrollbar-width: thin;
}

.post-media-inline-thumb {
    position: relative;
    flex: 0 0 4.5rem;
    display: grid;
    place-items: center;
    height: 3.5rem;
    padding: 0;
    overflow: hidden;
    border: 2px solid transparent;
    border-radius: .5rem;
    background: #334155;
    color: #fff;
    font: inherit;
    font-size: .75rem;
    cursor: pointer;
}

.post-media-inline-thumb[aria-current="true"] {
    border-color: #2769cf;
}

.post-media-stack .post-media-inline-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 0;
    object-fit: cover;
}

.post-media-inline-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    height: 100%;
    padding: 1rem 3.5rem;
    text-align: center;
    color: #142b55;
}
