/**************
Inner Midbar Section Styles
**************/

/* Main midbar section */
.inner-midbar {
    position: relative;
    height: 635px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    
    @media (max-width: 1024px) {
        height: 500px;
    }
    
    @media (max-width: 768px) {
        height: 400px;
    }
    
    @media (max-width: 576px) {
        height: 350px;
    }
}

/* Background container */
.midbar-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.midbar-bg-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.midbar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        180deg, 
        rgba(0, 0, 0, 0.1) 0%, 
        rgba(0, 0, 0, 0.3) 50%, 
        rgba(0, 0, 0, 0.6) 100%
    );
    z-index: 2;
}

/* Content container */
.midbar-content {
    position: relative;
    z-index: 3;
    width: 100%;
    padding-bottom: 45px;
    
    @media (max-width: 768px) {
        padding-bottom: 35px;
    }
    
    @media (max-width: 576px) {
        padding-bottom: 35px;
    }
}

/* Title styling */
.midbar-title {
    color: var(--white);
    font-family: var(--font-type2);
    font-size: 100px;
    font-style: normal;
    font-weight: 400;
    line-height: 90px;
    margin: 0;
    word-wrap: break-word;
    hyphens: auto;
    
    @media (max-width: 1200px) {
        font-size: 80px;
        line-height: 75px;
    }
    
    @media (max-width: 991px) {
        font-size: 70px;
        line-height: 78px;
        max-width: 500px;
    }
    
    @media (max-width: 768px) {
        font-size: 60px;
        line-height: 65px;
        max-width: 400px;
    }
    
    @media (max-width: 576px) {
        font-size: 50px;
        line-height: 52px;
        max-width: 100%;
    }
    
    @media (max-width: 400px) {
        font-size: 40px;
        line-height: 45px;
    }
}

/* Container positioning */
.inner-midbar .container {
    position: relative;
    z-index: 3;
    height: 100%;
    display: flex;
    align-items: flex-end;
}

/* Responsive text handling for longer content */
@media (max-width: 768px) {
    .midbar-title {
        /* Ensure text wraps properly on smaller screens */
        overflow-wrap: break-word;
        word-break: break-word;
    }
}

/* Additional overlay for better text readability on mobile */
@media (max-width: 576px) {
    .midbar-overlay::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 50%;
        background: linear-gradient(
            0deg,
            rgba(0, 0, 0, 0.4) 0%,
            transparent 100%
        );
        z-index: 1;
    }
}

/**************
RTL Support
**************/

/* RTL text alignment and positioning */
[dir="rtl"] .midbar-text-content {
    text-align: right;
}

[dir="rtl"] .midbar-title {
    text-align: right;
    direction: rtl;
}

/* RTL container positioning - content positioned from right side */
[dir="rtl"] .inner-midbar .container {
    direction: rtl;
}

[dir="rtl"] .midbar-content {
    display: flex;
    justify-content: flex-start;
}

[dir="rtl"] .midbar-text-content {
    margin-left: auto;
    margin-right: 0;
}

/* RTL overlay positioning adjustments */
@media (max-width: 576px) {
    [dir="rtl"] .midbar-overlay::after {
        left: auto;
        right: 0;
    }
}

/* RTL font handling for Arabic text */
[dir="rtl"] .midbar-title {
    /* Better line-height for Arabic text */
    line-height: 1.2;

    @media (max-width: 1200px) {
        line-height: 1.15;
    }

    @media (max-width: 991px) {
        line-height: 1.1;
    }

    @media (max-width: 768px) {
        line-height: 1.1;
    }

    @media (max-width: 576px) {
        line-height: 1.05;
    }
}
