:root {
    --s12-radius: 4px;
}

#service-section-12 {
    padding: var(--section-pad-y) var(--section-pad-x);
}

#service-section-12 .container {
    max-width: var(--s1-max);
    margin: 0 auto;
}

.section-12__inner {
    position: relative;
    background: #111;
    border-radius: var(--s12-radius);
    overflow: hidden;
    min-height: clamp(280px, 40vw, 420px);
    display: grid;
    grid-template-columns: 1fr 420px;
}

.section-12__inner::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--bg) center/cover no-repeat;
    transform: translateZ(0);
}

.section-12__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, var(--overlay, .6));
}

.section-12__content {
    position: relative;
    z-index: 2;
    color: #fff;
    padding: clamp(24px, 4vw, 56px);
    max-width: 720px;
}

.section-12__content h2 {
    font-size: clamp(22px, 3.2vw, 38px);
    line-height: 1.22;
    margin: 0 0 12px;
    color: #fff;
}

.section-12__text {
    color: #e5e7eb;
    margin-bottom: 18px;
}

.section-12__cta-wrap {
    margin-top: 22%;
}

.section-12__cta {
    display: inline-block;
    background: var(--cta-btn-bg);
    color: var(--cta-btn-color);
    padding: 12px 22px;
    border-radius: 2px;
    text-decoration: none;
    font-weight: 600;
    font-size: 20px;
}

.section-12__cta:hover {
    background: var(--cta-btn-bg-h);
}

/* Ladder images on the right — grid: one image per row */
.section-12__media {
    position: relative;
    display: grid;
    grid-auto-rows: min-content;
    align-content: center;
    justify-items: end;
}

.section-12__item {
    position: relative;
    box-shadow: var(--s1-shadow);
    border-radius: var(--img-radius);
    overflow: hidden;
}

.section-12__item img {
    display: block;
    width: 200px;
    height: 150px;
    object-fit: cover;
    border-radius: inherit;
}

/* per-row horizontal offsets to create a stepped look while keeping one-per-row */
.section-12__item--1 {
    top: -10px;
    right: -20px;
    margin-right: 0;
}

.section-12__item--2 {
    top: -5px;
    right: 15px;
    margin-right: clamp(42px, 5vw, 90px);
}

.section-12__item--3 {
    left: -76px;
    margin-right: clamp(84px, 10vw, 180px);
}

/* Responsive */
@media (max-width: 1024px) {
    .section-12__inner {
        grid-template-columns: 1fr 360px;
    }

    .section-12__content {
        position: unset;
        order: 2;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .section-12__content p {
        margin-top: unset;
    }

    .section-12__inner {
        grid-template-columns: 1fr;
    }

    .section-12__media {
        justify-items: start;
        padding: clamp(12px, 3vw, 20px);
        gap: clamp(12px, 4vw, 20px);
    }

    .section-12__item img {
        width: 320px;
        height: 240px;
        object-fit: cover;
    }

    .section-12__item {
        height: 150px;
    }

    .section-12__item--1 {
        margin-right: 0;
        top: 10px;
        left: 50%;
    }

    .section-12__item--2 {
        margin-right: clamp(24px, 6vw, 48px);
        top: 10px;
        left: 25%;
    }

    .section-12__item--3 {
        margin-right: clamp(48px, 12vw, 96px);
        top: 10px;
        left: 1%;
    }
}

@media (max-width: 640px) {
    .section-12__media {
        justify-items: center;
    }

    .section-12__item--1, .section-12__item--2, .section-12__item--3 {
        margin-right: 0;
    }

    .section-12__item--3 {
        display: none;
    }
}

/* Mobile: make section-12 media a simple wrapping grid with equal-size tiles */
@media (max-width: 640px) {
    /* Switch off the stepped grid and use flex */
    .section-12__media {
        display: flex !important;
        flex-wrap: wrap;
        gap: 12px;                          /* spacing between tiles */
        grid-template-columns: none !important; /* cancel grid rules */
        justify-content: center;            /* center the row */
        align-content: flex-start;
        padding: 12px;                      /* optional: keep some padding */
    }

    /* Normalize each item: equal size, natural order */
    .section-12__media .section-12__item {
        position: static !important;        /* cancel offsets */
        top: auto !important;
        right: auto !important;
        bottom: auto !important;
        left: auto !important;
        margin: 0 !important;
        transform: none !important;
        order: 0 !important;

        /* Two per row on small screens */
        flex: 0 0 calc(50% - 6px);
        width: calc(50% - 6px);

        /* Equal heights via aspect ratio */
        aspect-ratio: 1 / 1;
        height: auto !important;            /* height driven by aspect-ratio */
    }

    /* Ensure the third item is visible on mobile (override previous hide) */
    .section-12__item--3 { display: block !important; }

    /* Make images cover their tiles neatly */
    .section-12__media .section-12__item img {
        display: block;
        width: 100% !important;
        height: 100% !important;
        object-fit: cover;                  /* fill without distortion */
        border-radius: inherit;
    }
}