/* ============================================================================
   home-hero.css — the homepage banner's typography and controls.

   ONE FILE FOR BOTH LOCALES, pushed by components/uowa/index/banner.blade.php
   and therefore loaded after style.css (ar) / en.css (en). Those two are forked
   near-copies, so a hero change made in one of them would ship to a single
   language; everything here is written with logical properties and serves both.

   THE PROBLEM THIS FIXES. The slide had four voices and no hierarchy:

     eyebrow    11px  gold, in a bordered pill
     title      24px  white, 800
     subtitle   16px  gold, 600      <- a second headline, not support
     descr      13px  white 90%

   A 24px title against a 16px sub-headline is a ratio of 1.5, which the eye
   reads as two headings rather than one heading and its support. Gold appeared
   three times (pill, subtitle, button) so nothing gold meant anything. And the
   whole block was centred over a photograph with no scrim behind the text.

   THE RULE HERE: one gold voice, one dominant size, one primary action.
   ========================================================================= */

:root {
    --hero-gold: var(--ul-c3, #febe35);
    --hero-ink: #061530;
    --hero-ease: cubic-bezier(.2, .7, .3, 1);
    /* Overshoots slightly before settling — the ring should feel like it snaps
       open, not like it is drawn. Used only on the pagination handover. */
    --hero-bounce: cubic-bezier(.34, 1.56, .64, 1);
}

/* ------------------------------------------------------------------ scrim */

/* style.css already fades the foot of the slide to near-black, which carries
   the buttons. It does nothing for the title, which sits further up and landed
   white-on-white over the pale brick in the live photograph.

   TWO LAYERS, and both are needed.

   The directional one alone was not enough: it reached zero by the far end of
   the headline's own line, so the last third of "جامعة وارث الأنبياء" was
   still sitting on the white lettering of the sign in the photograph. Its
   dense band is now wide enough to carry a full line of text.

   The vertical one is what makes it hold at every width. The text block is
   anchored to the FOOT of the hero, so a bottom-weighted gradient covers it no
   matter how long the line runs or how narrow the viewport gets — where a
   horizontal fade tuned for a 1440px column always leaks on a tablet. It
   starts below the midpoint so the top of the photograph stays untouched. */
.ul-banner-slide::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        linear-gradient(
            to var(--hero-scrim-to, left),
            rgba(4, 15, 33, .86) 0%,
            rgba(4, 15, 33, .74) 40%,
            rgba(4, 15, 33, .42) 68%,
            rgba(4, 15, 33, .1) 88%,
            rgba(4, 15, 33, 0) 100%
        ),
        linear-gradient(
            to bottom,
            rgba(4, 15, 33, 0) 38%,
            rgba(4, 15, 33, .34) 62%,
            rgba(4, 15, 33, .62) 82%,
            rgba(4, 15, 33, .72) 100%
        );
}

/* A gradient cannot take a logical direction keyword, so the one axis that
   genuinely needs mirroring is set as a variable. */
[dir="rtl"] .ul-banner-slide::after { --hero-scrim-to: left; }
[dir="ltr"] .ul-banner-slide::after { --hero-scrim-to: right; }

/* --------------------------------------------------------------- position */

/* Was `right: 60px` — a physical edge hardcoded for Arabic, which left the
   English hero anchored to the right as well. Logical properties put it at the
   reading edge in both. The width cap is what stops a long Arabic sentence
   running the full 1400px and losing its line breaks. */
.ul-banner-content {
    inset-inline-start: clamp(20px, 5vw, 76px);
    inset-inline-end: auto;
    inset-block-end: clamp(52px, 8vh, 104px);
    max-width: min(760px, 88vw);
    padding: 0;
    text-align: start;
}

.ul-banner-txt {
    text-align: start;
}

/* ------------------------------------------------------------- the eyebrow */

/* No pill. At 11px inside a bordered, blurred capsule it read as a small
   button, which is the one thing an eyebrow must not look like. A short gold
   rule and a plain label say "this is a kicker" and cost the eye nothing. */
.ul-banner-sub-title {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    backdrop-filter: none;
    color: var(--hero-gold);
    font-family: var(--font-lato);
    /* kicker role */
    font-size: var(--t-label);
    font-weight: 700;
    line-height: var(--lh-ui);
    margin-bottom: clamp(20px, 1.9vw, 30px);
}

.ul-banner-sub-title::before {
    content: "";
    width: clamp(22px, 2.4vw, 34px);
    height: 2px;
    background: var(--hero-gold);
    flex: none;
}

/* Letter-spacing only in Latin. Arabic is a connected script — spacing the
   letters pulls the joins apart and the word stops being one word. */
[dir="ltr"] .ul-banner-sub-title {
    letter-spacing: .14em;
    text-transform: uppercase;
}

/* --------------------------------------------------------------- the title */

/* The one thing that leads, and it leads on SIZE — the display token against a
   lead-size subtitle.

   WEIGHT 700, NOT 800. SomarSans ships two real cuts — Regular.otf at 400 and
   Bold.otf at 700 — so 800 was never a drawn weight; the browser was
   synthesising it by smearing the 700 file, which is why the headline looked
   slightly soft at large sizes. 700 is the genuine Bold. The scrim is what
   makes it safe: light strokes need the ground behind them held down.

   The negative tracking went with it. Tightening is a device for heavy display
   type; on a regular cut it just closes up the counters. */
.ul-banner-title {
    color: #fff;
    font-family: var(--font-lato);
    /* display role */
    font-size: var(--t-display);
    font-weight: 700;
    /* Room between the lines: Arabic ascenders and descenders travel further
       than Latin's. */
    line-height: var(--lh-display);
    letter-spacing: normal;
    margin-bottom: clamp(20px, 1.8vw, 30px);
    /* Stops the last line from breaking to a single orphan word. */
    text-wrap: balance;
    /* 20ch, not 17. The English slides put a whole sentence in the CMS `title`
       field — "Your future starts here… Diverse colleges and majors at Warith
       Al-Anbiya University" — and at 17ch that set as five lines of 55px type.
       Wider lines mean fewer of them. Deliberately NOT line-clamped: this is
       the h1, and hiding half a university's headline to protect a layout is
       the wrong trade. The real fix is editorial — that sentence belongs in
       the sub-content field, with a short phrase as the title. */
    max-width: 20ch;
    text-shadow: 0 2px 24px rgba(4, 15, 33, .45);
}

/* ENGLISH ONLY — a smaller display size, and it is a content problem showing
   through, not a taste one. The Arabic slides carry a short phrase in the CMS
   `title` field ("اختر مستقبلك المهني معنا") which wants every pixel of 68px.
   The English ones carry a whole sentence ("Your future starts here… Diverse
   colleges and majors at Warith Al-Anbiya University") and at the same size it
   set as four lines of 56px type filling half the hero.

   Scoped on [dir="ltr"] rather than a lang attribute because that is the hook
   the rest of this file already uses, and direction here tracks the locale
   exactly (see components/layout/default.blade.php). Arabic keeps 32→68px. */
[dir="ltr"] .ul-banner-title {
    /* A wider measure, so the English sentence resolves to a few full lines
       rather than a stack of two-word ones. The size is the display token. */
    max-width: 26ch;
}

/* ------------------------------------------------------------ the subtitle */

/* Demoted from a gold 600 headline to white supporting text, and turned from
   an <h2> into a <p> in the markup — it was never a section heading, and a
   second h-level under the h1 was telling screen readers otherwise.

   `ch` rather than px: the cap follows the type size, so the line length stays
   readable at every breakpoint instead of only at the one it was tuned for. */
.ul-banner-subtitle {
    color: rgba(255, 255, 255, .94);
    font-family: var(--font-lato);
    /* lead role */
    font-size: var(--t-lead);
    /* 400, down from 500. With the title now a regular cut, a semi-bold
       subtitle was the heaviest text in the hero — the smallest thing carrying
       the most weight, which is the hierarchy backwards. Size is the only
       ranking device in this block now, and it is consistent. */
    font-weight: 400;
    line-height: 1.62;
    margin-bottom: clamp(24px, 2.2vw, 34px);
    max-width: 46ch;
    text-shadow: 0 1px 16px rgba(4, 15, 33, .4);
}

/* ----------------------------------------------------------- the descrip'n */

/* Clamped to three lines. The CMS `content` field is a full article body on
   some slides — unclamped it pushed the buttons off the bottom of the hero. */
.ul-banner-descr {
    color: rgba(255, 255, 255, .8);
    font-size: var(--t-body);
    font-weight: 400;
    line-height: var(--lh-body);
    margin-bottom: clamp(32px, 3vw, 48px);
    max-width: 58ch;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --------------------------------------------------------------- the calls */

/* flex-direction and justify-content are declared even though `row` and
   `normal` are the initial values. style.css carries
   `@media (max-width: 768px) { .ul-banner-btns { flex-direction: column } }`
   at the same specificity as this rule — so it is beaten on load order, but
   only for properties this rule actually names. A property left undeclared is
   not "the default", it is whatever the other file said. */
.ul-banner-btns {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
}

/* Height and padding are fixed here because the old buttons sized themselves
   from their label: "سجل الآن" was one line and "اكتشف مجال تخصصك" wrapped to
   two inside the same row, so the pair sat at different heights. */
/* `width: auto` for the same reason: style.css pins `.ul-banner-btns a` to a
   flat 200px under 768px, which clipped "اكتشف مجال تخصصك" against the
   nowrap below. Sizing from the label is the point. */
.ul-banner-btns .ul-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: auto;
    max-width: 100%;
    min-height: clamp(44px, 3.4vw, 54px);
    padding: 0 clamp(20px, 1.9vw, 30px);
    border-radius: 999px;
    font-family: inherit;
    /* label role. Leading 1.5, not 1: a 1 clips the dots on Arabic letters. */
    font-size: var(--t-label);
    font-weight: 700;
    line-height: var(--lh-ui);
    text-decoration: none;
    white-space: nowrap;
    transition: background .22s var(--hero-ease), color .22s var(--hero-ease),
        border-color .22s var(--hero-ease), transform .22s var(--hero-ease);
}

.ul-banner-btns .ul-btn i {
    font-size: .78em;
    transition: transform .22s var(--hero-ease);
}

.ul-banner-btns .ul-btn:hover { transform: translateY(-2px); }

/* The chevron leans the way the text reads. */
[dir="rtl"] .ul-banner-btns .ul-btn:hover i { transform: translateX(-4px); }
[dir="ltr"] .ul-banner-btns .ul-btn:hover i { transform: translateX(4px); }

.ul-banner-btns .ul-btn.is-primary {
    background: var(--hero-gold);
    border: 1px solid var(--hero-gold);
    color: var(--hero-ink);
}

.ul-banner-btns .ul-btn.is-primary:hover,
.ul-banner-btns .ul-btn.is-primary:focus-visible {
    background: #ffd166;
    border-color: #ffd166;
    color: var(--hero-ink);
}

/* Glass rather than a second gold. Two gold buttons side by side make the
   visitor choose between two identical-looking things. */
.ul-banner-btns .ul-btn.is-ghost {
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .45);
    color: #fff;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.ul-banner-btns .ul-btn.is-ghost:hover,
.ul-banner-btns .ul-btn.is-ghost:focus-visible {
    background: rgba(255, 255, 255, .2);
    border-color: #fff;
    color: #fff;
}

/* ---------------------------------------------------------- slider controls */

/* The arrows are removed from the markup; this is the guard for anything that
   re-inserts them (Swiper recreates navigation elements on some configs). */
.ul-banner-slider .swiper-button-next,
.ul-banner-slider .swiper-button-prev {
    display: none !important;
}

/* A column of dots down the far side — the edge the text does not use, so the
   two never compete for the same corner.

   Centred with `inset-block: 0` + flex rather than `top: 50%` and a transform:
   Swiper writes its own transform onto this element for some pagination modes,
   and a rule that fights it wins only until the mode changes. Nothing here
   touches transform, so there is nothing to fight. */
.ul-banner .swiper-pagination {
    position: absolute;
    inset-block: 0;
    inset-inline-end: clamp(16px, 2.6vw, 44px);
    inset-inline-start: auto;
    width: auto;
    z-index: 21;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* The ring reaches 12.5px out from each dot's centre. At the old 10-14px
       gap the active ring overlapped its neighbours. */
    gap: clamp(22px, 1.8vw, 28px);
}

/* Swiper stamps .swiper-pagination-horizontal on the element and its own
   stylesheet positions and spaces bullets from that. Named here so this rule
   outranks it rather than relying on load order alone. */
.ul-banner .swiper-pagination.swiper-pagination-horizontal {
    flex-direction: column;
    inset-inline-start: auto;
}

/* A small solid dot. The countdown ring below needs room to sit around it, so
   the dot itself is deliberately smaller than the control it belongs to — the
   ring is what carries the size. */
.ul-banner .swiper-pagination-bullet {
    position: relative;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .42);
    border: 0;
    opacity: 1;
    margin: 0 !important;
    cursor: pointer;
    transition: background .3s var(--hero-ease), transform .45s var(--hero-bounce);
}

.ul-banner .swiper-pagination-bullet:hover {
    background: rgba(255, 255, 255, .85);
    transform: scale(1.25);
}

/* ---- the countdown ring ----

   A conic-gradient masked down to a 2px ring, so the gold arc is the share of
   the slide's 5s autoplay that has elapsed. `--p` (0→1) is written onto the
   active bullet by hero-progress.js from Swiper's own `autoplayTimeLeft`
   event, which means the ring is driven by the real timer rather than by a CSS
   animation guessing at the same duration — pause the carousel and the ring
   pauses with it, because it is reading the clock, not imitating one.

   No extra elements: a pseudo-element on each bullet, invisible until that
   bullet is the active one. */
.ul-banner .swiper-pagination-bullet::after {
    content: "";
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    background: conic-gradient(
        var(--hero-gold) calc(var(--p, 0) * 360deg),
        rgba(255, 255, 255, .22) 0deg
    );
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px));
    opacity: 0;
    transform: scale(.45) rotate(-90deg);
    transition: opacity .3s var(--hero-ease), transform .5s var(--hero-bounce);
    pointer-events: none;
}

/* Without the mask the conic-gradient is a filled disc, not a ring — which
   would read as a gold blob swallowing the dot. Rings only where it works. */
@supports not (mask: radial-gradient(#000, #000)) {
    .ul-banner .swiper-pagination-bullet::after { display: none; }
}

/* The handover. The outgoing dot drops back to a plain mark while the incoming
   one fills gold and its ring springs open from the centre — one gesture, two
   dots, so the eye is carried across rather than asked to notice a change. */
.ul-banner .swiper-pagination-bullet-active {
    background: var(--hero-gold);
    transform: scale(1.15);
    box-shadow: 0 0 14px rgba(254, 190, 53, .5);
}

.ul-banner .swiper-pagination-bullet-active::after {
    opacity: 1;
    /* rotate(0) rather than -90deg: the ring unwinds into place as it appears,
       and a conic-gradient starts its sweep at 12 o'clock, so the arc grows the
       way a clock hand travels. */
    transform: scale(1) rotate(0deg);
}

/* focus is invisible sitewide — style.css sets outline:none */
.ul-banner a:focus-visible,
.ul-banner .swiper-pagination-bullet:focus-visible {
    outline: 2.5px solid var(--hero-gold);
    outline-offset: 3px;
}

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

/* The type sizes are already fluid — every size above is a clamp, so they
   track the viewport continuously rather than stepping at a breakpoint. What
   these queries change is LAYOUT: what is on screen, where it sits, and how
   the buttons flow. That split is deliberate; adding font-size overrides here
   as well would mean two systems fighting over the same numbers. */

/* Laptop and down: the ch-based measures were tuned for a wide column and
   start forcing awkward two-word lines once the column narrows. */
@media (max-width: 991px) {
    .ul-banner-title { max-width: 100%; }
    .ul-banner-subtitle { max-width: 100%; }
    .ul-banner-descr { -webkit-line-clamp: 2; max-width: 100%; }
}

/* style.css centres .ul-banner-content below 768px. Undone here — a centred
   block under a start-aligned eyebrow rule reads as two different layouts, and
   long Arabic lines are harder to scan centred. */
@media (max-width: 768px) {
    .ul-banner-content {
        text-align: start;
        /* Keeps the text clear of the dot column at the far edge. */
        max-width: calc(100% - 46px);
    }
}

@media (max-width: 575px) {
    .ul-banner-content {
        inset-inline-start: 18px;
        inset-inline-end: 18px;
        /* Lifted from 34px to clear the pagination and its ring below. */
        inset-block-end: 90px;
        max-width: none;
    }

    /* A hero paragraph on a phone is scrolled past, not read; the title and
       one action are what the screen has room to do well. */
    .ul-banner-descr { display: none; }

    .ul-banner-sub-title { margin-bottom: 16px; }
    .ul-banner-title { margin-bottom: 16px; line-height: 1.35; }
    .ul-banner-subtitle { margin-bottom: 26px; -webkit-line-clamp: 3; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }

    /* Only here do the buttons stack — full-bleed rows, which is the shape a
       thumb expects, rather than two pills side by side with no room to be
       tapped apart. */
    .ul-banner-btns {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .ul-banner-btns .ul-btn { width: 100%; }

    /* The dot column moves under the content and centres: down the side of a
       phone it sat within a thumb's reach of the screen edge, where it gets
       caught during a scroll. Centred is also the one position that does not
       have to be mirrored per locale — `inset-inline: 0` plus `justify-content`
       is direction-agnostic. */
    /* padding-top, not just a larger offset. The active dot's ring extends 8px
       beyond the 9px dot, so the control is ~25px tall — it reached up to 41px
       from the foot while the buttons ended at 34px, and the ring clipped the
       last button. The padding gives the ring its own room and keeps the dots
       a comfortable distance below the call to action. */
    .ul-banner .swiper-pagination {
        inset-block: auto 34px;
        inset-inline: 0;
        width: 100%;
        padding-top: 20px;
        flex-direction: row;
        justify-content: center;
        gap: 24px;
    }

    .ul-banner .swiper-pagination.swiper-pagination-horizontal {
        flex-direction: row;
        inset-inline-start: 0;
    }
}

/* PHONES: THE CONTENT IS IN NORMAL FLOW AND THE BANNER GROWS AROUND IT.

   The header is fixed and ~126px tall on a phone, and the base sheet anchors
   the slide content to the FOOT of a banner that is 70vh tall. A display-size
   title, a subtitle and two stacked buttons are taller than the room that
   leaves, so the eyebrow climbed up under the bar — by 76px on the English
   slides at 390px. A larger fixed height only moves the point at which it
   happens.

   So below 768px the slider comes out of its absolute positioning and the
   content out of its, and the slide is a column that is as tall as its text,
   never shorter than 640px. The background panel becomes the layer behind
   the content instead of the thing that sets the height. The content sits at
   the foot of the slide when there is room (the desktop composition) and
   pushes the slide taller when there is not. The top padding is the header
   plus breathing room, so the eyebrow always clears the bar. */
@media (max-width: 767.98px) {
    .ul-banner {
        height: auto;
        min-height: 0;
    }

    .ul-banner-slider {
        position: relative;
        height: auto;
        width: 100%;
    }

    .ul-banner .swiper-wrapper {
        height: auto;
        min-height: 640px;
    }

    .ul-banner .swiper-slide {
        height: auto;
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
    }

    .ul-banner-slide {
        position: absolute;
        inset: 0;
        width: auto;
        height: auto;
    }

    .ul-banner-content {
        position: relative;
        inset: auto;
        width: 100%;
        max-width: none;
        /* 126px header + 28px; the 60px end padding keeps the text clear of
           the dot column that runs down that edge between 576 and 767px. */
        padding-block: 154px 110px;
        padding-inline: 18px 60px;
    }
}

/* Under 576px the dots are a row along the foot (see the 575px block above),
   so the text can take the full width. */
@media (max-width: 575.98px) {
    .ul-banner-content {
        padding-inline: 18px;
    }
}

/* A landscape phone, or a short laptop, gives the hero ~380px of height. The
   fixed 600px min-height then pushed the buttons below the fold with no way to
   reach them. Everything tightens rather than the block being cropped. */
@media (max-height: 620px) and (min-width: 576px) {
    .ul-banner { min-height: 440px; }

    .ul-banner-content { inset-block-end: clamp(28px, 5vh, 52px); }
    .ul-banner-title { font-size: clamp(26px, 4.4vh, 40px); margin-bottom: 8px; }
    .ul-banner-subtitle { font-size: clamp(14px, 2.2vh, 17px); margin-bottom: 12px; }
    .ul-banner-sub-title { margin-bottom: 10px; }
    .ul-banner-descr { display: none; }
    .ul-banner-btns .ul-btn { min-height: 40px; }
}

/* REDUCED MOTION — only the motion nobody asked for.

   What is switched off is the 8-second Ken Burns push that drifts across every
   slide on its own. That is continuous, unrequested, full-bleed movement, and
   it is exactly what the query is for.

   The BUTTON hovers are deliberately left running. An earlier version killed
   those too, which meant that on Windows — where this query is on for anyone
   who has unticked "animation effects" — the hero's calls to action had no
   feedback at all. A 2px lift under the pointer is not a vestibular risk; it is
   the button telling you it heard you. */
