/* ── GALERIA ───────────────────────────────────────────── */
.galeria-hero {
  background-image:
    linear-gradient(rgba(15, 23, 42, 0.22), rgba(15, 23, 42, 0.65)),
    url("../assets/parella-13.jpg");

  background-position: center 10%;
}

.galeria-section {
  max-width: 1380px;
  margin: 0 auto;
  padding: 80px 5vw 100px;
}

.galeria-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 40px;
  gap: 16px;
  flex-wrap: wrap;
}

.galeria-header div {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.galeria-header p {
  margin: 0;
  color: #8a8175;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.82rem;
}

.galeria-header h2 {
  margin: 0;
  color: var(--accent);
  font-size: clamp(2.2rem, 4vw, 4.5rem);
  line-height: 1;
}

.galeria-link-album {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border: 1.5px solid var(--accent);
  border-radius: 8px;
  background: transparent;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.88rem;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s, transform 0.2s;
}

.galeria-link-album.disabled{
  /* pointer-events: none; */
  opacity: .5;
  cursor: not-allowed;
}

.galeria-link-album:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-2px);
}

/* ── MASONRY GRID ─────────────────────────────────────── */
.galeria-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 240px;
  gap: 10px;
}

.galeria-item {
  overflow: hidden;
  border-radius: 8px;
  cursor: pointer;
  background: #e2ddd7;
  position: relative;
}

.galeria-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.3s ease;
  opacity: 0;
}

.galeria-item img.loaded {
  opacity: 1;
}

.galeria-item:hover img {
  transform: scale(1.06);
}

.galeria-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.32) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.galeria-item:hover::after {
  opacity: 1;
}

/* Mides variades */
.galeria-item.ample {
  grid-column: span 2;
}

.galeria-item.alt {
  grid-row: span 2;
}

.galeria-item.gran {
  grid-column: span 2;
  grid-row: span 2;
}

/* ── SKELETON LOADING ─────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, #e8e4de 25%, #f0ede8 50%, #e8e4de 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* ── LIGHTBOX ─────────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 14, 24, 0.93);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.lightbox.actiu {
  opacity: 1;
  pointer-events: all;
}

.lightbox-img-wrap {
  position: relative;
  max-width: 92vw;
  max-height: 90vh;
}

.lightbox img {
  display: block;
  max-width: 92vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.7);
}

.lightbox-tancar {
  position: fixed;
  top: 24px;
  right: 28px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  transition: background 0.2s;
}

.lightbox-tancar:hover {
  background: rgba(255, 255, 255, 0.22);
}

.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: #fff;
  font-size: 1.3rem;
  cursor: pointer;
  transition: background 0.2s;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.22);
}

.lightbox-prev {
  left: 20px;
}

.lightbox-next {
  right: 20px;
}

.lightbox-counter {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

/* ── ESTAT BUIT / ERROR ───────────────────────────────── */
.galeria-estat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  text-align: center;
  color: #8a8175;
  gap: 14px;
}

.galeria-estat svg {
  opacity: 0.35;
}

.galeria-estat p {
  margin: 0;
  font-size: 1.05rem;
}

.galeria-estat a {
  color: var(--accent);
  font-weight: 700;
}

/* ── RESPONSIVE ───────────────────────────────────────── */
@media (max-width: 960px) {
  .galeria-grid {
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 200px;
  }
}

@media (max-width: 640px) {
  .galeria-section {
    padding: 56px 16px 72px;
  }

  .galeria-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .galeria-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 160px;
    gap: 7px;
  }

  .galeria-item.gran {
    grid-column: span 2;
    grid-row: span 1;
  }

  .galeria-item.ample {
    grid-column: span 2;
  }

  .galeria-item.alt {
    grid-row: span 2;
  }
}