/* شركاء التقدم — homepage partners strip (<x-uowa.index.partners>).

   Loaded after style.css / en.css, and every rule is scoped to
   .ul-home-partners, so it wins over the old .ul-partners rules without
   !important. */

.ul-home-partners {
    padding: clamp(64px, 7vw, 110px) 0;
    background: #f6f7f9;
}

/* The old section painted a gradient over itself with ::before. */
.ul-home-partners::before {
    content: none;
}

.ul-home-partners .ul-section-heading {
    margin-bottom: clamp(32px, 3.4vw, 52px);
}

/* --------------------------------------------------------------------------
   Rail — the same continuous strip as the statistics at the top of the page
   (statistics-section.css), including its seam rule: the tiles are printed
   twice and the track travels exactly half its width, which only lands on a
   seamless loop if every tile carries its own trailing margin rather than
   the track having a `gap`.
   -------------------------------------------------------------------------- */
.ul-hp-rail {
    --hp-gap: 22px;

    position: relative;
    overflow: hidden;
    /* Room for the hover lift and shadow, which overflow would clip. */
    padding-block: 8px 20px;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}

.ul-hp-track {
    --hp-shift: -50%;

    display: flex;
    align-items: stretch;
    width: max-content;
    animation: ul-hp-marquee var(--hp-lap, 40s) linear infinite;
}

/* RTL rows start at the right, so the track travels the other way. */
[dir="rtl"] .ul-hp-track {
    --hp-shift: 50%;
}

@keyframes ul-hp-marquee {
    from { transform: translateX(0); }
    to   { transform: translateX(var(--hp-shift)); }
}

/* (0,2,0) so it beats the `animation` shorthand, which resets play-state. */
.ul-hp-rail:hover .ul-hp-track,
.ul-hp-rail:focus-within .ul-hp-track {
    animation-play-state: paused;
}

/* --------------------------------------------------------------------------
   Tile
   -------------------------------------------------------------------------- */
.ul-hp-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
    flex: 0 0 auto;
    width: clamp(170px, 14vw, 200px);
    margin: 0;
    margin-inline-end: var(--hp-gap);
    padding: 26px 18px 22px;
    text-align: center;
    background: #fff;
    border: 1px solid rgba(4, 28, 51, 0.08);
    border-radius: 16px;
    transition:
        transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
        border-color 0.35s ease,
        box-shadow 0.35s ease;
}

/* A partner with a site is a link: keep the tile's own colours. */
a.ul-hp-card {
    color: inherit;
    text-decoration: none;
}

.ul-hp-card:hover {
    transform: translateY(-4px);
    border-color: var(--ul-c3);
    box-shadow: 0 16px 34px -14px rgba(11, 37, 78, 0.25);
}

/* A fixed-height well, so round seals and wide wordmarks sit on the same
   line; the logo is contained, never cropped. */
.ul-hp-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 104px;
}

.ul-hp-logo img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.ul-hp-card:hover .ul-hp-logo img {
    transform: scale(1.05);
}

.ul-hp-name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    /* Two lines reserved, so one-line names do not make a ragged row. */
    min-height: 2.9em;
    margin: 0;
    padding-top: 14px;
    width: 100%;
    border-top: 1px solid rgba(4, 28, 51, 0.08);
    /* meta role */
    font-size: var(--t-meta);
    font-weight: 700;
    line-height: var(--lh-ui);
    color: var(--ul-primary);
}

/* --------------------------------------------------------------------------
   The strip always moves, on touch screens too. A touch screen has no hover,
   so a tap would leave the strip stuck paused; the hover pause and tile lift
   are therefore limited to real pointers.
   -------------------------------------------------------------------------- */
@media (hover: none) {
    .ul-hp-rail:hover .ul-hp-track {
        animation-play-state: running;
    }

    .ul-hp-card:hover {
        transform: none;
        border-color: rgba(4, 28, 51, 0.08);
        box-shadow: none;
    }
}

/* Arrows under the strip, centred (the buttons' look comes from the
   shared .ul-side-heading-nav). */
.ul-hp-nav {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 18px;
}

@media screen and (max-width: 767px) {
    .ul-hp-rail {
        --hp-gap: 14px;
    }

    .ul-hp-card {
        width: 150px;
        padding: 20px 12px 16px;
        gap: 12px;
    }

    .ul-hp-logo {
        height: 80px;
    }

    .ul-hp-name {
        padding-top: 10px;
    }
}
