/**
 * Flexible Carousel ADA - Accessibility Styles
 *
 * Styles for accessible carousel controls per WCAG 2.2 Level AA.
 *
 * @package    Blade Child Theme
 * @subpackage Features/Flexible-Carousel-ADA
 * @since      1.0.0
 */

/* ==========================================================================
   Screen Reader Only Class
   ========================================================================== */

.grve-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ==========================================================================
   Pause/Play Button - Bottom Right Overlay with Contrast
   ========================================================================== */

/* Position absolutely on top of carousel, bottom right */
.grve-carousel-pause-btn {
    position: absolute !important;
    bottom: 15px !important;
    right: 15px !important;
    z-index: 100 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    height: 36px !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    background-color: rgba(0, 0, 0, 0.7) !important;
    background-image: none !important;
    border: 2px solid rgba(255, 255, 255, 0.8) !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    opacity: 1;
    transition: all 0.3s;
    box-sizing: border-box !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3) !important;
    overflow: visible !important;
}

/* Hover state */
.grve-carousel-pause-btn:hover {
    background-color: rgba(0, 0, 0, 0.9) !important;
    border-color: #ffffff !important;
    transform: scale(1.05);
}

/* Focus state - visible indicator for keyboard users */
.grve-carousel-pause-btn:focus {
    outline: 3px solid #ffffff !important;
    outline-offset: 2px !important;
    background-color: rgba(0, 0, 0, 0.9) !important;
}

.grve-carousel-pause-btn:focus:not(:focus-visible) {
    outline: none !important;
}

.grve-carousel-pause-btn:focus-visible {
    outline: 3px solid #ffffff !important;
    outline-offset: 2px !important;
    background-color: rgba(0, 0, 0, 0.9) !important;
}

/* ==========================================================================
   Pause/Play Icons - Sized to fit in 36px button
   ========================================================================== */

.grve-carousel-pause-btn .grve-pause-icon,
.grve-carousel-pause-btn .grve-play-icon {
    display: block;
    width: 16px;
    height: 16px;
    position: relative;
    text-indent: 0 !important;
    overflow: visible !important;
}

/* Pause icon - two vertical bars */
.grve-carousel-pause-btn .grve-pause-icon {
    position: relative;
}

.grve-carousel-pause-btn .grve-pause-icon::before,
.grve-carousel-pause-btn .grve-pause-icon::after {
    content: '';
    position: absolute;
    top: 0;
    width: 4px;
    height: 16px;
    background-color: #ffffff;
    border-radius: 1px;
}

.grve-carousel-pause-btn .grve-pause-icon::before {
    left: 2px;
}

.grve-carousel-pause-btn .grve-pause-icon::after {
    right: 2px;
}

/* Play icon - triangle */
.grve-carousel-pause-btn .grve-play-icon {
    position: relative;
    display: none;
}

.grve-carousel-pause-btn .grve-play-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 3px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 8px 0 8px 12px;
    border-color: transparent transparent transparent #ffffff;
}

/* Toggle icon visibility based on play state */
.grve-carousel-pause-btn[data-playing="true"] .grve-pause-icon {
    display: block;
}

.grve-carousel-pause-btn[data-playing="true"] .grve-play-icon {
    display: none;
}

.grve-carousel-pause-btn[data-playing="false"] .grve-pause-icon {
    display: none;
}

.grve-carousel-pause-btn[data-playing="false"] .grve-play-icon {
    display: block;
}

/* ==========================================================================
   Carousel Wrapper Focus Styles
   ========================================================================== */

.grve-carousel-wrapper:focus {
    outline: 3px solid #F5A623 !important;
    outline-offset: 3px !important;
}

.grve-carousel-wrapper:focus:not(:focus-visible) {
    outline: none !important;
}

.grve-carousel-wrapper:focus-visible {
    outline: 3px solid #F5A623 !important;
    outline-offset: 3px !important;
}

/* ==========================================================================
   Navigation Button Focus Styles
   ========================================================================== */

.grve-carousel-wrapper .grve-carousel-prev,
.grve-carousel-wrapper .grve-carousel-next {
    /* Ensure buttons are keyboard accessible */
    cursor: pointer;
}

.grve-carousel-wrapper .grve-carousel-prev:focus,
.grve-carousel-wrapper .grve-carousel-next:focus {
    outline: 3px solid #F5A623 !important;
    outline-offset: 2px !important;
}

.grve-carousel-wrapper .grve-carousel-prev:focus:not(:focus-visible),
.grve-carousel-wrapper .grve-carousel-next:focus:not(:focus-visible) {
    outline: none !important;
}

.grve-carousel-wrapper .grve-carousel-prev:focus-visible,
.grve-carousel-wrapper .grve-carousel-next:focus-visible {
    outline: 3px solid #F5A623 !important;
    outline-offset: 2px !important;
}

/* ==========================================================================
   Slide Focus Styles
   ========================================================================== */

.grve-carousel-wrapper .owl-item:focus {
    outline: 3px solid #F5A623 !important;
    outline-offset: -3px !important;
}

.grve-carousel-wrapper .owl-item:focus:not(:focus-visible) {
    outline: none !important;
}

.grve-carousel-wrapper .owl-item:focus-visible {
    outline: 3px solid #F5A623 !important;
    outline-offset: -3px !important;
}

/* ==========================================================================
   Reduced Motion Support
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .grve-carousel-wrapper .owl-wrapper {
        transition: none !important;
    }

    .grve-carousel-pause-btn {
        transition: none !important;
    }
}

/* ==========================================================================
   High Contrast Mode Support
   ========================================================================== */

@media (forced-colors: active) {
    .grve-carousel-pause-btn {
        border: 2px solid ButtonText;
        background-color: ButtonFace;
    }

    .grve-carousel-pause-btn:focus {
        outline: 3px solid Highlight !important;
    }

    .grve-pause-icon::before,
    .grve-pause-icon::after,
    .grve-play-icon::before {
        background-color: ButtonText;
        border-color: ButtonText;
    }

    .grve-carousel-wrapper:focus,
    .grve-carousel-wrapper .grve-carousel-prev:focus,
    .grve-carousel-wrapper .grve-carousel-next:focus {
        outline: 3px solid Highlight !important;
    }
}

/* ==========================================================================
   Mobile Responsive Adjustments
   ========================================================================== */

@media screen and (max-width: 767px) {
    .grve-carousel-pause-btn {
        width: 40px;
        height: 40px;
    }

    .grve-pause-icon,
    .grve-play-icon {
        width: 16px;
        height: 16px;
    }

    .grve-pause-icon::before,
    .grve-pause-icon::after {
        width: 5px;
        height: 14px;
    }

    .grve-play-icon::before {
        border-width: 7px 0 7px 12px;
    }
}

/* ==========================================================================
   Pagination Dots Accessibility
   ========================================================================== */

.grve-carousel-wrapper .owl-pagination .owl-page {
    cursor: pointer;
}

.grve-carousel-wrapper .owl-pagination .owl-page:focus {
    outline: 3px solid #F5A623 !important;
    outline-offset: 2px !important;
}

.grve-carousel-wrapper .owl-pagination .owl-page:focus:not(:focus-visible) {
    outline: none !important;
}

.grve-carousel-wrapper .owl-pagination .owl-page:focus-visible {
    outline: 3px solid #F5A623 !important;
    outline-offset: 2px !important;
}
