#content ul.thumbnails {
  display: flex !important; /* Back to flex for better rotate handling/centering */
  flex-wrap: wrap !important;
  justify-content: center !important; /* Tight centering—no left shift on rotate */
  align-items: flex-start !important; /* Tops align, reduces vertical gaps */
  width: 100% !important;
  max-width: 100% !important; /* No caps—fluid on rotate */
  margin: 0 auto !important;
  padding: 0 !important;
  list-style: none !important;
  gap: 4px !important; /* Small uniform space between photos/rows—fixes large vertical gaps */
}

#content ul.thumbnails li {
  flex: 0 0 calc(50% - 4px) !important; /* Strict two per row, no spread/shift */
  margin: 0 !important; /* No extra margins—rely on gap for tightness */
  box-sizing: border-box !important;
  text-align: center !important;
}

#content ul.thumbnails li span.wrap1, #content ul.thumbnails li span.wrap2 {
  width: auto !important;
  max-width: 100% !important;
  display: inline-block !important;
  padding: 0 !important;
  margin: 0 !important;
}

#content ul.thumbnails li img {
  max-width: 100% !important; /* Resizes for snug fit on rotate */
  height: auto !important;
  aspect-ratio: auto !important;
  display: block !important;
  margin: 0 auto !important;
  object-fit: contain !important;
}

/* Titles */
#content ul.thumbnails li .thumbnail-title {
  text-align: center !important;
  margin-top: 2px !important; /* Tighter for flow */
  width: auto !important;
}

/* Device-specific: Tighten for Pro Max/15 Pro orientations */
@media (max-width: 430px) {  /* 15 Pro/Pro Max portrait */
  #content ul.thumbnails {
    gap: 4px !important; /* Consistent small gaps */
  }
  #content ul.thumbnails li {
    flex: 0 0 calc(50% - 4px) !important;
  }
}

@media (min-width: 431px) and (max-width: 932px) {  /* Landscape on 15 Pro/Pro Max */
  #content ul.thumbnails {
    gap: 6px !important; /* Slight more for wider, but still snug—no spread */
    justify-content: center !important; /* Reinforce centering on rotate */
  }
  #content ul.thumbnails li {
    flex: 0 0 calc(50% - 6px) !important; /* Prevents move-apart */
  }
}

@media (min-width: 933px) {  /* Laptop/full desktop */
  #content ul.thumbnails {
    gap: 8px !important; /* Balanced for big screens */
  }
  #content ul.thumbnails li {
    flex: 0 0 calc(50% - 8px) !important;
  }
}}}}}
