/*
 * GRAUMAENLEIN_TV · Social gallery size V126
 * Based on remote photo grid V124 + automatic counts V125.
 * The size variable below controls each image's maximum width.
 * No image files are stored or downloaded by the website.
 */
.nr-story-body .gtv-remote-gallery-wrap {
  --gtv-social-photo-width: 280px;
  --gtv-social-photo-gap: 12px;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
}

.nr-story-body .gtv-remote-gallery-wrap > .gtv-remote-gallery {
  gap: var(--gtv-social-photo-gap) !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
}

/* 1 link = 1 photo without blank space. */
.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) {
  width: min(100%, var(--gtv-social-photo-width)) !important;
  grid-template-columns: minmax(0, 1fr) !important;
}

/* 2 links = 2 photos, same sizing as a single photo. */
.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) {
  width: min(100%, calc(var(--gtv-social-photo-width) * 2 + var(--gtv-social-photo-gap))) !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

/* 3–9 links = photo grid; no unused width to the right. */
.nr-story-body .gtv-remote-gallery-wrap > .gtv-remote-gallery[data-gtv-count="3"],
.nr-story-body .gtv-remote-gallery-wrap > .gtv-remote-gallery:has(> .gtv-remote-tile:nth-child(3)) {
  width: min(100%, calc(var(--gtv-social-photo-width) * 3 + var(--gtv-social-photo-gap) * 2)) !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

/* The portraits stay proportionate; mobile stays responsive. */
.nr-story-body .gtv-remote-gallery-wrap .gtv-remote-tile {
  aspect-ratio: 3 / 4 !important;
  max-width: 100% !important;
}

@container (max-width: 650px) {
  .nr-story-body .gtv-remote-gallery-wrap > .gtv-remote-gallery[data-gtv-count="3"],
  .nr-story-body .gtv-remote-gallery-wrap > .gtv-remote-gallery:has(> .gtv-remote-tile:nth-child(3)) {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    width: min(100%, calc(var(--gtv-social-photo-width) * 2 + var(--gtv-social-photo-gap))) !important;
  }
}

@container (max-width: 430px) {
  .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"],
  .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)) {
    grid-template-columns: minmax(0, 1fr) !important;
    width: min(100%, var(--gtv-social-photo-width)) !important;
  }
}
