/* Gallery styles integrated into HTML5UP Future Imperfect
   The projects page should look like the admin card layout. */

/* Album overview (same sizing as admin) */
.projects-grid.admin-grid{
  display:grid;
  /* Prevent a single album from stretching to full width */
  grid-template-columns:repeat(auto-fill, minmax(260px, 330px));
  gap:1rem;
  justify-content:start;
}

.admin-album{
  border:1px solid rgba(160,160,160,.25);
  border-radius:.35rem;
  overflow:hidden;
  background:rgba(255,255,255,.03);
}

.admin-album__cover{display:block;}
.admin-album__cover img{width:100%; height:160px; object-fit:cover; object-position:center; display:block}
.admin-album__body{padding:1rem}
.admin-album__title{margin:0 0 .4rem}
.admin-album__meta{margin:0; opacity:.75; color: #000;}

.album-desc{margin:0.5rem 0 0 0;color:#6b6b6b;}

/* Opened album gallery: 5 thumbnails per row on desktop */
.gallery-inline{
  display:grid;
  grid-template-columns:repeat(5, minmax(0, 1fr));
  gap:12px;
  margin-top:1.25rem;
}

/* Card-like thumbnail (frontend) */
.gallery-inline__item{
  /* neutralize theme button styling */
  display:block !important;
  width:100% !important;
  padding:0 !important;
  margin:0 !important;
  border:1px solid rgba(160,160,160,0.25) !important;
  background:#fff !important;
  cursor:pointer;
  border-radius:0.5rem;
  overflow:hidden;
  line-height:0 !important;
  font-size:0 !important;
  letter-spacing:0 !important;
  text-transform:none !important;
  white-space:normal !important;
  box-shadow:0 10px 25px rgba(0,0,0,0.06);
  transition:transform .18s ease, box-shadow .18s ease;
  /* Fixed height so tiles always render (no reliance on aspect-ratio) */
  height:170px;
}

.gallery-inline__item:hover{
  transform:translateY(-2px);
  box-shadow:0 14px 30px rgba(0,0,0,0.10);
}

/* Show the FULL image inside the tile (no cropping) */
.gallery-inline__item img{
  display:block !important;
  width:100% !important;
  height:100% !important;
  object-fit:cover !important;
  object-position:center !important;
}

/* If template .image styles leak in, force our sizing */
.gallery-inline__item.image img{
  width:100% !important;
  height:100% !important;
  object-fit:cover !important;
}

/* Responsive */
@media (max-width: 1200px){
  .gallery-inline{grid-template-columns:repeat(4, minmax(0, 1fr));}
  .gallery-inline__item{height:165px;}
}
@media (max-width: 980px){
  .gallery-inline{grid-template-columns:repeat(3, minmax(0, 1fr));}
  .gallery-inline__item{height:160px;}
}
@media (max-width: 736px){
  .gallery-inline{grid-template-columns:repeat(2, minmax(0, 1fr));}
  .gallery-inline__item{height:150px;}
}

.btn-back{
  display:inline-block;
  margin-top:1.25rem;
  /* kleinerer Button (Höhe reduziert) */
  padding:0.45rem 0.9rem;
  border-radius:0.35rem;
  background:#d9d9d9;
  color:#000 !important;
  text-decoration:none;
  font-weight:600;
  font-size:0.95rem;
  line-height:1.2;
  margin-bottom: 10px;
}
.btn-back:hover{background:#cfcfcf;}

/* Modal */
.gallery-modal{display:none;position:fixed;inset:0;background:rgba(0,0,0,.85);z-index:10000;align-items:center;justify-content:center;padding:1rem;}
.gallery-modal.active{display:flex;}
/* Modal: Bild immer vollständig im Viewport (auch Hochkant) */
.gallery-modal__inner{position:relative;width:95vw;height:90vh;display:flex;align-items:center;justify-content:center;}

/* Image wrapper so the close button can be placed on the image corner */
.gallery-modal__figure{position:relative;display:flex;align-items:center;justify-content:center;max-width:95vw;max-height:90vh;}
.gallery-modal__figure img{
  display:block;
  width:auto !important;
  height:auto !important;
  max-width:95vw !important;
  max-height:90vh !important;
  object-fit:contain;
  border-radius:0.35rem;
  cursor:pointer;
}

/* Schließen-Button: rund, schwarz, weißes X (oben rechts auf dem Bild) */
.gallery-modal__btn{
  position:absolute;
  width:44px;
  height:44px;
  border-radius:999px;
  border:none;
  background:#000 !important;
  color:#fff !important;
  /* neutralize theme button typography */
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif !important;
  font-weight: 400 !important;
  font-size: 16px;
  line-height: 1;
  cursor:pointer;
  display:grid;
  place-items:center;
  opacity:.92;
  padding:0;
}
.gallery-modal__btn:hover{opacity:1;}
.gallery-modal__close{top:10px;right:10px;}

/* SVG close icon: always perfectly centered */
.gallery-modal__close-icon{
  width:18px;
  height:18px;
  stroke:#fff;
  stroke-width:2.6;
  stroke-linecap:round;
  fill:none;
}
.gallery-modal__counter{position:absolute;bottom:10px;left:50%;transform:translateX(-50%);padding:6px 12px;border-radius:999px;border:1px solid rgba(255,255,255,.25);background:rgba(0,0,0,.35);color:#fff;font-size:0.95rem;}