/* Modern folio gallery — Swiper + GLightbox.
   Layout note: in portfolio pages, #project h3 is position:fixed (top:50px, height:50px),
   so .folio-gallery must start 50px below the page header so the swiper visually sits
   under the h3 (by Y position, not z-index). */

#project { overflow: visible; }
#project .folio-gallery { padding-top: 50px; }

.folio-gallery {
  width: 100%;
  height: calc(100vh - 100px);
  box-sizing: border-box;
  padding: 16px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #111;
}

/* When used inside non-#project sections (e.g. case study bottom) it just flows normally. */
#caseProject .folio-gallery,
.casestudy .folio-gallery {
  height: auto;
  padding: 32px 16px 48px;
}

.folio-main {
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  background: #111;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

#caseProject .folio-main,
.casestudy .folio-main {
  height: min(72vh, 820px);
  flex: 0 0 auto;
}

.folio-main .swiper-slide {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #111;
}

.folio-main .swiper-slide a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  text-decoration: none;
}

.folio-main .swiper-slide img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  cursor: zoom-in;
  user-select: none;
  -webkit-user-drag: none;
}

.folio-main .swiper-button-prev,
.folio-main .swiper-button-next {
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background 0.2s ease, transform 0.2s ease;
}
.folio-main .swiper-button-prev:hover,
.folio-main .swiper-button-next:hover {
  background: rgba(0, 0, 0, 0.7);
  transform: scale(1.05);
}
.folio-main .swiper-button-prev::after,
.folio-main .swiper-button-next::after {
  font-size: 16px;
  font-weight: 700;
}

.folio-main .swiper-pagination-bullet {
  background: #fff;
  opacity: 0.5;
}
.folio-main .swiper-pagination-bullet-active {
  opacity: 1;
}

.folio-thumbs {
  width: 100%;
  flex: 0 0 auto;
  padding: 4px 0;
  box-sizing: border-box;
}

.folio-thumbs .swiper-wrapper {
  justify-content: center;
}

.folio-thumbs .swiper-slide {
  width: 120px;
  height: 80px;
  opacity: 0.45;
  border-radius: 4px;
  overflow: hidden;
  background: #222;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.folio-thumbs .swiper-slide:hover {
  opacity: 0.85;
}

.folio-thumbs .swiper-slide-thumb-active {
  opacity: 1;
  outline: 2px solid #fff;
  outline-offset: -2px;
}

.folio-thumbs .swiper-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (max-width: 800px) {
  .folio-gallery { padding: 12px 8px 16px; height: calc(100vh - 100px); }
  .folio-thumbs .swiper-slide { width: 80px; height: 56px; }
  .folio-main .swiper-button-prev,
  .folio-main .swiper-button-next { width: 36px; height: 36px; }
  .folio-main .swiper-button-prev::after,
  .folio-main .swiper-button-next::after { font-size: 13px; }
}

/* GLightbox dark polish */
.glightbox-clean .gslide-description { background: rgba(0,0,0,0.6); }
