/* ═══════════════════════════════════════════════
   shared-nav.css — Unified Blog Navbar + Theme Toggle + Scroll-to-top
   Replaces duplicated navbar CSS from:
   - index.html <style> block
   - blog/index.html <style> block  
   - blog/article-styles.css .blog-nav section
   ═══════════════════════════════════════════════ */

/* ── Blog Navbar ──────────────────────────────── */
.blog-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1060;
    background: rgba(10,10,15,0.85);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    transition: background 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.blog-nav.scrolled {
    background: rgba(10,10,15,0.95);
    box-shadow: 0 4px 16px rgba(0,0,0,0.45);
}
[data-theme="light"] .blog-nav {
    background: rgba(245,243,239,0.9) !important;
    border-bottom-color: rgba(0,0,0,0.06) !important;
}
[data-theme="light"] .blog-nav.scrolled {
    background: rgba(245,243,239,0.97) !important;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06) !important;
}

.blog-nav-inner {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.6rem 0;
    min-height: 58px;
}
.blog-nav-brand img {
    height: 38px;
    width: auto;
    display: block;
    transition: opacity 0.25s;
}
.blog-nav-brand:hover img { opacity: 0.8; }

/* ── Desktop Links ────────────────────────────── */
.blog-nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: 0.5rem;
}
.blog-nav-link {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    border-radius: 8px;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    transition: all 0.25s;
    white-space: nowrap;
}
.blog-nav-link i { font-size: 0.72rem; opacity: 0.7; }
.blog-nav-link:hover { color: #f0f0f2; background: rgba(255,255,255,0.06); }
.blog-nav-link.active { color: #3b82f6; background: rgba(59,130,246,0.1); font-weight: 600; }
[data-theme="light"] .blog-nav-link { color: rgba(0,0,0,0.55); }
[data-theme="light"] .blog-nav-link:hover { color: #1a1a1f; background: rgba(0,0,0,0.04); }
[data-theme="light"] .blog-nav-link.active { color: #2563eb; background: rgba(37,99,235,0.08); }

/* ── Right Section ────────────────────────────── */
.blog-nav-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
}

/* ── Countdown ────────────────────────────────── */
.blog-nav-countdown {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
}
[data-theme="light"] .blog-nav-countdown { background: rgba(0,0,0,0.025); border-color: rgba(0,0,0,0.06); }
.countdown-flag { font-size: 1.1rem; line-height: 1; }
.countdown-info { display: flex; flex-direction: column; line-height: 1.2; }
.countdown-race {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.38);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}
[data-theme="light"] .countdown-race { color: rgba(0,0,0,0.34); }
.countdown-timer {
    font-size: 0.78rem;
    color: #3b82f6;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}
[data-theme="light"] .countdown-timer { color: #2563eb; }

.blog-nav-countdown-mobile {
    display: none;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    color: #3b82f6;
    font-weight: 600;
}
.blog-nav-countdown-mobile i { font-size: 0.65rem; color: rgba(255,255,255,0.38); }
[data-theme="light"] .blog-nav-countdown-mobile i { color: rgba(0,0,0,0.34); }

/* ── Hamburger ────────────────────────────────── */
.blog-nav-hamburger {
    display: none;
    width: 44px; height: 44px;
    border: none;
    background: none;
    cursor: pointer;
    padding: 8px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.blog-nav-hamburger span {
    display: block;
    height: 2px; width: 22px;
    background: rgba(255,255,255,0.6);
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}
[data-theme="light"] .blog-nav-hamburger span { background: rgba(0,0,0,0.4); }
.blog-nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.blog-nav-hamburger.open span:nth-child(2) { opacity: 0; }
.blog-nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Mobile Menu ──────────────────────────────── */
.blog-nav-mobile {
    display: none;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.35s ease, padding 0.35s ease;
    padding: 0 1rem;
    border-top: 1px solid transparent;
    background: rgba(10,10,15,0.95);
}
.blog-nav-mobile.open {
    max-height: 320px;
    padding: 0.5rem 1rem 0.75rem;
    border-top-color: rgba(255,255,255,0.08);
}
[data-theme="light"] .blog-nav-mobile { background: rgba(245,243,239,0.98); }
[data-theme="light"] .blog-nav-mobile.open { border-top-color: rgba(0,0,0,0.06); }

.blog-nav-mobile-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 0.85rem;
    border-radius: 8px;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    transition: all 0.25s;
    min-height: 44px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.blog-nav-mobile-link i { width: 18px; text-align: center; font-size: 0.82rem; opacity: 0.7; }
.blog-nav-mobile-link:hover,
.blog-nav-mobile-link:active { color: #f0f0f2; background: rgba(255,255,255,0.06); }
.blog-nav-mobile-link.active { color: #3b82f6; background: rgba(59,130,246,0.1); font-weight: 600; }
[data-theme="light"] .blog-nav-mobile-link { color: rgba(0,0,0,0.55); }
[data-theme="light"] .blog-nav-mobile-link:hover { color: #1a1a1f; background: rgba(0,0,0,0.04); }
[data-theme="light"] .blog-nav-mobile-link.active { color: #2563eb; background: rgba(37,99,235,0.08); }

@media (max-width: 991px) {
    .blog-nav-links { display: none; }
    .blog-nav-hamburger { display: flex; }
    .blog-nav-mobile { display: block; }
}
@media (max-width: 767px) {
    .blog-nav-countdown { display: none; }
    .blog-nav-countdown-mobile { display: flex; }
}

/* ── Theme Toggle Button ──────────────────────── */
.theme-toggle-btn {
    position: fixed;
    bottom: 2rem; left: 1.5rem;
    z-index: 1050;
    width: 40px; height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.14);
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 3px rgba(0,0,0,0.4);
    transition: all 0.25s;
}
.theme-toggle-btn:hover {
    color: #3b82f6;
    border-color: #3b82f6;
    transform: scale(1.08);
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}
.theme-toggle-btn .icon-sun { display: inline; }
.theme-toggle-btn .icon-moon { display: none; }
[data-theme="light"] .theme-toggle-btn {
    background: #FDFCFA;
    border-color: rgba(0,0,0,0.1);
    color: rgba(0,0,0,0.5);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
[data-theme="light"] .theme-toggle-btn:hover { color: #2563eb; border-color: #2563eb; }
[data-theme="light"] .theme-toggle-btn .icon-sun { display: none; }
[data-theme="light"] .theme-toggle-btn .icon-moon { display: inline; }

/* ── Scroll-to-Top Button ─────────────────────── */
.scroll-to-top-btn {
    position: fixed !important;
    bottom: calc(2rem + 44px) !important;
    left: 1.5rem !important;
    right: auto !important;
    width: 40px !important; height: 40px !important;
    border-radius: 50% !important;
    border: 1px solid rgba(255,255,255,0.14) !important;
    background: rgba(255,255,255,0.06) !important;
    background-image: none !important;
    color: rgba(255,255,255,0.6) !important;
    font-size: 0.85rem !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.4) !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.85);
    transition: all 0.25s, opacity 0.4s ease, visibility 0.4s ease, transform 0.4s cubic-bezier(0.34,1.56,0.64,1);
    z-index: 1050;
    margin-bottom: 0 !important;
}
.scroll-to-top-btn.visible {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) scale(1) !important;
}
.scroll-to-top-btn:hover {
    color: #3b82f6 !important;
    border-color: #3b82f6 !important;
    transform: scale(1.08) !important;
}
.scroll-to-top-btn::before { display: none !important; }
.scroll-to-top-btn i { transform: none !important; font-size: 0.85rem !important; }
.scroll-to-top-btn:hover i { transform: none !important; }
[data-theme="light"] .scroll-to-top-btn {
    background: #FDFCFA !important;
    border-color: rgba(0,0,0,0.1) !important;
    color: rgba(0,0,0,0.5) !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04) !important;
}
[data-theme="light"] .scroll-to-top-btn:hover { color: #2563eb !important; border-color: #2563eb !important; }

/* ── Hide old navbar if present ───────────────── */
.theme-toggle-container { display: none !important; }
header > .navbar { display: none !important; }

@media (max-width: 767px) {
    .theme-toggle-btn { width: 38px; height: 38px; }
    .scroll-to-top-btn { width: 38px !important; height: 38px !important; bottom: calc(2rem + 42px) !important; }
}
