/* ==================== Site-wide highlight ticker ==================== */
.ai-ticker {
    position: fixed;
    top: 68px;
    left: 0;
    right: 0;
    z-index: 999;
    background: linear-gradient(90deg, #0F172A 0%, #1E1B4B 50%, #0F172A 100%);
    color: #E2E8F0;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    overflow: hidden;
    min-height: 40px;
}

body.has-ticker .main-content {
    padding-top: 108px; /* 68px fixed navbar + 40px ticker */
}

.ai-ticker::after {
    content: "";
    position: absolute;
    top: 0;
    left: -40%;
    width: 40%;
    height: 100%;
    background: linear-gradient(100deg, rgba(255,255,255,0) 0%, rgba(255,255,255,.10) 50%, rgba(255,255,255,0) 100%);
    transform: skewX(-18deg);
    animation: aiTickerShimmer 7s ease-in-out infinite;
    pointer-events: none;
}

@keyframes aiTickerShimmer {
    0%   { left: -40%; }
    55%  { left: 120%; }
    100% { left: 120%; }
}

.ai-ticker-inner {
    max-width: 1280px;
    margin: 0 auto;
    min-height: 40px;
    padding: .35rem 1rem;
    display: flex;
    align-items: center;
    gap: .6rem;
}

.ai-ticker-live {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(250, 204, 21, .16);
    color: #FACC15;
    font-size: .72rem;
    flex-shrink: 0;
    animation: aiTickerPulse 2.2s ease-in-out infinite;
}

@keyframes aiTickerPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(250, 204, 21, .35); }
    50%      { box-shadow: 0 0 0 6px rgba(250, 204, 21, 0); }
}

.ai-ticker-items {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    height: 24px;
}

.ai-ticker-item {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    gap: .5rem;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .45s ease, transform .45s ease;
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    font-size: .8rem;
}

.ai-ticker-item.is-active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.ai-ticker-badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    flex-shrink: 0;
    font-size: .66rem;
    font-weight: 800;
    letter-spacing: .03em;
    text-transform: uppercase;
    padding: .18rem .5rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, .10);
    color: #E2E8F0;
}

.ai-ticker-ai .ai-ticker-badge { background: rgba(79, 70, 229, .28); color: #C7D2FE; }
.ai-ticker-offer .ai-ticker-badge { background: rgba(245, 158, 11, .22); color: #FCD34D; }
.ai-ticker-contributor .ai-ticker-badge { background: rgba(16, 185, 129, .22); color: #6EE7B7; }
.ai-ticker-new .ai-ticker-badge { background: rgba(59, 130, 246, .22); color: #93C5FD; }
.ai-ticker-notice .ai-ticker-badge { background: rgba(148, 163, 184, .20); color: #CBD5E1; }

.ai-ticker-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #E2E8F0;
    font-weight: 600;
}

.ai-ticker-links {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
}

.ai-ticker-links a {
    color: #93C5FD;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.ai-ticker-links a:hover,
.ai-ticker-links a:focus {
    color: #BFDBFE;
    text-decoration: underline;
}

.ai-ticker-sep {
    color: rgba(255, 255, 255, .35);
    margin: 0 .15rem;
}

.ai-ticker-link {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    flex-shrink: 0;
    color: #93C5FD;
    font-weight: 700;
    text-decoration: none;
    font-size: .76rem;
}

.ai-ticker-link:hover,
.ai-ticker-link:focus {
    color: #BFDBFE;
    text-decoration: underline;
}

.ai-ticker-close {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
    color: #CBD5E1;
    font-size: .7rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .2s ease, color .2s ease;
}

.ai-ticker-close:hover,
.ai-ticker-close:focus {
    background: rgba(255, 255, 255, .18);
    color: #fff;
    outline: none;
}

.ai-ticker.is-hidden {
    display: none;
}

@media (max-width: 640px) {
    .ai-ticker-inner { padding: .35rem .65rem; gap: .45rem; }
    .ai-ticker-badge { font-size: .58rem; padding: .15rem .4rem; }
    .ai-ticker-item { font-size: .74rem; }
    .ai-ticker-link span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .ai-ticker::after,
    .ai-ticker-live { animation: none; }
    .ai-ticker-item { transition: none; }
}
