/* nav.css - Global Sticky Navigation for all pages */
.sticky-nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

.nav-brand {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #1d1d1f;
}

.nav-brand a {
    text-decoration: none;
    color: inherit;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    color: #86868b;
    transition: color 0.2s ease;
}

.nav-links a:hover {
    color: #1d1d1f;
}

@media (max-width: 768px) {
    .nav-links { gap: 0.5rem; }
    .nav-links a { display: none; }

    .chapter-nav {
        margin-top: 0.5rem;
        padding: 0.5rem 0;
    }

    .chapter-nav-scroll {
        gap: 1.5rem;
        padding: 0.5rem 1rem;
    }

    .chapter-image {
        font-size: 2.6rem;
        height: 64px;
        margin-bottom: 0.5rem;
    }

    .chapter-label {
        font-size: 0.85rem;
    }
}

/* Chapter Navigation Tabs (Apple Style) */
.chapter-nav {
    margin-top: 2rem;
    width: 100%;
    padding: 1.5rem 0;
    position: relative;
    z-index: 10;
}

.chapter-nav-scroll {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    /* Firefox */
    padding: 1rem max(1.5rem, calc((100vw - 1200px) / 2));
    gap: 2.5rem;
    justify-content: flex-start;
    align-items: flex-end;
}

@media (min-width: 1024px) {
    .chapter-nav-scroll {
        justify-content: center;
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

.chapter-nav-scroll::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

.chapter-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #1d1d1f;
    min-width: 100px;
    scroll-snap-align: center;
    transition: all 0.2s ease;
    opacity: 0.85;
}

.chapter-item:hover {
    color: #FFC904;
    transform: scale(1.05);
    opacity: 1;
}

.chapter-image {
    font-size: 3.2rem;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.8rem;
    transition: transform 0.3s ease;
}

.chapter-item:hover .chapter-image {
    transform: translateY(-5px);
}

.chapter-label {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

/* ===================================
   Footer
   =================================== */
.footer {
    background: #f5f5f7;
    padding: 2rem 0;
    text-align: center;
    border-top: 1px solid rgba(183, 65, 14, 0.1);
}

.footer p {
    color: #86868b;
    margin-bottom: 0.5rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.footer-links a {
    color: #86868b;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: #b7410e;
}

html.dark-mode .sticky-nav {
    background: rgba(29, 29, 31, 0.72);
}
html.dark-mode .nav-brand {
    color: #f5f5f7;
}
html.dark-mode .nav-links a {
    color: #a1a1a6;
}
html.dark-mode .nav-links a:hover {
    color: #f5f5f7;
}
html.dark-mode .chapter-item {
    color: #f5f5f7 !important;
}
html.dark-mode .chapter-label {
    color: #f5f5f7 !important;
}
html.dark-mode .footer {
    background: #000000;
}
html.dark-mode .footer p,
html.dark-mode .footer-links a {
    color: #a1a1a6;
}
html.dark-mode .footer-links a:hover {
    color: #f5f5f7;
}
.theme-toggle {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: inherit;
    transition: transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.theme-toggle:hover {
    transform: scale(1.1);
}
html.dark-mode .theme-toggle {
    color: #f5f5f7;
}
