/* ====== GALLERY (Masonry Layout + GLightbox) ====== */
.masonry {
  column-count: 3;
  column-gap: 1rem;
  padding: 2rem;
}

@media (max-width: 768px) {
  .masonry {
    column-count: 1;
  }
}

.masonry-item {
  break-inside: avoid;
  margin-bottom: 1rem;
  border-radius: 12px;
  overflow: hidden;
  display: block;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.masonry-item img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  -webkit-user-drag: none;
  user-select: none;
  transition: transform 0.3s ease;
}

.masonry-item img:hover {
  transform: scale(1.02);
}

/* ====== LIGHTBOX STYLING ====== */

/* Flechas visibles en escritorio */
@media (min-width: 769px) {
  .glightbox-clean .gprev,
  .glightbox-clean .gnext {
    opacity: 1 !important;
    color: white !important;
    font-size: 35px;
    top: 50%;
    transform: translateY(-50%);
  }

  .glightbox-clean .gprev {
    left: 15px;
  }

  .glightbox-clean .gnext {
    right: 15px;
  }
}

/* Flechas invisibles pero funcionales en móvil */
@media (max-width: 768px) {
  .glightbox-clean .gprev,
  .glightbox-clean .gnext {
    opacity: 0 !important;
    pointer-events: auto;
  }

  .glightbox-container .gslide-media {
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    touch-action: none;
  }

  .glightbox-container .gslide-image img {
    max-width: 100%;
    max-height: 100vh;
    width: auto;
    height: auto;
    object-fit: contain;
    touch-action: pinch-zoom;
    -ms-touch-action: pinch-zoom;
    -webkit-user-drag: none;
    user-select: none;
    transform-origin: center center;
    transition: transform 0.3s ease;
  }
}

/* Botón de cerrar */
.glightbox-clean .gclose {
  top: 20px;
  right: 20px;
  font-size: 28px;
  color: white;
  opacity: 1;
}

/* Fondo del lightbox oscuro */
.glightbox-container {
  background-color: rgba(0, 0, 0, 0.95) !important;
}

/* ====== CREDITOS ====== */
.credit {
  text-align: center;
  margin-top: 2em;
  color: #fffbf5;
}

/* ====== RESPONSIVE MÓVIL ====== */
@media (max-width: 576px) {
  .navbar-brand {
    font-size: 1.4em;
  }
  .profile-box {
    padding: 0.8em;
    margin-bottom: 1rem;
    margin-top: 1rem;
  }
  .profile-box p,
  .char-card a {
    font-size: 1em;
    margin-bottom: 0.4em;
    line-height: 1.3;
  }
  .profile-box p.description {
    font-size: 1.2em;
    line-height: 1.4;
    margin-bottom: 0.4em;
  }
  .social-icons {
    margin-top: 0.5em;
    margin-bottom: 0.3em;
  }
  .social-icons a {
    font-size: 1.5em;
    margin: 0 0.3em;
  }
  .char-card {
    margin-top: 0.3em;
    margin-bottom: 0.3em;
  }
  .navbar-nav .nav-link {
    margin: 0.2em 0;
    font-size: 1em;
  }
  .char-link em {
    font-size: 1.3em;
  }
}

/* ====== RESPONSIVE DESKTOP ====== */
@media (min-width: 577px) {
  .main-header {
    margin-bottom: 2.5rem;
  }
}
