.panelWrapper {
    --calculatedWidth: calc(100% / var(--count));
    --baseAnimationTime: 0.5s;

    display: flex;
    background-color: white;
    position: relative;
}
.panelWrapper:hover .panel-item {
    /*width: 23.3333%;*/
    width: var(--calculatedWidth);
}

.panelWrapper .panel-header p {
    color: white;
    line-height: 1.5;
    margin: 0;
    text-align: center;
}

.panel-item {
    transform: translate3d(0, 0, 0);
    position: relative;
    width: var(--calculatedWidth);
    height: 700px;
    min-height: 600px;
    color: #fff;
    overflow: hidden;
    transition: width var(--baseAnimationTime) ease;
}
.panel-item:before, .panel-item:after {
    transform: translate3d(0, 0, 0);
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
}
.panel-item:after {
    background: #0000007d;
    opacity: 1;
    transition: opacity var(--baseAnimationTime) ease;
}
.panel-item:before {
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, black 75%);
    z-index: 1;
    opacity: 0;
    transform: translate3d(0, 0, 0) translateY(50%);
    transition: opacity var(--baseAnimationTime) ease, transform var(--baseAnimationTime) ease;
}
.panel-item:hover {
    width: calc(var(--calculatedWidth) + 15%) !important;
}
.panel-item:hover:after {
    opacity: 0;
}
.panel-item:hover:before {
    opacity: 1;
    transform: translate3d(0, 0, 0) translateY(0);
    transition: opacity var(--baseAnimationTime) ease, transform var(--baseAnimationTime) ease 0.25s;
}
.panel-item:hover .panel-content {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.75s ease var(--baseAnimationTime);
}
.panel-item:hover .panel-bg {
    filter: grayscale(0);
}

.panel-content {
    transform: translate3d(0, 0, 0) translateY(25px);
    position: relative;
    z-index: 1;
    text-align: center;
    margin: 15px 1.618em 0 1.618em;
    top: 60%;
    opacity: 0;
}
.panel-content h1 {
    text-transform: uppercase;
    color: #ffffff;
    font-size: 1.44rem;
    font-weight: normal;
}

.panel-content p {
    color: white;
}

.panel-header {
    white-space: nowrap;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translateX(-50%) translateY(-50%);
    z-index: 1;
    border-top: 1px solid #fff;
    border-bottom: 1px solid #fff;
    padding: 10px 15px;
}
.panel-header p {
    font-size: 1.728rem;
    line-height: 0;
}

.panel-bg {
    transform: translate3d(0, 0, 0);
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background-size: cover;
    background-position: center center;
    transition: filter var(--baseAnimationTime) ease;
    filter: grayscale(100%);
}

@media (max-width: 991px) {
    .panelWrapper {
        display: flex;
        flex-direction: column;
    }
    .panelWrapper .panel-item {
        width: 100% !important;
        height: 400px;
        min-height: 400px;
    }
    .panel-item:after {
        height: 400px;
    }
    .panel-bg {
        max-height: 400px;
    }
    .panel-header {
        top: 5%;
        transform: translateX(-50%);
    }
    .panel-content {
        top: 30%;
    }
    .panel-item:before {
        height: 400px;
        transform: unset;
    }
}


/* Panel Small */
.container.smallPanels .panelWrapper {
    gap: 0.5rem;
}
.container.smallPanels .panel-item {
    height: 500px;
    min-height: 500px;
}
.container.smallPanels .panel-item .panel-header {
    top: 50%;
}
.container.smallPanels .panel-item:hover .panel-header {
    top: 25%;
    transition: top var(--baseAnimationTime) ease;
}
.container.smallPanels .panel-item .panel-content {
    top: 35%;
}
.container.smallPanels .panel-item:hover {
    width: calc(var(--calculatedWidth) * 2);
}

@media (max-width: 991px) {
    .container.smallPanels .panel-bg {
        max-height: 500px;
    }
    .container.smallPanels .panel-item .panel-header {
        transform: translateX(-50%) translateY(-50%);
    }
    .container.smallPanels .panel-item:hover .panel-header {
        top: 15%;
    }
    .container.smallPanels .panel-item .panel-content {
        top: 30%;
    }
    .container.smallPanels .panel-item:after,
    .container.smallPanels .panel-item:before {
        height: 500px;
    }
}