/* Accessibility Styles */

/* Screen reader only class */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

/* Focus styles for keyboard navigation */
#mainMenu a:focus,
#mainMenu button:focus,
#mainMenu-trigger button:focus {
    outline: 2px solid #e74133;
    outline-offset: 2px;
}

/* Special focus style for red button (TERMIN VEREINBAREN) to match its design */
#mainMenu .btn-red:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(231, 65, 51, 0.4);
    background-color: #e74133;
    color: #ffffff;
}

/* Ensure red button has same height/size as other navigation items */
#mainMenu .btn-red {
    padding: 10px 12px;
    line-height: normal;
    display: inline-block;
    vertical-align: baseline;
    box-sizing: border-box;
    margin-left: 2px;
}

/* Remove left margin on mobile/hamburger menu */
@media (max-width: 991px) {
    #mainMenu .btn-red {
        margin-left: 0;
    }
}

/* Reduce padding of SERVICE link to match red button height */
#mainMenu nav > ul > li > a:not(.btn) {
    padding: 8px 12px;
}

/* Dropdown menu focus states */
#mainMenu .dropdown-menu a:focus {
    outline: 2px solid #e74133;
    outline-offset: 2px;
    background-color: rgba(231, 65, 51, 0.1);
}

/* Mobile menu button focus state */
#mainMenu-trigger button:focus {
    outline: 2px solid #e74133;
    outline-offset: 2px;
}

/* Make sure dropdowns are accessible via keyboard */
#mainMenu .dropdown:focus-within .dropdown-menu {
    display: block;
    opacity: 1;
    visibility: visible;
}

/* Skip to main content link - becomes visible on focus */
.skip-to-main-content {
    position: absolute;
    left: -999px;
    width: 1px;
    height: 1px;
    top: auto;
    z-index: 999999;
}

.skip-to-main-content:focus {
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    height: auto;
    padding: 1em;
    background: #ffffff;
    border: 2px solid #e74133;
    color: #000000;
    text-decoration: none;
}

/* ========================================
   CAROUSEL ACCESSIBILITY STYLES
   ======================================== */

/* Carousel Focus States */
.carousel:focus {
    outline: 2px solid #e74133;
    outline-offset: 2px;
}

/* Carousel Navigation Buttons */
.carousel-nav-buttons {
    margin-top: 20px;
    text-align: center;
}

.carousel-nav-btn {
    background: #ffffff;
    border: 2px solid #e74133;
    color: #e74133;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 20px;
    font-weight: bold;
    margin: 0 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.carousel-nav-btn:hover,
.carousel-nav-btn:focus {
    background: #e74133;
    color: #ffffff;
    outline: 2px solid #e74133;
    outline-offset: 2px;
}

.carousel-nav-btn:disabled {
    background: #f5f5f5;
    border-color: #cccccc;
    color: #999999;
    cursor: not-allowed;
}

.carousel-nav-btn:disabled:hover {
    background: #f5f5f5;
    color: #999999;
}

/* Improved Focus for Carousel Items */
.carousel .portfolio-item a:focus {
    outline: 2px solid #e74133;
    outline-offset: 2px;
    z-index: 10;
    position: relative;
}

/* Enhanced Flickity Button Focus */
.flickity-button:focus {
    outline: 2px solid #e74133 !important;
    outline-offset: 2px !important;
    z-index: 100 !important;
}

/* Live Region Announcements */
#carousel-announcements {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Keyboard Navigation Instructions */
.carousel-instructions {
    font-size: 14px;
    color: #666;
    margin-top: 10px;
    text-align: center;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .carousel:focus,
    .carousel .portfolio-item a:focus,
    .flickity-button:focus {
        outline: 3px solid;
        outline-offset: 3px;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .carousel * {
        transition: none !important;
        animation: none !important;
    }
}

/* ========================================
   FORM ACCESSIBILITY STYLES
   ======================================== */

/* Enhanced Form Validation Styles */
.form-control.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.form-control.is-invalid:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
    outline: 2px solid #dc3545;
    outline-offset: 2px;
}

/* Error message styling */
.form-text.text-danger[role="alert"] {
    display: flex;
    align-items: center;
    margin-top: 0.5rem;
    font-weight: 500;
}

.form-text.text-danger[role="alert"]:before {
    content: "⚠";
    margin-right: 0.5rem;
    font-size: 1.1em;
}

/* Form focus improvements */
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    outline: 2px solid #e74133;
    outline-offset: 2px;
    border-color: #e74133;
    box-shadow: 0 0 0 0.2rem rgba(231, 65, 51, 0.25);
}

/* Required field indicators */
.form-label:after {
    content: " *";
    color: #dc3545;
    font-weight: bold;
}

/* Hide asterisk for optional fields */
.form-label.optional:after {
    content: "";
}

/* High contrast mode for forms */
@media (prefers-contrast: high) {
    .form-control.is-invalid {
        border-width: 3px;
    }
    
    .form-control:focus {
        outline-width: 3px;
    }
}
