/**
 * Hero Carousel Styles - Figma Design Implementation
 * March Medical Associates
 */

/* Carousel Container */
.hero-carousel-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    min-height: clamp(400px, 60vh, 600px);
}

/* Carousel Slides */
.carousel-slides {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* Individual Slides */
.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease-in-out;
    display: none;
}

.carousel-slide.active {
    opacity: 1;
    visibility: visible;
    display: flex !important;
    align-items: end;
    z-index: 1;
}

.wp-block-cover .wp-block-cover__inner-container {
    margin-bottom: 5rem;
}

/* Split Layout Styling */
.hero-split-layout {
    height: 100%;
    min-height: clamp(400px, 60vh, 600px);
}

.hero-split-layout .wp-block-column:first-child {
    background: linear-gradient(135deg, #6b7c8a 0%, #5a6b78 100%) !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-split-layout .wp-block-column:last-child {
    position: relative;
}

/* Content Column Styling */
.hero-split-layout .wp-block-column:first-child .wp-block-heading {
    font-family: system-ui, -apple-system, sans-serif;
    font-weight: 700;
    line-height: 1.1;
    color: white;
    margin-bottom: 1.5rem;
}

.hero-split-layout .wp-block-column:first-child .wp-block-buttons {
    gap: 1rem;
    margin-top: 2rem;
}

/* Navigation Container - Full overlay on desktop, bottom bar on mobile */
.carousel-navigation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: none;
    z-index: 10;
    pointer-events: none;
}

/* Navigation Buttons */
.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: auto;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.85);
    color: #34495E;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
    font-size: 20px;
    font-weight: 400;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    opacity: 0.8;
}

.carousel-nav.prev {
    left: 16px;
}

.carousel-nav.next {
    right: 16px;
}

.carousel-nav:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    opacity: 1;
}

.carousel-nav a {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* Bottom Indicators Container */
.carousel-indicators-bottom {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.carousel-indicators {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: auto;
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Individual Indicators - use opacity instead of background-color for composited animation */
.indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background: white;
    cursor: pointer;
    opacity: 0.4;
    transition: opacity 0.3s ease, transform 0.3s ease;
    padding: 0;
    will-change: opacity, transform;
}

.indicator:hover,
.indicator.active {
    opacity: 0.9;
    transform: scale(1.5);
}

/* Services Panel Styling */
.services-panel {
    position: absolute !important;
    bottom: 0 !important;
    right: 50px !important;
    left: auto !important;
    transform: none !important;
    width: auto !important;
    min-width: 300px;
    background: rgba(52, 73, 94, 0.95) !important;
    backdrop-filter: blur(10px);
    border-radius: 8px 8px 0 0;
    z-index: 5;
}

/* Image Column Styling */
.hero-split-layout .wp-block-column:last-child .wp-block-cover {
    height: 100%;
    min-height: clamp(400px, 60vh, 600px);
}

.hero-split-layout .wp-block-column:last-child .wp-block-cover__image-background {
    object-fit: cover;
    object-position: center;
}

/* Button Styling */
.hero-split-layout .wp-block-button.is-style-fill .wp-block-button__link {
    background: #0D7D67 !important;
    color: white !important;
    border: none !important;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.hero-split-layout .wp-block-button.is-style-fill:hover .wp-block-button__link {
    background: #0B7060 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(26, 188, 156, 0.3);
}

.hero-split-layout .wp-block-button.is-style-outline .wp-block-button__link {
    background: transparent !important;
    color: white !important;
    border: 2px solid white !important;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.hero-split-layout .wp-block-button.is-style-outline:hover .wp-block-button__link {
    background: white !important;
    color: #6b7c8a !important;
    transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .carousel-nav {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .carousel-nav.prev {
        left: 12px;
    }

    .carousel-nav.next {
        right: 12px;
    }

    .services-panel {
        right: 30px !important;
        min-width: 250px;
    }
}

@media (max-width: 768px) {
    .hero-carousel-container {
        height: auto;
        min-height: auto;
        overflow: visible;
    }

    /* Stack slides and navigation vertically so nav sits below slides */
    .carousel-slides {
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        height: auto;
        min-height: auto;
        padding: 0;
    }

    /* Give slides a defined height within the column flow */
    .carousel-slide {
        position: relative;
        min-height: clamp(400px, 55vh, 500px);
    }

    /* Hide inactive slides — only active participates in flow */
    .carousel-slide:not(.active) {
        position: absolute;
        top: 0;
        left: 0;
    }

    .hero-split-layout {
        flex-direction: column !important;
        min-height: clamp(400px, 55vh, 500px);
    }

    .hero-split-layout .wp-block-column {
        flex-basis: 100% !important;
        width: 100% !important;
    }

    .hero-split-layout .wp-block-column:first-child {
        min-height: 300px;
        padding: 2rem 1.5rem !important;
    }

    .hero-split-layout .wp-block-column:last-child .wp-block-cover {
        min-height: 200px;
    }

    /* Navigation flows below the slides as a full-width bottom bar */
    .carousel-navigation {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        width: 100%;
        height: auto;
        box-sizing: border-box;
        pointer-events: auto;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.75rem;
        margin: 0;
        padding: 0.75rem 1.25rem;
        background: var(--wp--preset--color--neutral-lightest, #F2F2F2);
    }

    .carousel-nav {
        position: static;
        top: auto;
        transform: none;
        width: 36px;
        height: 36px;
        font-size: 16px;
        opacity: 1;
        background: rgba(255, 255, 255, 0.95);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    .carousel-nav.prev,
    .carousel-nav.next {
        left: auto;
        right: auto;
    }

    .carousel-indicators {
        position: static;
        transform: none;
    }

    .indicator {
        background: rgb(52, 73, 94);
        opacity: 0.3;
    }

    .indicator:hover,
    .indicator.active {
        opacity: 0.8;
    }

    .services-panel {
        right: 20px !important;
        min-width: 200px;
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .carousel-slide {
        min-height: clamp(350px, 50vh, 420px);
    }

    .hero-split-layout {
        min-height: clamp(350px, 50vh, 420px);
    }

    .hero-split-layout .wp-block-column:first-child {
        min-height: clamp(240px, 35vh, 280px);
        padding: 1.5rem 1rem !important;
    }

    .hero-split-layout .wp-block-column:first-child .wp-block-heading {
        font-size: clamp(1.8rem, 5vw, 2.5rem) !important;
    }

    .carousel-navigation {
        gap: 0.5rem;
        padding: 0.625rem 1rem;
    }

    .carousel-nav {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .indicator {
        width: 7px;
        height: 7px;
    }

    .services-panel {
        min-width: 180px;
        padding: 0.75rem 1rem !important;
    }
}

/* Focus States for Accessibility */
.carousel-nav:focus-visible,
.indicator:focus-visible {
    outline: 2px solid var(--wp--preset--color--pickled-bluewood, #34495E);
    outline-offset: 2px;
}

/* Hide focus ring for mouse clicks, show for keyboard */
.carousel-nav:focus:not(:focus-visible),
.indicator:focus:not(:focus-visible),
.hero-carousel-container:focus:not(:focus-visible) {
    outline: none;
}

/* Animation for slide transitions */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.carousel-slide.active .wp-block-group {
    animation: slideIn 0.5s ease-out;
}