/* AIP Pillars Slideshow Styles
 * Follows Bruviti design system with dark theme and orange accent
 * Mobile-first responsive design with 8px grid spacing
 */

/* Main slideshow section */
.aip-pillars-slideshow-section {
    padding: var(--space-12) 0;
    background: var(--primary-dark);
    position: relative;
    overflow: hidden;
}

/* Mobile: Allow overflow for navigation dots visibility */
@media (max-width: 767px) {
    .aip-pillars-slideshow-section {
        overflow: visible; /* Prevent clipping of navigation dots */
    }
}

/* Slideshow container - Mobile first with immersive sizing */
.aip-slideshow {
    position: relative;
    width: 100%;
    min-height: 70vh;
    max-height: 600px;
}

/* Slides wrapper */
.aip-slideshow__slides {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Individual slide */
.aip-slideshow__slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-base), visibility var(--transition-base);
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-6);
    align-items: center;
}

/* Active slide */
.aip-slideshow__slide.active {
    opacity: 1;
    visibility: visible;
    position: relative;
}

/* Slide content wrapper with minimal gap */
.aip-slideshow__content {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-3);
    align-items: center;
}

/* Image container - No background or borders */
.aip-slideshow__image-container {
    position: relative;
    width: 100%;
    height: 60vh;
    max-height: 400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: transparent;
    border: none;
}

/* Jet engine part image */
.aip-slideshow__image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.5s ease;
}

.aip-slideshow__slide.active .aip-slideshow__image {
    transform: scale(1.05);
}

/* Text content - Card container wrapper */
.aip-slideshow__text {
    width: 100%;
    max-width: 500px;    /* Reduced from 1200px */
    margin: 0 auto;
    padding: 0;
}

/* Card styling with always-visible orange border */
.aip-slideshow__card {
    text-align: left;
    border: 2px solid var(--medium-gray);
    padding: var(--space-3);
    background: transparent;
}

.aip-slideshow__card .aip-slideshow__title {
    font-size: 1.5rem;
    margin-bottom: var(--space-2);
    color: var(--text-bright-gray);
}

.aip-slideshow__card .aip-slideshow__description {
    font-size: 1rem; /* 16px - MINIMUM */
    line-height: 1.4;
    margin: 0;
    color: var(--text-primary-gray);
}

/* Navigation dots */
.aip-slideshow__nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-3);
    margin-top: var(--space-8);
    position: relative;
    z-index: 10;
}

.aip-slideshow__dot {
    width: 12px;
    height: 12px;
    border-radius: 0;
    background: var(--medium-gray);
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    padding: 0;
}

.aip-slideshow__dot:hover {
    background: var(--light-gray);
    transform: scale(1.2);
}

.aip-slideshow__dot.active {
    background: var(--accent-orange);
    width: 32px;
    border-radius: 0;
}

.aip-slideshow__dot:focus {
    outline: 2px solid var(--accent-orange);
    outline-offset: 3px;
}

/* Arrow navigation - Default desktop overlay styles */
.aip-slideshow__arrows--overlay {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 var(--space-4);
    pointer-events: none;
    z-index: 5;
}

/* Hide below arrows by default (desktop) */
.aip-slideshow__arrows--below {
    display: none;
}

.aip-slideshow__arrow {
    width: 48px;
    height: 48px;
    background: rgba(26, 26, 26, 0.8);
    border: 1px solid var(--medium-gray);
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-base);
    pointer-events: all;
    color: var(--text-white);
    font-size: 20px;
}

.aip-slideshow__arrow:hover {
    background: var(--secondary-dark);
    border-color: var(--accent-orange);
    transform: scale(1.1);
}

.aip-slideshow__arrow:focus {
    outline: 2px solid var(--accent-orange);
    outline-offset: 2px;
}

.aip-slideshow__arrow--prev::before {
    content: '←';
}

.aip-slideshow__arrow--next::before {
    content: '→';
}

/* Progress indicator - REMOVED */
.aip-slideshow__progress {
    display: none;
}

/* Mobile styles - Add horizontal padding and fix dots visibility */
@media (max-width: 767px) {
    /* Adjust container for mobile */
    .aip-slideshow {
        overflow: visible; /* Allow dots to be visible */
        min-height: auto; /* Let content determine height */
        max-height: none; /* Remove height constraint that might clip dots */
    }
    
    /* Apply padding to slide content instead */
    .aip-slideshow__slides {
        padding: 0 var(--space-3); /* Add 12px horizontal padding to content */
        min-height: 60vh; /* Maintain reasonable height */
    }
    
    /* Ensure navigation dots stay within viewport and are visible */
    .aip-slideshow__nav {
        padding: 0 var(--space-3); /* Match content padding for alignment */
        margin-top: var(--space-6); /* Reduce from space-8 for better mobile spacing */
        position: relative; /* Ensure proper stacking */
        z-index: 10; /* Keep above other content */
    }
    
    /* Hide overlay arrows on mobile */
    .aip-slideshow__arrows--overlay {
        display: none;
    }
    
    /* Show and position below arrows on mobile */
    .aip-slideshow__arrows--below {
        display: flex;
        justify-content: space-between;
        align-items: center;
        position: absolute; /* Position within slideshow */
        width: 100%;
        left: 0;
        right: 0;
        /* Position near bottom of the image container */
        top: calc(60vh - 180px); /* Position in lower third of 60vh image */
        transform: none;
        pointer-events: all;
        z-index: 10; /* Above slide content */
        background: transparent; /* Ensure transparency */
        padding: 0 var(--space-2); /* Add horizontal padding for edge spacing */
    }
    
    /* Style arrows for mobile below position */
    .aip-slideshow__arrows--below .aip-slideshow__arrow:not(:hover) {
        pointer-events: all;
        background: rgba(26, 26, 26, 0.95); /* Slightly more opaque for visibility */
        border: 2px solid var(--medium-gray) !important; /* Gray border to match desktop behavior */
        transform: translateY(-50%); /* Center vertically at their position */
    }
    
    /* Position individual arrows on left and right sides */
    .aip-slideshow__arrows--below .aip-slideshow__arrow--prev {
        left: var(--space-2); /* 8px from left edge */
    }
    
    .aip-slideshow__arrows--below .aip-slideshow__arrow--next {
        right: var(--space-2); /* 8px from right edge */
    }
    
    /* Slightly smaller arrows on mobile but maintain touch target */
    .aip-slideshow__arrow {
        width: 44px; /* Minimum touch target size */
        height: 44px; /* Minimum touch target size */
        font-size: 18px; /* Slightly smaller arrow icon */
    }
}

/* Tablet styles - Medium sizing */
@media (min-width: 768px) {
    .aip-slideshow {
        min-height: 550px;
        max-height: 550px;
    }

    .aip-slideshow__content {
        grid-template-columns: 1fr;
        gap: var(--space-3);
    }

    /* Styles consolidated with main .aip-slideshow__text definition */

    .aip-slideshow__image-container {
        height: 400px;
        max-height: 400px;
        width: auto;
        max-width: 500px;
    }
}

/* Desktop styles - Balanced proportions with side-by-side layout */
@media (min-width: 1024px) {
    .aip-slideshow {
        min-height: 600px;
        max-height: 700px;
    }

    .aip-slideshow__content {
        grid-template-columns: 1fr 1fr;
        gap: 0;         
        align-items: center;
        padding: 0 var(--space-4);
    }

    /* Styles consolidated with main .aip-slideshow__text definition */

    .aip-slideshow__arrows--overlay {
        padding: 0 var(--space-8);
        top: auto;                    /* Remove center positioning */
        bottom: var(--space-8);       /* Align with dots */
        transform: none;              /* Remove center transform */
    }

    .aip-slideshow__image-container {
        height: 450px;
        max-height: 500px;
        width: 100%;
        max-width: none;
    }

    .aip-slideshow__nav {
        margin-top: var(--space-6);
    }
}

/* Large desktop styles - Refined proportions */
@media (min-width: 1440px) {
    .aip-slideshow {
        max-height: 650px;
    }

    .aip-slideshow__content {
        grid-template-columns: 1fr 1fr;
        gap: 0;          /* Keep same gap */
        max-width: 1400px;
        margin: 0 auto;
    }

    /* Styles consolidated with main .aip-slideshow__text definition */

    .aip-slideshow__image-container {
        height: 500px;
        max-height: 500px;
    }
}

/* Animation keyframes */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}


/* Accessibility - reduced motion */
@media (prefers-reduced-motion: reduce) {
    .aip-slideshow__slide,
    .aip-slideshow__image,
    .aip-slideshow__dot,
    .aip-slideshow__arrow,
    .aip-slideshow__progress {
        transition: none !important;
        animation: none !important;
    }
}

/* Focus visible for keyboard navigation */
.aip-slideshow__dot:focus-visible,
.aip-slideshow__arrow:focus-visible {
    outline: 2px solid var(--accent-orange);
    outline-offset: 3px;
}

/* Loading state */
.aip-slideshow__image.loading {
    opacity: 0.5;
}

/* Error state */
.aip-slideshow__image.error {
    display: none;
}

.aip-slideshow__image.error::after {
    content: 'Image failed to load';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--light-gray);
    font-size: var(--text-sm);
}