/* =========================================================
   REVUTECK SERVICES LISTING
   Responsive service rows and mapped portfolio carousel.
========================================================= */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body.services-list-page {
    margin: 0;
    background: #f4f4f4;
    color: #242424;
    font-family: Inter, Arial, sans-serif;
    overflow-x: clip;
}

.services-list-page .page-shell {
    width: 100%;
    overflow: visible;
}

.service-showcase {
    padding: clamp(44px, 6vw, 74px) clamp(16px, 3vw, 28px);
}

.service-showcase:nth-child(odd) {
    background: #fff;
}

.service-showcase:nth-child(even) {
    background: #f3f3f3;
}

.service-wrap {
    width: min(100%, 1180px);
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
    gap: clamp(28px, 4vw, 48px);
    align-items: center;
}

.service-showcase.reverse .service-wrap {
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
}

.service-showcase.reverse .service-main {
    order: 2;
}

.service-showcase.reverse .service-media {
    order: 1;
}

.service-main,
.service-media {
    width: 100%;
    min-width: 0;
}

.service-main h2 {
    margin: 0;
}

.service-title {
    display: inline-block;
    margin: 0 0 16px;
    color: #eb6f3d;
    font-size: clamp(24px, 2.2vw, 30px);
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.18;
    text-decoration: none;
}

.service-desc {
    max-width: 540px;
    margin: 0 0 12px;
    color: #535353;
    font-size: 15px;
    line-height: 1.8;
}

.service-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 6px 0 24px;
    color: #e86d3a;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}

.service-cta::before {
    content: '➜';
    font-size: 12px;
}

.tech-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1px;
    width: 100%;
    max-width: 580px;
    overflow: hidden;
    border: 1px solid #ececec;
    border-radius: 8px;
    background: #ececec;
    box-shadow: 0 7.77px 16px rgba(0, 0, 0, .059),
                0 3px 3px rgba(0, 0, 0, .102),
                0 -8px 0 rgba(0, 0, 0, .051) inset,
                0 4px 0 rgba(255, 255, 255, .6) inset;
}

.tech-grid > a {
    min-width: 0;
    text-decoration: none;
}

.tech-item {
    min-height: 106px;
    padding: 18px 10px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #fafafa;
    text-align: center;
    transition: transform .3s ease, background .3s ease;
}

.tech-item:hover {
    background: #fff;
    transform: translateY(-2px);
}

.tech-item img {
    width: 26px;
    height: 26px;
    object-fit: contain;
    opacity: .92;
}

.tech-item span {
    max-width: 90px;
    color: #4c4c4c;
    font-size: 12px;
    line-height: 1.4;
}

/* =========================================================
   MAPPED PORTFOLIO CAROUSEL
========================================================= */

.portfolio-carousel {
    position: relative;
    isolation: isolate;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    cursor: grab;

    /* Vertical gestures always belong to the document. */
    touch-action: pan-y pinch-zoom;
    overscroll-behavior-x: contain;
    overscroll-behavior-y: auto;
}

.portfolio-carousel.is-dragging {
    cursor: grabbing;
    user-select: none;
}

.portfolio-track {
    display: flex;
    align-items: flex-start;
    width: 100%;
    min-width: 0;
    transform: translate3d(0, 0, 0);
    transition: transform .72s cubic-bezier(.2, .8, .2, 1);
    will-change: transform;
}

.portfolio-card {
    flex: 0 0 100%;
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    padding: 2px 0 48px;
}

.portfolio-visual {
    position: relative;
    width: 100%;
    min-height: clamp(330px, 31vw, 420px);
    overflow: hidden;
    border-radius: 10px;
    background: #111;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .13);
}

.portfolio-visual img {
    display: block;
    width: 100%;
    height: clamp(330px, 31vw, 420px);
    object-fit: cover;
    transform: scale(1.01);
}

.portfolio-badge {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border: 1px solid rgba(255, 255, 255, .55);
    border-radius: 999px;
    background: rgba(15, 15, 15, .24);
    color: #fff;
    font-size: 12px;
    text-decoration: none;
    backdrop-filter: blur(4px);
    transition: all .25s ease;
}

.portfolio-badge:hover {
    border-color: rgba(232, 109, 58, .92);
    background: rgba(232, 109, 58, .92);
    color: #fff;
}

.portfolio-content {
    position: relative;
    width: min(530px, calc(100% - 32px));
    margin: -100px 0 0 32px;
    padding: 24px 26px;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 18px 40px rgba(0, 0, 0, .11);
    color: #505050;
    font-size: 13px;
    line-height: 1.75;
}

.portfolio-title {
    margin: 0 0 10px;
    color: #242424;
    font-size: 19px;
    font-weight: 600;
    line-height: 1.3;
}

.portfolio-summary {
    margin: 0;
    overflow-wrap: anywhere;
}

.portfolio-actions {
    margin-top: 14px;
}

.case-study-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 18px;
    border-radius: 999px;
    background: #eb6f3d;
    box-shadow: 0 10px 22px rgba(235, 111, 61, .26);
    color: #fff !important;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: transform .25s ease, box-shadow .25s ease, background .25s ease;
}

.case-study-btn:hover {
    background: #de6231;
    box-shadow: 0 14px 28px rgba(235, 111, 61, .32);
    transform: translateY(-1px);
}

.carousel-dots {
    position: relative;
    z-index: 30;
    min-height: 30px;
    margin-top: -10px;
    padding: 2px 0 2px 32px;
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: auto;
}

.carousel-dot {
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    z-index: 31;
    flex: 0 0 auto;
    width: 10px;
    height: 10px;
    min-width: 10px;
    min-height: 10px;
    margin: 0;
    padding: 0 !important;
    border: 0;
    border-radius: 50%;
    background: #d1d1d1;
    cursor: pointer;
    pointer-events: auto;
    touch-action: manipulation;
    user-select: none;
    transition: width .25s ease, background .25s ease;
}

.carousel-dot.active {
    width: 28px;
    border-radius: 999px;
    background: var(--brand, #e86d3a);
}

.carousel-dot:focus-visible {
    outline: 2px solid var(--brand, #e86d3a);
    outline-offset: 3px;
}

.portfolio-carousel.is-dragging img,
.portfolio-carousel.is-dragging a {
    -webkit-user-drag: none;
    user-drag: none;
}

.empty-state {
    width: 100%;
    padding: 28px;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .06);
    color: #666;
}

@media (max-width: 1100px) {
    .service-wrap,
    .service-showcase.reverse .service-wrap {
        grid-template-columns: minmax(0, 1fr);
    }

    .service-showcase.reverse .service-main,
    .service-showcase.reverse .service-media {
        order: initial;
    }

    .tech-grid {
        max-width: 100%;
    }

    .portfolio-content {
        width: calc(100% - 28px);
        margin-left: 14px;
    }
}

@media (max-width: 767.98px) {
    .services-list-page .portfolio-page-hero {
        min-height: auto;
    }

    .services-list-page .portfolio-page-hero .container {
        padding-inline: 18px;
    }

    .services-list-page .portfolio-page-hero .content-wrap {
        padding-top: clamp(76px, 19vw, 108px);
        padding-bottom: clamp(48px, 13vw, 74px);
    }

    .services-list-page .portfolio-page-hero .title {
        font-size: clamp(34px, 10vw, 54px);
        line-height: 1.05;
    }

    .services-list-page .portfolio-page-hero .title-icon {
        transform: scale(.8);
        transform-origin: left center;
    }

    .services-list-page .portfolio-page-hero .hero-subtext {
        margin-top: 18px;
        font-size: 14px;
        line-height: 1.65;
    }

    .service-showcase {
        padding: 42px 16px;
    }

    .service-wrap {
        gap: 24px;
    }

    .service-title {
        font-size: clamp(24px, 7.6vw, 31px);
    }

    .service-desc {
        max-width: none;
        font-size: 14px;
        line-height: 1.72;
    }

    .tech-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tech-item {
        min-height: 92px;
        padding: 14px 8px;
    }

    .portfolio-carousel {
        cursor: auto;
    }

    .portfolio-card {
        padding-bottom: 34px;
    }

    .portfolio-visual {
        min-height: 0;
        aspect-ratio: 16 / 10;
        border-radius: 12px;
    }

    .portfolio-visual img {
        height: 100%;
        min-height: 0;
    }

    .portfolio-badge {
        top: 12px;
        right: 12px;
        padding: 8px 12px;
        font-size: 11px;
    }

    .portfolio-content {
        width: calc(100% - 24px);
        margin: -34px 12px 0;
        padding: 18px 18px 20px;
        border-radius: 18px;
        font-size: 13px;
        line-height: 1.65;
    }

    .portfolio-title {
        font-size: clamp(20px, 6.2vw, 26px);
    }

    /* Keep a mapped portfolio from occupying several mobile viewports. */
    .portfolio-summary {
        display: -webkit-box;
        overflow: hidden;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 8;
    }

    .carousel-dots {
        margin-top: -2px;
        padding-left: 12px;
    }

    .case-study-btn {
        min-height: 40px;
        padding: 0 16px;
        font-size: 12px;
    }

    .empty-state {
        padding: 22px;
    }
}

@media (max-width: 420px) {
    .service-showcase {
        padding-inline: 12px;
    }

    .services-list-page .portfolio-page-hero .container {
        padding-inline: 14px;
    }

    .portfolio-content {
        width: calc(100% - 16px);
        margin-left: 8px;
        margin-right: 8px;
        padding: 16px;
    }

    .portfolio-summary {
        -webkit-line-clamp: 7;
    }
}

@media (prefers-reduced-motion: reduce) {
    .portfolio-track,
    .tech-item,
    .case-study-btn {
        transition: none !important;
    }
}
