/* CSS Fixes for Medium Desktop Screens (768px - 1200px) */

/* Improve parallax animation smoothness for medium screens */
@media screen and (min-width: 768px) and (max-width: 1200px) {
    
    /* Reduce parallax intensity for smoother animations */
    .my-element[data-paroller-factor-md] {
        transform: none !important;
    }
    
    /* Optimize WOW.js animations for medium screens */
    .wow {
        animation-duration: 0.8s !important;
        animation-delay: 0.2s !important;
    }
    
    .wow.fadeInUp {
        animation-duration: 0.6s !important;
        animation-delay: 0.1s !important;
    }
    
    /* Fix layout alignment issues */
    .half-section .row {
        align-items: center;
        min-height: auto;
    }
    
    .half-section .col-sm-5,
    .half-section .col-sm-7 {
        margin-bottom: 30px;
    }
    
    /* Improve text and image alignment */
    .writing-sec {
        padding: 30px 15px;
        text-align: left;
    }
    
    .img-sec {
        text-align: center;
        padding: 15px;
    }
    
    .img-sec img {
        max-width: 100%;
        height: auto;
    }
    
    /* Fix navigation menu spacing */
    .menu-1-inner .dropdown .btn {
        padding: 8px 12px;
        margin: 0 5px;
        font-size: 14px;
    }
    
    /* Improve container fluid behavior */
    .container-fluid {
        padding-left: 30px;
        padding-right: 30px;
    }
    
    /* Fix header content alignment */
    .header-home-2 .header-cont {
        padding: 60px 30px;
        max-width: 90%;
        margin: 0 auto;
    }
    
    .header-home-2 h1 {
        font-size: 5.5vh;
        line-height: 1.2;
    }
    
    .header-home-2 h4 {
        font-size: 1.8vh;
        margin-bottom: 30px;
    }
    
    /* Improve section spacing */
    .main-section {
        padding: 60px 0;
    }
    
    .half-section {
        padding: 40px 0;
    }
    
    /* Fix iframe responsiveness */
    .h2-book-section iframe {
        width: 100% !important;
        max-width: 350px;
        height: 500px !important;
        margin: 0 auto;
        display: block;
    }
    
    /* Improve home about section */
    .home-about {
        margin: 60px auto 0;
        padding: 0 30px;
    }
    
    .home-about p {
        font-size: 1.2rem;
        line-height: 1.6;
    }
    
    /* Fix button alignment */
    .read-more.button-fancy {
        margin-top: 25px;
        display: inline-block;
    }
    
    /* Improve thm-h spacing */
    .thm-h {
        margin-bottom: 35px;
    }
    
    .thm-h h2 {
        font-size: 2.2rem;
        margin-bottom: 0.5em;
    }
    
    .thm-h h4 {
        font-size: 1.1rem;
    }
    
    /* Fix testimonials section */
    .testimonials {
        padding: 60px 0;
    }
    
    .testimonials-inner {
        padding: 30px;
        margin: 0 15px;
    }
    
    /* Disable problematic parallax effects on medium screens */
    .my-element[data-paroller-factor-md="0.3"] {
        transform: translateX(0) !important;
    }
    
    .my-element[data-paroller-factor-md="-0.2"] {
        transform: translateX(0) !important;
    }
    
    /* Smooth transitions for all animated elements */
    .my-element {
        transition: transform 0.3s ease-out;
    }
    
    /* Fix grid layout issues */
    .row.m-0.rtl-sec .col-sm-5,
    .row.m-0.rtl-sec .col-sm-7,
    .row.m-0 .col-sm-5,
    .row.m-0 .col-sm-7 {
        padding: 15px;
    }
    
    /* Improve mobile-first responsive behavior */
    .col-sm-5 {
        flex: 0 0 45%;
        max-width: 45%;
    }
    
    .col-sm-7 {
        flex: 0 0 55%;
        max-width: 55%;
    }
}

/* Additional fixes for specific medium screen ranges */
@media screen and (min-width: 992px) and (max-width: 1200px) {
    
    /* Fine-tune for larger medium screens */
    .container-fluid {
        max-width: 1140px;
    }
    
    .menu-1-inner .dropdown .btn {
        padding: 10px 15px;
        font-size: 15px;
    }
    
    .header-home-2 h1 {
        font-size: 6vh;
    }
}

@media screen and (min-width: 768px) and (max-width: 991px) {
    
    /* Fine-tune for smaller medium screens */
    .col-sm-5,
    .col-sm-7 {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 30px;
    }
    
    .rtl-sec .col-sm-5 {
        order: 2;
    }
    
    .rtl-sec .col-sm-7 {
        order: 1;
    }
    
    .header-home-2 h1 {
        font-size: 5vh;
    }
    
    .main_nav_outer {
        display: none;
    }
}



/* Additional fixes for header-home-2 background attachment on medium screens */
@media screen and (min-width: 768px) and (max-width: 1200px) {
    
    /* Fix background attachment issues on medium screens */
    .header-home-2 {
        background-attachment: scroll;
        background-size: cover;
        background-position: center center;
        min-height: 100vh;
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .header-home-2 .header-cont {
        max-width: 80%;
        margin-left: auto;
        margin-right: auto;
        text-align: center;
        padding: 40px 20px;
    }
    
    .header-home-2 h1,
    .header-home-2 h5 {
        text-align: center;
        margin-bottom: 20px;
    }
    
    .header-home-2 h1 {
        font-size: 48px;
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    }
    
    .header-home-2 h4 {
        font-size: 18px;
        max-width: 100%;
        color: white;
        font-weight: bold;
    }
}

/* Fix for tablets in portrait mode */
@media screen and (min-width: 768px) and (max-width: 991px) {
    .header-home-2 {
        padding-left: 15px;
        height: auto;
        min-height: 80vh;
    }
    
    .header-home-2 .header-cont {
        max-width: 90%;
        padding: 60px 15px;
    }
    
    .header-home-2 h1 {
        font-size: 42px;
    }
    
    .header-home-2 h4 {
        font-size: 16px;
    }
}

