/* ─── פס העדכונים (news ticker) — fixed at the bottom of public pages ───
   Stacking (z-index): content < navbar 100 < compare bar 900 < ticker 950
   < modals / bottom sheets 1000+ < toast 2000. Body gets bottom padding so
   the strip never covers the footer; bottom-fixed UI is lifted above it. */
:root { --nt-h: 44px; }
body.has-ticker { padding-bottom: calc(var(--nt-h) + env(safe-area-inset-bottom, 0px)); }
/* Focus Not Obscured (WCAG 2.4.11; Equality audit 23.11.2026, 200% zoom): when Tab moves
   to a field near the bottom of the viewport (e.g. the "הודעה" textarea on /contact), the
   browser scrolls it above the fixed strip, focus ring included. */
html:has(> body.has-ticker) { scroll-padding-bottom: calc(var(--nt-h) + 16px + env(safe-area-inset-bottom, 0px)); }
body.has-ticker .ds-cmpbar { bottom: calc(var(--nt-h) + 12px + env(safe-area-inset-bottom, 0px)); }
body.has-ticker .toast { bottom: calc(var(--nt-h) + 1rem); }

.news-ticker {
    position: fixed; inset-inline: 0; bottom: 0; z-index: 950;
    display: flex; align-items: stretch; height: calc(var(--nt-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--primary-dark, #0A3425); color: #fff;
    box-shadow: 0 -4px 18px rgba(10, 52, 37, 0.18);
    font-size: 0.9rem; max-width: 100vw;
}
.nt-label {
    flex-shrink: 0; display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0 0.9rem; background: var(--accent, #00C9A7); color: var(--primary-dark, #0A3425);
    font-weight: 800; text-decoration: none; letter-spacing: 0.01em;
}
.nt-label:hover, .nt-label:focus-visible { background: #2EE0C1; color: var(--primary-dark, #0A3425); }
.nt-viewport { flex: 1; min-width: 0; overflow: hidden; display: flex; align-items: center; position: relative; }
/* Without JS (or in manual mode) the list is a plain horizontally-scrollable row. */
.news-ticker:not(.is-running) .nt-viewport, .news-ticker.is-manual .nt-viewport {
    overflow-x: auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.35) transparent;
}
.nt-track { display: flex; align-items: center; width: max-content; list-style: none; margin: 0; padding: 0; will-change: transform; }
.nt-item { flex-shrink: 0; padding-inline: 1.1rem; position: relative; white-space: nowrap; }
.nt-item + .nt-item::before {
    content: ''; position: absolute; inset-inline-start: -3px; top: 50%; width: 6px; height: 6px;
    margin-top: -3px; border-radius: 50%; background: var(--accent, #00C9A7); opacity: 0.8;
}
.nt-item a { color: #fff; text-decoration: none; display: inline-flex; align-items: center; gap: 0.5rem; min-height: 32px; }
.nt-item a:hover .nt-text, .nt-item a:focus-visible .nt-text { text-decoration: underline; text-underline-offset: 3px; }
.nt-item a:focus-visible, .nt-btn:focus-visible, .nt-label:focus-visible { outline: 3px solid var(--gold, #F0B429); outline-offset: -3px; }
.nt-chip {
    display: inline-flex; align-items: center; gap: 0.2rem; font-size: 0.74rem; font-weight: 700;
    padding: 0.12rem 0.5rem; border-radius: 999px; background: rgba(255,255,255,0.14); color: #fff; white-space: nowrap;
}
.nt-chip.nt-deadline { background: var(--gold, #F0B429); color: #3b2a00; }
.nt-chip.nt-tariff { background: #CDEFE6; color: var(--primary-dark, #0A3425); }
/* Admin pages show the chips on a light background. */
.tk-admin-row .nt-chip { background: var(--bg-alt, #EDF5F0); color: var(--primary, #0F4C35); }
.tk-admin-row .nt-chip.nt-deadline { background: #FDF0CC; color: #6b4d00; }
.card .nt-chip { background: var(--bg-alt, #EDF5F0); color: var(--primary, #0F4C35); }

.nt-btn {
    flex-shrink: 0; width: 44px; display: inline-flex; align-items: center; justify-content: center;
    background: transparent; border: 0; border-inline-start: 1px solid rgba(255,255,255,0.14);
    color: #fff; cursor: pointer;
}
.nt-btn:hover { background: rgba(255,255,255,0.1); }
.nt-ic-play, .nt-ic-up { display: none; }
.news-ticker.is-paused .nt-ic-pause { display: none; }
.news-ticker.is-paused .nt-ic-play { display: inline; }
/* The pause button only matters while the strip moves (it is hidden when
   everything fits, and for prefers-reduced-motion). */
.news-ticker:not(.can-run) .nt-toggle { display: none; }

/* Marquee: the list is duplicated by ticker.js; moving the track by half its
   width lands the copy exactly where the original was → seamless loop. RTL:
   the strip moves left→right so each item's beginning (its right end)
   enters first. */
@keyframes nt-scroll-rtl { from { transform: translateX(0); } to { transform: translateX(50%); } }
.news-ticker.is-running .nt-track { animation: nt-scroll-rtl var(--nt-dur, 40s) linear infinite; }
.news-ticker.is-running:hover .nt-track { animation-play-state: paused; }
.news-ticker.is-manual .nt-track { animation: none; }
.news-ticker.is-manual .nt-clone { display: none; }

/* Minimised for this session: a small tab with the label + expand button. */
.news-ticker.is-min { inset-inline-end: auto; border-start-end-radius: 12px; }
.news-ticker.is-min .nt-viewport, .news-ticker.is-min .nt-toggle { display: none; }
.news-ticker.is-min .nt-ic-down { display: none; }
.news-ticker.is-min .nt-ic-up { display: inline; }
body.has-ticker.ticker-min { padding-bottom: calc(var(--nt-h) + env(safe-area-inset-bottom, 0px)); }

@media (max-width: 560px) {
    .news-ticker { font-size: 0.85rem; }
    .nt-label { padding: 0 0.6rem; }
    .nt-label-text { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
    .nt-item { padding-inline: 0.85rem; }
    .news-ticker.is-min .nt-label-text { position: static; width: auto; height: auto; margin: 0; clip: auto; }
}
@media (prefers-reduced-motion: reduce) {
    .news-ticker .nt-track { animation: none !important; }
    .news-ticker .nt-clone { display: none; }
    .news-ticker .nt-viewport { overflow-x: auto; }
}
@media print { .news-ticker { display: none !important; } body.has-ticker { padding-bottom: 0; } }
