/* ============================================================================
   rankings-section.css — the homepage "Rankings & Accreditations" block.

   ONE FILE FOR BOTH LOCALES, pushed by components/uowa/index/qualification.blade.php
   and therefore loaded after style.css (ar) / en.css (en). Those two are forked
   near-copies and the old card was styled from BOTH of them in different ways —
   en.css put the gold rail on `.award-highlight` as a border-left, style.css put
   it on a duplicate `.ul-qualification-item` rule as a border-right. Two files,
   two mechanisms, one component.

   NEW CLASS NAMES ON PURPOSE. The card markup below uses `ul-accred-*` rather
   than the old `ul-qualification-item*`, so none of those ~15 legacy rules apply
   to it at all. Overriding them one by one across two 13,000-line stylesheets
   would have meant winning fifteen specificity arguments and losing one of them
   silently later. The old rules are left where they are, now matching nothing on
   this page.

   THE TREATMENT — "medallion". The seal breaks the top edge of the card the way
   a real award seal sits proud of a certificate. What it replaces was a 4px
   saturated-yellow bar down the card's edge, which is a stock decoration and
   outweighed the award title beside it. Gold survives here as a 1px ring around
   the seal and a 4px dot before the year.

   WHY GOLD IS NEVER TEXT HERE: --ul-c3 is #fec619 (en) / #febe35 (ar), which is
   about 1.7:1 against white — unreadable as type. It works as a block on navy,
   which is why the header and hero can use it and this section cannot.
   ========================================================================= */

:root {
    --acc-navy: var(--ul-primary, #0b254e);
    --acc-gold: var(--ul-c3, #febe35);
    --acc-ink: #16202c;
    /* Both darkened from #6b7684 / #8a95a3. Those were picked against white; on
       the tinted card surface the issuer label measured 4.22:1 and the year
       about 2.8:1, under the 4.5 floor. Greys have to be re-checked whenever
       the surface under them moves — measured, not assumed. */
    --acc-muted: #59636f;
    --acc-muted-2: #666f7c;
    /* A cool, slightly navy-biased grey. The cards are white, so the section
       needs a ground to sit them on — a white card on a white band has no
       edge except its shadow. */
    /* The CARD surface, not a section background. See the note below. */
    --acc-surface: #f3f5f7;
    --acc-ease: cubic-bezier(.2, .7, .3, 1);
    /* Slight overshoot. Used only where something should feel picked up — the
       card lift and the seal — never on colour, which looks broken bouncing. */
    --acc-spring: cubic-bezier(.34, 1.4, .64, 1);
}

/* NO SECTION BACKGROUND — and this is deliberate, not an omission.

   The medallion treatment was drawn as white cards on a tinted band, and a
   tint was briefly set here to give them a ground. It had to come out: the page
   carries a pale geometric pattern that runs continuously behind every section,
   and a filled band cut a hard-edged slab out of it. The section's own
   decorative vectors (assets/img/1bg.png, 2bg.svg) read as belonging to that
   pattern, so slicing it detached them from the page.

   The contrast the cards need is taken the other way round instead: the CARD is
   the tinted surface and the SEAL stays white, so the medallion still separates
   from what it sits on. Same relationship, inverted, and the page background is
   left whole. */

/* ------------------------------------------------------- decorative art */

/* SIZE AND POSITION ARE NOT TOUCHED HERE.

   This file once re-sized and re-positioned .ul-qualification-vector,
   .vector-1 and .vector-2, and that was reverted at the client's request: the
   crop is how the art is meant to sit on this page. Their box rules live in
   style.css and en.css (identical in both):

     .ul-qualification-vector { position: absolute; z-index: -1 }
     .vector-1 { bottom: 0; right: -70px; max-width: clamp(250px,18.39vw,350px);
                 height: 100%; object-fit: cover; z-index: -1 }
     .vector-2 { top: 0; left: 0; width: clamp(500px,35vw,700px);
                 height: 100%; object-fit: cover; z-index: -1 }

   What IS set here is only how the building sketch (vector-1) fades. The crop
   left it with hard straight edges — a cut line on its inner side and at its
   top — while the geometric pattern opposite (vector-2) dissolves into the
   page. A mask fades the sketch out toward the content and the top the same
   way, and a little less opacity lets it sit back like the pattern does.
   Nothing about the box changes. */
.ul-qualification .vector-1 {
    /* filter, not opacity: WOW's fadeInLeft ends on opacity 1 and holds it. */
    filter: opacity(.55);
    -webkit-mask-image:
        linear-gradient(to left, #000 25%, transparent 95%),
        linear-gradient(to top, #000 45%, transparent 100%);
    -webkit-mask-composite: source-in;
    mask-image:
        linear-gradient(to left, #000 25%, transparent 95%),
        linear-gradient(to top, #000 45%, transparent 100%);
    mask-composite: intersect;
}

/* ------------------------------------------------------------- dispersion */

/* A DISPERSION, NOT A BAND. What the filled background got wrong was its EDGE —
   a flat colour stops dead at the section boundary and reads as a slab pasted
   over the page. These two ellipses reach full transparency at 68% and 60% of
   their own extent, well inside the box, so there is no boundary anywhere for
   the eye to catch. The section still gathers a little light behind the cards;
   it just never announces where it begins.

   This is the same mistake the hero once made in reverse: a gradient whose box
   ended before the gradient had finished fading showed the cut as a hard seam.
   Fade out early and the container becomes invisible.

   Peak alpha is .055 and .05 — deliberately near the limit of what registers.
   Anything heavier and it is a band again with softer corners.

   THE NUMBERS ARE NOT ARBITRARY. Each ellipse has to reach zero before it
   reaches any edge of the section, or the edge cuts it and the seam is back.
   Radius x stop-position gives the distance travelled, and centre ± that has to
   stay inside 0–100% on both axes:

     navy   48%/52% at 35%/44%, clear at 68%  ->  x 2.4–67.6%   y 8.6–79.4%
     gold   42%/38% at 70%/58%, clear at 60%  ->  x 44.8–95.2%  y 35.2–80.8%

   An earlier pass had the gold at `52% at 72%` and it ran to 103% vertically —
   cut dead along the section's bottom edge. Verified by temporarily raising
   both alphas 8x, which is the only way to see this at the shipped opacity. */
.ul-qualification::before {
    content: "";
    position: absolute;
    inset: 0;
    /* -2, below the decorative vectors at -1. At the same z-index the two would
       be ordered by DOM position, which is not something to leave to chance. */
    z-index: -2;
    pointer-events: none;
    background:
        radial-gradient(ellipse 48% 52% at 35% 44%,
            rgba(4, 28, 51, .055), rgba(4, 28, 51, 0) 68%),
        radial-gradient(ellipse 42% 38% at 70% 58%,
            rgba(254, 190, 53, .05), rgba(254, 190, 53, 0) 60%);
}

/* ------------------------------------------------------------------ grid */

/* Grid, not the Bootstrap `row row-cols-2` this replaced. Two reasons: grid
   rows stretch, so the cards are equal height instead of 147px beside 191px;
   and `auto-fit` means a third accreditation added in the CMS reflows on its
   own rather than needing the column count changed in the markup. */
.ul-accred-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: clamp(20px, 2vw, 30px);
    /* Clears the seal, which hangs 26px above the first row of cards. */
    margin-top: clamp(46px, 4vw, 62px);
}

/* ------------------------------------------------------------------ card */

/* The top padding is a FIXED 50px, not a clamp, and that is the one number in
   this file that must not drift: the seal is 64px tall and hangs 28px above the
   card, so it reaches 36px down into it. At a fluid top padding the text started
   at 24px on a 1120px viewport and the issuer label ran underneath the seal.
   50px leaves 14px of clearance. Change either number and check the other. */
.ul-accred-card {
    position: relative;
    height: 100%;
    background: var(--acc-surface);
    border-radius: 16px;
    padding: 50px clamp(20px, 1.8vw, 28px) clamp(22px, 1.8vw, 26px);
    /* Lighter than it was when the card was white on a tinted band. The card
       now has its own tint to separate it from the page, so the shadow only has
       to suggest depth rather than manufacture an edge — at the old weight it
       read as a heavy drop shadow on an already-visible box. */
    box-shadow: 0 4px 16px -10px rgba(4, 28, 51, .22);
    transition: box-shadow .34s var(--acc-ease), transform .34s var(--acc-spring),
        background-color .3s var(--acc-ease);
}

/* Only a card that actually has a seal reserves room for one — a CMS child with
   no image would otherwise carry 26px of empty space at the top. */
.ul-accred-card.has-seal {
    margin-top: 28px;
}

/* A card with no seal has nothing to clear, so it reclaims the padding. */
.ul-accred-card:not(.has-seal) {
    padding-top: clamp(24px, 2vw, 30px);
}

.ul-accred-seal {
    position: absolute;
    inset-block-start: -28px;
    inset-inline-start: clamp(20px, 1.8vw, 28px);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #fff;
    display: grid;
    place-items: center;
    /* The gold ring is a spread shadow rather than a border so it cannot add to
       the element's box and shift the seal off its 64px grid. */
    box-shadow:
        0 0 0 1px rgba(254, 190, 53, .55),
        0 4px 14px -4px rgba(4, 28, 51, .25);
    transition: transform .38s var(--acc-spring), box-shadow .34s var(--acc-ease);
}

/* object-fit because the CMS badges are wildly inconsistent — one is a square
   trophy illustration, the other a photographic ministry seal with its own
   whitespace. A shared disc is what makes them read as a set. */
.ul-accred-seal img {
    width: 38px;
    height: 38px;
    object-fit: contain;
}

/* ------------------------------------------------------------------ text */

.ul-accred-meta {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 12px;
    margin-bottom: clamp(10px, 1vw, 14px);
}

/* Small caps and tracked out: this is a label, and the award below it is the
   thing to read. The old card had this bold at 1.15em while the award sat in a
   163px column — the hierarchy was upside down. */
.ul-accred-issuer {
    /* meta role */
    font-size: var(--t-meta);
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    line-height: var(--lh-ui);
    color: var(--acc-muted);
}

/* Arabic is a connected script — tracking pulls the joins apart, so the
   uppercasing and letter-spacing are Latin-only. */
[dir="rtl"] .ul-accred-issuer {
    letter-spacing: normal;
    text-transform: none;
    font-size: clamp(12px, .85vw, 13.5px);
}

.ul-accred-year {
    /* meta role */
    font-size: var(--t-meta);
    line-height: var(--lh-ui);
    color: var(--acc-muted-2);
    font-variant-numeric: tabular-nums;
    display: inline-flex;
    align-items: center;
    gap: 9px;
}

/* The second and last place gold appears. */
.ul-accred-year::before {
    content: "";
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--acc-gold);
    flex: none;
}

/* The award itself — full card width at a real measure. It used to be 64
   characters over 7 lines in a 163px column, about nine characters per line. */
.ul-accred-award {
    margin: 0;
    /* card role */
    font-size: var(--t-card);
    font-weight: 700;
    line-height: var(--lh-heading);
    color: var(--acc-navy);
    max-width: 42ch;
    text-wrap: balance;
}

/* ---------------------------------------------------------- awards strip */

/* Matched to the cards rather than left on --ul-gray (#F2F2F2), so the two
   surfaces in this section are deliberately the same tone instead of nearly
   the same tone.

   The margin is set here because BOTH locale sheets carry
   `margin-top: clamp(34px, 4.62vw, 32px)` — a clamp whose maximum (32px) is
   below its minimum (34px). CSS resolves that as max(MIN, min(VAL, MAX)), so
   the minimum always wins and the value was pinned at a flat 34px at every
   width, fluid in appearance only. The strip sat almost touching the cards as a
   result. This one actually scales. */
.ul-qualification .ul-qualification-awards {
    background-color: var(--acc-surface);
    box-shadow: 0 4px 16px -10px rgba(4, 28, 51, .22);
    margin-top: clamp(30px, 3.6vw, 56px);
}

/* Moved out of a <style> block inside the Blade component, where it shipped a
   duplicate copy on every render and was invisible to anyone grepping the
   stylesheets. */
.ul-qualification-awards { overflow: hidden; }
.ul-qualification-awards-slider { flex: 1; min-width: 0; overflow: hidden; }

.ul-awards-viewport { overflow: hidden; flex: 1; min-width: 0; }

.ul-awards-track {
    display: flex;
    gap: 14px;
    transition: transform .45s ease;
    will-change: transform;
}

.ul-awards-item {
    flex: 0 0 calc((100% - 14px * 6) / 7);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

.ul-awards-item img {
    max-height: 58px;
    max-width: 100%;
    object-fit: contain;
    display: block;
}

/* ---------------------------------------------------------- responsive */

@media (max-width: 1100px) {
    .ul-awards-item { flex: 0 0 calc((100% - 14px * 4) / 5); }
}

@media (max-width: 768px) {
    .ul-qualification-awards { flex-wrap: wrap; }
    .ul-qualification-awards-buttons { width: 100%; }
    .ul-qualification-awards-btn { width: 100%; justify-content: center; }
    .ul-qualification-awards-slider { width: 100%; }
    .ul-awards-item { flex: 0 0 calc((100% - 14px * 2) / 3); }
    .ul-awards-item img { max-height: 44px; }
}

/* Same relationship held at the smaller size: a 56px seal hanging 24px above
   reaches 32px in, so the top padding is 46px. */
@media (max-width: 575px) {
    .ul-accred-grid { margin-top: 42px; }
    .ul-accred-card { padding: 46px 18px 20px; }
    .ul-accred-card.has-seal { margin-top: 24px; }
    .ul-accred-card:not(.has-seal) { padding-top: 22px; }
    .ul-accred-seal { width: 56px; height: 56px; inset-block-start: -24px; }
    .ul-accred-seal img { width: 32px; height: 32px; }
}

@media (max-width: 480px) {
    .ul-awards-item { flex: 0 0 calc((100% - 14px) / 2); }
    .ul-awards-item img { max-height: 38px; }
}

/* ------------------------------------------------------------------ hover */

/* ONE GESTURE, THREE PARTS. The card lifts, the seal tilts and its gold ring
   comes up to full strength with a halo behind it, and the issuer label darkens
   from grey to navy. They share an easing and a duration so it reads as the
   card being picked up rather than three effects firing at once.

   The seal is the only thing that rotates — a medal catching the light. At
   -3deg it is barely a gesture, which is the point; anything more and a
   university's accreditation badge looks like it is falling off. */
.ul-accred-issuer,
.ul-accred-award {
    transition: color .28s var(--acc-ease);
}

@media (hover: hover) {
    /* The card lightens to white as it lifts — the surface it is standing on
       stays tinted, so rising out of it is the more honest gesture than getting
       a bigger shadow. */
    .ul-accred-card:hover,
    .ul-accred-card:focus-within {
        transform: translateY(-5px);
        background: #fff;
        box-shadow: 0 16px 34px -14px rgba(4, 28, 51, .26);
    }

    .ul-accred-card:hover .ul-accred-seal,
    .ul-accred-card:focus-within .ul-accred-seal {
        transform: scale(1.07) rotate(-3deg);
        box-shadow:
            0 0 0 1px var(--acc-gold),
            0 0 0 7px rgba(254, 190, 53, .16),
            0 8px 20px -5px rgba(4, 28, 51, .3);
    }

    .ul-accred-card:hover .ul-accred-issuer,
    .ul-accred-card:focus-within .ul-accred-issuer {
        color: var(--acc-navy);
    }
}

/* --------------------------------------------------- awards strip, refined */

/* The logos are a QS wordmark, a magenta THE tile, a green UI GreenMetric mark,
   two navy crests and an outline ASIC lockup — six different palettes and six
   different weights sitting in one row. Held back to near-grey they read as a
   SET of credentials; each one comes up to full colour when it is pointed at,
   which is also the only moment anyone needs to identify it.

   `opacity` inside the filter rather than as its own property, so the whole
   thing is one composited step and the hover cannot half-apply. */
.ul-awards-item {
    padding: 8px 10px;
    border-radius: 12px;
    transition: transform .32s var(--acc-spring), background-color .28s var(--acc-ease);
}

.ul-awards-item img {
    filter: grayscale(.92) opacity(.6);
    transition: filter .34s var(--acc-ease);
}

@media (hover: hover) {
    /* White, not a darker tint — the strip itself is tinted now, so the logo
       lifts onto a bright chip rather than sinking into a darker one. */
    .ul-awards-item:hover {
        transform: translateY(-4px);
        background-color: #fff;
    }

    .ul-awards-item:hover img {
        filter: grayscale(0) opacity(1);
    }
}

a.ul-awards-item:focus-visible {
    outline: 2.5px solid var(--acc-gold);
    outline-offset: 2px;
}

a.ul-awards-item:focus-visible img {
    filter: grayscale(0) opacity(1);
}

/* The track slides under a fixed frame, so without this a logo is chopped in
   half at the moment it crosses the edge. The mask fades the last 34px instead.
   Applied to the slider, not the viewport, so the frame's own rounded corner is
   unaffected. */
.ul-qualification-awards-slider {
    -webkit-mask-image: linear-gradient(to right,
        transparent 0, #000 34px, #000 calc(100% - 34px), transparent 100%);
    mask-image: linear-gradient(to right,
        transparent 0, #000 34px, #000 calc(100% - 34px), transparent 100%);
}

/* ---- the call to action ---- */

/* Gold on navy is the one pairing where this brand's yellow is legible — 8.6:1
   against --ul-secondary, against 1.7:1 on white. So the chevron is the third
   and last place gold appears in this section. */
.ul-qualification-awards-btn {
    gap: 10px;
    transition: background-color .26s var(--acc-ease);
}

.ul-qualification-awards-btn i {
    color: var(--acc-gold);
    transition: transform .3s var(--acc-spring);
}

.ul-qualification-awards-btn:hover {
    background-color: #12315f;
}

/* Leans the way the text reads, in both directions. */
[dir="ltr"] .ul-qualification-awards-btn:hover i { transform: translateX(4px); }
[dir="rtl"] .ul-qualification-awards-btn:hover i { transform: translateX(-4px); }

/* REDUCED MOTION — WHAT IT DOES AND DOES NOT SWITCH OFF.

   An earlier version of this block removed the hover transitions and transforms
   outright, and that was wrong. `prefers-reduced-motion` is on for anyone who
   has unticked Windows' "animation effects", which is a great many ordinary
   visitors — including this project's own client — so that setting was quietly
   deleting every hover on the section for most of the people looking at it.

   The query exists for motion that can trigger vestibular symptoms: large,
   sweeping, parallax, and above all motion the visitor did not ask for. A 5px
   lift on the card someone is actively pointing at is none of those. It stays.

   What is genuinely gated is the logo strip's AUTO-ADVANCE — continuous motion
   nobody requested — and that is handled in awards-slider.js, which simply does
   not start the timer. The strip's own slide transition stays so that keyboard
   navigation still animates when the visitor drives it. Only the seal's
   rotation is dropped here, as the one flourish that is decoration rather than
   feedback. */
