﻿/* Core Hero Structure */
.hospital-hero {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    min-height: 420px;
    overflow: hidden;
    background: #002856;
}

.hospital-swiper {
    position: relative;
    width: 100%;
    height: 100%;
}

.hospital-slide {
    width: 100%;
    height: 100%;
}

.hospital-slide {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
}

/* Base Image Setup */
.hospital-slide > img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

/* Mask Transition Overlay */
.hospital-slide-mask {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    background-color: #002856;
    background-size: cover;
    background-position: center;
    -webkit-mask-image: url('../../mediic1/assets/images/resource/mask-btn2.png');
    mask-image: url('../../mediic1/assets/images/resource/mask-btn2.png');
    -webkit-mask-size: 2300% 100%;
    mask-size: 2300% 100%;
    -webkit-mask-position: 0% 0%;
    mask-position: 0% 0%;
    pointer-events: none;
}

/* Trigger Mask Animation when Slide becomes Active */
.hospital-slide.swiper-slide-active .hospital-slide-mask {
    animation: mask_slide_reveal 0.8s steps(22) forwards;
}

/* Reset Mask when Slide is Inactive */
.hospital-slide:not(.swiper-slide-active) .hospital-slide-mask {
    animation: mask_slide_hide 0.3s forwards;
}

/* Keyframe Animations */
@keyframes mask_slide_reveal {
    0% {
        -webkit-mask-position: 0% 0%;
        mask-position: 0% 0%;
        opacity: 1;
    }
    100% {
        -webkit-mask-position: 100% 0%;
        mask-position: 100% 0%;
        opacity: 1;
    }
}

@keyframes mask_slide_hide {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        -webkit-mask-position: 0% 0%;
        mask-position: 0% 0%;
    }
}

/* Slide Overlay (Gradients & Text Content Layering) */
.hospital-slide-overlay {
    position: absolute;
    inset: 0;
    z-index: 3;
    background: linear-gradient(90deg, rgba(0, 33, 72, .94) 0%, rgba(0, 40, 86, .68) 42%, rgba(0, 40, 86, .11) 76%), 
                linear-gradient(0deg, rgba(0, 20, 47, .36), transparent 46%);
}

.hospital-slide-content {
    position: relative;
    z-index: 4;
    color: #fff;
    padding-left: 8%;
}

.hospital-slide-content h1 {
    font-size: clamp(2rem, 5vw, 4rem);
    line-height: 1.2;
    margin: 0;
}

/* Left / right navigation â€” visible on swiper hover */
.hospital-swiper-controls {
    position: absolute;
    inset: 0;
    z-index: 8;
    pointer-events: none;
}

.hospital-swiper-controls button {
    position: absolute;
    top: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 26, 60, .65);
    color: #fff;
    font-size: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
    backdrop-filter: blur(8px);
    transform: translateY(-50%);
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility .3s ease, background .25s ease, color .25s ease, transform .25s ease;
    cursor: pointer;
    pointer-events: auto;
}

.hospital-swiper-prev {
    left: 24px;
}

.hospital-swiper-next {
    right: 24px;
}

@media (hover: hover) {
    .hospital-hero:hover .hospital-swiper-controls button {
        opacity: 1;
        visibility: visible;
    }
}

@media (hover: none) {
    .hospital-swiper-controls button {
        opacity: 1;
        visibility: visible;
    }
}

.hospital-swiper-controls button:hover {
    background: #ffb81b;
    color: #002856;
    transform: translateY(-50%) scale(1.05);
}

.hospital-swiper-controls button:focus-visible {
    opacity: 1;
    visibility: visible;
    outline: 2px solid #ffb81b;
    outline-offset: 2px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .hospital-hero {
        aspect-ratio: 4 / 3;
        min-height: 230px;
    }
    
    .hospital-slide-content {
        padding-left: 5%;
        padding-right: 5%;
    }
    
    .hospital-swiper-prev {
        left: 12px;
    }

    .hospital-swiper-next {
        right: 12px;
    }

    .hospital-swiper-controls button {
        width: 38px;
        height: 38px;
        font-size: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hospital-slide.swiper-slide-active .hospital-slide-mask {
        animation: none;
        -webkit-mask-position: 100% 0%;
        mask-position: 100% 0%;
    }
}

