/* =========================================
   Profile Gallery Grid
========================================= */

/* Mobile/Default: bleibt wie bisher */
.profile-gallery-grid{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 30px;
}

.profile-gallery-item img{
  width: 100%;
  height: auto;
  display: block;
  cursor: pointer;
  border-radius: 6px;
  transition: transform .2s ease;
}

.profile-gallery-item img:hover{
  transform: scale(1.02);
}

/* ✅ DESKTOP ONLY: Masonry (hochformat gleichmäßig, querformat anders) */
@media (min-width: 769px){
  .profile-gallery-grid{
    /* Grid deaktivieren -> Masonry via Columns */
    display: block;
    column-count: 4;
    column-gap: 16px;

    /* verhindert komische Lücken oben */
    margin-bottom: 30px;
  }

  .profile-gallery-item{
    /* wichtig für Masonry */
    break-inside: avoid;
    -webkit-column-break-inside: avoid;

    /* Spacing zwischen Blöcken */
    margin: 0 0 16px;
    display: block;
  }

  .profile-gallery-item img{
    /* bleibt responsiv im Column-Flow */
    width: 100%;
    height: auto;
    display: block;
  }
}

/* Mobile: bleibt 1 Spalte */
@media (max-width: 768px){
  .profile-gallery-grid{
    grid-template-columns: 1fr;
  }
}

/* =========================================
   Lightbox (DEFAULT AUS!)
========================================= */

.profile-lightbox{
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;

  background: rgba(0,0,0,0.90);

  opacity: 0;
  transition: opacity .18s ease;

  align-items: center;
  justify-content: center;
}

.profile-lightbox.is-open{
  display: flex;
  opacity: 1;
}

.profile-lightbox-inner{
  position: relative;
  width: 100%;
  max-width: 1100px;
  padding: 20px;

  display: flex;
  align-items: center;
  justify-content: center;

  box-sizing: border-box;
}

.profile-lightbox-image{
  display: block;

  max-width: 92vw;
  max-height: 88vh;
  width: auto;
  height: auto;

  border-radius: 10px;

  transform: scale(0.985);
  opacity: 0.0;
  transition: transform .22s ease, opacity .22s ease;

  box-shadow: 0 18px 60px rgba(0,0,0,0.45);
}

.profile-lightbox.is-open .profile-lightbox-image{
  transform: scale(1);
  opacity: 1;
}

/* =========================================
   Close + Arrows
   - Pfeile IMMER sichtbar, wenn Lightbox offen ist
========================================= */

.profile-lightbox-close{
  position: fixed;
  top: 18px;
  right: 20px;

  width: 46px;
  height: 46px;
  border-radius: 10px;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 28px;
  line-height: 1;

  background: rgba(45,45,45,0.90) !important;
  color: #ffffff !important;

  border: 1px solid rgba(255,255,255,0.10) !important;
  box-shadow: 0 10px 26px rgba(0,0,0,0.35) !important;

  cursor: pointer;
  z-index: 10001;

  transition: transform .12s ease, background .18s ease, opacity .18s ease;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.profile-lightbox-close:hover{
  background: rgba(70,70,70,0.92) !important;
  transform: scale(1.04);
}

.profile-lightbox-close:active{
  transform: scale(0.98);
}

.profile-lightbox-prev,
.profile-lightbox-next{
  position: fixed;
  top: 50%;
  transform: translateY(-50%);

  width: 52px;
  height: 52px;
  border-radius: 12px;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 22px;

  background: rgba(40,40,40,0.90) !important;
  color: #ffffff !important;

  border: 1px solid rgba(255,255,255,0.10) !important;
  box-shadow: 0 10px 26px rgba(0,0,0,0.35) !important;

  cursor: pointer;
  z-index: 10001;

  transition: transform .12s ease, background .18s ease;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);

  appearance: none !important;
  outline: none !important;
  text-decoration: none !important;
}

.profile-lightbox-prev:hover,
.profile-lightbox-next:hover{
  background: rgba(75,75,75,0.92) !important;
  transform: translateY(-50%) scale(1.05);
}

.profile-lightbox-prev:active,
.profile-lightbox-next:active{
  transform: translateY(-50%) scale(0.98);
}

.profile-lightbox-prev{ left: 18px; }
.profile-lightbox-next{ right: 18px; }

@media (max-width: 768px){
  .profile-lightbox-prev,
  .profile-lightbox-next{
    width: 56px;
    height: 56px;
    font-size: 24px;
    border-radius: 14px;
  }

  .profile-lightbox-close{
    width: 48px;
    height: 48px;
    top: 14px;
    right: 14px;
  }
}