/* Siatka kart — 3/2/1 kol. oraz limit 6 kafelków na desktopie po stronie JS */
#portfolio .produkcje .sekcja{
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr)); /* desktop: 3 kolumny */
  gap: 30px 10px;              /* odstępy jak na makiecie */
  align-content: start;
  justify-items: center;
}

/* mniejszy laptop – nadal 3 kolumny */
@media (max-width: 1399px){
  #portfolio .produkcje .sekcja{ grid-template-columns: repeat(3, minmax(220px, 1fr)); }
}

/* tablet – 2 kolumny */
@media (max-width: 991px){
  #portfolio .produkcje .sekcja{ grid-template-columns: repeat(2, minmax(200px, 1fr)); }
}

/* mobile – 1 kolumna */
@media (max-width: 575px){
  #portfolio .produkcje .sekcja{ grid-template-columns: 1fr; }
}

/* Pojedyncza karta */
#portfolio .karta{
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  user-select: none;
}

/* Okrągła miniatura (z żółtym overlayem i efektem hover) */
#portfolio .thumbnail{
  width: 220px;
  height: 220px;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  background-color: #000;     /* tło zabezpieczające */
}

#portfolio .thumbnail.img{
  background-position: center;
  background-size: 250%;
  background-repeat: no-repeat;
  /* żółte zabarwienie */
  background-color: var(--gray);
  background-blend-mode: multiply;
  transition: transform .35s ease, background-color .35s ease, opacity .35s ease;
}

#portfolio .karta:hover .thumbnail.img{
  background-color: transparent;   /* zdejmij żółty filtr na hover */
  transform: scale(1.03);
}

/* Podpisy pod miniaturą */
#portfolio .filmdata{ margin-top: 17px; }
#portfolio .filmname{
  color: #fff;
  margin: 0;
  font-weight: 300;
  text-transform: uppercase;
  font-size: clamp(14px, 2.2vw, 22px);
}
#portfolio .owner{
  color: #fff;
  margin: .25rem 0 0;
  font-weight: 600;
  font-size: clamp(12px, 1.8vw, 16px);
}

/* (opcjonalnie) stan „ładowania” miniatury */
#portfolio .karta.is-loading .thumbnail.img{
  filter: grayscale(100%) brightness(0.6);
  pointer-events: none;
}

/* ====== OVERLAY Z PLAYEREM VIMEO ====== */

/* Niezależny overlay, żeby nie kolidować z innymi skryptami */
#vimeoOverlay{
  display: none;              /* pokaz/ukryj w JS */
  position: fixed;
  inset: 0;
  background: #1d1d1b;
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

/* Kontener na player — TO określa rozmiar, iframe zawsze 100% */
#vimeoFrame{
  width: min(90vw, 1100px);
  height: min(80vh, 620px);
  background-color: var(--grayed) !important;
  position: relative;
  overflow: hidden;
  border-radius: 8px;
}

/* Iframe ma dokładnie rozmiar rodzica */
#vimeoFrame iframe{
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    border: 0;
    display: block;
    background-color: var(--grayed);
}

/* Przycisk zamknięcia */
#vimeoClose{
    position: absolute;
    top: -50px;
    transform: translateX(-50%);
    color: #fff;
    font-size: 38px;
    background: none;
    border: 0;
    cursor: pointer;
    z-index: 1001;
}

#vimeoClose:hover{ opacity: .85; }

/* ====== EMBED W LISTACH (jeśli kiedyś pokażesz mini-player) ====== */
#portfolio .embed{
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;         /* lub ustaw height: Xpx – parent nadaje rozmiar */
  background-color: var(--grayed);
  overflow: hidden;
}
#portfolio .embed iframe{
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  border: 0;
  display: block;
  background-color: var(--grayed);
}

#portfolio .embed body{
  background-color: var(--grayed);
}


#prevPage, #nextPage {
    display: flex; align-items: center; padding: 8px 16px; background: none; color: var(--white); border: none; cursor: pointer; 
}

#prevVideo,  #nextVideo {
    background: none; color: var(--white); border: none; cursor: pointer; 
}

#prevPage span, #nextPage span {
    margin: 0px 3px;
}

#pageInfo {
    color: var(--white); width: 100px; text-align: center;
}

#videoNavigation {
  display: flex;
  margin-top: 20px;
  width: 100%;
  justify-content: center;
  padding: 10px 0;
}

@media (max-width: 991px){ 
  #prevPage, #nextPage, #prevVideo,  #nextVideo {
    font-size: 18px;
  }

  #pageInfo { 
    font-size: 13px; 
  }

  #videoInfo {
    text-align: center;
    position: absolute;
    bottom: -75px;
  }

  #videoNavigation {
    position: absolute;
    bottom: -150px;
  }

  #vimeoClose{
    left: 100%;
  }
}

@media (min-width: 992px){ 
  #prevPage, #nextPage, #prevVideo,  #nextVideo {
    font-size: 25px;
  }
  #pageInfo { 
    font-size: 18px; 
    padding-top: 4px;
  }

  #videoInfo {
    position: absolute;
    bottom: 0;
    left: 5vw;
    z-index: 1001;
  }
  #vimeoClose{
    right: 2vw;
  }
}

@media (max-height: 992px){ 
  .produkcje {
    transform: scale(.9);
  }
}

    