/* news-section.css — the homepage news section (lead story + headline list).
 *
 * Page-scoped and pushed from components/uowa/index/blog.blade.php, so one file
 * serves Arabic and English. The rules this replaced lived in style.css AND
 * en.css, which is how the section ended up with a hardcoded #fdbe34 that gave
 * the English site the Arabic gold.
 *
 * Prefix is ul-nlead-, not ul-news-: ul-news-title, ul-news-excerpt,
 * ul-news-img and ul-news-meta are already taken by the administrative
 * news-card component.
 *
 * Direction comes from logical properties throughout.
 */

.ul-nlead-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: clamp(22px, 2.4vw, 32px);
}

.ul-nlead-h2 {
    margin: 0;
    line-height: 1.25;
}

.ul-nlead-h2::after {
    content: "";
    display: block;
    width: 52px;
    height: 4px;
    border-radius: 2px;
    background: var(--ul-c3);
    margin-top: 12px;
}

.ul-nlead-all {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    /* label role */
    font-size: var(--t-label);
    font-weight: 700;
    line-height: var(--lh-ui);
    color: var(--ul-primary);
    background: #fff;
    border: 1px solid #e3e7ee;
    border-radius: 9px;
    padding: 10px 16px;
    transition: background-color .25s cubic-bezier(.22, 1, .36, 1),
                color .25s cubic-bezier(.22, 1, .36, 1),
                border-color .25s cubic-bezier(.22, 1, .36, 1);
}

.ul-nlead-all:hover,
.ul-nlead-all:focus-visible {
    background: var(--ul-primary);
    border-color: var(--ul-primary);
    color: #fff;
}

.ul-nlead-all i {
    font-size: 12px;
    transition: transform .3s cubic-bezier(.22, 1, .36, 1);
}

.ul-nlead-all:hover i {
    transform: translateX(-4px);
}

[dir="ltr"] .ul-nlead-all:hover i {
    transform: translateX(4px);
}

.ul-nlead {
    --nl-ease: cubic-bezier(.22, 1, .36, 1);
    --nl-ink: #06162d;

    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(300px, .95fr);
    gap: 22px;
    align-items: stretch;
}

/* ───────────────────────────────────────────────────────── the lead */

.ul-nlead-stage {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    border-radius: 18px;
    min-height: clamp(360px, 34vw, 460px);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background: var(--nl-ink);
    text-decoration: none;
}

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

.ul-nlead-shots {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.ul-nlead-shot {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity .55s var(--nl-ease);
}

.ul-nlead-shot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ul-nlead-shot.is-on {
    opacity: 1;
}

/* The bottom stop is heavy because the headline sits there over an unknown
   photograph. Measured against the brightest pixel in the lower third of the
   supplied images, white still lands above 12:1. Do not lighten it without
   re-measuring. */
.ul-nlead-scrim {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(0deg,
        rgba(6, 22, 45, .95) 0%,
        rgba(6, 22, 45, .72) 42%,
        rgba(6, 22, 45, .18) 100%);
}

.ul-nlead-body {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: clamp(22px, 2.6vw, 34px);
    color: #fff;
}

/* Navy on gold measures 9.1:1 in Arabic and 11.1:1 in English. White on the
   same gold — which is what the date badge this replaced did — is 1.65:1. */
.ul-nlead-flag {
    display: inline-flex;
    align-items: center;
    /* meta role */
    font-size: var(--t-meta);
    font-weight: 700;
    line-height: var(--lh-ui);
    background: var(--ul-c3);
    color: var(--ul-primary);
    padding: 6px 12px;
    border-radius: 999px;
    margin-bottom: 14px;
}

.ul-nlead-title {
    /* feature role */
    font-size: var(--t-feature);
    font-weight: 700;
    line-height: var(--lh-heading);
    text-wrap: balance;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ul-nlead-ex {
    /* body role */
    font-size: var(--t-body);
    line-height: var(--lh-body);
    text-wrap: pretty;
    color: rgba(255, 255, 255, .9);
    max-width: 65ch;
    margin-bottom: 18px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ul-nlead-ex[hidden] {
    display: none;
}

.ul-nlead-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

/* Not a <button> and not a nested <a> — the whole panel is already the link.
   This is the affordance for it. */
.ul-nlead-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    color: var(--ul-primary);
    /* label role */
    font-size: var(--t-label);
    font-weight: 700;
    line-height: var(--lh-ui);
    padding: 12px 19px;
    border-radius: 10px;
    transition: background-color .3s var(--nl-ease), color .3s var(--nl-ease);
}

.ul-nlead-cta i {
    font-size: 12px;
    transition: transform .3s var(--nl-ease);
}

.ul-nlead-stage:hover .ul-nlead-cta,
.ul-nlead-stage:focus-visible .ul-nlead-cta {
    background: var(--ul-c3);
}

.ul-nlead-stage:hover .ul-nlead-cta i {
    transform: translateX(-4px);
}

[dir="ltr"] .ul-nlead-stage:hover .ul-nlead-cta i {
    transform: translateX(4px);
}

.ul-nlead-date {
    /* meta role */
    font-size: var(--t-meta);
    font-weight: 700;
    line-height: var(--lh-ui);
    font-variant-numeric: tabular-nums;
    color: rgba(255, 255, 255, .84);
}

/* ─────────────────────────────────────────────────── the headline list */

/* Centred, not top-aligned: the English site publishes far fewer news posts
   than the Arabic one — two against five today — and a short list pinned to the
   top of a 460px column reads as a rendering fault rather than as "that is all
   the news there is". With a full list this has no effect. */
.ul-nlead-list {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
}

.ul-nlead-item {
    position: relative;
    display: grid;
    grid-template-columns: 74px 1fr;
    gap: 13px;
    align-items: center;
    padding: 11px;
    border-radius: 13px;
    border: 1px solid transparent;
    text-decoration: none;
    transition: background-color .3s var(--nl-ease),
                border-color .3s var(--nl-ease),
                box-shadow .3s var(--nl-ease);
}

.ul-nlead-item:hover {
    background: #f7f9fc;
}

.ul-nlead-item.is-on {
    background: #fff;
    border-color: #e3e7ee;
    /* Softened. The border and the white ground already mark which headline is
       active, so the shadow only has to lift the card off the list — it does
       not have to carry the state on its own. */
    box-shadow: 0 6px 14px -12px rgba(11, 37, 78, .38);
}

.ul-nlead-item:focus-visible {
    outline: 3px solid var(--ul-c3);
    outline-offset: 2px;
}

.ul-nlead-thumb {
    width: 74px;
    height: 58px;
    border-radius: 9px;
    overflow: hidden;
    /* Desaturated until active, so the eye is drawn to the lead photograph
       rather than to five competing thumbnails. */
    filter: saturate(.6);
    transition: filter .35s var(--nl-ease);
}

.ul-nlead-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ul-nlead-item.is-on .ul-nlead-thumb,
.ul-nlead-item:hover .ul-nlead-thumb {
    filter: none;
}

.ul-nlead-it-txt {
    min-width: 0;
}

/* --ul-gray3 would be 3.46:1 here, under the 4.5:1 floor for 12px text. */
.ul-nlead-it-date {
    display: block;
    /* meta role */
    font-size: var(--t-meta);
    font-weight: 700;
    line-height: var(--lh-ui);
    font-variant-numeric: tabular-nums;
    color: var(--ul-gray2);
    margin-bottom: 3px;
}

.ul-nlead-it-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    /* card role */
    font-size: var(--t-card);
    font-weight: 700;
    line-height: var(--lh-heading);
    color: var(--ul-primary);
}

.ul-nlead-bar {
    position: absolute;
    inset-block: 11px;
    inset-inline-start: 0;
    width: 3px;
    border-radius: 999px;
    background: var(--ul-c3);
    transform: scaleY(0);
    transform-origin: top;
    transition: transform .35s var(--nl-ease);
}

.ul-nlead-item.is-on .ul-nlead-bar {
    transform: scaleY(1);
}

/* The countdown to the next story, under the active headline. Hidden while the
   section is not rotating at all — an idle track would promise a timer that is
   not running — but it stays put while the visitor pauses it by hovering, since
   a line that vanishes the moment you reach for it reads as a fault. */
.ul-nlead-tick {
    position: absolute;
    inset-block-end: 0;
    inset-inline: 11px;
    height: 2px;
    border-radius: 999px;
    background: #e3e7ee;
    overflow: hidden;
    opacity: 0;
}

.ul-nlead.is-playing .ul-nlead-item.is-on .ul-nlead-tick {
    opacity: 1;
}

.ul-nlead-tick i {
    position: absolute;
    inset-block: 0;
    inset-inline-start: 0;
    width: 0;
    background: var(--ul-primary);
}

/* Deliberately a CSS animation and not a requestAnimationFrame loop.
 *
 * The script advances the lead on this animation's `animationend`, so the bar
 * and the story it is counting down cannot drift apart, and pausing the
 * animation pauses the rotation with it — one mechanism, not two kept in sync.
 * It also survives the frame loop being frozen, which is what happens whenever
 * the page is not painting.
 *
 * --nl-dwell is written by the script so the duration has a single source of
 * truth; the literal here is only a fallback. */
@keyframes ul-nlead-count {
    from { width: 0; }
    to { width: 100%; }
}

.ul-nlead.is-playing .ul-nlead-item.is-on .ul-nlead-tick i {
    animation: ul-nlead-count var(--nl-dwell, 7000ms) linear forwards;
}

/* Must out-specify the rule above, not merely follow it: `animation` is a
   shorthand, so it resets animation-play-state to running every time it
   matches. A plain `.ul-nlead.is-paused .ul-nlead-tick i` (0,3,1) loses to
   (0,5,1) and the countdown carries on straight through the pause. */
.ul-nlead.is-playing.is-paused .ul-nlead-item.is-on .ul-nlead-tick i {
    animation-play-state: paused;
}

/* ─────────────────────────────────────────────────────── empty state */

.ul-nlead-empty {
    text-align: center;
    padding: 56px 20px;
    background: #fff;
    border: 1px solid #e3e7ee;
    border-radius: 18px;
}

.ul-nlead-empty i {
    font-size: 42px;
    color: var(--ul-c3);
}

.ul-nlead-empty-title {
    font-size: 19px;
    font-weight: 700;
    color: var(--ul-primary);
    margin: 16px 0 6px;
}

.ul-nlead-empty-txt {
    font-size: 14.5px;
    color: var(--ul-gray2);
    margin: 0;
}

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

@media (max-width: 991px) {
    .ul-nlead {
        grid-template-columns: 1fr;
    }

    .ul-nlead-stage {
        min-height: 340px;
    }
}

@media (max-width: 575px) {
    .ul-nlead-head {
        align-items: flex-start;
    }

    .ul-nlead-stage {
        min-height: 300px;
    }

    .ul-nlead-item {
        grid-template-columns: 62px 1fr;
    }

    .ul-nlead-thumb {
        width: 62px;
        height: 50px;
    }
}
