/* ============================================================
   Lanka Hot Topics — Front-end styles
   Відповідає дизайн-системі Lanka Core v1:
   – CSS-variables з теми
   – Градієнт #667eea → #764ba2
   – Dark mode через prefers-color-scheme
   ============================================================ */

/* ── Bar wrapper ─────────────────────────────────────────── */
.lht-bar {
    background: var(--color-surface, #ffffff);
    border-bottom: 1px solid var(--color-border, #e0e0e0);
    padding: 0;
    position: relative;
    z-index: 999;
    overflow: hidden;
}

/* Тонка градієнтна лінія зверху */
.lht-bar::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.lht-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 16px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;        /* Firefox */
    -ms-overflow-style: none;     /* IE/Edge */
    max-width: var(--container-max, 1200px);
    margin: 0 auto;
}

.lht-inner::-webkit-scrollbar {
    display: none;
}

/* ── Label ───────────────────────────────────────────────── */
.lht-label {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-text-muted, #888);
    white-space: nowrap;
    flex-shrink: 0;
    user-select: none;
}

/* ── List ────────────────────────────────────────────────── */
.lht-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}

.lht-item {
    flex-shrink: 0;
}

/* ── Link / Pill ─────────────────────────────────────────── */
.lht-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    color: var(--color-text, #121212);
    background: var(--color-surface-alt, #f8f9fa);
    border: 1.5px solid transparent;

    /* Акцентний колір з data-атрибуту через CSS variable */
    --lht-accent: #667eea;

    /* Тонка рамка з кольором теми */
    box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--lht-accent) 35%, transparent);

    transition:
        background 160ms ease,
        color 160ms ease,
        box-shadow 160ms ease,
        transform 120ms ease;
}

.lht-link:hover,
.lht-link:focus-visible {
    background: var(--lht-accent);
    color: #ffffff;
    box-shadow: 0 2px 10px color-mix(in srgb, var(--lht-accent) 40%, transparent);
    transform: translateY(-1px);
    text-decoration: none;
}

.lht-emoji {
    font-style: normal;
    line-height: 1;
    display: inline-block;
}

/* ── Dark mode ───────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
    .lht-bar {
        background: var(--color-surface, #1e1e1e);
        border-bottom-color: rgba(255, 255, 255, 0.07);
    }

    .lht-link {
        background: rgba(255, 255, 255, 0.05);
        color: var(--color-text, #e0e0e0);
    }

    .lht-link:hover,
    .lht-link:focus-visible {
        background: var(--lht-accent);
        color: #ffffff;
    }
}

/* ── Mobile ──────────────────────────────────────────────── */
@media (max-width: 480px) {
    .lht-label {
        display: none; /* приховуємо "ТОПТЕМИ:" на дуже маленьких екранах */
    }

    .lht-inner {
        padding: 6px 12px;
    }

    .lht-link {
        font-size: 0.73rem;
        padding: 4px 10px;
    }
}

/* ── Entrance animation ──────────────────────────────────── */
@keyframes lht-slide-down {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.lht-bar {
    animation: lht-slide-down 280ms ease both;
}

.lht-item {
    animation: lht-slide-down 280ms ease both;
}

/* Stagger: кожен pill з'являється по черзі */
.lht-item:nth-child(1)  { animation-delay: 40ms; }
.lht-item:nth-child(2)  { animation-delay: 80ms; }
.lht-item:nth-child(3)  { animation-delay: 120ms; }
.lht-item:nth-child(4)  { animation-delay: 160ms; }
.lht-item:nth-child(5)  { animation-delay: 200ms; }
.lht-item:nth-child(6)  { animation-delay: 240ms; }
.lht-item:nth-child(7)  { animation-delay: 280ms; }
.lht-item:nth-child(8)  { animation-delay: 320ms; }
