/* =========================================================
   REVUTECK SERVICES LISTING - DESIGN 2
   Reference-style alternating service rows.
   Loaded only when Design 2 is selected in admin.

   Important:
   - Design 1 styles are intentionally untouched.
   - Direct row children are not re-wrapped by GSAP (PHP uses .no-div),
     so the alternating grid remains stable after animations initialise.
========================================================= */

body.services-list-page.services-layout-design2 {
    margin: 0;
    background: #fff;
    color: #202124;
    overflow-x: clip;
}

body.services-layout-design2 .services-design2-shell {
    position: relative;
    width: 100%;
    padding: clamp(58px, 6vw, 92px) 0 clamp(76px, 8vw, 124px);
    background: #fff;
    overflow: clip;
}

/* Very subtle reference-like texture only at the top of Design 2 content. */
body.services-layout-design2 .services-design2-shell::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: min(100%, 1180px);
    height: 190px;
    transform: translateX(-50%);
    pointer-events: none;
    opacity: .38;
    background:
        radial-gradient(circle at 4px 4px, rgba(20, 24, 30, .05) 3px, transparent 3.5px) 0 0 / 32px 26px;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 20%, #000 80%, transparent 100%),
                        linear-gradient(180deg, #000 0, transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 20%, #000 80%, transparent 100%),
                linear-gradient(180deg, #000 0, transparent 100%);
}

body.services-layout-design2 .services-design2-list {
    position: relative;
    z-index: 1;
    width: min(1180px, calc(100% - 56px));
    margin: 0 auto;
}

/*
   Desktop layout is explicit and deterministic:
   1, 3, 5... = Content | Image
   2, 4, 6... = Image   | Content
*/
body.services-layout-design2 .services-design2-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(330px, 470px);
    grid-template-areas: "copy media";
    align-items: center;
    column-gap: clamp(68px, 7vw, 112px);
    row-gap: 32px;
    width: 100%;
    margin: 0 0 clamp(78px, 8vw, 118px);
}

body.services-layout-design2 .services-design2-row.is-reverse {
    grid-template-columns: minmax(330px, 470px) minmax(0, 1fr);
    grid-template-areas: "media copy";
}

body.services-layout-design2 .services-design2-row:last-child {
    margin-bottom: 0;
}

body.services-layout-design2 .services-design2-copy {
    grid-area: copy;
    width: 100%;
    max-width: 570px;
    min-width: 0;
    margin: 0;
    align-self: center;
    justify-self: start;
}

body.services-layout-design2 .services-design2-row.is-reverse .services-design2-copy {
    justify-self: end;
}

body.services-layout-design2 .services-design2-media {
    grid-area: media;
    position: relative;
    width: 100%;
    max-width: 470px;
    min-width: 0;
    margin: 0;
    align-self: center;
    justify-self: end;
}

body.services-layout-design2 .services-design2-row.is-reverse .services-design2-media {
    justify-self: start;
}

body.services-layout-design2 .services-design2-heading {
    margin: 0 0 12px;
    padding: 0;
    font-size: clamp(31px, 3vw, 46px);
    font-weight: 700;
    line-height: 1.06;
    letter-spacing: -.035em;
}

body.services-layout-design2 .services-design2-heading a {
    color: #202124;
    text-decoration: none;
    transition: color .22s ease;
}

body.services-layout-design2 .services-design2-heading a:hover,
body.services-layout-design2 .services-design2-heading a:focus-visible {
    color: var(--brand, #246bfd);
}

body.services-layout-design2 .services-design2-description {
    width: 100%;
    max-width: 555px;
    margin: 0 0 22px;
    color: #555b63;
    font-size: 13px;
    line-height: 1.64;
}

body.services-layout-design2 .services-design2-subservices {
    width: 100%;
    max-width: 570px;
    margin: 0;
    border-top: 1px solid #eceef1;
}

body.services-layout-design2 .services-design2-subservice {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 20px;
    align-items: center;
    gap: 10px;
    min-height: 62px;
    padding: 10px 0;
    border-bottom: 1px solid #eceef1;
    color: #202124;
    text-decoration: none;
    transition: color .22s ease, padding-left .22s ease;
}

body.services-layout-design2 .services-design2-subservice:hover,
body.services-layout-design2 .services-design2-subservice:focus-visible {
    padding-left: 5px;
    color: var(--brand, #246bfd);
}

body.services-layout-design2 .services-design2-index {
    color: #c8ccd1;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .02em;
}

body.services-layout-design2 .services-design2-subservice-title {
    min-width: 0;
    overflow: hidden;
    color: inherit;
    font-size: clamp(16px, 1.35vw, 20px);
    font-weight: 650;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.services-layout-design2 .services-design2-subservice-arrow {
    opacity: 0;
    transform: translateX(-5px);
    font-size: 16px;
    transition: opacity .22s ease, transform .22s ease;
}

body.services-layout-design2 .services-design2-subservice:hover .services-design2-subservice-arrow,
body.services-layout-design2 .services-design2-subservice:focus-visible .services-design2-subservice-arrow {
    opacity: 1;
    transform: translateX(0);
}

body.services-layout-design2 .services-design2-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 26px;
    margin: 28px 0 0;
}

body.services-layout-design2 .services-design2-primary,
body.services-layout-design2 .services-design2-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 40px;
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    transition: transform .2s ease, color .2s ease, border-color .2s ease, background .2s ease;
}

body.services-layout-design2 .services-design2-primary {
    padding: 0 17px;
    border: 1px solid #2e72ff;
    border-radius: 999px;
    color: #2e72ff;
    background: #fff;
}

body.services-layout-design2 .services-design2-primary:hover,
body.services-layout-design2 .services-design2-primary:focus-visible {
    color: #fff;
    background: #2e72ff;
    transform: translateY(-1px);
}

body.services-layout-design2 .services-design2-secondary {
    padding: 0;
    color: #2e72ff;
}

body.services-layout-design2 .services-design2-secondary:hover,
body.services-layout-design2 .services-design2-secondary:focus-visible {
    color: #0e4fcf;
    transform: translateX(2px);
}

/* =========================
   Media / mapped case studies
========================= */
body.services-layout-design2 .services-design2-media-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    isolation: isolate;
}

body.services-layout-design2 .services-design2-media-frame::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: 14px;
    background: #b5b5b5;
    transform: translate(12px, 12px);
}

body.services-layout-design2 .design2-media-carousel,
body.services-layout-design2 .services-design2-fallback {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
    margin: 0;
    overflow: hidden;
    border: 0;
    border-radius: 10px;
    background: #f2f2f2;
    box-shadow: none;
}

body.services-layout-design2 .design2-media-carousel .portfolio-track {
    display: flex;
    align-items: stretch;
    width: 100%;
    height: 100%;
    min-width: 0;
    margin: 0;
}

body.services-layout-design2 .design2-media-carousel .design2-portfolio-card {
    display: block;
    flex: 0 0 100%;
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    height: 100%;
    min-height: 0;
    margin: 0;
    padding: 0;
}

body.services-layout-design2 .design2-case-image,
body.services-layout-design2 .services-design2-fallback {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
    text-decoration: none;
}

body.services-layout-design2 .design2-case-image img,
body.services-layout-design2 .services-design2-fallback img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    margin: 0;
    object-fit: cover;
    object-position: center;
    transform: scale(1.001);
    transition: transform .5s cubic-bezier(.2, .7, .2, 1);
}

body.services-layout-design2 .design2-case-image:hover img,
body.services-layout-design2 .design2-case-image:focus-visible img {
    transform: scale(1.035);
}

body.services-layout-design2 .design2-case-overlay {
    position: absolute;
    inset: auto 0 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    min-height: 42%;
    padding: 54px 24px 22px;
    color: #fff;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, .76) 100%);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .28s ease, transform .28s ease;
}

body.services-layout-design2 .design2-case-image:hover .design2-case-overlay,
body.services-layout-design2 .design2-case-image:focus-visible .design2-case-overlay {
    opacity: 1;
    transform: translateY(0);
}

body.services-layout-design2 .design2-case-kicker {
    margin: 0 0 5px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    opacity: .8;
}

body.services-layout-design2 .design2-case-title {
    max-width: 92%;
    font-size: clamp(17px, 1.6vw, 23px);
    font-weight: 650;
    line-height: 1.2;
}

body.services-layout-design2 .design2-case-link {
    margin-top: 10px;
    font-size: 11px;
    font-weight: 600;
}

body.services-layout-design2 .design2-media-carousel .carousel-dots {
    position: absolute;
    z-index: 8;
    left: 50%;
    bottom: 14px;
    display: flex;
    width: auto;
    min-height: 0;
    margin: 0;
    padding: 7px 9px;
    gap: 6px;
    transform: translateX(-50%);
    border-radius: 999px;
    background: rgba(0, 0, 0, .32);
    backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity .22s ease;
}

body.services-layout-design2 .design2-media-carousel:hover .carousel-dots,
body.services-layout-design2 .design2-media-carousel:focus-within .carousel-dots {
    opacity: 1;
}

body.services-layout-design2 .design2-media-carousel .carousel-dot {
    width: 6px;
    height: 6px;
    min-width: 6px;
    min-height: 6px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, .52);
}

body.services-layout-design2 .design2-media-carousel .carousel-dot.active {
    width: 18px;
    background: #fff;
}

body.services-layout-design2 .services-design2-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    text-align: center;
    color: #777d85;
    font-size: 13px;
    background: #f5f5f5;
}

/* Keep Design 2 hero exactly available just like Design 1. */
body.services-layout-design2 .portfolio-page-hero .hero-bg-wrapper,
body.services-layout-design2 .portfolio-page-hero .hero-image,
body.services-layout-design2 .portfolio-page-hero .water_image_bg {
    display: block;
}

@media (max-width: 1100px) {
    body.services-layout-design2 .services-design2-list {
        width: min(980px, calc(100% - 42px));
    }

    body.services-layout-design2 .services-design2-row,
    body.services-layout-design2 .services-design2-row.is-reverse {
        column-gap: 52px;
    }

    body.services-layout-design2 .services-design2-row {
        grid-template-columns: minmax(0, 1fr) minmax(300px, 410px);
    }

    body.services-layout-design2 .services-design2-row.is-reverse {
        grid-template-columns: minmax(300px, 410px) minmax(0, 1fr);
    }

    body.services-layout-design2 .services-design2-media {
        max-width: 410px;
    }
}

@media (max-width: 767.98px) {
    body.services-layout-design2 .services-design2-shell {
        padding: 44px 0 76px;
    }

    body.services-layout-design2 .services-design2-shell::before {
        height: 120px;
        opacity: .2;
    }

    body.services-layout-design2 .services-design2-list {
        width: min(620px, calc(100% - 28px));
    }

    body.services-layout-design2 .services-design2-row,
    body.services-layout-design2 .services-design2-row.is-reverse {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "copy"
            "media";
        row-gap: 30px;
        margin-bottom: 72px;
    }

    body.services-layout-design2 .services-design2-copy,
    body.services-layout-design2 .services-design2-row.is-reverse .services-design2-copy,
    body.services-layout-design2 .services-design2-media,
    body.services-layout-design2 .services-design2-row.is-reverse .services-design2-media {
        width: 100%;
        max-width: none;
        justify-self: stretch;
    }

    body.services-layout-design2 .services-design2-heading {
        font-size: clamp(29px, 8vw, 38px);
    }

    body.services-layout-design2 .services-design2-description {
        font-size: 12.5px;
    }

    body.services-layout-design2 .services-design2-subservice {
        grid-template-columns: 36px minmax(0, 1fr) 18px;
        min-height: 56px;
    }

    body.services-layout-design2 .services-design2-actions {
        gap: 20px;
        margin-top: 22px;
    }

    body.services-layout-design2 .services-design2-media {
        width: min(100%, 520px);
        justify-self: start;
    }

    body.services-layout-design2 .design2-case-overlay {
        min-height: 35%;
        padding: 44px 18px 18px;
        opacity: 1;
        transform: none;
    }

    body.services-layout-design2 .design2-media-carousel .carousel-dots {
        opacity: 1;
    }
}

@media (max-width: 420px) {
    body.services-layout-design2 .services-design2-list {
        width: calc(100% - 24px);
    }

    body.services-layout-design2 .services-design2-heading {
        font-size: 29px;
    }

    body.services-layout-design2 .services-design2-subservice-title {
        font-size: 16px;
    }

    body.services-layout-design2 .services-design2-primary,
    body.services-layout-design2 .services-design2-secondary {
        font-size: 11px;
    }

    body.services-layout-design2 .services-design2-media-frame::before {
        transform: translate(8px, 8px);
    }
}

@media (prefers-reduced-motion: reduce) {
    body.services-layout-design2 .services-design2-shell *,
    body.services-layout-design2 .services-design2-shell *::before,
    body.services-layout-design2 .services-design2-shell *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
    }
}
