/* =============================================================
   GALERIA "Piscinas que cuidamos" (home)
   A seção trava na tela e as fotos correm na horizontal conforme
   você rola. Quem calcula o deslocamento é o js/galeria.js — aqui
   fica só a aparência e o esqueleto do pin.
   ============================================================= */

.gallery { overflow: visible; padding: 0; }

/* Espaçador que dá "curso" pro scroll. A altura real é definida no JS,
   em função de quantas fotos devem passar antes de soltar a página. */
.gallery__pin { position: relative; min-height: 100vh; }

/* DEPENDE de `html/body { overflow-x: clip }` (02-base.css).
   Se um dia trocarem por `overflow: hidden`, o sticky para de grudar. */
.gallery__sticky {
  position: sticky; top: 0;
  height: 100vh; height: 100svh;
  overflow: hidden;
  display: flex; flex-direction: column; justify-content: center;
  gap: clamp(1rem, 3vh, 2.4rem);
}

.gallery__viewport { overflow: hidden; padding-block: clamp(0.8rem, 2.4vh, 2rem); }
.gallery__track {
  display: flex; align-items: center;
  gap: clamp(20px, 3vw, 48px);
  padding-inline: clamp(1.2rem, 5vw, 4rem);
  width: max-content; will-change: transform;
}

/* As fotos são medidas pela ALTURA da tela (não pela largura). Em notebook
   pequeno ou com escala de 125/150% do Windows, dimensionar por largura
   estourava a altura do pin e cortava as fotos em cima e embaixo. */
.gallery__card {
  position: relative; flex: 0 0 auto;
  height: clamp(280px, 66vh, 560px); width: auto; aspect-ratio: 5 / 8;
  border-radius: var(--r-lg); overflow: hidden;
  border: 3px solid rgba(255,255,255,.65);
  box-shadow: 0 22px 50px rgba(6,40,74,.34);
  cursor: pointer;
  transition: transform .6s var(--ease), box-shadow .6s var(--ease);
}
.gallery__card img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .8s var(--ease); }
.gallery__card:hover { transform: rotate(-4deg) scale(1.06); z-index: 3; box-shadow: 0 40px 84px rgba(4,26,48,.5); }
.gallery__card:hover img { transform: scale(1.08); }

/* Sem JS ou com "reduzir movimento": vira carrossel de arrastar, sem travar a página */
.gallery--static .gallery__pin { min-height: 0; }
.gallery--static .gallery__sticky { position: static; height: auto; }
.gallery--static .gallery__viewport { overflow-x: auto; scroll-snap-type: x proximity; }
.gallery--static .gallery__card { scroll-snap-align: center; }

/* ---------- Setas ---------- */
.gallery__stage { position: relative; }
.gallery__arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 6;
  width: clamp(46px, 5vw, 56px); height: clamp(46px, 5vw, 56px);
  border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  background: rgba(255,255,255,.92); color: var(--c-blue-700);
  border: 1px solid rgba(255,255,255,.9);
  box-shadow: 0 12px 30px rgba(6,40,74,.30);
  transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast), opacity var(--t-med);
}
.gallery__arrow svg { width: 24px; height: 24px; }
.gallery__arrow:hover { background: var(--c-blue-600); color: #fff; transform: translateY(-50%) scale(1.08); }
.gallery__arrow--prev { left:  clamp(.5rem, 3vw, 2.2rem); }
.gallery__arrow--next { right: clamp(.5rem, 3vw, 2.2rem); }
.gallery__arrow:disabled { opacity: 0; pointer-events: none; }

/* Telas baixas (notebook pequeno, escala do Windows): comprime o título
   pra sobrar altura e a foto nunca ficar cortada. */
@media (max-height: 680px) {
  .gallery__sticky { gap: .4rem; }
  .gallery__sticky .section-head { margin-bottom: 0; }
  .gallery__sticky .section-head h2 { font-size: clamp(1.5rem, 3.4vw, 2rem); }
  .gallery__sticky .section-head p { margin-top: .3rem; font-size: .92rem; }
  .gallery__viewport { padding-block: .5rem; }
  .gallery__card { height: min(66vh, 470px); }
}
@media (max-height: 600px) {
  .gallery__sticky .section-head .eyebrow,
  .gallery__sticky .section-head p { display: none; }
  .gallery__card { height: min(70vh, 430px); }
}
