/* HPH Galerie – Frontend */
.hph-gal, .hph-album { width: 100%; box-sizing: border-box; }
.hph-gal *, .hph-album * { box-sizing: border-box; }
.hph-gal a, .hph-album a { display: block; text-decoration: none; border: 0; box-shadow: none; }
.hph-gal img, .hph-album img { display: block; max-width: none; border: 0; border-radius: 0; box-shadow: none; margin: 0; padding: 0; }

/* Blocksatz (automatisch) */
.hph-gal-justified { position: relative; overflow: hidden; min-height: 50px; }
.hph-gal-justified .hph-gal-item { position: absolute; overflow: hidden; opacity: 0; transition: opacity .4s ease; }
.hph-gal-justified.hph-ready .hph-gal-item { opacity: 1; }
.hph-gal-justified .hph-gal-item img { width: 100%; height: 100%; object-fit: cover; }

/* Spalten-Raster */
.hph-gal-grid { display: grid; grid-template-columns: repeat(var(--hph-cols, 3), minmax(0, 1fr)); gap: var(--hph-gutter, 10px); }
.hph-gal-grid .hph-gal-item img { width: 100%; height: auto; aspect-ratio: var(--hph-ratio, auto); object-fit: cover; }

/* Album */
.hph-album { display: flex; flex-wrap: wrap; margin: 0; }
.hph-album-item { width: calc(100% / var(--hph-cols, 4)); padding: 0 calc(var(--hph-gutter, 10px) / 2) var(--hph-margin, 10px); }
.hph-album-item img { width: 100%; height: auto; aspect-ratio: var(--hph-ratio, 960/650); object-fit: cover; }
/* Hover wie bisher im Theme-CSS für Envira definiert */
.hph-album-item img:hover, .hph-gal-item img:hover { -webkit-filter: grayscale(100%); filter: grayscale(100%); transform: scale(1.03); transition: .6s ease; cursor: pointer; }
.hph-album-title { margin: 5px 0; min-height: 60px; font-family: Roboto, sans-serif; font-size: 18px; font-weight: 300; line-height: 26px; color: #fff; text-align: center; }
@media only screen and (max-width: 767px) {
	.hph-album-cols-4 .hph-album-item, .hph-album-cols-5 .hph-album-item, .hph-album-cols-6 .hph-album-item { width: 33.333%; }
}
@media only screen and (max-width: 459px) {
	.hph-album .hph-album-item { width: 100%; }
	.hph-gal-grid { grid-template-columns: 1fr; }
}

/* Lightbox */
.hph-lb { position: fixed; inset: 0; z-index: 999999; background: rgba(0, 0, 0, .87); opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility 0s linear .3s; -webkit-user-select: none; user-select: none; }
.hph-lb.hph-open { opacity: 1; visibility: visible; transition: opacity .3s ease; }
.hph-lb-stage { position: absolute; top: 0; left: 0; right: 0; bottom: 70px; display: flex; align-items: center; justify-content: center; overflow: hidden; touch-action: pan-y; }
.hph-lb-img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; opacity: 0; transition: opacity .3s ease; }
.hph-lb-img.hph-loaded { opacity: 1; }
.hph-lb-spinner { position: absolute; top: 50%; left: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; border: 4px solid rgba(255, 255, 255, .25); border-top-color: rgba(255, 255, 255, .8); border-radius: 50%; animation: hph-spin .8s linear infinite; display: none; }
.hph-lb.hph-loading .hph-lb-spinner { display: block; }
@keyframes hph-spin { to { transform: rotate(360deg); } }
.hph-lb button { position: absolute; background: transparent; border: 0; padding: 0; margin: 0; color: #fff; cursor: pointer; opacity: .8; line-height: 1; box-shadow: none; border-radius: 0; min-width: 0; min-height: 0; }
.hph-lb button:hover, .hph-lb button:focus-visible { opacity: 1; background: transparent; }
.hph-lb-close { top: 12px; right: 14px; width: 40px; height: 40px; z-index: 3; }
.hph-lb-prev, .hph-lb-next { top: 50%; width: 50px; height: 80px; margin-top: -75px; z-index: 3; }
.hph-lb-prev { left: 0; }
.hph-lb-next { right: 0; }
.hph-lb svg { width: 26px; height: 26px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 2px rgba(0, 0, 0, .6)); }
.hph-lb-thumbs { position: absolute; left: 0; right: 0; bottom: 0; height: 70px; padding: 10px; display: flex; gap: 5px; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.hph-lb-thumbs button { position: static; flex: 0 0 75px; width: 75px; height: 50px; opacity: .5; border: 2px solid transparent; }
.hph-lb-thumbs button.hph-active { opacity: 1; border-color: #fff; }
.hph-lb-thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hph-lb.hph-single .hph-lb-prev, .hph-lb.hph-single .hph-lb-next, .hph-lb.hph-single .hph-lb-thumbs { display: none; }
.hph-lb.hph-single .hph-lb-stage { bottom: 0; }
html.hph-lb-locked, html.hph-lb-locked body { overflow: hidden; }
.hph-lb button:focus:not(:focus-visible) { outline: none; }
