/* Underground Palace-only treatment for the 3D modelling carousel. The
 * exported Cinema 4D title bar is cropped without changing the 16:9 card. */
.project-carousel--organism-models .project-carousel__slide {
  box-sizing: border-box;
  padding: 0;
}

.project-carousel--organism-models .project-carousel__slide .project-media-split__media {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
}

.project-carousel--organism-models .project-carousel__media-visual {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  object-position: center;
  transform: scale(1.085);
  transform-origin: center 77%;
}

/* Keep the four narrative studies on one shared 16:9 surface with a small,
 * consistent gap between each image and a little vertical breathing room. */
.underground-palace-narrative-cluster {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(0.5rem, 1vw, 1rem);
  padding-block: clamp(1rem, 2.5vw, 2.5rem);
}

/* The cluster's vertical padding belongs to the shared surface. Keep each
 * portrait GIF on its own 3:4 crop layer so the corner radius follows the
 * artwork itself instead of rounding the surrounding white space. */
.underground-palace-narrative-frame {
  overflow: visible;
  border-radius: 0 !important;
  background: transparent;
}

.underground-palace-narrative-photo {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  align-self: center;
  overflow: hidden;
  border-radius: 16px;
  clip-path: inset(0 round 16px);
}

.underground-palace-narrative-photo > .project-media {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  border-radius: inherit;
}

/* The sketch export is portrait-leaning. Keep the surrounding module at 16:9
 * and show the complete artwork with balanced side space. */
.underground-palace-sketch-frame {
  box-sizing: border-box;
  aspect-ratio: 16 / 9;
  padding: clamp(2rem, 5vw, 5rem) clamp(1rem, 5vw, 5rem);
}

.underground-palace-sketch-frame > .project-media {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: contain;
  justify-self: center;
  align-self: center;
}

/* Keep the sound circuit fully visible in the same 16:9 module, with a small
 * all-around inset so the narrower source does not feel oversized. */
.underground-palace-sound-frame {
  box-sizing: border-box;
  aspect-ratio: 16 / 9;
  padding: clamp(0.75rem, 2vw, 2rem);
}

.underground-palace-sound-frame > .project-media {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: contain;
  justify-self: center;
  align-self: center;
}
