/* ============================================================
   Rafael Rodoval — galeria em tira e ampliação
   Compartilhado por Print Design e Fashion (gallery.js).
   Cada página define --strip-h, a altura da tira.
   ============================================================ */

:root { --dot: #B7B7B7; }

html.zoom-open { overflow: hidden; }

/* ---------- Tira ---------- */

.galleries { position: relative; }

/* galeria: tira horizontal full-bleed, altura fixa, imagens no
   aspecto nativo — transborda à direita e rola na horizontal */
/* sem scroll-snap: ele puxava a rolagem de volta para a borda das
   fotos e impedia os bullets de pousarem em posições distintas */
.strip {
  display: flex;
  height: var(--strip-h);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.strip::-webkit-scrollbar { display: none; }

.strip img {
  flex: none;
  height: var(--strip-h);
  width: auto;
  cursor: zoom-in;
}

.strip[hidden] { display: none; }

/* ---------- Avançar / voltar na tira ---------- */

.strip-nav {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 104px;
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.25s ease;
  display: flex;
  align-items: center;
}

.strip-nav[hidden] { display: none; }
.strip-nav-next { right: 0; justify-content: flex-end; }
.strip-nav-prev { left: 0; justify-content: flex-start; }

.galleries:hover .strip-nav,
.strip-nav:focus-visible { opacity: 1; }

.strip-nav::after {
  content: "";
  width: 24px;
  height: 24px;
  margin: 0 20px;
  border-radius: 50%;
  background: rgba(255, 250, 238, 0.94) no-repeat center;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.14);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='9' viewBox='0 0 16 16'%3E%3Cpath d='M5.5 1.5 L12 8 L5.5 14.5' fill='none' stroke='%231D1D1B' stroke-width='1.4'/%3E%3C/svg%3E");
  transition: transform 0.2s ease;
}

.strip-nav-prev::after { transform: scaleX(-1); }
.strip-nav-next:hover::after { transform: translateX(3px); }
.strip-nav-prev:hover::after { transform: scaleX(-1) translateX(3px); }

/* ---------- Bullets ----------
   Quatro, ligados às paradas das setas (ver gallery.js). Pontos mínimos
   de 3px; o botão tem área de clique maior que o ponto, senão fica
   difícil acertar. */

.dots {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 16px;
  height: 18px;
}

.dots[hidden] { display: none; }

.dots button {
  padding: 6px 3px;
  border: 0;
  background: none;
  cursor: pointer;
  line-height: 0;
}

.dots button i {
  display: block;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--dot);
  transition: background-color 0.3s ease;
}

.dots button.is-active i { background: var(--ink); }

/* ---------- Zoom (ampliação simples) ----------
   Camada comum, não <dialog>: o <dialog> é desenhado numa camada
   especial do navegador e foi onde a versão anterior falhou. A foto
   nunca fica escondida esperando carregar; o spinner fica por trás
   dela e some sozinho quando ela é pintada por cima. */

.zoom {
  position: fixed;
  inset: 0;
  /* cobre também o espaço vazio da barra de rolagem (medido no JS) */
  right: calc(-1 * var(--gutter, 0px));
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(29, 29, 27, 0.94);
  animation: zoom-in 0.25s ease;
}

.zoom[hidden] { display: none; }

@keyframes zoom-in { from { opacity: 0; } }

.zoom::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 24px;
  margin: -12px 0 0 -12px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-top-color: rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  animation: zoom-spin 0.7s linear infinite;
}

@keyframes zoom-spin { to { transform: rotate(360deg); } }

.zoom-img {
  position: relative;
  z-index: 1;
  display: block;
  max-width: calc(100vw - 200px);
  max-height: calc(100vh - 120px);
  width: auto;
  height: auto;
  cursor: zoom-out;
}

.zoom button {
  position: absolute;
  z-index: 2;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  cursor: pointer;
  background: none no-repeat center;
  opacity: 0.85;
  transition: opacity 0.2s ease;
}

.zoom button:hover,
.zoom button:focus-visible { opacity: 1; }

.zoom button[hidden] { display: none; }

.zoom .zoom-close {
  top: 18px;
  right: 22px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 16 16'%3E%3Cpath d='M2 2 L14 14 M14 2 L2 14' fill='none' stroke='%23fff' stroke-width='1.1'/%3E%3C/svg%3E");
}

.zoom .zoom-prev,
.zoom .zoom-next {
  top: 50%;
  margin-top: -24px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 16 16'%3E%3Cpath d='M5.5 1.5 L12 8 L5.5 14.5' fill='none' stroke='%23fff' stroke-width='1.1'/%3E%3C/svg%3E");
}

.zoom-prev { left: 22px; transform: scaleX(-1); }
.zoom-next { right: 22px; }

.zoom-count {
  position: absolute;
  bottom: 22px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.65);
}

@media (prefers-reduced-motion: reduce) {
  .zoom { animation: none; }
}

/* ---------- Celular: uma foto por tela, deslizando ----------
   Estilo do modo de fotos do TikTok: cada foto ocupa a largura da
   tela e o deslize para exatamente na próxima. Sem setas, o gesto as
   substitui. Todas as fotos preenchem a altura da tira, como no
   desktop, mesmo que as de outra proporção percam um pouco das
   bordas. Cada página define --strip-h-m. */

@media (max-width: 767px) {
  /* o arrasto fica na galeria: no fim da tira ele não passa para a
     página (contain), e a página não se mexe junto */
  .strip {
    height: var(--strip-h-m, 133.33vw);
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
  }

  .strip img {
    width: 100vw;
    height: 100%;
    object-fit: cover;
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  .strip-nav { display: none; }

  .zoom-img {
    max-width: 100vw;
    max-height: calc(100vh - 140px);
  }

  .zoom .zoom-prev { left: 0; }
  .zoom .zoom-next { right: 0; }
  .zoom .zoom-close { top: 10px; right: 6px; }

  /* bullets um pouco maiores e mais rápidos no toque, ainda discretos.
     Um por foto numa fileira que anda (gallery.js): a janela mostra no
     máximo 5 (--slots), cada um ocupa 13px (5 do ponto + 8 de área) */
  .dots {
    justify-content: flex-start;
    width: calc(var(--slots, 4) * 13px);
    margin: 16px auto 0;
    overflow: hidden;
  }

  /* a fileira desliza com uma desaceleração suave no fim, como nos apps */
  .dots-track {
    display: flex;
    align-items: center;
    transition: transform 0.5s cubic-bezier(0.25, 0.75, 0.3, 1);
  }

  .dots button {
    flex: none;
    padding: 6px 4px;
  }

  .dots button i {
    width: 5px;
    height: 5px;
    transition: background-color 0.3s ease, transform 0.5s cubic-bezier(0.25, 0.75, 0.3, 1);
  }

  /* pontas da janela menores quando ainda há fotos além delas */
  .dots button.is-small i { transform: scale(0.65); }

  @media (prefers-reduced-motion: reduce) {
    .dots-track,
    .dots button i { transition: none; }
  }
}
