/* =========================================================
   PORTFOLIO PAGE
========================================================= */

/* Page Layout */

.portfolio-page {
    width: 100%;
    padding: 0 0 85px;
    background: var(--body-bg);
    color: var(--heading);
}

.portfolio-container {
    width: 90%;
    max-width: 1380px;
    margin: 0 auto;
}


/* =========================================================
   HERO
========================================================= */

.portfolio-hero {
    width: 100%;
    padding: 50px 0 32px;
    text-align: center;
}

.portfolio-heading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin: 0 auto;
    font-family: var(--font-family);
    font-size: 68px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -2px;
    text-align: center;
    text-transform: uppercase;
}

.portfolio-black {
    color: var(--heading);
}

.portfolio-red {
    color: var(--accent);
}

.portfolio-intro {
    max-width: 720px;
    margin: 20px auto 0;
    font-family: var(--font-family);
    font-size: 15px;
    line-height: 1.75;
    color: var(--text);
    text-align: center;
}


/* =========================================================
   MAIN SHOWCASE
========================================================= */

.portfolio-showcase {
    display: grid;
    grid-template-columns: .8fr 2fr;
    gap: 55px;
    align-items: center;
    width: 100%;
    padding: 12px 0 0;
    border: none;
    background: transparent;
    box-shadow: none;
}


/* =========================================================
   PORTFOLIO STORY
========================================================= */

.portfolio-story {
    width: 100%;
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
}

.story-small {
    display: block;
    margin: 0 0 18px;
    font-family: var(--font-family);
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--accent);
}

.portfolio-story h2 {
    max-width: 390px;
    margin: 0 0 24px;
    font-family: var(--font-family);
    font-size: 40px;
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -1.2px;
    text-transform: uppercase;
    color: #111111;
}

.portfolio-story h2 span {
    display: block;
    width: fit-content;
    margin: 7px 0;
    padding: 7px 12px;
    background: var(--accent);
    color: #ffffff;
}

.portfolio-story p {
    max-width: 385px;
    margin: 0;
    font-family: var(--font-family);
    font-size: 14px;
    line-height: 1.8;
    color: var(--text);
}


/* =========================================================
   PROJECT AREA
========================================================= */

.portfolio-project-area {
    position: relative;
    width: 100%;
}

.portfolio-slide {
    display: none;
    grid-template-columns: minmax(0, .9fr) 130px minmax(0, 1.25fr);
    gap: 40px;
    align-items: center;
    width: 100%;
}

.portfolio-slide.active {
    display: grid;
}


/* =========================================================
   BEFORE AND AFTER
========================================================= */

.portfolio-label {
    display: block;
    margin: 0 0 16px;
    font-family: var(--font-family);
    font-size: 21px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: .4px;
    text-transform: uppercase;
    color: #111111;
}

.portfolio-label-red {
    color: var(--accent);
}


/* Before */

.portfolio-before {
    width: 100%;
    opacity: 0;
}

.before-image-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 300px;
    overflow: visible;
    border: none;
    background: transparent;
    box-shadow: none;
}

.before-image-wrap img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border: none;
    background: transparent;
    box-shadow: none;
    transition: transform .4s ease;
}

.before-image-wrap:hover img {
    transform: scale(1.035);
}


/* After */

.portfolio-after {
    width: 100%;
    opacity: 0;
}

.after-image-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 420px;
    overflow: visible;
    border: none;
    background: transparent;
    box-shadow: none;
}

.after-image-wrap img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border: none;
    background: transparent;
    box-shadow: none;
    transition: transform .4s ease;
}

.after-image-wrap:hover img {
    transform: scale(1.025);
}


/* =========================================================
   TRANSFORMATION ARROW
========================================================= */

.portfolio-transform {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    opacity: 0;
}

.transform-arrow {
    position: relative;
    width: 115px;
    height: 70px;
    margin: 0 auto 16px;
}

.transform-arrow::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    width: 72px;
    height: 34px;
    border-radius: 7px 0 0 7px;
    background: var(--accent);
    transform: translateY(-50%);
}

.transform-arrow::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 0;
    width: 0;
    height: 0;
    border-top: 35px solid transparent;
    border-bottom: 35px solid transparent;
    border-left: 45px solid var(--accent);
    transform: translateY(-50%);
}

.transform-caption {
    display: block;
    margin-bottom: 4px;
    font-family: var(--font-family);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text);
}

.portfolio-transform strong {
    font-family: var(--font-family);
    font-size: 17px;
    font-weight: 800;
    text-transform: uppercase;
    color: #111111;
}


/* =========================================================
   REVEAL ANIMATION
========================================================= */

.portfolio-slide.active .portfolio-before {
    animation: beforeReveal 1.25s ease forwards;
}

.portfolio-slide.active .portfolio-transform {
    animation: arrowReveal 1s 1.15s ease forwards;
}

.portfolio-slide.active .portfolio-after {
    animation: afterReveal 1.25s 2.15s ease forwards;
}

@keyframes beforeReveal {
    from {
        opacity: 0;
        transform: translateY(24px) scale(.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes arrowReveal {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes afterReveal {
    from {
        opacity: 0;
        transform: translateY(25px) scale(.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}


/* =========================================================
   PAGINATION
========================================================= */

.portfolio-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    margin-top: 18px;
}

.portfolio-page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}


/* Page Numbers */

.portfolio-page-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid #cfcfcf;
    border-radius: 6px;
    background: transparent;
    color: #555555;
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    transition:
        background .25s ease,
        color .25s ease,
        border-color .25s ease,
        transform .25s ease;
}

.portfolio-page-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
}

.portfolio-page-btn.active {
    border-color: var(--accent);
    background: var(--accent);
    color: #ffffff;
}


/* Previous and Next */

.portfolio-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    background: transparent;
    color: #111111;
    font-family: Arial, sans-serif;
    font-size: 30px;
    font-weight: 400;
    line-height: 1;
    cursor: pointer;
    transition:
        color .25s ease,
        transform .25s ease,
        opacity .25s ease;
}

.portfolio-nav-btn:hover:not(:disabled) {
    color: var(--accent);
}

.portfolio-prev:hover:not(:disabled) {
    transform: translateX(-3px);
}

.portfolio-next:hover:not(:disabled) {
    transform: translateX(3px);
}

.portfolio-nav-btn:disabled {
    opacity: .25;
    cursor: not-allowed;
}


/* =========================================================
   RESPONSIVE
========================================================= */

/* Tablet */

@media (max-width: 1150px) {
    .portfolio-heading {
        font-size: 58px;
    }

    .portfolio-showcase {
        grid-template-columns: .9fr 2fr;
        gap: 40px;
    }

    .story-small {
        font-size: 14px;
    }

    .portfolio-story h2 {
        font-size: 34px;
    }

    .portfolio-slide {
        grid-template-columns: minmax(0, .9fr) 105px minmax(0, 1.15fr);
        gap: 28px;
    }

    .portfolio-label {
        font-size: 18px;
    }

    .before-image-wrap {
        height: 260px;
    }

    .after-image-wrap {
        height: 360px;
    }

    .transform-arrow {
        width: 95px;
        height: 60px;
    }

    .transform-arrow::before {
        width: 60px;
        height: 30px;
    }

    .transform-arrow::after {
        border-top-width: 30px;
        border-bottom-width: 30px;
        border-left-width: 38px;
    }
}


/* Small Tablet */

@media (max-width: 900px) {
    .portfolio-showcase {
        grid-template-columns: 1fr;
        gap: 45px;
    }

    .portfolio-story {
        max-width: 650px;
    }

    .portfolio-slide,
    .portfolio-slide.active {
        grid-template-columns: 1fr 1fr;
        gap: 34px;
    }

    .portfolio-before {
        grid-column: 1;
        grid-row: 1;
    }

    .portfolio-after {
        grid-column: 2;
        grid-row: 1;
    }

    .portfolio-transform {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .before-image-wrap,
    .after-image-wrap {
        height: 310px;
    }
}


/* Mobile */

@media (max-width: 768px) {
    .portfolio-page {
        padding-bottom: 70px;
    }

    .portfolio-container {
        width: 92%;
    }

    .portfolio-hero {
        padding-bottom: 28px;
    }

    .portfolio-heading {
        gap: 8px;
        font-size: 44px;
        letter-spacing: -1px;
    }

    .portfolio-intro {
        margin-top: 17px;
        font-size: 13px;
        line-height: 1.7;
    }

    .story-small {
        font-size: 13px;
    }

    .portfolio-story h2 {
        font-size: 31px;
    }

    .portfolio-label {
        font-size: 17px;
    }
}


/* Mobile Stack */

@media (max-width: 600px) {
    .portfolio-slide,
    .portfolio-slide.active {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .portfolio-before,
    .portfolio-transform,
    .portfolio-after {
        grid-column: 1;
        grid-row: auto;
    }

    .portfolio-story h2 {
        font-size: 29px;
    }

    .portfolio-story p {
        font-size: 13px;
    }

    .before-image-wrap {
        height: 270px;
    }

    .after-image-wrap {
        height: 330px;
    }

    .transform-arrow {
        width: 65px;
        height: 95px;
    }

    .transform-arrow::before {
        top: 0;
        left: 50%;
        width: 30px;
        height: 60px;
        border-radius: 7px 7px 0 0;
        transform: translateX(-50%);
    }

    .transform-arrow::after {
        top: auto;
        right: auto;
        bottom: 0;
        left: 50%;
        border-top: 40px solid var(--accent);
        border-right: 32px solid transparent;
        border-bottom: none;
        border-left: 32px solid transparent;
        transform: translateX(-50%);
    }

    .portfolio-pagination {
        gap: 7px;
        margin-top: 16px;
    }

    .portfolio-page-numbers {
        gap: 6px;
    }

    .portfolio-page-btn,
    .portfolio-nav-btn {
        width: 40px;
        height: 40px;
    }
}


/* Small Mobile */

@media (max-width: 480px) {
    .portfolio-heading {
        flex-wrap: wrap;
        gap: 6px;
        font-size: 35px;
    }

    .portfolio-story h2 {
        font-size: 26px;
    }

    .portfolio-label {
        font-size: 16px;
    }

    .before-image-wrap {
        height: 235px;
    }

    .after-image-wrap {
        height: 295px;
    }

    .portfolio-page-btn {
        font-size: 13px;
    }

    .portfolio-nav-btn {
        font-size: 27px;
    }
}


/* =========================================================
   ACCESSIBILITY
========================================================= */

@media (prefers-reduced-motion: reduce) {
    .portfolio-slide.active .portfolio-before,
    .portfolio-slide.active .portfolio-transform,
    .portfolio-slide.active .portfolio-after {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}
/* Center Before / After labels above their images */

.portfolio-before,
.portfolio-after {
    text-align: center;
}

.portfolio-before .portfolio-label,
.portfolio-after .portfolio-label {
    display: block;
    width: 100%;
    text-align: center;
}