/* =========================================================
   PC-J.MUELLER EVENT-GALERIE
   Datei: assets/event-gallery.css
   Version: 1.0.5
   ========================================================= */


/* =========================================================
   01. GRUNDLAGEN
   ========================================================= */

.pcjm-gallery,
.pcjm-gallery * {
    box-sizing: border-box;
}

.pcjm-gallery {
    width: 100%;
    max-width: 1400px;

    margin: 0 auto;
    padding: 1rem;

    color: #111111 !important;
    -webkit-text-fill-color: #111111;

    color-scheme: light;
}


/* =========================================================
   02. GALERIEKOPF
   ========================================================= */

.pcjm-gallery-header {
    max-width: 980px;

    margin: 0 auto 2rem;
    padding: 1.25rem;

    border: 1px solid rgba(40, 40, 40, 0.3);
    border-radius: 14px;

    background: rgba(215, 215, 215, 0.88);

    color: #111111 !important;
    -webkit-text-fill-color: #111111 !important;

    text-align: center;

    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.45);

    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.pcjm-gallery-header,
.pcjm-gallery-header h2,
.pcjm-gallery-header p {
    color: #111111 !important;
    -webkit-text-fill-color: #111111 !important;

    opacity: 1 !important;

    text-shadow: none !important;
}

.pcjm-gallery-header h2 {
    margin: 0 0 0.8rem !important;

    color: #111111 !important;
    -webkit-text-fill-color: #111111 !important;

    font-size: clamp(2.4rem, 5vw, 4rem) !important;
    font-weight: 800 !important;
    line-height: 1.1 !important;
}

.pcjm-gallery-header p {
    max-width: 900px;

    margin: 0 auto !important;

    color: #111111 !important;
    -webkit-text-fill-color: #111111 !important;

    font-size: clamp(1.2rem, 2vw, 1.55rem) !important;
    font-weight: 700 !important;
    line-height: 1.55 !important;
}


/* =========================================================
   03. GALERIERASTER
   Die Bilder behalten ihr echtes Seitenverhältnis.
   ========================================================= */

.pcjm-gallery-grid {
    display: grid;

    grid-template-columns:
        repeat(
            4,
            minmax(0, 1fr)
        );

    align-items: start;

    gap: 1rem;
}

.pcjm-gallery-item {
    margin: 0;

    color: #111111 !important;
}


/* =========================================================
   04. GALERIEKACHELN
   Kein festes Seitenverhältnis und kein Zuschneiden.
   ========================================================= */

.pcjm-gallery-open {
    display: block;

    width: 100%;
    padding: 0;

    border: 0;
    border-radius: 12px;

    overflow: hidden;

    background: rgba(40, 40, 40, 0.9);

    cursor: pointer;

    box-shadow:
        0 8px 22px rgba(0, 0, 0, 0.24);
}

.pcjm-gallery-open img {
    display: block;

    width: 100%;
    height: auto;

    max-width: 100%;

    object-fit: initial;
    object-position: initial;

    transition:
        transform 0.25s ease,
        filter 0.25s ease;
}

.pcjm-gallery-open:hover img,
.pcjm-gallery-open:focus-visible img {
    transform: scale(1.015);

    filter: brightness(1.04);
}

.pcjm-gallery-open:focus-visible {
    outline: 3px solid #1f5e8c;
    outline-offset: 3px;
}


/* =========================================================
   05. DATEINAMEN
   ========================================================= */

.pcjm-gallery-item figcaption {
    padding: 0.55rem 0.3rem 0;

    color: #111111 !important;
    -webkit-text-fill-color: #111111 !important;

    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.4;

    overflow-wrap: anywhere;
}


/* =========================================================
   06. LIGHTBOX AUSBLENDEN
   ========================================================= */

.pcjm-gallery-lightbox[hidden] {
    display: none !important;
}


/* =========================================================
   07. LIGHTBOX
   ========================================================= */

.pcjm-gallery-lightbox {
    position: fixed !important;
    inset: 0 !important;
    z-index: 2147483000 !important;

    display: grid;

    grid-template-columns:
        auto
        minmax(0, 1fr)
        auto;

    align-items: center;

    gap: 1rem;

    width: 100vw;
    height: 100vh;

    margin: 0 !important;
    padding: 1rem;

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

    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;

    color-scheme: dark;
}


/* =========================================================
   08. LIGHTBOX-BILD
   ========================================================= */

.pcjm-gallery-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    min-width: 0;
    min-height: 0;
}

.pcjm-gallery-stage img {
    display: block;

    max-width: 100%;
    max-height: calc(100vh - 8rem);

    width: auto;
    height: auto;

    object-fit: contain;
}


/* =========================================================
   09. BILDBESCHRIFTUNG IN DER LIGHTBOX
   ========================================================= */

.pcjm-gallery-stage p {
    margin: 0.75rem 0 0;

    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;

    font-weight: 700;

    text-align: center;

    overflow-wrap: anywhere;
}


/* =========================================================
   10. NAVIGATION UND SCHLIESSEN
   ========================================================= */

.pcjm-gallery-close,
.pcjm-gallery-nav {
    border: 0;

    background: rgba(255, 255, 255, 0.16);

    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;

    cursor: pointer;
}

.pcjm-gallery-close {
    position: fixed !important;

    top: max(
        16px,
        env(safe-area-inset-top)
    ) !important;

    right: max(
        16px,
        env(safe-area-inset-right)
    ) !important;

    z-index: 2147483646 !important;

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

    width: 58px !important;
    height: 58px !important;

    margin: 0 !important;
    padding: 0 !important;

    border: 3px solid #ffffff !important;
    border-radius: 50% !important;

    background: rgba(0, 0, 0, 0.94) !important;

    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;

    font-size: 2.35rem !important;
    font-weight: 700 !important;
    line-height: 1 !important;

    box-shadow:
        0 6px 20px rgba(0, 0, 0, 0.65) !important;
}

.pcjm-gallery-nav {
    width: 54px;
    height: 72px;

    border-radius: 12px;

    font-size: 2.7rem;
    font-weight: 700;
    line-height: 1;
}

.pcjm-gallery-close:hover,
.pcjm-gallery-nav:hover,
.pcjm-gallery-close:focus-visible,
.pcjm-gallery-nav:focus-visible {
    background: #1f5e8c !important;
}

.pcjm-gallery-close:focus-visible,
.pcjm-gallery-nav:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: 3px;
}


/* =========================================================
   11. DOWNLOAD-BUTTON SICHERHEITSHALBER VERSTECKEN
   Der Button wurde bereits aus der PHP entfernt.
   Diese Regel fängt alte zwischengespeicherte Ausgaben ab.
   ========================================================= */

.pcjm-gallery-download,
a.pcjm-gallery-download,
[data-pcjm-download] {
    display: none !important;

    visibility: hidden !important;
    opacity: 0 !important;

    width: 0 !important;
    height: 0 !important;

    margin: 0 !important;
    padding: 0 !important;

    pointer-events: none !important;
}


/* =========================================================
   12. MELDUNGEN
   ========================================================= */

.pcjm-gallery-message {
    padding: 1rem;

    border-radius: 10px;

    background: #e4e4e4;

    color: #222222 !important;
    -webkit-text-fill-color: #222222 !important;

    font-weight: 700;
}

.pcjm-gallery-error {
    border: 1px solid #c76060;

    background: #fdeaea;

    color: #551b1b !important;
    -webkit-text-fill-color: #551b1b !important;
}


/* =========================================================
   13. SEITENSCROLLEN BEI GEÖFFNETER LIGHTBOX SPERREN
   ========================================================= */

body.pcjm-gallery-lightbox-open {
    overflow: hidden !important;
}


/* =========================================================
   14. EVENTKARTEN
   Grauer Hintergrund für sichere Lesbarkeit.
   ========================================================= */

body.page-id-3836 .pcjm-hero,
body.page-id-3836 .pcjm-card {
    background: rgba(205, 205, 205, 0.88) !important;

    color: #111111 !important;
    -webkit-text-fill-color: #111111 !important;

    border-color: rgba(35, 35, 35, 0.38) !important;

    box-shadow:
        0 10px 28px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

body.page-id-3836 .pcjm-event-wrap,
body.page-id-3836 .pcjm-event-wrap h1,
body.page-id-3836 .pcjm-event-wrap h2,
body.page-id-3836 .pcjm-event-wrap h3,
body.page-id-3836 .pcjm-event-wrap h4,
body.page-id-3836 .pcjm-event-wrap p,
body.page-id-3836 .pcjm-event-wrap li,
body.page-id-3836 .pcjm-event-wrap label,
body.page-id-3836 .pcjm-event-wrap legend,
body.page-id-3836 .pcjm-event-wrap span,
body.page-id-3836 .pcjm-event-wrap strong,
body.page-id-3836 .pcjm-event-wrap small {
    color: #111111 !important;
    -webkit-text-fill-color: #111111 !important;

    font-weight: 700;
}


/* =========================================================
   15. FORMULARFELDER IM HELLEN MODUS
   ========================================================= */

body.page-id-3836 .pcjm-event-wrap input,
body.page-id-3836 .pcjm-event-wrap textarea,
body.page-id-3836 .pcjm-event-wrap select {
    color-scheme: light !important;
}


/* =========================================================
   16. SYSTEM-DARK-MODE
   Karten werden dunkler, Text bleibt kontrastreich.
   ========================================================= */

@media (prefers-color-scheme: dark) {

    .pcjm-gallery {
        color: #f4f4f4 !important;
        -webkit-text-fill-color: #f4f4f4;
    }

    .pcjm-gallery-header {
        border-color: rgba(255, 255, 255, 0.28);

        background: rgba(55, 55, 55, 0.92);

        color: #ffffff !important;
        -webkit-text-fill-color: #ffffff !important;
    }

    .pcjm-gallery-header,
    .pcjm-gallery-header h2,
    .pcjm-gallery-header p {
        color: #ffffff !important;
        -webkit-text-fill-color: #ffffff !important;
    }

    .pcjm-gallery-item,
    .pcjm-gallery-item figcaption {
        color: #ffffff !important;
        -webkit-text-fill-color: #ffffff !important;
    }

    body.page-id-3836 .pcjm-hero,
    body.page-id-3836 .pcjm-card {
        background: rgba(55, 55, 55, 0.92) !important;

        color: #ffffff !important;
        -webkit-text-fill-color: #ffffff !important;

        border-color: rgba(255, 255, 255, 0.3) !important;
    }

    body.page-id-3836 .pcjm-event-wrap,
    body.page-id-3836 .pcjm-event-wrap h1,
    body.page-id-3836 .pcjm-event-wrap h2,
    body.page-id-3836 .pcjm-event-wrap h3,
    body.page-id-3836 .pcjm-event-wrap h4,
    body.page-id-3836 .pcjm-event-wrap p,
    body.page-id-3836 .pcjm-event-wrap li,
    body.page-id-3836 .pcjm-event-wrap label,
    body.page-id-3836 .pcjm-event-wrap legend,
    body.page-id-3836 .pcjm-event-wrap span,
    body.page-id-3836 .pcjm-event-wrap strong,
    body.page-id-3836 .pcjm-event-wrap small {
        color: #ffffff !important;
        -webkit-text-fill-color: #ffffff !important;
    }

    body.page-id-3836 .pcjm-event-wrap input,
    body.page-id-3836 .pcjm-event-wrap textarea,
    body.page-id-3836 .pcjm-event-wrap select {
        background: rgba(245, 245, 245, 0.96) !important;

        color: #111111 !important;
        -webkit-text-fill-color: #111111 !important;

        color-scheme: light !important;
    }

    body.page-id-3836 .pcjm-event-wrap input::placeholder,
    body.page-id-3836 .pcjm-event-wrap textarea::placeholder {
        color: rgba(20, 20, 20, 0.65) !important;

        opacity: 1 !important;
    }
}


/* =========================================================
   17. TABLET
   ========================================================= */

@media (max-width: 1000px) {

    .pcjm-gallery-grid {
        grid-template-columns:
            repeat(
                3,
                minmax(0, 1fr)
            );
    }
}


/* =========================================================
   18. SMARTPHONE
   ========================================================= */

@media (max-width: 700px) {

    .pcjm-gallery {
        padding: 0.5rem;
    }

    .pcjm-gallery-header {
        margin-bottom: 1rem;
        padding: 1rem;
    }

    .pcjm-gallery-header h2 {
        font-size:
            clamp(
                2rem,
                10vw,
                3rem
            ) !important;
    }

    .pcjm-gallery-header p {
        font-size:
            clamp(
                1.05rem,
                5vw,
                1.3rem
            ) !important;
    }

    .pcjm-gallery-grid {
        grid-template-columns:
            repeat(
                2,
                minmax(0, 1fr)
            );

        gap: 0.65rem;
    }

    .pcjm-gallery-lightbox {
        grid-template-columns: 1fr;

        padding:
            4.8rem
            0.5rem
            4.5rem;
    }

    .pcjm-gallery-nav {
        position: fixed;

        bottom: max(
            12px,
            env(safe-area-inset-bottom)
        );

        width: 48px;
        height: 48px;

        border-radius: 50%;

        font-size: 2rem;
    }

    .pcjm-gallery-prev {
        left: calc(50% - 60px);
    }

    .pcjm-gallery-next {
        right: calc(50% - 60px);
    }

    .pcjm-gallery-stage img {
        max-height: calc(100vh - 11rem);
    }
}


/* =========================================================
   19. KLEINE SMARTPHONES
   ========================================================= */

@media (max-width: 420px) {

    .pcjm-gallery-grid {
        grid-template-columns: 1fr;
    }

    .pcjm-gallery-close {
        width: 52px !important;
        height: 52px !important;

        font-size: 2.1rem !important;
    }
}


/* =========================================================
   20. REDUZIERTE BEWEGUNGEN
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    .pcjm-gallery-open img {
        transition: none;
    }

    .pcjm-gallery-open:hover img,
    .pcjm-gallery-open:focus-visible img {
        transform: none;
    }
}