/**
 * Accessible Carousel Styles
 */

/* Carousel Controls Container */
.carousel-controls {
    position: absolute;
    bottom: 80px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 1000;
}

/* Control Buttons Base Styles - Hidden by default, visible only on keyboard focus */
.carousel-controls button {
    /* Visually hidden but accessible */
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Show buttons when they receive keyboard focus */
.carousel-controls button:focus,
.carousel-controls button:focus-visible {
    /* Restore visibility */
    position: relative;
    width: 48px;
    height: 48px;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
    
    /* Visual styling */
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #0A5C36;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #0A5C36;
    
    /* Focus indicator */
    outline: 3px solid #FF7A00;
    outline-offset: 2px;
}

.carousel-controls button:active {
    transform: scale(0.95);
}

/* Play/Pause Button - shown on focus */
.carousel-play-pause:focus,
.carousel-play-pause:focus-visible {
    background: rgba(255, 122, 0, 0.9) !important;
    border-color: #FF7A00 !important;
    color: white !important;
}

/* Icons */
.carousel-controls svg {
    width: 20px;
    height: 20px;
}

/* Navigation Dots Enhancement */
.slideshow-nav {
    z-index: 999;
}

.nav-dot {
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-dot:hover {
    transform: scale(1.2);
}

.nav-dot:focus {
    outline: 2px solid #FF7A00;
    outline-offset: 3px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .carousel-controls {
        bottom: 60px;
        right: 10px;
        gap: 8px;
    }

    .carousel-controls button:focus,
    .carousel-controls button:focus-visible {
        width: 40px;
        height: 40px;
    }

    .carousel-controls svg {
        width: 16px;
        height: 16px;
    }
}

/* Screen Reader Only */
.carousel-live-region {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Ensure slides are properly hidden/shown */
.slide[aria-hidden="true"] {
    display: none !important;
}

.slide[aria-hidden="false"] {
    display: block !important;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .carousel-controls button {
        border-width: 3px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .carousel-controls button:focus,
    .carousel-controls button:focus-visible {
        transition: none;
    }
    
    .nav-dot {
        transition: none;
    }
}

.nav-dot:focus-visible {
    outline: 2px solid #FF7A00;
    outline-offset: 3px;
}

/* Scroll Arrow Link Accessibility */
.scroll-arrow {
    text-decoration: none;
    display: block;
}

.scroll-arrow:focus {
    outline: 3px solid #FF7A00;
    outline-offset: 2px;
}

.scroll-arrow:focus-visible {
    outline: 3px solid #FF7A00;
    outline-offset: 2px;
}

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

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}
