/* opportunities-section.css — the homepage opportunities accordion.
 *
 * Page-scoped and pushed from components/uowa/index/opportunities.blade.php, so
 * one file serves both locales. That matters here: every rule this replaced was
 * duplicated across style.css AND en.css — 39 matching selectors in each — and
 * editing them there means making the same change twice and hoping nobody
 * forgets one.
 *
 * Three panels; the active one expands. Because there are only three, a
 * collapsed panel is still ~240px wide at desktop and its title sets
 * horizontally — no rotated text, so Arabic and English behave identically.
 *
 * Direction comes from logical properties throughout.
 */

.ul-opp-acc {
    --opp-navy: #041c33;
    --opp-ease: cubic-bezier(.22, 1, .36, 1);
    --opp-radius: 16px;
    --opp-grow: 2.6;

    display: flex;
    gap: 12px;
    height: clamp(360px, 40vw, 450px);
    margin-top: clamp(24px, 3vw, 40px);
}

/* ───────────────────────────────────────────────────────────── the panel */

.ul-opp-slat {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    flex: 1 1 0;
    min-width: 0;
    border-radius: var(--opp-radius);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background: var(--opp-navy);
    /* flex-grow is the expansion. It is deliberately NOT gated behind
       prefers-reduced-motion: this is feedback for something the visitor is
       doing right now, and the panel is in the correct state whether or not a
       single frame of it animates. */
    transition: flex-grow .55s var(--opp-ease);
}

.ul-opp-slat.is-active {
    flex-grow: var(--opp-grow);
}

.ul-opp-slat:focus-visible {
    outline: 3px solid var(--ul-c3);
    outline-offset: 3px;
}

.ul-opp-photo {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-size: cover;
    background-position: center;
    transform: scale(1.06);
    transition: transform .8s var(--opp-ease);
}

.ul-opp-slat.is-active .ul-opp-photo {
    transform: scale(1);
}

/* Collapsed panels sit back so the active one carries the eye. The bottom stop
   is heavy because the title sits there over an unknown photograph: measured
   against the brightest pixel in the lower third of the three supplied images,
   white still lands above 9:1. Do not lighten without re-measuring. */
.ul-opp-scrim {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(180deg,
        rgba(4, 28, 51, .70) 0%,
        rgba(4, 28, 51, .80) 45%,
        rgba(4, 28, 51, .94) 100%);
    transition: background .55s var(--opp-ease);
}

.ul-opp-slat.is-active .ul-opp-scrim {
    background: linear-gradient(180deg,
        rgba(4, 28, 51, .34) 0%,
        rgba(4, 28, 51, .62) 46%,
        rgba(4, 28, 51, .93) 100%);
}

/* ─────────────────────────────────────────────────────────────── the icon */

.ul-opp-icon {
    position: absolute;
    z-index: 3;
    inset-block-start: clamp(16px, 1.6vw, 22px);
    inset-inline-start: clamp(16px, 1.6vw, 22px);
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    font-size: 1.2rem;
    color: #fff;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .22);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: transform .5s var(--opp-ease), background-color .5s var(--opp-ease);
}

.ul-opp-icon img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    /* CMS icons are black on transparent. */
    filter: brightness(0) invert(1);
}

.ul-opp-slat.is-active .ul-opp-icon {
    transform: scale(1.08);
    background: rgba(255, 255, 255, .2);
}

/* ─────────────────────────────────────────────────────────────── the body */

.ul-opp-body {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: clamp(20px, 2.2vw, 32px);
    color: #fff;
}

.ul-opp-title {
    /* feature role — one size open or closed; the open slat is told apart by
       its width and its revealed body, not by a second title size. */
    font-size: var(--t-feature);
    font-weight: 700;
    line-height: var(--lh-heading);
    text-wrap: balance;
}

/* Everything below the title belongs to the active panel only.
 *
 * grid-template-rows 0fr -> 1fr is what animates the height. It is used instead
 * of max-height because a max-height large enough for the longest panel makes
 * every shorter one ease at the wrong speed.
 *
 * It collapses only the FIRST grid child — further children land in implicit
 * auto-sized tracks and stay at full height. Hence .ul-opp-reveal-in: exactly
 * one child, one track. Do not move desc/tags/cta up a level. */
.ul-opp-reveal {
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    transition: grid-template-rows .5s var(--opp-ease), opacity .35s var(--opp-ease);
}

.ul-opp-reveal-in {
    display: block;
    min-height: 0;
    overflow: hidden;
}

.ul-opp-slat.is-active .ul-opp-reveal {
    grid-template-rows: 1fr;
    opacity: 1;
    transition-delay: .1s;
}

.ul-opp-desc {
    display: block;
    /* body role */
    font-size: var(--t-body);
    line-height: var(--lh-body);
    text-wrap: pretty;
    color: rgba(255, 255, 255, .88);
    max-width: 65ch;
    margin-block-start: 12px;
}

.ul-opp-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-block-start: 16px;
}

.ul-opp-tag {
    /* meta role */
    font-size: var(--t-meta);
    font-weight: 700;
    line-height: var(--lh-ui);
    padding: 6px 13px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .15);
    border: 1px solid rgba(255, 255, 255, .26);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    white-space: nowrap;
}

/* Not a button element — the whole panel is the anchor, and a nested <a> would
   be invalid. This is the affordance for the link the panel already is. */
.ul-opp-cta {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-block-start: 20px;
    padding: .8rem 1.3rem;
    border-radius: 10px;
    background: #fff;
    color: var(--opp-navy);
    font-size: .95rem;
    font-weight: 700;
    line-height: 1.2;
    transition: background-color .3s var(--opp-ease), color .3s var(--opp-ease);
}

.ul-opp-cta i {
    transition: transform .3s var(--opp-ease);
}

/* Gold with a WHITE label measures about 1.6:1 against either locale's gold
   (#febe35 ar, #fec619 en) — the previous section did exactly that and the
   label all but vanished. Navy on the same gold is 10.9:1. */
.ul-opp-slat:hover .ul-opp-cta,
.ul-opp-slat:focus-visible .ul-opp-cta {
    background: var(--ul-c3);
    color: var(--opp-navy);
}

.ul-opp-slat:hover .ul-opp-cta i {
    transform: translateX(3px);
}

[dir="rtl"] .ul-opp-slat:hover .ul-opp-cta i {
    transform: translateX(-3px);
}

/* ─────────────────────────────────────────────────────────────── stacked */

/* Below this width there is no room for three panels side by side, and on a
   touch screen there is no hover to expand one with — a tap navigates. So every
   panel opens and the accordion becomes a plain stack. */
@media (max-width: 860px), (hover: none) {
    .ul-opp-acc {
        flex-direction: column;
        height: auto;
        gap: 14px;
    }

    .ul-opp-slat,
    .ul-opp-slat.is-active {
        flex: none;
        min-height: 240px;
    }

    .ul-opp-slat .ul-opp-photo {
        transform: scale(1);
    }

    .ul-opp-slat .ul-opp-scrim {
        background: linear-gradient(180deg,
            rgba(4, 28, 51, .34) 0%,
            rgba(4, 28, 51, .62) 46%,
            rgba(4, 28, 51, .93) 100%);
    }


    .ul-opp-slat .ul-opp-reveal {
        grid-template-rows: 1fr;
        opacity: 1;
    }
}

@media (max-width: 480px) {
    .ul-opp-tag {
        white-space: normal;
    }
}
