/* Account gallery: same 15px gaps as the public operator profile. */
.profile__galery--grid-up {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  grid-template-rows: auto;
  row-gap: 15px;
  column-gap: 15px;
}
@media only screen and (min-width: 768px) {
  .profile__galery--grid-up {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media only screen and (min-width: 1024px) {
  .profile__galery--grid-up {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr);
    width: 100%;
    height: auto !important;
  }
  .profile__galery--grid-up .sortHandle {
    width: 100%;
  }
  .profile__galery--grid-up .sortHandle:not(.ui-draggable-dragging) {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    width: 100% !important;
  }
  .profile__galery--grid-up .sortHandle.ui-draggable-dragging {
    z-index: 1000;
  }
}

.profile__galery--grid-up .profile__galery--grid-item {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 8px;
  line-height: 0;
}

.profile__galery--grid-up .profile__galery--grid-img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  min-height: 0 !important;
  object-fit: cover !important;
  object-position: center center;
  transform: scale(1);
  transform-origin: center center;
  transition: transform 0.45s ease;
}

.profile__galery--grid-up .profile__galery--grid-item--video .profile__galery--grid-img {
  transform: scale(1.34);
}

@media (hover: hover) and (pointer: fine) {
  .profile__galery--grid-up .profile__galery--grid-item:hover .profile__galery--grid-img,
  .profile__galery--grid-up .profile__galery--grid-item:focus-visible .profile__galery--grid-img {
    transform: scale(1.05);
  }

  .profile__galery--grid-up .profile__galery--grid-item--video:hover .profile__galery--grid-img,
  .profile__galery--grid-up .profile__galery--grid-item--video:focus-visible .profile__galery--grid-img {
    transform: scale(1.407);
  }
}

.gallery__modal .modal-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.gallery__modal .modal-footer .btn-main-transparent {
  order: 0 !important;
}

/* Lightbox: nie rozciągaj zdjęć — zachowaj proporcje (nadpisuje webpack height:100%). */
@media only screen and (min-width: 1024px) {
  .lg-object.lg-image {
    width: auto !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
  }
}

.fixed-size.lg-outer .lg-img-wrap {
  display: flex !important;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  height: 100%;
}

.fixed-size.lg-outer .lg-item {
  text-align: center;
}
