
/* TRANSFORMATIONS SECTION */
.transformations-section {
    padding: 55px 0 30px;
    /* background: #FBFAF8; */
    overflow: hidden;
}

.transformations-heading {
    max-width: 650px;
    margin: 0 auto 35px;
    padding: 25px 20px;
    text-align: center;
}

.transformations-heading p {
    margin: 0 0 12px;
    color: #B99F6A;
    font-family: "Montserrat", sans-serif;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 3px;
}

.transformations-heading h2 {
    margin: 0;
    color: #34312F;
    font-family: "Playfair Display", Georgia, serif;
    font-size: 42px;
    font-weight: 400;
    line-height: 1.3;
}

.transformations-heading span {
    display: block;
    width: 80px;
    height: 2px;
    margin: 20px auto 0;
    background: #D99DA4;
}

/* CAROUSEL VIEWPORT */
.transformations-carousel-wrapper {
    width: 100%;
    overflow: hidden;
}

.transformations-carousel {
    display: flex;
    align-items: stretch;
    gap: 24px;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    overscroll-behavior-x: contain;
    scroll-behavior: auto;
    touch-action: pan-x;
}

.transformations-carousel::-webkit-scrollbar {
    display: none;
}

/* TRANSFORMATION CARD */
.transformation-card {
    flex: 0 0 calc((100% - 48px) / 4);
    min-width: 0;
    background: #FFFFFF;
}

.transformation-category {
    margin: 0;
    padding: 0 4px;
    color: #B99F6A;
    font-family: "Montserrat", sans-serif;
    font-size: 10px;
    letter-spacing: 1.5px;
}

.transformation-card h3 {
    margin: 4px 0 10px;
    padding: 0 4px;
    color: #34312F;
    font-family: "Playfair Display", Georgia, serif;
    font-size: 16px;
    font-weight: 400;
}

/* BEFORE / AFTER IMAGES */
.transformation-images {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.transformation-image {
    position: relative;
    min-width: 0;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background: #EEE9E2;
}

.transformation-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.transformation-before,
.transformation-after {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    padding: 10px 4px;
    color: #FFFFFF;
    font-family: "Montserrat", sans-serif;
    font-size: 10px;
    letter-spacing: 1.5px;
    text-align: center;
}

.transformation-before {
    background: rgba(52, 49, 47, 0.68);
}

.transformation-after {
    background: rgba(217, 157, 164, 0.68);
}

.transformation-description {
    margin: 10px 4px 0;
    color: #81766B;
    font-family: "Montserrat", sans-serif;
    font-size: 11px;
    line-height: 1.7;
}

/* BOTTOM CONTROLS */
.transformations-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 16px 0;
}

.transformations-controls p {
    margin: 0;
    color: #81766B;
    font-family: "Montserrat", sans-serif;
    font-size: 12px;
}

.transformations-arrows {
    display: flex;
    gap: 8px;
}

.transformations-arrows button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid #D99DA4;
    background: transparent;
    color: #34312F;
    font-size: 18px;
    cursor: pointer;
    transition: background-color 0.25s ease, color 0.25s ease;
}

.transformations-arrows button:hover {
    background: #D99DA4;
    color: #FFFFFF;
}

/* TABLET */
@media (max-width: 991px) {
    .transformation-card {
        flex-basis: calc((100% - 32px) / 3);
    }

    .transformations-heading h2 {
        font-size: 34px;
    }
}

/* MOBILE */
@media (max-width: 575px) {
    .transformations-section {
        padding: 35px 0 25px;
    }

    .transformations-heading {
        margin-bottom: 25px;
    }

    .transformations-heading h2 {
        font-size: 28px;
    }

    .transformations-carousel {
        gap: 16px;
    }

    .transformation-card {
        flex-basis: 82%;
    }

    .transformations-controls {
        padding: 18px 14px 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .transformations-arrows button {
        transition: none;
    }
}

/* =========================================================== */


/* =====================================
   PORTFOLIO GALLERY SECTION
===================================== */

.portfolio-gallery-section {
    padding: 55px 0 70px;
    /* background: #fbfaf8; */
}

.portfolio-gallery-container {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 100px;
}

/* =====================================
   CATEGORY TABS
===================================== */

.portfolio-gallery-tabs {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 36px;
}

.portfolio-tab {
    position: relative;
    padding: 0 4px 12px;
    border: none;
    background: transparent;
    color: #81766b;
    font-family: "Montserrat", sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    cursor: pointer;
    transition: color 0.3s ease;
}

.portfolio-tab::after {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 2px;
    content: "";
    background: #d99da4;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.3s ease;
}

.portfolio-tab:hover,
.portfolio-tab.active {
    color: #34312f;
}

.portfolio-tab.active::after {
    transform: scaleX(1);
}

.portfolio-tab:focus-visible {
    outline: 2px solid #d99da4;
    outline-offset: 5px;
}

/* =====================================
   MASONRY GALLERY
===================================== */

.portfolio-gallery-grid {
    column-count: 4;
    column-gap: 12px;
}

.portfolio-gallery-item {
    display: inline-block;
    width: 100%;
    margin: 0 0 12px;
    overflow: hidden;
    background: #eee9e2;
    vertical-align: top;
    break-inside: avoid;
    opacity: 1;
    transform: translateY(0);
    transition:
        opacity 0.35s ease,
        transform 0.35s ease;
}

.portfolio-gallery-item[hidden] {
    display: none;
}

.portfolio-gallery-item.is-entering {
    opacity: 0;
    transform: translateY(12px);
}

.portfolio-gallery-item img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
    transition: transform 0.5s ease;
}

/* Subtle image hover effect */
.portfolio-gallery-item:hover img {
    transform: scale(1.025);
}



/* =====================================
   PORTFOLIO IMAGE POPUP
===================================== */

/* Make gallery images clickable */
.portfolio-gallery-item {
    cursor: pointer;
}

.portfolio-gallery-item img {
    cursor: zoom-in;
}

/* Popup Background */
.portfolio-image-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(35, 32, 30, 0.45);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

/* Keep the native hidden attribute working */
.portfolio-image-modal[hidden] {
    display: none;
}

/* Visible Popup */
.portfolio-image-modal.is-open {
    opacity: 1;
    visibility: visible;
}

/* Popup Container */
.portfolio-image-modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(100%, 1000px);
    max-height: 94vh;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #e5e1dc;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    transform: translateY(10px) scale(0.99);
    transition: transform 0.25s ease;
}

/* Popup Entrance */
.portfolio-image-modal.is-open .portfolio-image-modal-content {
    transform: translateY(0) scale(1);
}

/* Popup Header */
.portfolio-image-modal-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    min-height: 80px;
    padding: 18px 60px;
    background: #f5f2ed;
}

.portfolio-image-modal-header h2 {
    margin: 0;
    color: #81766b;
    font-family: "Montserrat", sans-serif;
    font-size: 18px;
    font-weight: 400;
    line-height: 1.5;
    text-align: center;
}

/* Close Button */
.portfolio-image-modal-close {
    position: absolute;
    top: 50%;
    right: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: none;
    background: transparent;
    color: #34312f;
    font-family: Arial, sans-serif;
    font-size: 32px;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    transform: translateY(-50%);
    transition: color 0.2s ease, transform 0.2s ease;
}

.portfolio-image-modal-close:hover {
    color: #b96a75;
    transform: translateY(-50%) rotate(90deg);
}

.portfolio-image-modal-close:focus-visible {
    outline: 2px solid #d99da4;
    outline-offset: 2px;
}

/* Popup Image Area */
.portfolio-image-modal-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    padding: 30px;
    overflow: auto;
    background: #ffffff;
}

/* Large Image */
.portfolio-image-modal-body img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: calc(94vh - 145px);
    object-fit: contain;
}

/* Prevent Background Scrolling */
body.portfolio-modal-open {
    overflow: hidden;
}

/* =====================================
   TABLET
===================================== */

@media (max-width: 991px) {
    .portfolio-gallery-section {
        padding: 45px 0 55px;
    }

    .portfolio-gallery-container {
        padding: 0 22px;
    }

    .portfolio-gallery-grid {
        column-count: 2;
        column-gap: 12px;
    }

    .portfolio-gallery-item {
        margin-bottom: 12px;
    }

    .portfolio-gallery-tabs {
        gap: 24px;
        margin-bottom: 28px;
    }
}

/* =====================================
   MOBILE
===================================== */

@media (max-width: 575px) {
    .portfolio-gallery-section {
        padding: 35px 0 45px;
    }

    .portfolio-gallery-container {
        padding: 0 14px;
    }

    .portfolio-gallery-tabs {
        justify-content: flex-start;
        flex-wrap: nowrap;
        gap: 22px;
        margin-bottom: 24px;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .portfolio-gallery-tabs::-webkit-scrollbar {
        display: none;
    }

    .portfolio-tab {
        flex: 0 0 auto;
        font-size: 12px;
        white-space: nowrap;
    }

    .portfolio-gallery-grid {
        column-count: 2;
        column-gap: 8px;
    }

    .portfolio-gallery-item {
        margin-bottom: 8px;
    }
}

/* =====================================
   REDUCED MOTION
===================================== */

@media (prefers-reduced-motion: reduce) {
    .portfolio-tab,
    .portfolio-tab::after,
    .portfolio-gallery-item,
    .portfolio-gallery-item img {
        transition: none;
    }
}

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

@media (max-width: 575px) {
    .portfolio-image-modal {
        padding: 10px;
    }

    .portfolio-image-modal-content {
        width: 100%;
        max-height: 92vh;
        border-radius: 8px;
    }

    .portfolio-image-modal-header {
        min-height: 64px;
        padding: 14px 48px;
    }

    .portfolio-image-modal-header h2 {
        font-size: 14px;
    }

    .portfolio-image-modal-close {
        right: 8px;
        width: 34px;
        height: 34px;
        font-size: 28px;
    }

    .portfolio-image-modal-body {
        padding: 12px;
    }

    .portfolio-image-modal-body img {
        max-height: calc(92vh - 90px);
    }
}

/* =====================================
   REDUCED MOTION
===================================== */

@media (prefers-reduced-motion: reduce) {
    .portfolio-image-modal,
    .portfolio-image-modal-content,
    .portfolio-image-modal-close {
        transition: none;
    }
}