/* Uzupełnienia dla wersji Next.js: zastępują układ liczony wcześniej przez jQuery (cubeportfolio,
   bxSlider, Revolution Slider, parallax.js, lightGallery). Reszta wyglądu pochodzi z CSS motywu. */

/* Siatka projektów (cubeportfolio): kafle 270x260, odstęp 30 px, skalowane do szerokości kontenera */
#grid-container.cbp {
  height: auto !important;
}
#grid-container.cbp > ul {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 30px;
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (max-width: 599px) {
  #grid-container.cbp > ul {
    grid-template-columns: 1fr;
  }
}
#grid-container .cbp-item {
  position: relative !important;
  width: auto !important;
  height: auto !important;
  aspect-ratio: 270 / 260;
  opacity: 1;
  transition: opacity 0.4s ease, transform 0.4s ease;
}
#grid-container .cbp-item.next-hidden {
  display: none;
}
#grid-container .cbp-item .cbp-caption,
#grid-container .cbp-item .cbp-caption-defaultWrap {
  height: 100%;
}
#grid-container .cbp-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Slider "Revolution" na stronie głównej: jeden pełnoekranowy slajd */
.next-hero {
  position: relative;
  height: 100vh;
  min-height: 480px;
  overflow: hidden;
  background-color: #e9e9e9;
}
.next-hero .rev_slider {
  height: 100%;
}
.next-hero .tp-caption {
  visibility: visible;
}
.next-hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center top;
}
.next-hero .tp-caption {
  position: absolute;
  left: 50%;
  top: 50%;
  white-space: nowrap;
  opacity: 0;
  animation-fill-mode: forwards;
}
.next-hero .next-hero-logo {
  transform: translate(-50%, calc(-50% - 115px));
  animation: next-fade-in 0.3s ease-in-out 0s forwards;
}
.next-hero .next-hero-title {
  margin: 0;
  transform: translate(-50%, calc(-50% + 105px + 40px));
  animation: next-rise-title 0.6s cubic-bezier(0.165, 0.84, 0.44, 1) 0.9s forwards;
}
.next-hero .next-hero-button {
  transform: translate(-50%, calc(-50% + 265px + 40px));
  animation: next-rise-button 0.9s cubic-bezier(0.165, 0.84, 0.44, 1) 0.9s forwards;
}
@keyframes next-fade-in {
  to {
    opacity: 1;
  }
}
@keyframes next-rise-title {
  to {
    opacity: 1;
    transform: translate(-50%, calc(-50% + 105px));
  }
}
@keyframes next-rise-button {
  to {
    opacity: 1;
    transform: translate(-50%, calc(-50% + 265px));
  }
}
/* Revolution Slider poniżej 778 px skalował warstwy proporcjonalnie do szerokości (ok. szerokość / 680)
   i przesuwał je względem środka - wartości dopasowane do pomiarów oryginału na 320 i 375 px */
@media (max-width: 777px) {
  .next-hero .next-hero-logo {
    width: 37.35vw;
    transform: translate(-50%, calc(-50% - 7px - 15.38vw));
  }
  .next-hero .next-hero-logo img {
    width: 100%;
    height: auto;
  }
  .next-hero .next-hero-title {
    font-size: 4.8vw !important;
    letter-spacing: 0 !important;
    line-height: 6.13vw !important;
    transform: translate(-50%, calc(-50% - 7px + 17.06vw + 40px));
  }
  @keyframes next-rise-title {
    to {
      opacity: 1;
      transform: translate(-50%, calc(-50% - 7px + 17.06vw));
    }
  }
  .next-hero .next-hero-button {
    transform: translate(-50%, calc(-50% - 2px + 39.26vw + 40px));
  }
  @keyframes next-rise-button {
    to {
      opacity: 1;
      transform: translate(-50%, calc(-50% - 2px + 39.26vw));
    }
  }
}

/* Karuzela zespołu (bxSlider): kafle 170 px, odstęp 15 px, do 6 widocznych */
.next-team .bx-wrapper {
  position: relative;
  margin: 0 auto;
  padding: 0;
}
.next-team .bx-viewport {
  overflow: hidden;
  position: relative;
}
.next-team .next-team-track {
  display: flex;
  transition: transform 0.5s ease;
}
.next-team .limargin {
  flex: 0 0 auto;
  margin-right: 15px;
}
.next-team .limargin img {
  display: block;
  width: 100%;
  height: auto;
}

/* Nagłówek parallax na stronie projektu (parallax.js) */
.ws-parallax-header.next-parallax {
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}
@supports (-webkit-touch-callout: none) {
  .ws-parallax-header.next-parallax {
    background-attachment: scroll;
  }
}

/* Lightbox obrazków w treści */
.next-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1040;
  background-color: rgba(0, 0, 0, 0.9);
  opacity: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.next-lightbox-image {
  max-width: 92vw;
  max-height: 88vh;
  object-fit: contain;
}
.next-lightbox button {
  background: none;
  border: 0;
  color: #999;
  position: absolute;
}
.next-lightbox-close {
  top: 0;
  right: 0;
  font-size: 26px;
  padding: 10px 15px;
}
.next-lightbox-close::after {
  content: '\e070';
}
.next-lightbox .lg-prev,
.next-lightbox .lg-next {
  top: 50%;
  margin-top: -10px;
  font-size: 22px;
  padding: 8px 10px 9px;
  background-color: rgba(0, 0, 0, 0.45);
  border-radius: 2px;
}
.next-lightbox .lg-prev {
  left: 20px;
}
.next-lightbox .lg-next {
  right: 20px;
}
.next-lightbox .lg-prev::after {
  content: '\e094';
}
.next-lightbox .lg-next::before {
  content: '\e095';
}
.next-lightbox-counter {
  position: absolute;
  top: 0;
  left: 0;
  color: #999;
  padding: 12px 20px;
  font-size: 16px;
}
