/* =========================================
   PORTFOLIO CAROUSEL SECTION
========================================= */

.portfolio-carousel-section {
    width: 100%;
    padding: 60px 0 80px;

    background: #ffffff;
}

.portfolio-carousel-inner {
    width: calc(100% - 40px);
    max-width: 1200px;

    margin: 0 auto;
}


/* =========================================
   HEADER
========================================= */

.portfolio-carousel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 30px;

    margin-bottom: 30px;
}

.portfolio-carousel-heading {
    margin: 0 !important;

    font-size: clamp(1.75rem, 2vw, 2.25rem) !important;
    line-height: 1.15 !important;
    font-weight: 400 !important;
}


/* =========================================
   CONTROLS
========================================= */

.portfolio-carousel-controls {
    display: flex;
    align-items: center;

    gap: 10px;

    flex: 0 0 auto;
}

.portfolio-carousel-prev,
.portfolio-carousel-next {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 44px !important;
    height: 44px !important;

    margin: 0;
    padding: 8px !important;

    border: 0 !important;
    border-radius: 0 !important;

    background: transparent !important;

    box-shadow: none !important;

    cursor: pointer;
}

.portfolio-carousel-prev img,
.portfolio-carousel-next img {
    display: block;

    width: 24px !important;
    height: 24px !important;

    max-width: 24px !important;
    max-height: 24px !important;

    object-fit: contain;
}

.portfolio-carousel-prev:disabled,
.portfolio-carousel-next:disabled {
    opacity: 0.25;

    cursor: default;
}


/* =========================================
   CAROUSEL VIEWPORT
========================================= */

.portfolio-carousel {
    width: 100%;

    overflow: hidden;
}


/* =========================================
   TRACK
========================================= */

.portfolio-carousel-track {
    display: flex;

    width: 100%;

    gap: 20px;

    overflow-x: auto;
    overflow-y: hidden;

    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;

    scrollbar-width: none;

    -webkit-overflow-scrolling: touch;
}

.portfolio-carousel-track::-webkit-scrollbar {
    display: none;
}


/* =========================================
   CARD — DESKTOP: 3 ACROSS
========================================= */

.portfolio-carousel-card {
    flex: 0 0 calc((100% - 40px) / 3);

    min-width: 0;

    margin: 0;

    overflow: hidden;

    scroll-snap-align: start;
}

.portfolio-carousel-link {
    position: relative;

    display: block;

    width: 100%;

    overflow: hidden;

    text-decoration: none;
}


/* =========================================
   IMAGE
========================================= */

.portfolio-carousel-image {
    display: block;

    width: 100% !important;
    height: auto !important;

    max-width: none !important;

    aspect-ratio: 16 / 9;

    object-fit: cover;
}


/* =========================================
   OVERLAY
========================================= */

.portfolio-carousel-overlay {
    position: absolute;

    inset: 0;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    padding: 30px;

    text-align: center;

    opacity: 0;

    transition: opacity 0.25s ease;
}


/* Original alternating IES-style colors */

.portfolio-carousel-card:nth-child(3n + 1) .portfolio-carousel-overlay {
    background: rgba(67, 118, 145, 0.90);
}

.portfolio-carousel-card:nth-child(3n + 2) .portfolio-carousel-overlay {
    background: rgba(90, 90, 90, 0.90);
}

.portfolio-carousel-card:nth-child(3n + 3) .portfolio-carousel-overlay {
    background: rgba(104, 145, 58, 0.90);
}


/* Hover / keyboard */

.portfolio-carousel-link:hover .portfolio-carousel-overlay,
.portfolio-carousel-link:focus-visible .portfolio-carousel-overlay {
    opacity: 1;
}


/* =========================================
   OVERLAY CONTENT
========================================= */

.portfolio-carousel-card-title {
    margin: 0 0 20px !important;

    color: #ffffff !important;

    font-size: clamp(1.1rem, 1.4vw, 1.4rem) !important;
    line-height: 1.2 !important;
    font-weight: 500 !important;
}

.portfolio-carousel-button {
    display: inline-flex;
    align-items: center;

    gap: 7px;

    color: #ffffff;

    font-size: 0.9rem;
    line-height: 1;

    text-transform: uppercase;
}

.portfolio-carousel-button img {
    display: block;

    width: 16px !important;
    height: auto !important;

    max-width: 16px !important;
}


/* =========================================
   TABLET — 2 ACROSS
========================================= */

@media (max-width: 991px) {

    .portfolio-carousel-card {
        flex-basis: calc((100% - 20px) / 2);
    }

}


/* =========================================
   MOBILE — 1 ACROSS
========================================= */

@media (max-width: 767px) {

    .portfolio-carousel-section {
        padding: 50px 0 60px;
    }

    .portfolio-carousel-inner {
        width: calc(100% - 40px);
    }

    .portfolio-carousel-header {
        gap: 15px;

        margin-bottom: 24px;
    }

    .portfolio-carousel-heading {
        font-size: 1.75rem !important;
    }

    .portfolio-carousel-card {
        flex-basis: 100%;
    }

    .portfolio-carousel-overlay {
        padding: 24px;
    }

}