/* Full-story media and related cards; loaded on showfull only. */
/* Full story gallery: identical fixed canvas to the feed card. ----------- */
.full_story > .story-primary-media .pk-gallery {
  width: 100% !important;
  aspect-ratio: 4 / 3 !important;
  height: auto !important;
  max-height: min(72dvh, 620px) !important;
  overflow: hidden !important;
}

.full_story > .story-primary-media .pk-gallery .pk-gallery__grid {
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  display: grid !important;
  overflow: hidden !important;
  aspect-ratio: auto !important;
}

.full_story > .story-primary-media .pk-gallery--2 .pk-gallery__grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-template-rows: minmax(0, 1fr) !important;
}

.full_story > .story-primary-media .pk-gallery .pk-gallery__link {
  min-width: 0 !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

.full_story > .story-primary-media .pk-gallery .pk-gallery__link img {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: cover !important;
  object-position: center !important;
}

/* Editor.js galleries live inside .full_text, outside story-primary-media. */
.full_story .full_text .pk-gallery {
  width: calc(100% + 36px) !important;
  max-width: none !important;
  aspect-ratio: 4 / 3 !important;
  height: auto !important;
  max-height: min(72dvh, 620px) !important;
  margin: 28px -18px !important;
  display: block !important;
  overflow: hidden !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #e9edf1 !important;
}

.full_story .full_text .pk-gallery > .pk-gallery__grid {
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  display: grid !important;
  gap: 4px !important;
  overflow: hidden !important;
  aspect-ratio: auto !important;
}

.full_story .full_text .pk-gallery .pk-gallery__link {
  min-width: 0 !important;
  min-height: 0 !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  display: block !important;
  position: relative !important;
  overflow: hidden !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #e5e9ed !important;
  line-height: 0 !important;
  text-decoration: none !important;
}

.full_story .full_text .pk-gallery .pk-gallery__link img {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  display: block !important;
  border: 0 !important;
  border-radius: 0 !important;
  object-fit: cover !important;
  object-position: center !important;
}

.full_story .full_text .pk-gallery--1 > .pk-gallery__grid {
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: minmax(0, 1fr) !important;
}

.full_story .full_text .pk-gallery--2 > .pk-gallery__grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-template-rows: minmax(0, 1fr) !important;
}

.full_story .full_text .pk-gallery--3 > .pk-gallery__grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-template-rows: 5fr 3fr !important;
}

.full_story .full_text .pk-gallery--3 > .pk-gallery__grid > .pk-gallery__link:first-child {
  grid-column: 1 / -1 !important;
}

.full_story .full_text .pk-gallery--4 > .pk-gallery__grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-template-rows: repeat(2, minmax(0, 1fr)) !important;
}

.full_story .full_text .pk-gallery--5 > .pk-gallery__grid {
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  grid-template-rows: repeat(2, minmax(0, 1fr)) !important;
}

.full_story .full_text .pk-gallery--5 > .pk-gallery__grid > .pk-gallery__link:first-child {
  grid-column: 1 / 3 !important;
  grid-row: 1 / 3 !important;
}

.full_story .full_text .pk-gallery--5 > .pk-gallery__grid > .pk-gallery__link:not(:first-child) {
  grid-column: span 2 !important;
}

.full_story .full_text .pk-gallery--6 > .pk-gallery__grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  grid-template-rows: repeat(2, minmax(0, 1fr)) !important;
}

.full_story .full_text .pk-gallery--7 > .pk-gallery__grid,
.full_story .full_text .pk-gallery--8 > .pk-gallery__grid {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  grid-template-rows: repeat(2, minmax(0, 1fr)) !important;
}

.full_story .full_text .pk-gallery--7 > .pk-gallery__grid > .pk-gallery__link:first-child {
  grid-column: span 2 !important;
}

.full_story .full_text .pk-gallery--9 > .pk-gallery__grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  grid-template-rows: repeat(3, minmax(0, 1fr)) !important;
}

/* Editor.js Image blocks remain standalone and visible. Only the dedicated
   Gallery block uses the compact 1-9 image grid above. */
.full_story .full_text figure.story-image {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.full_story .full_text figure.story-image > a,
.full_story .full_text figure.story-image img {
  visibility: visible !important;
  opacity: 1 !important;
}

/* Editor.js uploaded videos use the same v28 player as primary media.
   Keep the base .story-video selector as a safe first-paint fallback for
   server-rendered shared-player markup, before JavaScript adds its marker. */
.full_story .full_text figure.story-video {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  padding: 0 !important;
  line-height: 0;
}

.full_story .full_text figure.story-video > .modern-player {
  width: 100% !important;
  min-height: 0 !important;
  height: auto !important;
  max-height: none !important;
  aspect-ratio: 1 / 1 !important;
  margin: 0 !important;
  display: block !important;
  position: relative !important;
  overflow: hidden !important;
  background: #05070a !important;
  line-height: 0;
}

.full_story .full_text figure.story-video.story-primary-media {
  margin-top: 0 !important;
  margin-bottom: 22px !important;
}

.full_story .full_text figure.story-video .modern-player__canvas {
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

.full_story .full_text figure.story-video > figcaption {
  position: relative;
  z-index: 1;
  line-height: 1.5;
}

.full_story .full_text figure.story-video .modern-player__video {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  object-fit: contain !important;
  object-position: 50% 50% !important;
}

.story-primary-media.is-media-fullscreen-host {
  overflow: visible !important;
  transform: none !important;
  contain: none !important;
}

.story-primary-media .modern-player:fullscreen,
.story-primary-media .modern-player:-webkit-full-screen,
.story-primary-media .modern-player.is-fallback-fullscreen {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  max-width: none !important;
  max-height: none !important;
  aspect-ratio: auto !important;
  margin: 0 !important;
  border-radius: 0 !important;
  background: #000 !important;
}

.story-primary-media .modern-player:fullscreen .modern-player__canvas,
.story-primary-media .modern-player:-webkit-full-screen .modern-player__canvas,
.story-primary-media .modern-player.is-fallback-fullscreen .modern-player__canvas {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

.story-primary-media .modern-player:fullscreen .modern-player__video,
.story-primary-media .modern-player:-webkit-full-screen .modern-player__video,
.story-primary-media .modern-player.is-fallback-fullscreen .modern-player__video {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  object-fit: contain !important;
  object-position: 50% 50% !important;
}

.full_story .full_text figure.story-video .modern-player.is-native-fallback .modern-player__controls,
.full_story .full_text figure.story-video .modern-player.is-native-fallback .modern-player__shade,
.full_story .full_text figure.story-video .modern-player.is-native-fallback .modern-player__center-state {
  display: none !important;
}

/* Related cards: hard 4:3 canvas, complete foreground image and blurred margins.
   A padding canvas is intentional here: it cannot be stretched by the source
   image's intrinsic ratio or by an equal-height grid row. */
.story-related .related-card {
  overflow: hidden !important;
  border-radius: var(--ui-card-radius) !important;
}

.story-related .related-card__media {
  position: relative !important;
  width: 100% !important;
  height: 0 !important;
  min-height: 0 !important;
  padding: 75% 0 0 !important;
  display: block !important;
  aspect-ratio: auto !important;
  overflow: hidden !important;
  isolation: isolate;
  background: #161b21 !important;
}

.story-related .related-card__media-bg {
  position: absolute !important;
  inset: -18px !important;
  z-index: 0 !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  background-size: cover !important;
  filter: blur(20px) brightness(.62) saturate(1.05) !important;
  opacity: .9 !important;
  transform: scale(1.12) !important;
}

.story-related .related-card__media-inner {
  position: absolute !important;
  inset: 0 !important;
  z-index: 1 !important;
  width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  display: grid !important;
  place-items: center !important;
  overflow: hidden !important;
  background: transparent !important;
}

.story-related .related-card__media .related-card__image {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  margin: auto !important;
  display: block !important;
  object-fit: contain !important;
  object-position: center !important;
  background: transparent !important;
  opacity: 1 !important;
  transform: none !important;
}

.story-related .related-card__type {
  z-index: 2;
}

