/* Lightbox galerii */
/* LIGHTBOX */

.lightbox{
position:fixed;
top:0;
left:0;
width:100%;
height:100%;
background:rgba(0,0,0,0.9);
display:flex;
align-items:center;
justify-content:center;
opacity:0;
pointer-events:none;
transition:opacity 0.3s ease;
z-index:2000;
}

.lightbox img{
max-width:90%;
max-height:90%;
}

.lightbox.active{
opacity:1;
pointer-events:auto;
}

.lightbox-left,
.lightbox-right{
position:absolute;
top:50%;
transform:translateY(-50%);
font-size:60px;
color:white;
cursor:pointer;
user-select:none;
padding:20px;
}

.lightbox-left{
left:40px;
}

.lightbox-right{
right:40px;
}

.lightbox-close{
position:absolute;
top:20px;
right:25px;
font-size:40px;
color:#fff;
cursor:pointer;
z-index:9999;
font-family:Arial, sans-serif;
}

.lightbox-close:hover{
opacity:0.7;
}

/* Galeria realizacji */
/* Etap 5 — Realizacje */

.realizacje-redesign-section {
  padding-top: 26px !important;
  padding-bottom: 28px !important;
  background: linear-gradient(180deg, #f8fafb 0%, #f2f6f8 100%);
}

.realizacje-redesign {
  max-width: 1280px;
  margin: 0 auto;
}

.realizacje-redesign__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 14px;
}

.realizacje-redesign__heading {
  display: flex;
  align-items: center;
  gap: 10px;
}

.realizacje-redesign__heading h2 {
  margin: 0;
  font-size: 1.65rem;
  line-height: 1;
  font-weight: 700;
  color: #171717;
}

.realizacje-redesign__icon {
  width: 31px;
  height: 31px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ef1d24;
}

.realizacje-redesign__icon svg {
  width: 29px;
  height: 29px;
  fill: currentColor;
}

.realizacje-redesign__all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #ef1d24;
  font-size: 0.89rem;
  font-weight: 600;
  white-space: nowrap;
}

.realizacje-redesign__all > span {
  font-size: 1.14rem;
  line-height: 1;
}

.gallery-redesign {
  display: grid !important;
  grid-template-columns: minmax(0, 1.62fr) minmax(330px, 0.95fr) !important;
  gap: 16px !important;
  max-width: none !important;
  margin: 0 !important;
  align-items: stretch !important;
}

.gallery-stage {
  position: relative;
  min-width: 0;
  height: 510px;
  overflow: hidden;
  border-radius: 8px;
  background: #111820;
  box-shadow: 0 4px 15px rgba(17, 24, 39, 0.10);
}

.gallery-redesign .gallery-stage .main {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center center;
  display: block;
  background: #111820 !important;
  cursor: pointer;
  transition: opacity 240ms ease;
}

.gallery-stage__gradient {
  position: absolute;
  inset: auto 0 0 0;
  height: 40%;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(5, 10, 16, 0) 0%,
    rgba(5, 10, 16, 0.28) 34%,
    rgba(5, 10, 16, 0.88) 100%
  );
}

.gallery-stage__caption {
  position: absolute;
  left: 22px;
  right: 145px;
  bottom: 28px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 3px;
  color: #ffffff;
  pointer-events: none;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

.gallery-caption-title {
  font-size: 1.12rem;
  line-height: 1.15;
  font-weight: 700;
}

.gallery-caption-subtitle {
  font-size: 0.82rem;
  line-height: 1.3;
  opacity: 0.92;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  z-index: 4;
  width: 46px;
  height: 46px;
  margin: 0;
  padding: 0 0 3px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: rgba(26, 39, 52, 0.78);
  color: #ffffff;
  font-family: Arial, sans-serif;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background 0.18s ease, transform 0.18s ease;
}

.gallery-nav:hover {
  background: rgba(17, 28, 39, 0.94);
}

.gallery-prev {
  left: 18px;
}

.gallery-next {
  right: 18px;
}

.gallery-stage__status {
  position: absolute;
  right: 17px;
  bottom: 17px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 11px;
  color: #ffffff;
}

.gallery-counter {
  font-size: 0.86rem;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
}

.gallery-toggle {
  width: 35px;
  height: 35px;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.88);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(17, 28, 39, 0.62);
  color: #ffffff;
  cursor: pointer;
  font-family: Arial, sans-serif;
  font-size: 0.94rem;
  line-height: 1;
}

.gallery-toggle-play {
  display: none;
  font-size: 0.72rem;
  margin-left: 2px;
}

.gallery-toggle.is-paused .gallery-toggle-pause {
  display: none;
}

.gallery-toggle.is-paused .gallery-toggle-play {
  display: inline;
}

.gallery-progress {
  position: absolute;
  left: 22px;
  right: 92px;
  bottom: 10px;
  z-index: 4;
  display: flex;
  gap: 6px;
  pointer-events: none;
}

.gallery-progress__item {
  height: 3px;
  flex: 1 1 0;
  overflow: hidden;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.35);
}

.gallery-progress__item::after {
  content: "";
  display: block;
  width: 0;
  height: 100%;
  background: #ef1d24;
  transition: width 0.22s ease;
}

.gallery-progress__item.is-active::after {
  width: 100%;
}

.gallery-redesign .thumbs {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-template-rows: repeat(4, minmax(0, 1fr)) !important;
  grid-auto-rows: calc((100% - 24px) / 4) !important;
  gap: 8px !important;
  width: auto !important;
  height: 510px !important;
  min-height: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  align-content: start !important;
  align-self: stretch !important;
  scrollbar-width: thin;
  scrollbar-color: rgba(95, 105, 115, 0.42) transparent;
  scroll-behavior: smooth;
}


.gallery-redesign .thumbs::-webkit-scrollbar {
  width: 6px;
}

.gallery-redesign .thumbs::-webkit-scrollbar-track {
  background: transparent;
}

.gallery-redesign .thumbs::-webkit-scrollbar-thumb {
  background: rgba(95, 105, 115, 0.38);
  border-radius: 20px;
}

.gallery-redesign .thumbs::-webkit-scrollbar-thumb:hover {
  background: rgba(95, 105, 115, 0.58);
}

.gallery-redesign .thumbs img {
  width: 100% !important;
  height: 100% !important;
  min-height: 0;
  object-fit: cover;
  border-radius: 7px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color 0.18s ease, opacity 0.18s ease, transform 0.18s ease;
}

.gallery-redesign .thumbs img:hover {
  opacity: 0.92;
}

.gallery-redesign .thumbs img.active {
  border-color: #ef1d24;
}



/* Zdjęcia pionowe — pełny kadr + rozmyte tło po bokach */
.gallery-stage::before {
  content: "";
  position: absolute;
  inset: -18px;
  z-index: 0;
  opacity: 0;
  pointer-events: none;
  background-image: var(--gallery-blur-image);
  background-position: center;
  background-size: cover;
  filter: blur(22px) saturate(0.92) brightness(0.72);
  transform: scale(1.08);
  transition: opacity 220ms ease;
}

.gallery-stage.is-portrait::before {
  opacity: 1;
}

.gallery-redesign .gallery-stage .main {
  position: relative;
  z-index: 1;
}

.gallery-stage.is-portrait .main {
  object-fit: contain !important;
  object-position: center center !important;
  background: transparent !important;
}

.gallery-stage.is-landscape .main {
  object-fit: cover !important;
}

/* Warstwy interfejsu muszą pozostać nad rozmytym tłem i zdjęciem */
.gallery-stage__gradient,
.gallery-stage__caption,
.gallery-nav,
.gallery-stage__status,
.gallery-progress {
  z-index: 4;
}

html.theme-dark .realizacje-redesign-section {
  background: linear-gradient(180deg, #11161b 0%, #141a20 100%);
}

html.theme-dark .realizacje-redesign__heading h2 {
  color: #f5f7fa;
}

html.theme-dark .gallery-stage {
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.3);
}

html.theme-dark .gallery-redesign .thumbs img {
  background: #171d23;
}

@media (max-width: 1000px) {
  .gallery-redesign {
    grid-template-columns: minmax(0, 1fr) 280px !important;
  }

  .gallery-stage,
  .gallery-redesign .thumbs {
    height: 460px !important;
  }

  .gallery-redesign .thumbs {
    grid-auto-rows: calc((100% - 24px) / 4) !important;
  }
}

@media (max-width: 820px) {
  .realizacje-redesign__all {
    display: none;
  }

  .gallery-redesign {
    display: block !important;
  }

  .gallery-stage {
    height: clamp(360px, 68vw, 500px) !important;
  }

  .gallery-redesign .thumbs {
    margin-top: 10px;
    display: grid !important;
    grid-auto-flow: column;
    grid-auto-columns: 150px;
    grid-auto-rows: 92px !important;
    grid-template-columns: none !important;
    grid-template-rows: 92px !important;
    gap: 8px !important;
    width: 100% !important;
    height: 92px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scrollbar-width: none;
  }

  .gallery-redesign .thumbs::-webkit-scrollbar {
    display: none;
  }

  .gallery-stage__caption {
    right: 95px;
  }

  .gallery-nav {
    width: 42px;
    height: 42px;
  }
}

@media (max-width: 560px) {
  .realizacje-redesign-section {
    padding-top: 23px !important;
    padding-bottom: 24px !important;
  }

  .realizacje-redesign__heading h2 {
    font-size: 1.47rem;
  }

  .gallery-stage {
    height: 420px !important;
    border-radius: 7px;
  }

  .gallery-stage__caption {
    left: 15px;
    right: 80px;
    bottom: 24px;
  }

  .gallery-caption-title {
    font-size: 0.98rem;
  }

  .gallery-caption-subtitle {
    font-size: 0.75rem;
  }

  .gallery-prev {
    left: 10px;
  }

  .gallery-next {
    right: 10px;
  }

  .gallery-nav {
    width: 38px;
    height: 38px;
    font-size: 1.7rem;
  }

  .gallery-stage__status {
    right: 11px;
    bottom: 12px;
  }

  .gallery-counter {
    display: none;
  }

  .gallery-toggle {
    width: 32px;
    height: 32px;
  }

  .gallery-progress {
    left: 15px;
    right: 55px;
    bottom: 8px;
    gap: 4px;
  }

  .gallery-redesign .thumbs {
    grid-auto-columns: 126px;
    grid-template-rows: 78px !important;
    height: 78px !important;
  }
}


/* Poprawka: opisy zdjęć wyśrodkowane w oknie galerii */
.gallery-stage__caption {
  left: 50% !important;
  right: auto !important;
  width: calc(100% - 220px) !important;
  transform: translateX(-50%) !important;
  align-items: center !important;
  text-align: center !important;
}

@media (max-width: 820px) {
  .gallery-stage__caption {
    left: 50% !important;
    right: auto !important;
    width: calc(100% - 150px) !important;
    transform: translateX(-50%) !important;
    align-items: center !important;
    text-align: center !important;
  }
}

@media (max-width: 560px) {
  .gallery-stage__caption {
    left: 50% !important;
    right: auto !important;
    width: calc(100% - 96px) !important;
    transform: translateX(-50%) !important;
    align-items: center !important;
    text-align: center !important;
  }
}

/* =========================================================
   Podstrony usług — zachowanie naturalnych proporcji zdjęć
   2026-09-26
   ========================================================= */
body.service-page .gallery-redesign .gallery-stage .main,
body.service-page .gallery-stage.is-portrait .main,
body.service-page .gallery-stage.is-landscape .main {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  object-position: center center !important;
}

body.service-page .lightbox img {
  width: auto !important;
  height: auto !important;
  max-width: 90vw !important;
  max-height: 90vh !important;
  object-fit: contain !important;
}
