﻿.flex-grid-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: -2.5%
}
.flex-image-container {
    overflow: hidden /* ONLY NEEDED for background-images */
}

.row-of-five {
    margin-left: 2.5%;
    margin-bottom: 2.5%
}
.row-of-three {
    margin-left: 2.5%;
    margin-bottom: 2.5%
}


@media screen and (max-width: 768px) {
    .row-of-five {
        flex: 0 0 calc(95% / 3); /* allowing for 2.5% margin */
    }

    .flex-grid-container .row-of-five:nth-child(3n - 2) {
        margin-left: 0
    }
    .row-of-three {
        flex: 0 0 calc(97.5% / 2); /* allowing for 2.5% margin */
    }

    .flex-grid-container .row-of-three:nth-child(2n - 1) {
        margin-left: 0
    }
}

@media screen and (min-width: 768px) and (max-width: 1024px) {
    .row-of-five {
        flex: 0 0 calc(92.5% / 4);
    }

    .flex-grid-container .row-of-five:nth-child(4n - 3) {
        margin-left: 0
    }
    .row-of-three {
        flex: 0 0 calc(97.5% / 2); /* allowing for 2.5% margin */
    }

    .flex-grid-container .row-of-three:nth-child(2n - 1) {
        margin-left: 0
    }
}

@media screen and (min-width: 1024px) {
    .row-of-five {
        flex: 0 0 calc(90% / 5); /* allowing for 2.5% margin */
    }

    .flex-grid-container .row-of-five:nth-child(5n - 4) {
        margin-left: 0
    }
    .row-of-three {
        flex: 0 0 calc(95% / 3); /* allowing for 2.5% margin */
    }

    .flex-grid-container .row-of-three:nth-child(3n - 2) {
        margin-left: 0
    }
}


.fixed-row-of-three {
    flex: 0 0 calc(95% / 3); /* allowing for 2.5% margin */
    margin-left: 2.5%;
    margin-bottom: 2.5%
}
.flex-grid-container .fixed-row-of-three:nth-child(3n - 2) {
    margin-left: 0
}

.background-image-wrapper {
    display: flex;
    width: 100%;
    padding-top: 100%;
    overflow: hidden
}
.background-image {
    display: flex;
    width: 100%;
    margin-top: -100%;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    overflow: hidden;
    cursor: pointer;
}
.background-image-title {
    align-self: flex-end;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 1rem;
    margin: 0;
    padding: 10px !important;
    color: rgb(255,255,255);
    background:  rgba(84,88,91,0.8); /* PANTONE 425 C */
    cursor: pointer;
    display: inline
}


.full-cover-image-wrapper,
.full-height-image-wrapper,
.half-height-image-wrapper {
    position: relative;
    overflow: hidden;
}

.full-cover-image-wrapper::after, 
.full-height-image-wrapper::after {
    content: "";
    display: block;
    padding-bottom: 100%;
}
.half-height-image-wrapper::after {
    content: "";
    display: block;
    padding-bottom: 50%;
}
    .full-cover-image-wrapper > img {
        position: absolute;
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center bottom;
    }
    .full-height-image-wrapper > img,
    .half-height-image-wrapper > img {
        position: absolute;
        width: 100%;
        height: 100%;
        object-fit: contain;
        object-position: center bottom;
    }

    .full-cover-image-wrapper > div,
    .full-height-image-wrapper > div,
    .half-height-image-wrapper > div {
        position: absolute;
        display: flex;
        flex-direction: column;
        height: 100%;
        width: 100%;
        align-items: flex-start;
        justify-content: flex-start;
        background-color: none; /* SET DYNMICALLY IF REQUIRED */
    }

.colour-swatch {
    border-radius: 200px;
}
    
.finish-info {
    margin: 15px auto;
    padding: 3px 5px;
    background-color: rgb(255,255,255);
    text-transform: uppercase;
    font-size: 0.8rem;
    font-weight: 700;
    text-align: center
}

.image-label {
    padding: 10px 0 30px 0;
    display: flex;
    justify-content: center;
    text-align: center
}

    .image-label > div {
        padding: 5px 10px;
    }

    .image-label table {
        border-collapse: collapse;
    }
        .image-label td {
        vertical-align: bottom;
        background-color: rgb(255,255,255);
        border: none;
        padding: 2px 6px;
    }
    
        .image-label tr td:first-child {
        border-right: solid 1px;
        font-size: 0.8rem;
        font-weight: 700;
        text-align: right;
    }

@media screen and (max-width: 768px) {
    .image-label tr td:first-child {
        display: none
    }
    .image-label td {
        text-align: center
    }
}
