.gallery-public,
.scan-gallery-page {
  min-height: 100dvh;
  /*
  background:
    radial-gradient(circle at top, rgba(58, 78, 106, 0.2), transparent 34%),
    linear-gradient(180deg, #0a0f16 0%, #05070b 100%);
  */
}

.gallery-public .scan-section--gallery,
.scan-gallery-page .scan-section--gallery {
  position: relative;
  min-height: 100dvh;
  padding: calc(env(safe-area-inset-top, 0px) + 72px) 14px calc(env(safe-area-inset-bottom, 0px) + 24px);
  background: transparent;
}

.gallery-public .scan-section__header,
.scan-gallery-page .scan-section__header {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 16px);
  left: 16px;
  right: 16px;
  z-index: 40;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  pointer-events: none;
}

.gallery-public .scan-section__header > div,
.scan-gallery-page .scan-section__header > div {
  display: none;
}

.gallery-public .scan-backlink,
.scan-gallery-page .scan-backlink {
  pointer-events: auto;
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 16px);
  left: 16px;
  z-index: 45;
}

.gallery-public .scan-gallery-grid,
.scan-gallery-page .scan-gallery-grid {
  column-count: 2;
  column-gap: 10px;
}

.gallery-public .scan-gallery-grid--albums,
.scan-gallery-page .scan-gallery-grid--albums {
  display: block;
  width: 100%;
  max-width: none;
  column-count: initial;
}

.gallery-public .scan-gallery-card,
.scan-gallery-page .scan-gallery-card,
.gallery-slide {
  position: relative;
  display: flex;
  align-items: flex-end;
  width: 100%;
  margin: 0 0 10px;
  overflow: hidden;
  border-radius: 20px;
  background: #0f1722;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
  isolation: isolate;
  cursor: zoom-in;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  page-break-inside: avoid;
}

.gallery-public .scan-gallery-card:nth-child(6n+1),
.scan-gallery-page .scan-gallery-card:nth-child(6n+1) {
  aspect-ratio: 4/5;
}

.gallery-public .scan-gallery-card:nth-child(6n+2),
.scan-gallery-page .scan-gallery-card:nth-child(6n+2),
.gallery-public .scan-gallery-card:nth-child(6n+4),
.scan-gallery-page .scan-gallery-card:nth-child(6n+4),
.gallery-public .scan-gallery-card:nth-child(6n+6),
.scan-gallery-page .scan-gallery-card:nth-child(6n+6) {
  aspect-ratio: 1/1;
}

.gallery-public .scan-gallery-card:nth-child(6n+3),
.scan-gallery-page .scan-gallery-card:nth-child(6n+3) {
  aspect-ratio: 16/10;
}

.gallery-public .scan-gallery-card:nth-child(6n+5),
.scan-gallery-page .scan-gallery-card:nth-child(6n+5) {
  aspect-ratio: 3/4;
}

.gallery-public .scan-gallery-card__media,
.scan-gallery-page .scan-gallery-card__media {
  position: absolute;
  inset: 0;
  background: #0f1722;
}

.gallery-public .scan-gallery-card__media::after,
.scan-gallery-page .scan-gallery-card__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(5, 7, 11, 0.04) 20%, rgba(5, 7, 11, 0.28) 62%, rgba(5, 7, 11, 0.76) 100%);
  z-index: 1;
}

.gallery-media {
  width: 100%;
  height: 100%;
  min-height: 0;
  align-self: stretch;
  box-sizing: border-box;
  display: block;
}

.gallery-public .scan-gallery-card__media img,
.scan-gallery-page .scan-gallery-card__media img,
.gallery-slide img,
.gallery-media--image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  transition: transform 0.45s ease;
}

.gallery-public .scan-gallery-card__media video,
.scan-gallery-page .scan-gallery-card__media video,
.gallery-lightbox__slide video,
.gallery-media--video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  background: #000;
}

.gallery-public .scan-gallery-card__content,
.scan-gallery-page .scan-gallery-card__content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  padding: 14px;
  color: #fff;
}

.gallery-public .scan-gallery-card__meta,
.scan-gallery-page .scan-gallery-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
}

.gallery-public .scan-gallery-card__album,
.scan-gallery-page .scan-gallery-card__album {
  display: none;
}

.gallery-public .scan-gallery-card__merchant,
.scan-gallery-page .scan-gallery-card__merchant,
.gallery-public .scan-gallery-card__title-badge,
.scan-gallery-page .scan-gallery-card__title-badge {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  backdrop-filter: blur(10px);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gallery-public .scan-gallery-card__content p,
.scan-gallery-page .scan-gallery-card__content p {
  margin: 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 13px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gallery-public .scan-empty,
.scan-gallery-page .scan-empty {
  min-height: calc(100dvh - 120px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  color: #fff;
}

.scan-gallery-albums {
  display: flex;
  flex-direction: column;
  /*gap: 18px;*/
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  column-span: all;
}

.scan-gallery-album {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(126px, 28vw);
  gap: 10px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  width: 100%;
}

.scan-gallery-album::-webkit-scrollbar {
  display: none;
}

.scan-gallery-album > * {
  min-width: 0;
  scroll-snap-align: start;
  aspect-ratio: 1/1;
}

.scan-gallery-album-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  gap: 12px;
  min-width: 0;
  padding: 18px 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  background: linear-gradient(145deg, #344255, #253244);
  color: #fff;
  cursor: pointer;
  text-align: center;
}

.scan-gallery-album-card:focus-visible {
  outline: 3px solid #d85a30;
  outline-offset: 3px;
}

[data-gallery-lightbox-item]:focus-visible {
  outline: 3px solid #d85a30;
  outline-offset: 3px;
}

.scan-gallery-album-card__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.scan-gallery-album-card__icon .material-symbols-outlined {
  font-size: 27px;
}

.scan-gallery-album-card__title {
  display: -webkit-box;
  max-width: 100%;
  overflow: hidden;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.gallery-lightbox__status {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 72px);
  left: 50%;
  z-index: 100;
  max-width: calc(100% - 40px);
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(25, 25, 25, 0.82);
  color: #fff;
  font-size: 13px;
  transform: translateX(-50%);
}

.gallery-lightbox__status.is-error {
  background: rgba(151, 47, 34, 0.92);
}

.gallery-lightbox__album-badge {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 16px);
  left: 16px;
  z-index: 99;
  max-width: min(62vw, 320px);
  overflow: hidden;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(25, 25, 25, 0.66);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
  backdrop-filter: blur(14px);
}

@media (min-width: 768px) {
  .scan-gallery-album {
    grid-auto-columns: minmax(170px, 210px);
    grid-template-rows: 250px;
  }
}
.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
  background: rgba(0, 0, 0, 0.88);
}

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

.gallery-lightbox__close {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 16px);
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  z-index: 99;
  background: rgba(25, 25, 25, 0.4);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.gallery-lightbox__viewport {
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}

.gallery-lightbox__stage {
  width: 100%;
  flex: 1 1 auto;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
}

.gallery-lightbox__stage::-webkit-scrollbar {
  display: none;
}

.gallery-lightbox__track {
  display: flex;
  width: 100%;
  height: 100%;
}

.gallery-lightbox__slide {
  flex: 0 0 100%;
  width: 100vw;
  min-width: 100vw;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  overflow: hidden;
  background: #000;
}

.gallery-lightbox__image-backdrop {
  position: absolute;
  inset: 0;
  background-color: #000;
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  filter: blur(40px);
  transform: scale(1.2);
  opacity: 0;
  transition: opacity 0.28s ease;
  will-change: transform, filter, opacity;
}

.gallery-lightbox__slide img,
.gallery-lightbox__slide video {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: cover;
  border-radius: 0;
  box-shadow: none;
  transition: object-fit 0.28s ease;
}

.gallery-lightbox__slide--contain .gallery-lightbox__image-backdrop {
  opacity: 0.55;
}

.gallery-lightbox__slide--contain img {
  object-fit: contain;
}

.gallery-lightbox__slide--cover img {
  object-fit: cover;
}

.gallery-lightbox__meta {
  position: absolute;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  left: 16px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  text-align: left;
  color: #fff;
  pointer-events: none;
}

.gallery-lightbox__counter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.gallery-lightbox__caption {
  margin: 0;
  max-width: min(92vw, 520px);
  color: rgba(255, 255, 255, 0.86);
  font-size: 14px;
  line-height: 1.45;
}

@media (hover: hover) and (pointer: fine) {
  .gallery-public .scan-gallery-card:hover .scan-gallery-card__media img,
  .scan-gallery-page .scan-gallery-card:hover .scan-gallery-card__media img {
    transform: scale(1.04);
  }
}
@media (min-width: 768px) {
  .gallery-public .scan-section--gallery,
  .scan-gallery-page .scan-section--gallery {
    padding: 92px 24px 32px;
  }
  .gallery-public .scan-section__header,
  .scan-gallery-page .scan-section__header,
  .gallery-public .scan-backlink,
  .scan-gallery-page .scan-backlink {
    top: 24px;
    left: 24px;
    right: 24px;
  }
  .gallery-public .scan-gallery-grid,
  .scan-gallery-page .scan-gallery-grid {
    max-width: 920px;
    margin: 0 auto;
    column-count: 3;
    column-gap: 16px;
  }
  .gallery-public .scan-gallery-card,
  .scan-gallery-page .scan-gallery-card {
    border-radius: 24px;
    margin-bottom: 16px;
  }
  .gallery-public .scan-gallery-card__content,
  .scan-gallery-page .scan-gallery-card__content {
    padding: 18px;
  }
  .gallery-public .scan-gallery-card__content p,
  .scan-gallery-page .scan-gallery-card__content p {
    font-size: 14px;
  }
}
@media (min-width: 1100px) {
  .gallery-public .scan-gallery-grid,
  .scan-gallery-page .scan-gallery-grid {
    max-width: 1120px;
    column-count: 4;
  }
}
