/*
 * Portfolio details: "Modal" (window over the page) or "Vollbild" (full screen).
 * content.scss sets `.portfolio-modal .modal-dialog { margin: 1rem; max-width: 100vw; }`,
 * so both variants need the extra class to win over it.
 */

/*
 * Full screen: Bootstrap .modal-fullscreen fills the viewport. Each image is shown as large as the
 * screen allows (whole image visible); subtitle and text, if any, follow below and scroll.
 * `.portfolio-modal.portfolio-modal--fullscreen` beats the equally specific rules in content.scss.
 */
.portfolio-modal--fullscreen .modal-dialog.modal-fullscreen {
    margin: 0;
    max-width: none;
}

.portfolio-modal.portfolio-modal--fullscreen .modal-content {
    padding: 0;
    overflow-y: auto;
}

.portfolio-modal.portfolio-modal--fullscreen .portfolio-carousel {
    max-width: none;
    margin: 0;
}

/* The bootstrap_package theme pads every carousel slide (`.carousel .carousel-item`), which shifts the image. */
.portfolio-modal.portfolio-modal--fullscreen .portfolio-carousel .carousel-item {
    position: relative;
    padding: 0;
}

.portfolio-modal.portfolio-modal--fullscreen .portfolio-carousel .carousel-item img {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-width: none;
    max-height: none;
    margin: 0;
    object-fit: contain;
}

/* Photo credit / AI note on the image instead of below it, so the image keeps the full height. */
.portfolio-modal.portfolio-modal--fullscreen .carousel-item .litorals-photo-credit {
    position: absolute;
    right: .75rem;
    bottom: .5rem;
    z-index: 2;
    margin: 0;
    padding: .125rem .35rem;
    border-radius: .2rem;
    background: rgb(0 0 0 / 55%);
    color: #fff;
}

.portfolio-modal.portfolio-modal--fullscreen .carousel-item .litorals-photo-credit a {
    color: inherit;
}

.portfolio-modal.portfolio-modal--fullscreen .portfolio-modal__text {
    padding-block: 2rem 3rem;
}

/* Close cross: fixed on a light round background so it stays visible on any photo. */
.portfolio-modal.portfolio-modal--fullscreen .close-modal {
    position: fixed;
    z-index: 3;
    top: 1rem;
    right: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.5rem;
    height: 3.5rem;
    padding: 0;
    border-radius: 50%;
    background-color: rgb(255 255 255 / 85%);
}

.portfolio-modal.portfolio-modal--fullscreen .close-modal .lr {
    margin: 0;
}

/* Modal: a centred window, the page stays visible behind the backdrop. */
.portfolio-modal--window .modal-dialog {
    margin: 1.75rem auto;
    max-width: min(1140px, calc(100vw - 2rem));
}

.portfolio-modal--window .modal-content {
    max-height: calc(100vh - 3.5rem);
    overflow-y: auto;
    padding: 4rem 0 2rem;
}

.portfolio-modal--window .modal-content h2 {
    font-size: 2.25em;
}

.portfolio-modal--window .close-modal {
    top: .5rem;
    right: .5rem;
}

.portfolio-modal--window .portfolio-carousel .carousel-item img {
    max-height: 60vh;
}

@media (max-width: 575.98px) {
    .portfolio-modal--window .modal-dialog {
        margin: .5rem;
        max-width: none;
    }

    .portfolio-modal--window .modal-content {
        max-height: calc(100vh - 1rem);
    }
}
