@import url("bungalows.css");

/* ==========================================================================
   ALBUM GALLERY STYLES
   ========================================================================== */

.album-section {
  padding: 80px 40px;
  background-color: var(--bg-cream);
  min-height: 80vh;
}

.album-header {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 40px auto;
}

.album-subtitle {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-green-light);
  letter-spacing: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 15px;
}

.album-title {
  font-family: var(--font-serif);
  font-size: 2.8rem;
  color: var(--color-green);
  line-height: 1.2;
  font-weight: 700;
  margin-bottom: 15px;
}

.album-desc {
  color: var(--color-text-light);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

.album-header-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-top: 25px;
}

.album-header-divider .divider-line {
  width: 50px;
  height: 1px;
  background-color: var(--color-rust);
  opacity: 0.4;
}

.album-header-divider .divider-leaf {
  font-size: 1rem;
  color: var(--color-rust);
  opacity: 0.8;
}

/* Contenedor de Paginación */
.pagination-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 50px;
  flex-wrap: wrap;
}

#pagination-container-top {
  margin-top: 0;
  margin-bottom: 40px;
}

.pagination-btn {
  background-color: white;
  border: 1px solid rgba(30, 70, 32, 0.15);
  color: var(--color-green);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 10px 20px;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pagination-btn:hover:not(:disabled) {
  background-color: var(--color-green);
  color: white;
  border-color: var(--color-green);
  transform: translateY(-1.5px);
  box-shadow: 0 4px 10px rgba(30, 70, 32, 0.15);
}

.pagination-btn.active {
  background-color: var(--color-rust);
  color: white;
  border-color: var(--color-rust);
  box-shadow: 0 4px 12px rgba(138, 79, 42, 0.25);
}

.pagination-btn:disabled {
  background-color: #eae7df;
  border-color: rgba(30, 70, 32, 0.08);
  color: var(--color-text-light);
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.page-num-btn {
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 50%;
}

.prev-btn, .next-btn {
  padding: 10px 22px;
  border-radius: 30px;
}

/* Grilla de la Galería */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 30px;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 20px;
}

.gallery-item {
  position: relative;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(45, 43, 39, 0.05);
  aspect-ratio: 4/3;
  cursor: pointer;
  background-color: #eae7df;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              box-shadow 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Animación de entrada al filtrar */
.gallery-item.show {
  animation: item-scale-in 0.45s ease forwards;
  display: block;
}

.gallery-item.hide {
  display: none;
}

@keyframes item-scale-in {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.gallery-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 25px rgba(45, 43, 39, 0.12);
}

.gallery-img-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
}

.gallery-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.gallery-item:hover .gallery-img-wrapper img {
  transform: scale(1.05);
}

/* Overlay de la tarjeta */
.gallery-overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(30, 70, 32, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.4s ease;
  color: white;
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
}

.zoom-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  transition: background-color 0.3s ease, transform 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.gallery-item:hover .zoom-icon {
  transform: scale(1.15);
}

/* ==========================================================================
   LIGHTBOX MODAL
   ========================================================================== */

.lightbox {
  position: fixed;
  inset: 0;
  background-color: rgba(18, 17, 16, 0.98);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  user-select: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lightbox.active {
  display: flex;
  opacity: 1;
}

.lightbox-close {
  position: absolute;
  top: 30px;
  right: 30px;
  color: white;
  font-size: 2.5rem;
  font-weight: 300;
  cursor: pointer;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease, color 0.3s ease;
  z-index: 2010;
}

.lightbox-close:hover {
  transform: rotate(90deg);
  color: var(--color-rust);
}

.lightbox-download {
  position: absolute;
  top: 35px;
  right: 90px;
  color: white;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease, color 0.3s ease;
  z-index: 2010;
  text-decoration: none;
}

.lightbox-download svg {
  width: 22px;
  height: 22px;
}

.lightbox-download:hover {
  transform: scale(1.1);
  color: var(--color-rust);
}

.lightbox-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 90vw;
  max-height: 80vh;
  position: relative;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 70vh;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  object-fit: contain;
  display: block;
}

.lightbox-caption {
  width: 100%;
  color: white;
  margin-top: 20px;
  text-align: center;
  padding: 0 10px;
}

.lightbox-caption h3 {
  display: none !important;
}

.lightbox-caption p {
  display: none !important;
}

#lightbox-counter {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--color-rust);
  font-weight: 700;
  letter-spacing: 1px;
}

/* Botones de navegación */
.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 1.8rem;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 2005;
}

.lightbox-prev {
  left: 40px;
}

.lightbox-next {
  right: 40px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
  background-color: var(--color-rust);
  border-color: var(--color-rust);
  transform: translateY(-50%) scale(1.08);
}

/* Responsividad de Galería y Lightbox */
@media (max-width: 992px) {
  .lightbox-prev {
    left: 20px;
  }
  .lightbox-next {
    right: 20px;
  }
  .lightbox-prev,
  .lightbox-next {
    width: 50px;
    height: 50px;
    font-size: 1.4rem;
  }
}

@media (max-width: 768px) {
  .lightbox-close {
    top: 15px;
    right: 15px;
    font-size: 2rem;
    width: 40px;
    height: 40px;
  }
  .lightbox-download {
    top: 15px;
    right: 65px;
    width: 40px;
    height: 40px;
  }
  .album-section {
    padding: 60px 20px;
  }
  .album-title {
    font-size: 2.2rem;
  }
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 0;
  }
  .lightbox-prev,
  .lightbox-next {
    position: fixed;
    top: auto;
    bottom: 20px;
    transform: none;
  }
  .lightbox-prev {
    left: 30%;
  }
  .lightbox-next {
    right: 30%;
  }
  .lightbox-prev:hover,
  .lightbox-next:hover {
    transform: scale(1.05);
  }
  .lightbox-content {
    max-height: 75vh;
  }
  .lightbox-caption {
    margin-top: 15px;
  }
}

@media (max-width: 480px) {
  .pagination-container {
    gap: 6px;
  }
  .pagination-btn {
    padding: 8px 14px;
    font-size: 0.8rem;
  }
  .page-num-btn {
    width: 36px;
    height: 36px;
    padding: 0;
  }
  .lightbox-prev {
    left: 20%;
  }
  .lightbox-next {
    right: 20%;
  }
}
