/* Anchor Navigation Block Styles */
.anchor-navigation {
    position: relative;
    z-index: 999; /* Just below header (1000) but above everything else */
    background: var(--anchor-nav-bg, #1E293B);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: box-shadow 0.3s ease;
}

/* Fixed state (applied via JavaScript) */
.anchor-navigation.is-fixed {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    /* top is set dynamically by JavaScript based on header height */
}

.anchor-navigation__container {
    max-width: 1520px;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.anchor-navigation__label {
    color: var(--anchor-nav-text, #94A3B8);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

.anchor-navigation__items {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 6px 0;
}

.anchor-navigation__items::-webkit-scrollbar {
    display: none;
}

.anchor-navigation__item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    background: transparent;
    color: var(--anchor-nav-text, #94A3B8);
    border: 1px solid var(--tcm-accent);
    border-radius: 8px;
    font-size: 16px;
    font-weight: 400;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.25s ease;
    cursor: pointer;
    flex-shrink: 0;
}

.anchor-navigation__item:hover {
    background: rgba(59, 130, 246, 0.1) !important;
    border-color: var(--anchor-nav-active, #3B82F6) !important;
    color: var(--anchor-nav-active-text, var(--tcm-custom-blocks-bg, var(--tcm-custom-blocks-bg, #FFFFFF))) !important;
}

.anchor-navigation__item.is-active {
    background: var(--anchor-nav-active, #3B82F6) !important;
    border-color: var(--tcm-accent) !important;
    color: var(--anchor-nav-active-text, var(--tcm-custom-blocks-bg, var(--tcm-custom-blocks-bg, #FFFFFF))) !important;
}

/* Sticky state with shadow */
.anchor-navigation.is-sticky {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Tablet */
@media (max-width: 1024px) {
    .anchor-navigation__container {
        padding: 10px 16px;
        gap: 12px;
    }
    
    .anchor-navigation__item {
        padding: 8px 14px;
        font-size: 13px;
    }
}

/* Mobile - Horizontal scroll */
@media (max-width: 768px) {
    .anchor-navigation__container {
        flex-direction: row;
        align-items: center;
        padding: 12px 16px;
        gap: 12px;
    }
    
    .anchor-navigation__label {
        font-size: 13px;
        flex-shrink: 0;
    }
    
    .anchor-navigation__items {
        display: flex;
        flex-wrap: nowrap;
        gap: 8px;
        width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
        -ms-overflow-style: none;
        -webkit-overflow-scrolling: touch;
    }
    
    .anchor-navigation__items::-webkit-scrollbar {
        display: none;
    }
    
    .anchor-navigation__item {
        padding: 8px 12px;
        font-size: 12px;
        flex: 0 0 auto;
        white-space: nowrap;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .anchor-navigation__container {
        padding: 10px 12px;
        gap: 8px;
    }
    
    .anchor-navigation__item {
        padding: 6px 10px;
        font-size: 11px;
        border-radius: 6px;
    }
}

/* Editor styles */
.anchor-navigation-editor {
    margin: 20px 0;
}

.anchor-navigation-preview {
    border: 1px dashed #ccc;
}
