/* =========================================================
   PGA — Widget "PGA Tour Gallery" (sección "Photo gallery" de Overview). Copia de la maqueta pga/tour-gallery.css.
   Carrusel con la foto del centro grande y las vecinas asomando con velo blanco
   (idea de la galería de CimaTreks, adaptada a la columna de Overview y a PGA).
   Clic en la del centro = pantalla completa con miniaturas; clic en una vecina = la trae al centro.
   ========================================================= */

.tt-gallery { position: relative; }
.tt-gallery svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ── Carrusel ── */
.tt-gallery__stage { position: relative; }

.tt-gallery__swiper { overflow: hidden; padding: .5rem 0 1.25rem; }   /* aire para la sombra */

.tt-gallery__swiper .swiper-slide {
  position: relative;
  width: 72%;
  aspect-ratio: 3 / 2;                        /* todas iguales; la foto completa se ve en pantalla completa */
  overflow: hidden;
  border-radius: 10px;
  background: var(--idx-soft);
  box-shadow: 0 18px 36px -22px var(--idx-overlay-soft);
  cursor: pointer;
}

.tt-gallery__swiper .swiper-slide img { width: 100%; height: 100%; display: block; object-fit: cover; }

/* velo de las vecinas: lo gradúa tour-gallery.js con --veil (0 la del centro → .55 las de los lados) mientras se arrastra */
.tt-gallery__swiper .swiper-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--idx-white);
  opacity: var(--veil, 0);                    /* sin encender (editor) = sin velo */
  pointer-events: none;
}

.tt-gallery__swiper .swiper-slide-active { cursor: zoom-in; }

/* lupa (cuadrada) sobre la foto del centro: aparece al pasar el mouse; en celular se ve siempre */
.tt-gallery__zoom {
  position: absolute;
  top: .875rem;
  right: .875rem;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 2.375rem;
  height: 2.375rem;
  border-radius: 6px;                         /* cuadrado, como los botones de la web */
  background: var(--idx-overlay-soft);
  color: var(--idx-white);
  opacity: 0;
  transform: scale(.8);
  transition: opacity .3s var(--pga-ease), transform .3s var(--pga-ease), background-color .25s var(--pga-ease);
  pointer-events: none;
}
.tt-gallery__zoom svg { width: 1.0625rem; height: 1.0625rem; }

.tt-gallery__swiper .swiper-slide-active:hover .tt-gallery__zoom,
.tt-gallery__solo:hover .tt-gallery__zoom { opacity: 1; transform: none; background: var(--idx-primary); }

@media (hover: none) {
  .tt-gallery__swiper .swiper-slide-active .tt-gallery__zoom,
  .tt-gallery__solo .tt-gallery__zoom { opacity: 1; transform: none; }
}

/* flechas: cuadrado blanco sobre las vecinas; naranja al pasar el mouse */
.tt-gallery__arrow {
  position: absolute;
  top: calc(50% - .375rem);                   /* centro de la foto (el carrusel tiene más aire abajo, por la sombra) */
  z-index: 5;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 0;
  border-radius: 6px;                         /* cuadrado, como los botones de la web */
  background: var(--idx-white);
  color: var(--idx-title);
  box-shadow: 0 8px 20px -8px var(--idx-overlay-soft);
  transform: translateY(-50%);
  cursor: pointer;
  transition: background-color .25s var(--pga-ease), color .25s var(--pga-ease), transform .2s var(--pga-ease);
}
.tt-gallery__arrow svg { width: 1.25rem; height: 1.25rem; }
.tt-gallery__arrow--prev { left: .5rem; }
.tt-gallery__arrow--next { right: .5rem; }
.tt-gallery__arrow:focus-visible { outline: 2px solid var(--idx-secondary); outline-offset: 2px; }
.tt-gallery__arrow.swiper-button-disabled { opacity: .35; cursor: default; }

@media (hover: hover) {
  .tt-gallery__arrow:not(.swiper-button-disabled):hover { background: var(--idx-primary); color: var(--idx-white); transform: translateY(-50%) scale(1.06); }
}

/* contador "3 / 12" */
.tt-gallery__count {
  margin: .25rem 0 0;
  text-align: center;
  font: 500 .8125rem/1 var(--idx-font-title), system-ui, sans-serif;
  letter-spacing: .06em;
  color: var(--idx-muted-light);
}
.tt-gallery__now { color: var(--idx-title); }

/* ── Una sola foto ── */
.tt-gallery__solo {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  padding: 0;
  border: 0;
  overflow: hidden;
  border-radius: 10px;
  background: var(--idx-soft);
  cursor: zoom-in;
}
.tt-gallery__solo img { width: 100%; height: 100%; display: block; object-fit: cover; }

/* ── Celular: el carrusel llega de borde a borde (como la barra de pestañas) y sin flechas: se desliza con el dedo ── */
@media (max-width: 767px) {
  .tt-gallery__stage { width: 100vw; margin-left: calc(50% - 50vw); }   /* ancho de pantalla, sean cuales sean los márgenes de alrededor */
  .tt-gallery__swiper .swiper-slide { width: 74%; }   /* deja asomar un borde de cada vecina: avisa que se desliza */
  .tt-gallery__arrow { display: none; }
  .tt-gallery__zoom { top: .625rem; right: .625rem; width: 2.125rem; height: 2.125rem; }
  .tt-gallery__zoom svg { width: .9375rem; height: .9375rem; }
}

/* ── Pantalla completa (BiggerPicture) + tira de miniaturas ── */

.tt-gallery__lbwrap {
  --pga-ease: cubic-bezier(.22, 1, .36, 1);   /* va directo en <body>, fuera de .pga-tt */
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  flex-direction: column;
  contain: strict;
}
.tt-gallery__lbwrap.open,
.tt-gallery__lbwrap.closing { display: flex; }

.tt-gallery__lb { position: relative; flex: 1 1 auto; min-height: 0; }
.tt-gallery__lb .bp-wrap { position: absolute !important; contain: layout size; }
.tt-gallery__lb .bp-wrap > div:first-child { background: var(--idx-overlay); }   /* el fondo de la librería (negro al 75%) → azul oscuro de PGA */

.tt-gallery__thumbs {
  z-index: 1;
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 6px;
  height: 100px;
  padding: 0 12px;
  overflow-x: auto;
  scrollbar-width: none;
  background: var(--idx-overlay);
  opacity: 0;
  transition: opacity .35s var(--pga-ease);
}
.tt-gallery__thumbs::-webkit-scrollbar { display: none; }
.tt-gallery__thumbs::before,
.tt-gallery__thumbs::after { content: ""; margin: auto; }   /* centra la tira cuando son pocas */
.tt-gallery__lbwrap.open .tt-gallery__thumbs { opacity: 1; }
.tt-gallery__lbwrap.closing .tt-gallery__thumbs { opacity: 0; transition-duration: .25s; }

.tt-gallery__thumbs button {
  flex-shrink: 0;
  width: 120px;
  height: 80px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: center / cover no-repeat;
  opacity: .5;
  cursor: pointer;
  transition: opacity .2s var(--pga-ease), transform .2s var(--pga-ease);
}
.tt-gallery__thumbs button:hover,
.tt-gallery__thumbs button:focus-visible { opacity: .8; }
.tt-gallery__thumbs button.is-active { opacity: 1; transform: scale(1.06); box-shadow: 0 0 0 2px var(--idx-white); }

.bp-lock { overflow-y: clip !important; }
.bp-lock body { overflow: clip !important; }

@media (max-width: 768px) {
  .tt-gallery__thumbs { gap: 4px; height: 75px; }
  .tt-gallery__thumbs button { width: 90px; height: 60px; }
}
@media (max-height: 500px) {
  .tt-gallery__thumbs { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .tt-gallery__zoom, .tt-gallery__arrow, .tt-gallery__thumbs button { transition: none; }
}
