.gal-section {
  background: white;
  color: var(--color-neutral-900);
  padding: clamp(48px, 7vw, 84px) clamp(20px, 5vw, 72px);
  overflow-x: clip;
}

.gal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.gal-title-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gal-line {
  display: inline-block;
  width: 28px;
  height: 2px;
  background: var(--color-neutral-500);
}

.gal-subtitle {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-neutral-500);
}

.gal-link {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-neutral-600);
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.gal-link i {
  color: var(--color-accent-600);
}

/* --- UKŁAD KARUZELI --- */
.gal-container {
  display: flex;
  flex-direction: column;
}

.gal-row {
  width: 100%;
  overflow: hidden;
  margin-bottom: 14px;
}

.gal-track {
  display: flex;
  flex-wrap: nowrap;
  width: max-content;
  animation: galScroll linear infinite;
}

.gal-row:hover .gal-track {
  animation-play-state: paused;
}

@keyframes galScroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.gal-t1 { animation-duration: 90s; }
.gal-t2 { animation-duration: 180s; animation-direction: reverse; }
.gal-t3 { animation-duration: 250s; }

.gal-fig {
  display: block;
  flex: 0 0 auto;
  position: relative;
  overflow: hidden;
  margin: 0 14px 0 0;
  height: clamp(120px, 16vw, 200px);
  cursor: zoom-in;
  text-decoration: none;
}

.gal-fig figure.image {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  max-width: none;
}

.gal-fig img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  max-width: none;
  transform-origin: center center; /* Wymuszenie środka jako punktu skali */
  transition: transform 0.4s ease;
}

.gal-fig:hover img {
  transform: scale(1.04) rotate(3deg);
}

/* Rząd 1 */
.gal-fig.gal-w-a1 { width: min(260px, 80px + 16vw); }
.gal-fig.gal-w-a2 { width: min(186px, 80px + 12vw); }
.gal-fig.gal-w-a3 { width: min(322px, 80px + 20vw); }
.gal-fig.gal-w-a4 { width: min(384px, 80px + 24vw); }
.gal-fig.gal-w-a5 { width: min(285px, 80px + 18vw); }

/* Rząd 2 */
.gal-fig.gal-w-b1 { width: min(298px, 80px + 19vw); }
.gal-fig.gal-w-b2 { width: min(372px, 80px + 24vw); }
.gal-fig.gal-w-b3 { width: min(434px, 80px + 27vw); }
.gal-fig.gal-w-b4 { width: min(322px, 80px + 20vw); }
.gal-fig.gal-w-b5 { width: min(236px, 80px + 15vw); }

/* Rząd 3 */
.gal-fig.gal-w-c1 { width: min(211px, 80px + 13vw); }
.gal-fig.gal-w-c2 { width: min(285px, 80px + 18vw); }
.gal-fig.gal-w-c3 { width: min(347px, 80px + 22vw); }
.gal-fig.gal-w-c4 { width: min(310px, 80px + 19vw); }
.gal-fig.gal-w-c5 { width: min(236px, 80px + 15vw); }
.gal-fig.gal-w-c6 { width: min(198px, 80px + 12vw); }


@keyframes lbFade { 
  from { opacity: 0; } 
  to { opacity: 1; } 
}

@keyframes lbZoom { 
  from { transform: scale(0.62); opacity: 0; filter: blur(6px); } 
  to { transform: scale(1); opacity: 1; filter: blur(0); } 
}

.lightbox { 
  position: fixed; 
  inset: 0; 
  z-index: 9999; 
  background: rgba(22, 24, 38, 0.88); 
  backdrop-filter: blur(8px); 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  padding: clamp(16px, 4vw, 48px); 
  cursor: zoom-out; 
  animation: lbFade 0.25s ease; 
}

.lightbox img { 
  max-width: 100%; 
  max-height: 100%; 
  object-fit: contain; 
  animation: lbZoom 0.45s cubic-bezier(0.22, 1, 0.36, 1); 
  box-shadow: 0 16px 40px rgba(0,0,0,0.65);
}

.lightbox-close { 
  position: absolute; 
  top: 18px; 
  right: 18px; 
  width: 44px; 
  height: 44px; 
  border-radius: 50%; 
  border: 1px solid #75798c; 
  background: rgba(22, 24, 38, 0.7); 
  color: white; 
  font-size: 20px; 
  cursor: pointer; 
  display: inline-flex; 
  align-items: center; 
  justify-content: center; 
  transition: border-color 0.2s ease, color 0.2s ease;
}

.lightbox-close:hover { 
  border-color: #9184d9; 
  color: #9184d9; 
}