
/* START PAGE STYLE */
:root {
    --imagebox-button-size: 3rem;
}

div.project-showroom {
    display: flex;
    align-items: flex-start;
}

div.project-showroom-imagebox,
#project-showroom-image-dialog {
    svg {
        width: var(--imagebox-button-size);
        height: 100%;
        /*margin: auto 1rem auto 1rem;*/
        cursor: pointer;
    }
    .disabled {
        fill: gray;
        cursor: default;
    }
}

div.project-showroom-imagebox {

    background-clip: border-box; /* Fix for small gap in border corners */
    padding: 1rem;

    .project-showroom-image-carousel {
        /* TODO: Fix this with a responsiv design, if these values are not set the "extend text" button changes the size of the boxes */
        width: 62.5rem;
        height: 41.625rem;
        margin-bottom: 1rem;

        display: flex;

        .project-showroom-image-container {
            width: 90%;
            height: auto;
            position: relative; /* Makes the description pos:abs work */

            display: flex;
            justify-content: center;

            .project-showroom-image {
                width: 100%;
                height: 100%;
                object-fit: cover;
                overflow: hidden;
                cursor: zoom-in;
            }
            .project-showroom-image-description {
                position: absolute;
                bottom: 0;
                width: 100%;
                background: rgba(0, 0, 0, 0.75);
                color: var(--secondary-text-color);
                padding: 1rem;
                text-align: center;
                opacity: 0;
                transition: .5s ease;
                border-radius: 0 0 0.5rem 0.5rem;
            }
        }
        .project-showroom-image-container:hover .project-showroom-image-description {
            opacity: 1;
        }
    }
    .project-showroom-image-carousel-xxs-buttons {
        display: none;
    }
    .project-showroom-imagepreviews {
        display: flex;
        width: 100%;

        .entries {
            overflow-y: hidden;
            overflow-x: auto;
            flex-grow: 1;
            white-space: nowrap;
            width: 1px; /* For some reason this keeps the div at the correct size without a real fixed size */

            padding: 0 var(--imagebox-button-size) 0 var(--imagebox-button-size);

            img {
                width: 12rem;
                height: 8rem;
                object-fit: cover;
                overflow: hidden;

                cursor: pointer;

                filter: brightness(75%);
            }
            .project-showroom-imagepreview-active {
                border: 4px solid var(--accent-color-select);
                filter: brightness(100%);
                transition: 0.35s;
            }
            img:hover {
                filter: brightness(100%);
                transition: 0.25s;
            }
        }
        
    }
}

div.project-showroom-info {

    background-clip: border-box; /* Fix for small gap in border corners */

    margin-left: 0.5rem;

    .facts {
        margin-bottom: 0.75rem;

        table {
            width: 100%;
            tr td:first-child {
                font-weight: bold;
            }
            tr td {
                padding-right: 0.5rem;
            }
        }
    }
    hr {
        width: 85%;
        margin: auto;
    }
    .description {
        margin-top: 0.75rem;

        p:not(:first-child) {
            display: none;
        }

        svg {
            height: 1.75rem;
            width: 100%;
            text-align: center;
            cursor: pointer;
        }
    }
}

#project-showroom-image-dialog[open] {
    top: 0;
    bottom: 0;
    width: 85vw;
    height: 85vh;
    text-align: center;
    margin: auto;
    display: flex;
    flex-direction: column;
    z-index: 1000;

    outline: none;

    .project-showroom-image-dialog-close {
        /*position: absolute;
        right: 0;
        top: 0;*/
        text-align: right;
        flex: 0 0 auto;

        svg {
            width: 2rem;
            height: 2rem;
        }
    }

    .project-showroom-image-dialog-carousel {
        height: max-content;
        flex: 1;

        /* Gets overridden with display: flex */
        min-width: 0;
        min-height: 0;

        display: flex;

        a {
            /* Gets overridden with display: flex */
            min-width: 0;
            min-height: 0;

            height: 100%;
            width: 100%;

            display: inline-block;
            text-align: center;

            img {
                max-width: 100%;
                max-height: 100%;

                width: 100%;
                height: auto;

                aspect-ratio: 1;

                /* border-radius get's "removed" with this but I see no other option */
                object-fit: contain;
                overflow: hidden;

                cursor: zoom-in;
            }
        }
    }

    hr {
        margin: 0.5rem 0 0.5rem 0;
    }
    div.project-showroom-image-dialog-text {
        margin-top: 0.5rem;
        font-size: 1.4rem;
    }
}

/* Below 1500px */
@media only screen and (max-width: 93.75em) {
    div.project-showroom-imagebox {
        .project-showroom-image-carousel {
            width: 50vw;
            height: 30vw;
        }
    }
}

/* Below 950px */
@media only screen and (max-width: 59.375em) {
    div.project-showroom {
        display: block;
        margin-bottom: 1rem;
    }
    div.project-showroom-info {
        margin-top: 1rem;
        margin-left: 0;
    }
    div.project-showroom-imagebox {
        .project-showroom-image-carousel {
            /* TODO: Fix this with a responsiv design, if these values are not set the "extend text" button changes the size of the boxes */
            width: 100%;
            height: auto;
            margin-bottom: 0;

            svg {
                display: none;
            }

            .project-showroom-image-container {
                display: block;
                width: 100%;

                img {
                    display: block;
                    height: auto !important;
                    border-radius: 0;
                    border-bottom: 1px solid lightgray;
                }

                .project-showroom-image-description {
                    position: relative;
                    background-color: transparent;
                    color: var(--text-color);
                    padding: 0.5rem 0 0 0;
                    opacity: 1;
                    transition: none;
                    background-color: var(--secondary-color);
                    filter: drop-shadow(0 0.1rem var(--imagebox-shadow-blur) rgba(0,0,0,var(--imagebox-shadow-alpha)));
                }
            }
        }
        #project-showroom-imagepreviews {
            display: none;
        }
        .project-showroom-image-carousel-xxs-buttons {
            height: 3rem;
            border-radius: 8px;
            display: block;

            svg:last-child {
                float:right;
            }
        }
    }
    div.project-showroom-imagebox-xxs {
        padding: 0;
    }
}
/* END PAGE STYLE */
