/* =============================================
   BLOG ARTICLE MICRO-ANIMATIONS
   хостелнедорого.рф — 2026
   ============================================= */

/* ===== 1. ICON SHIMMER/GLOW ===== */
@keyframes iconShimmer {
    0%, 85%, 100% {
        filter: brightness(1) drop-shadow(0 0 0 transparent);
    }
    90% {
        filter: brightness(1.4) drop-shadow(0 0 6px rgba(18, 144, 248, 0.5));
    }
    95% {
        filter: brightness(1.15) drop-shadow(0 0 3px rgba(18, 144, 248, 0.3));
    }
}

.si--title {
    animation: iconShimmer 4s ease-in-out infinite;
}

.article-content h2:nth-of-type(2) .si--title { animation-delay: 0.6s; }
.article-content h2:nth-of-type(3) .si--title { animation-delay: 1.2s; }
.article-content h2:nth-of-type(4) .si--title { animation-delay: 1.8s; }
.article-content h2:nth-of-type(5) .si--title { animation-delay: 2.4s; }
.article-content h2:nth-of-type(6) .si--title { animation-delay: 3.0s; }
.article-content h2:nth-of-type(7) .si--title { animation-delay: 3.6s; }

/* ===== 2. SCROLL REVEAL ===== */
.scroll-reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.scroll-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.scroll-reveal.delay-1 { transition-delay: 0.1s; }
.scroll-reveal.delay-2 { transition-delay: 0.2s; }
.scroll-reveal.delay-3 { transition-delay: 0.3s; }

/* ===== 3. RELATED CARD HOVER ===== */
.related-card {
    position: relative;
}

.related-card img {
    transition: transform 0.4s ease;
}

.related-card:hover img {
    transform: scale(1.05);
}

.related-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #1290F8, transparent);
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.related-card:hover::after {
    transform: scaleX(1);
}

.related-card h3 {
    transition: color 0.3s ease;
}

.related-card:hover h3 {
    color: #1290F8;
}

/* ===== 4. CTA BUTTON SHINE ===== */
.cta-btn {
    position: relative;
    overflow: hidden;
}

.cta-btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(
        120deg,
        transparent 0%,
        rgba(18, 144, 248, 0.15) 40%,
        rgba(255, 255, 255, 0.4) 50%,
        rgba(18, 144, 248, 0.15) 60%,
        transparent 100%
    );
    animation: ctaShine 3s ease-in-out infinite;
    pointer-events: none;
}

.cta-btn-secondary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(
        120deg,
        transparent 0%,
        rgba(255, 255, 255, 0.1) 40%,
        rgba(255, 255, 255, 0.25) 50%,
        rgba(255, 255, 255, 0.1) 60%,
        transparent 100%
    );
    animation: ctaShine 3s ease-in-out 1.5s infinite;
    pointer-events: none;
}

@keyframes ctaShine {
    0%, 70%, 100% { left: -100%; }
    85% { left: 150%; }
}

.cta-btn-primary {
    animation: ctaGlow 2s ease-in-out infinite;
}

@keyframes ctaGlow {
    0%, 100% { box-shadow: 0 4px 15px rgba(18, 144, 248, 0.2); }
    50% { box-shadow: 0 4px 25px rgba(18, 144, 248, 0.4); }
}

.cta-btn:hover::before {
    animation-play-state: paused;
}

/* ===== 5. TABLE ROW STAGGER ===== */
.article-table-wrap.visible .article-table tbody tr {
    animation: tableRowSlideIn 0.5s ease-out both;
}

.article-table-wrap.visible .article-table tbody tr:nth-child(1) { animation-delay: 0.05s; }
.article-table-wrap.visible .article-table tbody tr:nth-child(2) { animation-delay: 0.1s; }
.article-table-wrap.visible .article-table tbody tr:nth-child(3) { animation-delay: 0.15s; }
.article-table-wrap.visible .article-table tbody tr:nth-child(4) { animation-delay: 0.2s; }
.article-table-wrap.visible .article-table tbody tr:nth-child(5) { animation-delay: 0.25s; }
.article-table-wrap.visible .article-table tbody tr:nth-child(6) { animation-delay: 0.3s; }
.article-table-wrap.visible .article-table tbody tr:nth-child(7) { animation-delay: 0.35s; }
.article-table-wrap.visible .article-table tbody tr:nth-child(8) { animation-delay: 0.4s; }
.article-table-wrap.visible .article-table tbody tr:nth-child(9) { animation-delay: 0.45s; }
.article-table-wrap.visible .article-table tbody tr:nth-child(10) { animation-delay: 0.5s; }

@keyframes tableRowSlideIn {
    from { opacity: 0; transform: translateX(-15px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ===== 6. TABLE ROW HOVER ===== */
.article-table tbody tr {
    transition: background 0.2s ease;
}

.article-table tbody tr:hover {
    background: rgba(18, 144, 248, 0.08) !important;
    box-shadow: inset 3px 0 0 #1290F8;
}

/* ===== 7. LEAD PARAGRAPH ENTRANCE ===== */
.article-lead.visible {
    animation: leadEntrance 0.8s ease-out both;
}

@keyframes leadEntrance {
    from {
        opacity: 0;
        transform: translateX(-15px);
        border-left-color: transparent;
    }
    40% {
        opacity: 0.7;
        border-left-color: #1290F8;
    }
    to {
        opacity: 1;
        transform: translateX(0);
        border-left-color: #1290F8;
    }
}

/* ===== 8. MOBILE BOTTOM NAV ===== */
.mobile-bottom-nav {
    display: none;
}

@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 9998;
        background: #fff;
        border-top: 1px solid rgba(18, 144, 248, 0.12);
        box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
        padding: 6px 0 env(safe-area-inset-bottom, 6px);
        justify-content: space-around;
        align-items: center;
    }

    .mobile-bottom-nav__item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 3px;
        text-decoration: none;
        color: #7a8fa0;
        font-size: 11px;
        font-weight: 500;
        padding: 4px 12px;
        border-radius: 8px;
        transition: color 0.2s ease, background 0.2s ease;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-bottom-nav__item img {
        width: 35px;
        height: 35px;
        opacity: 0.45;
        transition: opacity 0.3s ease, filter 0.3s ease, transform 0.3s ease;
    }

    .mobile-bottom-nav__item:active {
        background: rgba(18, 144, 248, 0.08);
    }

    .mobile-bottom-nav__item.active {
        color: #1290F8;
    }

    .mobile-bottom-nav__item.active img {
        opacity: 1;
        filter: brightness(0) saturate(100%) invert(42%) sepia(93%) saturate(1350%) hue-rotate(196deg) brightness(100%) contrast(95%);
    }

    /* Offset footer and telegram widget for bottom nav */
    .footer {
        padding-bottom: 80px !important;
    }

    .telegram-widget {
        bottom: 75px !important;
    }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    .si--title { animation: none; }
    .scroll-reveal { opacity: 1; transform: none; transition: none; }
    .cta-btn-primary::before,
    .cta-btn-secondary::before { animation: none; }
    .cta-btn-primary { animation: none; }
    .article-table-wrap.visible .article-table tbody tr { animation: none; opacity: 1; }
    .article-lead.visible { animation: none; opacity: 1; }
}
