/* =====================================================================================================
   Notice ticker (tier 3 of the header, directly under the navy menu bar).
   Markup: resources/views/components/header-component.blade.php (.t-ticker, data-t-ticker hooks).
   Behaviour: public/frontend/js/jmc-ticker.js (speed from width, keyboard focus scrolling); pauses on hover and focus.
   White bar on the site container; navy "Notices" pill with a live dot; each notice is a date chip,
   the title and an optional "New" badge; seamless loop (two identical sets, translateX -50%).
   ===================================================================================================== */
.t-ticker {
    --t-h: 52px;
    --t-fade: 44px;
    position: relative;
    z-index: 4;
    background: linear-gradient(180deg, #fff 0%, #fbfcff 100%);
    border-bottom: 1px solid var(--j-line);
    box-shadow: 0 10px 22px -22px rgba(10, 20, 48, .55);
    font-family: var(--j-font);
}
.t-ticker__inner { display: flex; align-items: center; gap: 14px; height: var(--t-h); }

/* label: navy pill with megaphone and live dot */
.t-ticker .t-ticker__label {
    flex: none; display: inline-flex; align-items: center; gap: 9px;
    height: 34px; padding: 0 16px 0 4px; border-radius: 999px;
    background: var(--j-blue); color: #fff;
    font-size: .78rem; font-weight: 800; line-height: 1; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap;
    box-shadow: 0 6px 14px -8px rgba(18, 48, 106, .55);
    transition: background-color .25s var(--j-ease), box-shadow .25s var(--j-ease);
}
.t-ticker .t-ticker__label:hover { background: var(--j-royal); color: #fff; box-shadow: 0 8px 18px -8px rgba(36, 80, 216, .55); }
.t-ticker__badge { position: relative; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: rgba(255, 255, 255, .14); }
.t-ticker__badge .j-ico { width: 14px; height: 14px; stroke-width: 2; }
.t-ticker__live {
    position: absolute; top: -1px; right: -2px; width: 9px; height: 9px; border-radius: 50%;
    background: #34c47c; border: 2px solid var(--j-blue);
    animation: t-live 2s ease-out infinite;
    transition: border-color .25s var(--j-ease);
}
.t-ticker .t-ticker__label:hover .t-ticker__live { border-color: var(--j-royal); }
@keyframes t-live { 0% { box-shadow: 0 0 0 0 rgba(52, 196, 124, .55); } 70%, 100% { box-shadow: 0 0 0 6px rgba(52, 196, 124, 0); } }

/* marquee */
.t-ticker__viewport {
    position: relative; flex: 1; min-width: 0; height: 100%;
    display: flex; align-items: center; overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 var(--t-fade), #000 calc(100% - var(--t-fade)), transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 var(--t-fade), #000 calc(100% - var(--t-fade)), transparent 100%);
}
.t-ticker__track { display: flex; width: max-content; will-change: transform; animation: t-marquee var(--t-ticker-dur, 60s) linear infinite; }
.t-ticker:hover .t-ticker__track, .t-ticker:focus-within .t-ticker__track { animation-play-state: paused; }
/* keyboard: stop the loop so the browser can scroll the focused notice into view */
.t-ticker__viewport:focus-within .t-ticker__track { animation: none; }
@keyframes t-marquee { to { transform: translateX(-50%); } }

.t-ticker__set { display: flex; align-items: center; margin: 0; padding: 0; list-style: none; }
.t-ticker__item { position: relative; display: flex; align-items: center; padding: 0 22px; white-space: nowrap; }
.t-ticker__item::after { content: ""; position: absolute; right: 0; top: 50%; width: 1px; height: 18px; margin-top: -9px; background: var(--j-line-strong); }

.t-ticker .t-ticker__link {
    display: inline-flex; align-items: center; gap: 10px; padding: 5px 2px; border-radius: 8px;
    color: var(--j-ink); text-decoration: none;
}
.t-ticker__title { font-size: .95rem; font-weight: 600; line-height: 1.3; letter-spacing: -.005em; text-decoration: underline; text-decoration-color: transparent; text-decoration-thickness: 1.5px; text-underline-offset: 4px; transition: color .2s var(--j-ease), text-decoration-color .2s var(--j-ease); }
.t-ticker .t-ticker__link:hover { color: var(--j-royal); }
.t-ticker .t-ticker__link:hover .t-ticker__title { text-decoration-color: currentColor; }
.t-ticker .t-ticker__link:focus-visible { outline: 2px solid var(--j-royal); outline-offset: 2px; border-radius: 8px; }

.t-ticker__date {
    flex: none; display: inline-flex; align-items: center; gap: 6px;
    height: 26px; padding: 0 10px 0 8px; border-radius: 999px;
    background: var(--j-sky, #eef3ff); border: 1px solid var(--j-sky-2, #e1e9fd); color: var(--j-blue);
    font-size: .78rem; font-weight: 700; line-height: 1;
    transition: background-color .2s var(--j-ease), border-color .2s var(--j-ease), color .2s var(--j-ease);
}
.t-ticker__date .j-ico { width: 13px; height: 13px; stroke-width: 2; opacity: .8; }
.t-ticker .t-ticker__link:hover .t-ticker__date { background: var(--j-royal); border-color: var(--j-royal); color: #fff; }

.t-ticker__new {
    flex: none; display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px;
    background: #e3f8ed; border: 1px solid #c4ecd6; color: #0f6a3d;
    font-size: .68rem; font-weight: 800; line-height: 1; letter-spacing: .08em; text-transform: uppercase;
}

/* too few notices to fill the bar: show one still set */
.t-ticker.is-static .t-ticker__track { animation: none; }
.t-ticker.is-static [data-t-ticker-clone] { display: none; }
.t-ticker.is-static .t-ticker__viewport { -webkit-mask-image: none; mask-image: none; }

/* Nepali: no uppercase or tracking on Devanagari */
.j-site:lang(ne) .t-ticker .t-ticker__label { text-transform: none; letter-spacing: 0; font-size: .92rem; font-weight: 700; }
.j-site:lang(ne) .t-ticker__new { text-transform: none; letter-spacing: 0; font-size: .74rem; }
.j-site:lang(ne) .t-ticker__date { font-size: .8rem; }
.j-site:lang(ne) .t-ticker__title { letter-spacing: 0; }

@media (max-width: 767px) {
    .t-ticker { --t-h: 48px; --t-fade: 22px; }
    .t-ticker__inner { gap: 10px; }
    .t-ticker .t-ticker__label { height: 32px; padding-right: 12px; gap: 7px; font-size: .72rem; letter-spacing: .08em; }
    .t-ticker__badge { width: 24px; height: 24px; }
    .t-ticker__item { padding: 0 16px; }
    .t-ticker__title { font-size: .9rem; }
    .t-ticker__date { height: 24px; font-size: .74rem; }
}
@media (max-width: 340px) { .t-ticker__labeltext { display: none; } .t-ticker .t-ticker__label { padding-right: 4px; } }

/* reduced motion: no loop, one set, scroll sideways by hand */
@media (prefers-reduced-motion: reduce) {
    .t-ticker__live { animation: none; }
    .t-ticker__track { animation: none; will-change: auto; }
    .t-ticker [data-t-ticker-clone] { display: none; }
    .t-ticker__viewport {
        overflow-x: auto; scrollbar-width: thin;
        -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - var(--t-fade)), transparent 100%);
        mask-image: linear-gradient(90deg, #000 calc(100% - var(--t-fade)), transparent 100%);
    }
    .t-ticker__date, .t-ticker__title, .t-ticker .t-ticker__label { transition: none; }
}

@media print { .t-ticker { display: none; } }
/* touch pause (no button): finger hold and tap-to-toggle on empty space */
.t-ticker.is-held .t-ticker__track, .t-ticker.is-paused .t-ticker__track { animation-play-state: paused; }
/* gg7: the label stays aligned with the content edge on the left, but the scrolling notices run to the right
   edge of the window (no blank strip after the container). 100% here is the bar's width, so no scrollbar overflow. */
.t-ticker > .t-ticker__inner { max-width: none; margin: 0; padding-right: 0; padding-left: max(var(--j-gutter), calc((100% - var(--j-container)) / 2)); }
.t-ticker__viewport { -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 var(--t-fade), #000 calc(100% - 28px), transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 var(--t-fade), #000 calc(100% - 28px), transparent 100%); }
/* audit: nothing in the bar below 12px on phones */
.t-ticker .t-ticker__date { font-size: max(.74rem, 12px); }
.t-ticker .t-ticker__labeltext { font-size: max(.72rem, 12px); }
