/**
 * Skip Links Styles
 * 
 * Provides keyboard-accessible skip links for better navigation.
 * Skip links allow keyboard users to bypass repetitive content.
 * 
 * WCAG 2.1 Criteria:
 * - 2.4.1 Bypass Blocks (Level A)
 * - 2.1.1 Keyboard (Level A)
 * 
 * @package BFL_Accessibility
 * @author WP-Stars - Valentin Girleanu
 */

/* ==========================================================================
   Skip Links Container
   ========================================================================== */

.bfl-skip-links {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 999999;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* ==========================================================================
   Skip Link Items
   ========================================================================== */

.bfl-skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    display: block;
    padding: 15px 20px;
    background-color: #ffffff;
    color: #000000;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
    border: 2px solid #000000;
    border-radius: 0 0 4px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: top 0.2s ease-in-out;
    white-space: nowrap;
    z-index: 999999;
}

/* Show skip link on focus */
/* Updated to match accessibility report requirements (black dotted) */
.bfl-skip-link:focus {
    top: 0;
    outline: 2px dotted #000000;
    outline-offset: -3px;
}

/* Hover state (for mouse users who tab to it) */
.bfl-skip-link:hover {
    background-color: #f0f0f0;
    color: #000000;
}

/* Active state */
.bfl-skip-link:active {
    background-color: #e0e0e0;
}

/* ==========================================================================
   Multiple Skip Links
   ========================================================================== */

/* Position multiple skip links in a row */
.bfl-skip-links .bfl-skip-link:nth-child(2) {
    left: auto;
    right: 0;
    border-radius: 0 0 0 4px;
}

.bfl-skip-links .bfl-skip-link:nth-child(3) {
    left: 50%;
    transform: translateX(-50%);
    border-radius: 0 0 4px 4px;
}

.bfl-skip-links .bfl-skip-link:nth-child(3):focus {
    transform: translateX(-50%);
}

/* ==========================================================================
   High Contrast Mode Support
   ========================================================================== */

@media (prefers-contrast: high) {
    .bfl-skip-link {
        border: 3px solid #000000;
    }

    .bfl-skip-link:focus {
        outline: 4px dotted #000000;
        outline-offset: 2px;
    }
}

/* ==========================================================================
   Reduced Motion Support
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .bfl-skip-link {
        transition: none;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .bfl-skip-links,
    .bfl-skip-link {
        display: none !important;
    }
}

/* ==========================================================================
   Screen Reader Only Text (for additional context)
   ========================================================================== */

.bfl-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.bfl-sr-only:focus {
    position: static;
    width: auto;
    height: auto;
    padding: inherit;
    margin: inherit;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* ==========================================================================
   Dark Mode Support
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    .bfl-skip-link {
        background-color: #ffffff;
        color: #000000;
        border: 2px solid #000000;
    }

    .bfl-skip-link:hover {
        background-color: #f0f0f0;
    }

    .bfl-skip-link:active {
        background-color: #e0e0e0;
    }
}

/* ==========================================================================
   Skip Link Targets
   ========================================================================== */

/* Ensure skip link targets are focusable and have proper outline */
/* Updated to match accessibility report requirements (black dotted) */
#bfl-main-content:focus,
#bfl-primary-navigation:focus,
#bfl-footer:focus,
.bfl-skip-target:focus {
    outline: 2px dotted #000000;
    outline-offset: 2px;
}

/* Ensure skip targets don't interfere with layout */
.bfl-skip-target {
    position: absolute;
    pointer-events: none;
}

/* Smooth scroll behavior for skip links */
html {
    scroll-behavior: smooth;
}

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .bfl-skip-link {
        font-size: 14px;
        padding: 12px 16px;
    }
}

@media (max-width: 480px) {
    .bfl-skip-link {
        font-size: 13px;
        padding: 10px 14px;
    }

    /* Stack skip links on very small screens */
    .bfl-skip-links .bfl-skip-link:nth-child(2),
    .bfl-skip-links .bfl-skip-link:nth-child(3) {
        left: 0;
        right: auto;
        transform: none;
        border-radius: 0 0 4px 0;
    }

    .bfl-skip-links .bfl-skip-link:nth-child(2):focus {
        top: 50px;
    }

    .bfl-skip-links .bfl-skip-link:nth-child(3):focus {
        top: 100px;
        transform: none;
    }
}

