/* Galeria / carrossel — modal (carregado sob demanda) */
.gs-gallery {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(18, 2, 3, 0.55);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.gs-gallery.is-open {
  display: flex;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.gs-gallery:not(.is-open) .gs-gallery__slide {
  opacity: 0;
  visibility: hidden;
}

.gs-gallery__dialog {
  width: fit-content;
  max-width: min(96vw, 860px);
  max-height: min(94vh, 820px);
  display: flex;
  flex-direction: column;
  background: #E3E3E3;
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(18, 2, 3, 0.28);
  overflow: hidden;
  transform: translateY(12px) scale(0.98);
  transition: transform 0.28s ease;
}

.gs-gallery__dialog:focus {
  outline: none;
}

.gs-gallery.is-open .gs-gallery__dialog {
  transform: translateY(0) scale(1);
}

.gs-gallery__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem 0.65rem;
  background: #E3E3E3;
  border-bottom: 1px solid rgba(28, 16, 14, 0.1);
}

.gs-gallery__title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--gs-ink);
  line-height: 1.3;
}

.gs-gallery__close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: rgba(28, 16, 14, 0.06);
  color: var(--gs-ink);
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.gs-gallery__close:focus {
  outline: none;
}

.gs-gallery__close:focus-visible {
  outline: 2px solid var(--gs-gold);
  outline-offset: 2px;
}

.gs-gallery__close:focus:not(:focus-visible) {
  outline: none;
  background: rgba(28, 16, 14, 0.06);
}

.gs-gallery__close:hover {
  background: rgba(28, 16, 14, 0.1);
}

.gs-gallery__close:active {
  background: rgba(28, 16, 14, 0.06);
}

.gs-gallery__body {
  position: relative;
  flex: 1;
  min-height: 0;
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: pan-y;
  background: #E3E3E3;
}

.gs-gallery__viewport {
  position: relative;
  width: auto;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #E3E3E3;
  border-radius: 16px;
  overflow: hidden;
}

.gs-gallery__skeleton {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 14px;
  background: linear-gradient(
    110deg,
    #d0d0d0 0%,
    #e8e8e8 18%,
    #d8d8d8 33%,
    #ececec 50%,
    #d8d8d8 67%,
    #e8e8e8 82%,
    #d0d0d0 100%
  );
  background-size: 220% 100%;
  animation: gs-gallery-shimmer 1.15s ease-in-out infinite;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
  pointer-events: none;
}

.gs-gallery__viewport.is-loading .gs-gallery__skeleton {
  opacity: 1;
  visibility: visible;
}

@keyframes gs-gallery-shimmer {
  0% {
    background-position: 120% 0;
  }
  100% {
    background-position: -120% 0;
  }
}

.gs-gallery__slide {
  position: relative;
  z-index: 2;
  width: auto;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  border-radius: 14px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.gs-gallery__slide.is-ready {
  opacity: 1;
  visibility: visible;
}

.gs-gallery__viewport.is-loading .gs-gallery__slide:not(.is-ready) {
  opacity: 0;
  visibility: hidden;
}

.gs-gallery__nav {
  display: none;
}

.gs-gallery__foot {
  padding: 0.65rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  background: #E3E3E3;
}

.gs-gallery__counter {
  margin: 0;
  font-size: 0.78rem;
  color: var(--gs-ink-soft);
}

.gs-gallery__dots {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: center;
}

.gs-gallery__dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(28, 16, 14, 0.2);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.gs-gallery__dot:focus {
  outline: none;
}

.gs-gallery__dot:focus-visible {
  outline: 2px solid var(--gs-gold);
  outline-offset: 2px;
}

.gs-gallery__dot.is-active {
  background: var(--gs-gold);
  transform: scale(1.15);
}

html.gs-gallery-open {
  overflow: hidden;
}

html.gs-gallery-open body {
  overflow: hidden;
}

@media (min-width: 900px) {
  .gs-gallery__dialog {
    max-width: min(92vw, 860px);
  }

  .gs-gallery__nav {
    display: grid;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(33, 3, 3, 0.42);
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.72rem;
    cursor: pointer;
    place-items: center;
    opacity: 0.5;
    z-index: 3;
    transition: opacity 0.2s ease, background 0.2s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .gs-gallery__body:hover .gs-gallery__nav:not(:disabled),
  .gs-gallery__nav:hover:not(:disabled),
  .gs-gallery__nav:focus-visible:not(:disabled) {
    opacity: 0.92;
    background: rgba(33, 3, 3, 0.68);
  }

  .gs-gallery__nav:focus:not(:focus-visible) {
    outline: none;
    opacity: 0.5;
    background: rgba(33, 3, 3, 0.42);
  }

  .gs-gallery__nav:focus {
    outline: none;
  }

  .gs-gallery__nav:focus-visible:not(:disabled) {
    outline: 2px solid var(--gs-gold);
    outline-offset: 2px;
  }

  .gs-gallery__nav:disabled {
    opacity: 0;
    pointer-events: none;
  }

  .gs-gallery__nav--prev {
    left: 0.4rem;
  }

  .gs-gallery__nav--next {
    right: 0.4rem;
  }
}

@media (min-width: 900px) and (hover: none) {
  .gs-gallery__nav {
    display: none;
  }
}

@media (max-width: 520px) {
  .gs-gallery {
    padding: 0.5rem;
  }

  .gs-gallery--landscape {
    padding: 0.35rem;
  }

  .gs-gallery__dialog {
    width: 100%;
    max-width: 100%;
    max-height: 92vh;
    border-radius: 16px;
  }

  .gs-gallery--landscape .gs-gallery__dialog {
    width: 100%;
    max-height: none;
    height: auto;
  }

  .gs-gallery__body {
    padding: 0.65rem 0.75rem;
  }

  .gs-gallery--landscape .gs-gallery__body {
    flex: 0 1 auto;
    padding: 0.45rem 0.35rem;
  }

  .gs-gallery--landscape .gs-gallery__slide {
    width: 100%;
  }
}
