/* FIX Onboarding & Connectivity Lifecycle Services (a services subpage).
   Linked from the page's HTML code field after services-subpages.css, so it loads on that page only
   and applies to every .tiles-wall on it.
   - The service tiles go two per row (2x2) across the article width instead of three per row.
   - The bullet items in the tiles read as ordinary list text. In the content they are links
     (copied tiles carry <a style="color: #39c2d7">, which the editor pushes into every item),
     and the site paints list links teal, semibold and underlined; hence !important on the
     colour, to beat that inline style. */

/* The description line under the page title, added by js/services-subpage-onboarding-lifecycle.js.
   The header has no bottom padding, and the site pins its certification badges to the header's
   bottom right corner (140 x 50 at 15px from the edges, common.css .main-header::after).
   The line is kept narrow enough to stay clear of them on wide screens; on narrower screens it can
   reach under them, so it leaves room below instead. */
.main-header > .main-header__title-description {
    max-width: 720px;
    margin-bottom: 30px;
}

.main-header ~ .main-content .main-article .tiles-wall {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 30px 20px;
    margin-bottom: 30px;
}

    .main-header ~ .main-content .main-article .tiles-wall > .tile {
        width: auto;
        min-width: 0;
        max-width: none;
        margin: 0;
    }

    /* a header that needs three lines grows instead of running into the list */
    .main-header ~ .main-content .main-article .tiles-wall .tile__header {
        height: auto;
        min-height: 65px;
    }

    .main-header ~ .main-content .main-article .tiles-wall .tile li,
    .main-header ~ .main-content .main-article .tiles-wall .tile li a {
        font-family: "source_sans_proregular", sans-serif;
        font-size: 16px;
        font-weight: normal;
        line-height: 24px;
        color: #464547 !important;
        text-decoration: none;
    }

/* FIX Studio gallery: the site's teal photo block (.photos / .photos__title from common.css)
     <div class="photos gallery">
       <div class="photos__title">FIX Studio</div>
       <a class="photo gallery-img" href="/media/.../full.png"><img src="/media/.../full.png" alt="..."></a>
       ...
     </div>
   - Only the first three pictures show, in one row, all the same height. A picture of another
     shape is cropped to fit (object-fit: cover, kept from the top left, where the app's header is).
   - The rest are hidden but stay in the gallery: common.js opens .gallery with
     delegate .gallery-img, which picks up hidden links too, so the viewer pages through all of them.
   - The third picture carries "+N", the number of hidden ones, as on the other photo blocks
     on the site. */

.main-article .photos.gallery {
    column-gap: 5px;
    padding: 0 5px 5px;
}

    .main-article .photos.gallery .photo {
        position: relative;
        width: calc((100% - 10px) / 3);
        aspect-ratio: 16 / 10;
        margin: 0;
        overflow: hidden;
        cursor: zoom-in;
    }

        /* !important beats a style="display: inline" the editor may leave on a link */
        .main-article .photos.gallery .photo:nth-of-type(n+4) {
            display: none !important;
        }

        .main-article .photos.gallery .photo img {
            position: absolute;
            inset: 0;
            width: 100%;
            height: 100%;
            max-width: none;
            object-fit: cover;
            object-position: left top;
        }

        .main-article .photos.gallery .photo:nth-of-type(3):not(:last-of-type)::after {
            position: absolute;
            inset: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            background: rgba(34, 34, 34, 0.6);
            color: #FFFFFF;
            font-size: 64px;
            line-height: 1;
        }

        .main-article .photos.gallery .photo:nth-of-type(3):nth-last-of-type(2)::after { content: "+1"; }
        .main-article .photos.gallery .photo:nth-of-type(3):nth-last-of-type(3)::after { content: "+2"; }
        .main-article .photos.gallery .photo:nth-of-type(3):nth-last-of-type(4)::after { content: "+3"; }
        .main-article .photos.gallery .photo:nth-of-type(3):nth-last-of-type(5)::after { content: "+4"; }
        .main-article .photos.gallery .photo:nth-of-type(3):nth-last-of-type(6)::after { content: "+5"; }

        .main-article .photos.gallery .photo:focus-visible {
            outline: 2px solid #FFFFFF;
            outline-offset: -4px;
        }

/* below this width a full last line of the description reaches the badges */
@media screen and (max-width: 914px) {
    .main-header > .main-header__title-description {
        margin-bottom: 75px;
    }
}

@media screen and (max-width: 768px) {
    .main-header ~ .main-content .main-article .tiles-wall {
        grid-template-columns: minmax(0, 1fr);
        gap: 20px;
    }

        .main-header ~ .main-content .main-article .tiles-wall .tile__header {
            min-height: 0;
        }
}

@media screen and (max-width: 576px) {
    .main-article .photos.gallery .photo:nth-of-type(3):not(:last-of-type)::after {
        font-size: 32px;
    }
}
