/* ─── GALERIE-VOLLANSICHT (User-Frontend) ─────────────────────────────────── */

.galerie {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.3em;
    justify-content: flex-start;
    align-content: flex-start;
    padding: 0.5rem;

    & h1,h2,h3,h4,h5 {
        flex-basis: 100%;
    }
    & .imageCard {
        display: block;
        max-width: min(48%, 24em);
        position: relative;
        overflow: hidden;
        &:focus {
            outline: 2px solid var(--prim);
        }
        & img {
            height: min(25vw,10em);
            width: auto;
            display: block;
        }
    }
}

/* ─── MODAL ───────────────────────────────────────────────────────────────── */

#modalView {
    margin: auto;
    padding: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-bg-body);
    border: 0;
}

#modalView[open] {
    display: flex;
    flex-direction: column;
}

#modalHeader {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1rem;
    border-bottom: 2px solid var(--color-rot-dark);
    background: color-mix(in srgb, var(--color-rot-dark) 7%, var(--color-bg-body));
    flex-shrink: 0;
}

#modalHeader h2 {
    margin: 0;
    font-family: 'Playfair Display', 'Times New Roman', serif;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--color-rot-dark);
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#modalContent {
    flex: 1;
    min-height: 0;
    width: 100%;
    position: relative;
    padding: 1rem 0;
}

#modalContent > button {
    --button-height: 3rem;
    position: absolute;
    top: calc(50% - var(--button-height)/2);
    height: var(--button-height);
    border: 0;
    background: transparent;
    font-weight: bold;
    cursor: pointer;
    font-size: 3rem;
    color: var(--color-body);
}

#closeButton {
    padding: 0.2rem 0.5rem;
    font-size: 0.85rem;
    flex-shrink: 0;
    cursor: pointer;
}

#modalContent > button:hover {
    color: var(--ink-mid);
    background: transparent;
    border-radius: 0.5rem;
}

#modalContent .leftButton  { left: 0; }
#modalContent .rightButton { right: 0; }

#modalContent .imageWrapper {
    display: flex;
    text-align: center;
    height: 100%;
    justify-content: center;
    align-content: center;
}

#modalContent img {
    max-width: 100%;
    max-height: 100%;
    align-self: center;
}

#imageList {
    margin: 0;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 1rem;
    overflow-x: scroll;
    height: 15%;
    width: 100%;
}

#imageList .active { opacity: 0.5; }

#modalView::backdrop {
    background: var(--color-bg-body);
}

/* ─── RESPONSIVE ──────────────────────────────────────────────────────────── */

@media all and (min-width: 50em) {
    #modalContent img { width: auto; }
}
