/* Galería de la plantilla clásica (partials/clients_public_page_gallery.html). */
.pub-gal-tile {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: #eef1f4;
  overflow: hidden;
  cursor: zoom-in;
}
.pub-gal-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s ease;
}
.pub-gal-tile:hover img { transform: scale(1.03); }
.pub-gal-tile:focus-visible { outline: 3px solid var(--brand); outline-offset: -3px; }

/* Escritorio: la primera foto grande; el resto se reparte según cuántas haya. */
.pub-gal-mosaic {
  position: relative;
  height: 420px;
  gap: 6px;
  border-radius: 14px;
  overflow: hidden;
}
.pub-gal-mosaic-1 { grid-template-columns: 1fr; }
.pub-gal-mosaic-2 { grid-template-columns: 2fr 1fr; }
.pub-gal-mosaic-3 { grid-template-columns: 2fr 1fr; grid-template-rows: repeat(2, 1fr); }
.pub-gal-mosaic-4 { grid-template-columns: 2fr 1fr; grid-template-rows: repeat(3, 1fr); }
.pub-gal-mosaic-5 { grid-template-columns: 2fr 1fr 1fr; grid-template-rows: repeat(2, 1fr); }
.pub-gal-mosaic > .pub-gal-tile:first-child { grid-row: 1 / -1; }
.pub-gal-all {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #2d3748;
  font-size: .85rem;
  font-weight: 500;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
}
.pub-gal-all:hover { color: var(--brand); }

/* Teléfono: carrusel con contador. */
.pub-gal-swiper {
  height: 280px;
  border-radius: 12px;
  overflow: hidden;
  background: #eef1f4;
}
.pub-gal-swiper .swiper-slide { position: relative; height: 100%; }
.pub-gal-caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 1.25rem 1rem .6rem;
  color: #fff;
  font-size: .85rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, .55));
  pointer-events: none;
}
.pub-gal-swiper .pub-gal-counter {
  left: auto;
  right: 10px;
  bottom: 10px;
  top: auto;
  width: auto;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-size: .8rem;
}

/* Galería ampliada. */
.pub-gal-modal .modal-content {
  background: #14121a;
  color: #fff;
  border: 0;
  padding: 12px 12px 16px;
}
.pub-gal-modal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 10px;
  font-size: .9rem;
}
.pub-gal-modal-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pub-gal-modal-close:hover { background: rgba(255, 255, 255, .22); }
.pub-gal-modal-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: min(70vh, 640px);
}
.pub-gal-modal-stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
}
.pub-gal-modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .9);
  color: #2d3748;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pub-gal-modal-nav.prev { left: 8px; }
.pub-gal-modal-nav.next { right: 8px; }
.pub-gal-modal-caption {
  min-height: 1.2em;
  margin: 10px 4px 0;
  font-size: .9rem;
  text-align: center;
  color: rgba(255, 255, 255, .85);
}
.pub-gal-modal-thumbs {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.pub-gal-thumb {
  width: 64px;
  height: 48px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 6px;
  overflow: hidden;
  background: #2a2733;
  opacity: .55;
}
.pub-gal-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pub-gal-thumb.active { opacity: 1; border-color: #fff; }
@media (max-width: 767.98px) {
  .pub-gal-modal .modal-dialog { margin: 0; max-width: none; height: 100%; }
  .pub-gal-modal .modal-content { height: 100%; border-radius: 0; justify-content: center; }
  .pub-gal-modal-stage { height: 62vh; }
  .pub-gal-modal-nav { width: 36px; height: 36px; }
  .pub-gal-thumb { width: 48px; height: 36px; }
}
