/* GALLERY_SHOWCASE_MAR2026_B */
.gallery-showcase,
.horizontal-gallery.gallery-showcase {
  --gallery-card-width: clamp(170px, 31vw, 240px);
  --gallery-card-height: clamp(220px, 38vw, 320px);
  display: flex !important;
  gap: 16px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  padding: 6px 4px 14px !important;
  align-items: stretch !important;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.gallery-showcase--grid,
.gallery-grid.gallery-showcase {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)) !important;
  gap: 16px !important;
  align-items: stretch !important;
}

.gallery-card,
.gallery-showcase .gallery-item,
.gallery-showcase .gallery-item-card,
.gallery-showcase > .gallery-photo-tile {
  flex: 0 0 var(--gallery-card-width) !important;
  min-width: var(--gallery-card-width) !important;
  max-width: var(--gallery-card-width) !important;
  scroll-snap-align: start;
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  padding: 10px !important;
  border-radius: 26px !important;
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(255,246,250,.96)) !important;
  border: 1px solid rgba(246, 209, 225, .95) !important;
  box-shadow: 0 14px 34px rgba(81, 43, 66, .08), inset 0 1px 0 rgba(255,255,255,.85) !important;
  overflow: hidden !important;
  position: relative;
}

.gallery-showcase .gallery-item::before,
.gallery-showcase .gallery-item-card::before,
.gallery-showcase > .gallery-photo-tile::before,
.gallery-card::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 22px;
  border: 1px solid rgba(243, 209, 224, .9);
  pointer-events: none;
}

.gallery-showcase .gallery-item img,
.gallery-showcase .gallery-item-card img,
.gallery-showcase > img,
.gallery-showcase > .gallery-photo-tile img,
.gallery-card img,
.admin-media-preview {
  display: block !important;
  width: 100% !important;
  height: var(--gallery-card-height) !important;
  min-height: var(--gallery-card-height) !important;
  max-height: var(--gallery-card-height) !important;
  margin: 0 !important;
  border-radius: 20px !important;
  border: 1px solid rgba(236, 202, 219, .95) !important;
  background: #f9eff4 !important;
  object-fit: cover !important;
  object-position: center !important;
  padding: 0 !important;
  cursor: zoom-in !important;
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease !important;
  box-shadow: 0 8px 18px rgba(255, 120, 170, .08);
}

.profile-main-photo.gallery-hero {
  display: block !important;
  width: 100% !important;
  max-height: min(74vh, 760px) !important;
  border-radius: 24px !important;
  border: 1px solid rgba(236, 202, 219, .95) !important;
  object-fit: cover !important;
  object-position: center !important;
  padding: 0 !important;
  cursor: zoom-in !important;
}

.avatar-hero.gallery-hero {
  width: min(100%, 180px) !important;
  height: min(100%, 180px) !important;
  object-fit: cover !important;
  padding: 0 !important;
  border-radius: 24px !important;
  border: 1px solid rgba(236, 202, 219, .95) !important;
}

.gallery-showcase .gallery-item img:hover,
.gallery-showcase .gallery-item-card img:hover,
.gallery-showcase > img:hover,
.gallery-showcase > .gallery-photo-tile img:hover,
.gallery-card img:hover,
.profile-main-photo.gallery-hero:hover,
.avatar-hero.gallery-hero:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(255, 120, 170, .18);
  filter: saturate(1.03);
}

.gallery-showcase .danger-btn,
.gallery-showcase .ghost-btn,
.gallery-showcase .primary-btn,
.gallery-showcase .secondary-btn {
  width: 100% !important;
  justify-content: center !important;
  margin-top: auto !important;
}

#gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(20, 12, 18, .84);
  backdrop-filter: blur(10px);
}

#gallery-lightbox.is-open { display: flex; }

.gallery-lightbox__dialog {
  position: relative;
  width: min(96vw, 1120px);
  max-height: 94vh;
  padding: 16px;
  border-radius: 30px;
  background: linear-gradient(180deg, rgba(255,255,255,.985), rgba(255,247,250,.97));
  border: 1px solid rgba(255,255,255,.8);
  box-shadow: 0 24px 90px rgba(0,0,0,.24);
}

.gallery-lightbox__stage {
  min-height: 58vh;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: pan-y;
}

.gallery-lightbox__image {
  max-width: 100%;
  max-height: calc(94vh - 138px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 24px;
  background: #fff;
  border: 1px solid rgba(236, 202, 219, .95);
}

.gallery-lightbox__close,
.gallery-lightbox__nav {
  position: absolute;
  border: none;
  cursor: pointer;
  background: rgba(255,255,255,.96);
  box-shadow: 0 8px 22px rgba(40,24,39,.12);
  color: #2c2430;
}

.gallery-lightbox__close {
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  font-size: 26px;
  line-height: 1;
}

.gallery-lightbox__nav {
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  border-radius: 16px;
  font-size: 24px;
}

.gallery-lightbox__nav--prev { left: 14px; }
.gallery-lightbox__nav--next { right: 14px; }

.gallery-lightbox__footer {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.gallery-lightbox__counter { color: var(--muted); font-weight: 700; }
.gallery-lightbox__thumbs { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 2px; }
.gallery-lightbox__thumb {
  width: 64px; height: 84px; padding: 0; flex: 0 0 auto; border-radius: 14px; overflow: hidden;
  border: 2px solid transparent; background: transparent; cursor: pointer;
}
.gallery-lightbox__thumb.is-active { border-color: #ff79a9; }
.gallery-lightbox__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

@media (max-width: 768px) {
  .gallery-showcase,
  .horizontal-gallery.gallery-showcase {
    --gallery-card-width: 180px;
    --gallery-card-height: 230px;
  }
  .gallery-showcase--grid,
  .gallery-grid.gallery-showcase {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .profile-main-photo.gallery-hero { max-height: min(46vh, 360px) !important; }
  .gallery-lightbox__dialog { width: 100%; padding: 14px; border-radius: 22px; }
  .gallery-lightbox__footer { flex-direction: column; align-items: stretch; }
  .gallery-lightbox__nav { width: 42px; height: 42px; }
}


/* GALLERY_SHOWCASE_PHONE_POLISH */
.gallery-showcase .gallery-item,
.gallery-showcase .gallery-item-card,
.gallery-showcase > .gallery-photo-tile,
.gallery-showcase > .gallery-item {
  align-self: stretch;
}

.gallery-showcase .gallery-item img,
.gallery-showcase .gallery-item-card img,
.gallery-showcase > .gallery-photo-tile img,
.gallery-showcase > .gallery-item img {
  width: 100% !important;
  display: block !important;
}

@media (max-width: 900px) {
  .gallery-showcase .gallery-item,
  .gallery-showcase .gallery-item-card,
  .gallery-showcase > .gallery-photo-tile,
  .gallery-showcase > .gallery-item {
    padding: 8px !important;
  }

  .gallery-showcase .gallery-item::before,
  .gallery-showcase .gallery-item-card::before,
  .gallery-showcase > .gallery-photo-tile::before,
  .gallery-showcase > .gallery-item::before {
    inset: 8px !important;
  }
}
