/* Galerie-Redesign – bewusst auf die Phoca-Gallery beschränkt. */
#phocagallery {
    --pg-accent: #e53935;
    --pg-accent-bright: #ff4b46;
    --pg-surface: rgba(20, 21, 25, 0.92);
    --pg-surface-raised: #25262b;
    --pg-border: rgba(255, 255, 255, 0.1);
    --pg-text: #f5f5f6;
    --pg-text-muted: #b4b5bb;
    color: var(--pg-text);
}

#phocagallery .phocagallery-black-wrapper {
    position: relative;
    isolation: isolate;
    overflow: visible;
    margin: 24px auto;
    padding: clamp(14px, 2vw, 28px);
    border: 2px solid rgba(5, 5, 7, 0.88);
    border-radius: 11px;
    background: rgba(25, 25, 28, 0.68);
    box-shadow: 0 16px 46px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.035);
    backdrop-filter: blur(5px) saturate(0.82);
    -webkit-backdrop-filter: blur(5px) saturate(0.82);
}

#phocagallery .phocagallery-black-wrapper::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0;
    border-radius: inherit;
    background: rgba(255, 255, 255, 0.012);
    box-shadow: inset 0 0 45px rgba(0, 0, 0, 0.14);
    pointer-events: none;
}

/* Raster */
#phocagallery #pg-msnr-container.pg-modern-grid {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: clamp(10px, 1.2vw, 18px);
    margin: 0 0 28px;
}

#phocagallery .pg-item-box.pg-item-card {
    position: relative;
    display: flex;
    min-width: 0;
    aspect-ratio: 4 / 3;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(168, 172, 181, 0.25);
    border-radius: 10px;
    background: linear-gradient(145deg, rgba(55, 56, 62, 0.94), rgba(30, 30, 34, 0.96));
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.38);
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

#phocagallery .pg-item-box.pg-item-card::after {
    content: "";
    position: absolute;
    z-index: 3;
    inset: 0;
    box-sizing: border-box;
    border-right: 3px solid rgba(255, 55, 55, 0.82);
    border-radius: inherit;
    box-shadow: inset -7px 0 13px -10px rgba(255, 55, 55, 0.95);
    pointer-events: none;
}

#phocagallery .pg-item-box.pg-item-card:nth-child(even)::after {
    border-right: 0;
    border-left: 3px solid rgba(255, 55, 55, 0.82);
    box-shadow: inset 7px 0 13px -10px rgba(255, 55, 55, 0.95);
}

#phocagallery .pg-item-box.pg-item-card:hover,
#phocagallery .pg-item-box.pg-item-card:focus-within {
    z-index: 2;
    transform: translateY(-4px);
    border-color: rgba(255, 75, 70, 0.64);
    box-shadow: 0 15px 32px rgba(0, 0, 0, 0.48), 0 0 16px rgba(255, 48, 48, 0.18);
}

#phocagallery .pg-item-box.pg-item-card figure,
#phocagallery .pg-item-box.pg-item-card .pg-item-box-image,
#phocagallery .pg-item-box.pg-item-card .pg-item-box-image a {
    display: block;
    width: 100% !important;
    height: 100% !important;
    margin: 0;
}

#phocagallery .pg-item-box.pg-item-card img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    transition: transform 350ms ease, filter 350ms ease;
}

#phocagallery .pg-item-box.pg-item-card:hover img,
#phocagallery .pg-item-box.pg-item-card:focus-within img {
    transform: scale(1.045);
    filter: brightness(0.72);
}

#phocagallery .pg-item-box.pg-item-card .pg-item-box-info {
    padding: 13px 15px;
}

#phocagallery .pg-item-box.pg-item-card .pg-item-box-title {
    margin: 0 0 8px;
    color: var(--pg-text);
    font-size: 0.95rem;
    font-weight: 650;
}

#phocagallery .pg-item-box.pg-item-card .pg-item-box-tags,
#phocagallery .pg-item-box.pg-item-card .pg-item-box-descripton {
    margin-top: 7px;
    color: var(--pg-text-muted);
    font-size: 0.82rem;
}

/* Bildaktionen */
#phocagallery .pg-item-box.pg-item-card .pg-hover-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px;
    opacity: 0;
    background: linear-gradient(180deg, rgba(9, 9, 11, 0.08), rgba(20, 16, 19, 0.78));
    pointer-events: none;
    transition: opacity 180ms ease;
}

#phocagallery .pg-item-box.pg-item-card:hover .pg-hover-overlay,
#phocagallery .pg-item-box.pg-item-card:focus-within .pg-hover-overlay {
    opacity: 1;
    pointer-events: auto;
}

#phocagallery .pg-item-box.pg-item-card .pg-hover-overlay a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 7px;
    background: rgba(38, 38, 42, 0.9);
    color: #fff;
    text-decoration: none;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
    transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

#phocagallery .pg-item-box.pg-item-card .pg-hover-overlay a:hover,
#phocagallery .pg-item-box.pg-item-card .pg-hover-overlay a:focus-visible {
    transform: translateY(-2px);
    border-color: var(--pg-accent-bright);
    background: var(--pg-accent);
    outline: none;
}

#phocagallery .pg-item-box.pg-item-card .pg-hover-overlay a svg {
    width: 23px;
    height: 23px;
}

#phocagallery .pg-category-box-label-box {
    position: absolute;
    z-index: 3;
    top: 10px;
    left: 10px;
    display: flex;
    gap: 5px;
}

#phocagallery .pg-category-box-label-hot,
#phocagallery .pg-category-box-label-new {
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--pg-accent);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 750;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Seitennavigation */
#phocagallery .pagination.pagination-centered {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 9px;
    margin: 0;
    padding: 4px 0 22px;
    color: var(--pg-text-muted);
    text-align: center;
}

#phocagallery .pagination ul,
#phocagallery ul.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 7px;
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
}

#phocagallery .pagination li {
    margin: 0;
    list-style: none;
}

#phocagallery .pagination a,
#phocagallery .pagination li > span,
#phocagallery .pagination .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 12px;
    border: 1px solid var(--pg-border);
    border-radius: 6px;
    background: rgba(43, 43, 47, 0.82);
    color: var(--pg-text);
    text-decoration: none;
    box-shadow: none;
    transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}

#phocagallery .pagination a:hover,
#phocagallery .pagination a:focus-visible,
#phocagallery .pagination .page-link:hover,
#phocagallery .pagination .page-link:focus-visible {
    border-color: var(--pg-accent-bright);
    background: rgba(229, 57, 53, 0.18);
    color: #fff;
    outline: none;
}

#phocagallery .pagination .active > a,
#phocagallery .pagination .active > span,
#phocagallery .pagination .page-item.active .page-link {
    border-color: var(--pg-accent);
    background: linear-gradient(180deg, #ff4540, #d92925);
    color: #fff;
    box-shadow: 0 0 13px rgba(255, 52, 52, 0.35);
}

#phocagallery .pagination .disabled > a,
#phocagallery .pagination .disabled > span,
#phocagallery .pagination .page-item.disabled .page-link {
    opacity: 0.42;
    cursor: default;
}

#phocagallery .pagination .counter {
    flex-basis: 100%;
    margin: 0;
    color: var(--pg-text-muted);
}

#phocagallery select#limit.form-select {
    min-height: 38px;
    margin-left: 6px;
    padding: 6px 32px 6px 10px;
    border: 1px solid var(--pg-border);
    border-radius: 6px;
    background-color: rgba(38, 38, 42, 0.9);
    color: var(--pg-text);
    font-size: 0.9rem;
    font-weight: 600;
}

#phocagallery select#limit.form-select:focus-visible {
    border-color: var(--pg-accent-bright);
    outline: 2px solid rgba(229, 57, 53, 0.28);
    outline-offset: 2px;
}

@media (max-width: 1360px) {
    #phocagallery #pg-msnr-container.pg-modern-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 1040px) {
    #phocagallery #pg-msnr-container.pg-modern-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    #phocagallery .phocagallery-black-wrapper {
        margin: 14px auto;
        border-radius: 9px;
    }

    #phocagallery #pg-msnr-container.pg-modern-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 460px) {
    #phocagallery #pg-msnr-container.pg-modern-grid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    #phocagallery .pg-item-box.pg-item-card,
    #phocagallery .pg-item-box.pg-item-card img,
    #phocagallery .pg-item-box.pg-item-card .pg-hover-overlay,
    #phocagallery .pg-item-box.pg-item-card .pg-hover-overlay a {
        transition: none;
    }
}
