/* GRAUMAENLEIN.TV – Social gallery adaptive layout / V125
 * Intentionally loaded AFTER newsroom-social-remote-v124.css.
 * Only the gallery wrapper and responsive column layout are changed.
 * Images remain on external servers, no preview uploads.
 */
.nr-story-body .gtv-remote-gallery-wrap {
    box-sizing: border-box !important;
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: none !important;
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    outline: 0 !important;
}

/* Full reset for the dark background seen around a single photo. */
.nr-story-body .gtv-remote-gallery-wrap > .gtv-remote-gallery {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 12px !important;
    box-sizing: border-box !important;
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: none !important;
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    outline: 0 !important;
    overflow: visible !important;
}

/* One original post: one portrait tile, no empty columns. */
.nr-story-body .gtv-remote-gallery-wrap > .gtv-remote-gallery[data-gtv-count="1"],
.nr-story-body .gtv-remote-gallery-wrap > .gtv-remote-gallery:has(> .gtv-remote-tile:only-child) {
    grid-template-columns: minmax(0, 1fr) !important;
    width: min(100%, 340px) !important;
}

/* Two original posts: two equal picture tiles, no unused third column. */
.nr-story-body .gtv-remote-gallery-wrap > .gtv-remote-gallery[data-gtv-count="2"],
.nr-story-body .gtv-remote-gallery-wrap > .gtv-remote-gallery:has(> .gtv-remote-tile:nth-child(2):last-child) {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    width: min(100%, 692px) !important;
}

/* External photos keep their individual shape and their Instagram overlays. */
.nr-story-body .gtv-remote-gallery-wrap .gtv-remote-tile {
    min-width: 0 !important;
    max-width: 100% !important;
    border: 0 !important;
    box-shadow: none !important;
}

@container (max-width: 650px) {
    .nr-story-body .gtv-remote-gallery-wrap > .gtv-remote-gallery:not(:has(> .gtv-remote-tile:only-child)) {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@container (max-width: 430px) {
    /* Match the count selectors so a small screen always becomes one column. */
    .nr-story-body .gtv-remote-gallery-wrap > .gtv-remote-gallery:has(> .gtv-remote-tile:only-child),
    .nr-story-body .gtv-remote-gallery-wrap > .gtv-remote-gallery:has(> .gtv-remote-tile:nth-child(2):last-child),
    .nr-story-body .gtv-remote-gallery-wrap > .gtv-remote-gallery:has(> .gtv-remote-tile:nth-child(3)),
    .nr-story-body .gtv-remote-gallery-wrap > .gtv-remote-gallery[data-gtv-count="1"],
    .nr-story-body .gtv-remote-gallery-wrap > .gtv-remote-gallery[data-gtv-count="2"],
    .nr-story-body .gtv-remote-gallery-wrap > .gtv-remote-gallery[data-gtv-count="3"] {
        grid-template-columns: minmax(0, 1fr) !important;
        width: min(100%, 340px) !important;
        gap: 10px !important;
    }
}

/* Backup for browsers without :has: the small JS sets data-gtv-count. */
@media (max-width: 480px) {
    .nr-story-body .gtv-remote-gallery-wrap > .gtv-remote-gallery {
        gap: 9px !important;
    }
}
