/* Final sitewide image treatment: edge-to-edge media, restrained frames, no letterboxing. */
:root {
  --site-image-radius: clamp(14px, 1.6vw, 22px);
  --site-image-border: rgba(255, 255, 255, .16);
  --site-image-shadow: 0 14px 34px rgba(0, 0, 0, .16);
}

html,
body {
  max-width: 100%;
  overflow-x: clip !important;
}

/* Photography should meet the edge of its card instead of floating inside a thick frame. */
body :is(
  .home-photo-journal__item,
  .real-session-shot,
  .drive-editorial-insert__frame,
  .imp16-shell .imp16-photo-clip,
  .home-lab-choice__card,
  .feedback-mobile-lab
) {
  box-sizing: border-box !important;
  padding: 0 !important;
  border: 1px solid var(--site-image-border) !important;
  outline: 0 !important;
  border-radius: var(--site-image-radius) !important;
  background: transparent !important;
  box-shadow: var(--site-image-shadow) !important;
  overflow: hidden !important;
}

body :is(
  .drive-photo-journal__rail figure,
  .my-story-editorial-strip .founder-photo-insert__frame,
  .feedback-away-images
) {
  box-sizing: border-box !important;
  padding: 0 !important;
  border: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body :is(
  .home-photo-journal__item img,
  .real-session-shot img,
  .drive-editorial-insert__frame img,
  .imp16-shell .imp16-photo-clip img,
  .drive-photo-journal__rail figure img,
  .my-story-editorial-strip .founder-photo-insert__frame img,
  .feedback-away-images img,
  .home-lab-choice__photo,
  .feedback-mobile-lab > img:first-child
) {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  border: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: var(--site-image-radius) !important;
}

/* Repeating galleries retain equal cards, but the photograph fills every available pixel. */
body :is(
  .home-photo-journal__item img,
  .real-session-shot img,
  .drive-photo-journal__rail figure img,
  .feedback-away-images img,
  .home-lab-choice__photo,
  .feedback-mobile-lab > img:first-child
) {
  height: 100% !important;
  object-fit: cover !important;
}

/* Standalone editorial photography follows the supplied image ratio, eliminating black bands. */
body .drive-editorial-insert__frame,
body .imp16-shell .imp16-photo-clip {
  aspect-ratio: auto !important;
  height: auto !important;
  min-height: 0 !important;
}

body .drive-editorial-insert__frame img,
body .imp16-shell .imp16-photo-clip img {
  position: relative !important;
  inset: auto !important;
  height: auto !important;
  aspect-ratio: auto !important;
  object-fit: cover !important;
}

/* The My Story portrait is intentionally a single, naturally proportioned editorial image. */
body.page-about-refined .my-story-editorial-strip .founder-photo-insert__frame {
  display: block !important;
  grid-template-columns: none !important;
  width: min(100%, 820px) !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  aspect-ratio: auto !important;
  margin-inline: auto !important;
  overflow: hidden !important;
  border-radius: var(--site-image-radius) !important;
}

body.page-about-refined .my-story-editorial-strip .founder-photo-insert__frame > img:first-child {
  position: static !important;
  inset: auto !important;
  display: block !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  aspect-ratio: auto !important;
  object-fit: contain !important;
  object-position: center !important;
  transform: none !important;
}

@media (max-width: 760px) {
  :root {
    --site-image-radius: 16px;
    --site-image-shadow: 0 10px 24px rgba(0, 0, 0, .14);
  }

  body :is(
    .home-photo-journal__item,
    .real-session-shot,
    .drive-editorial-insert__frame,
    .imp16-shell .imp16-photo-clip,
    .home-lab-choice__card,
    .feedback-mobile-lab
  ) {
    border-width: 1px !important;
    outline: 0 !important;
  }

  body .drive-photo-journal__rail figure,
  body .my-story-editorial-strip .founder-photo-insert__frame,
  body .feedback-away-images {
    padding: 0 !important;
    border: 0 !important;
  }
}

/* Award photographs are supplied as portraits. Keep the complete face and
   ceremony context instead of forcing them through the gallery's 4:3 crop. */
body .drive-photo-journal__rail figure.drive-photo-journal__portrait img {
  height: auto !important;
  aspect-ratio: 3 / 4 !important;
  object-fit: cover !important;
  object-position: 50% top !important;
}

/* Keep the homepage portrait and My Story pair composed around the face while
   still filling their cards edge to edge. */
body.doc-exact-home .home-photo-journal__item:nth-child(2) img[src*="shivi-teal-studio-chair"] {
  object-position: 50% 42% !important;
}

body .feedback-away-images img {
  aspect-ratio: 4 / 5 !important;
}

body .feedback-away-images img:nth-child(1) {
  object-position: 50% 50% !important;
}

body .feedback-away-images img:nth-child(2) {
  object-position: 50% 18% !important;
}

@media (max-width: 760px) {
  body .home-photo-journal__item:nth-child(2),
  body .home-photo-journal__item:nth-child(2) img[src*="shivi-teal-studio-chair"] {
    aspect-ratio: 3 / 4 !important;
  }

  body.doc-exact-home .home-photo-journal__item:nth-child(2) img[src*="shivi-teal-studio-chair"] {
    object-position: 50% 36% !important;
  }
}
