/*
  Organized (no functional changes) on 2026-01-08
  - Merged consecutive duplicate selectors
  - Removed exact duplicate declarations
*/

/* HERO */
.hero {
  width: 100%;
  min-height: 320px;
  padding: 4rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(rgba(115 110 110 / 66%), rgba(244 178 74 / 67%)),
    url("/assets/images/gallery/gallery_wrapper.webp");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  color: white;
  text-shadow: 0 2px 8px rgba(0,0,0,.35);
}

.hero p {
  margin: 0 0 18px;
  opacity: .86;
  color: white;
  text-shadow: 0 2px 8px rgba(0,0,0,.35);
}

.hero > * {
  position: relative;
  z-index: 2;
}

/* Galería */
.gallery-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 12px;
}

.gallery-item {
  grid-column: span 4;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.72);
  box-shadow: var(--shadow);
  position: relative;
}

.gallery-item img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  display: block;
  transform: scale(1);
  transition: transform .25s ease, filter .25s ease;
}

@media (max-width: 980px) {
  .gallery-item {
    grid-column: span 6;
  }
}

@media (max-width: 640px) {
  .gallery-item {
    grid-column: span 12;
  }
}

/* Pagination */
.pagination {
  margin: 18px 0 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.page-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.78);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
}

.page-link:hover {
  transform: translateY(-1px);
}

.page-link.is-disabled {
  opacity: .55;
  pointer-events: none;
}

.page-info {
  color: var(--muted);
  font-size: .95rem;
}

/* Items: only pictures + hover */
.gallery-btn {
  display: block;
  width: 100%;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.gallery-btn:focus-visible {
  outline: 3px solid rgba(0,0,0,.25);
  outline-offset: 3px;
  border-radius: 18px;
}

.gallery-item:hover img,
.gallery-btn:focus-visible img {
  transform: scale(1.05);
  filter: contrast(1.02);
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
}

.lightbox.is-open {
  display: block;
}

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.78);
}

.lightbox__dialog {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.lightbox__figure {
  margin: 0;
  max-width: min(1100px, 96vw);
  max-height: 86vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox__img {
  max-width: 100%;
  max-height: 86vh;
  width: auto;
  height: auto;
  border-radius: 16px;
  box-shadow: 0 18px 60px rgba(0,0,0,.45);
  background: rgba(255,255,255,.04);
}

.lightbox__close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(0,0,0,.25);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(0,0,0,.25);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox__nav--prev {
  left: 14px;
}

.lightbox__nav--next {
  right: 14px;
}

@media (max-width: 768px) {
  .gallery-item img {
    height: 190px;
  }

  .lightbox__nav {
    display: none;
  }
}
