/* Shared responsive improvements for mobile and tablet screens */

/* Prevent horizontal overflow */
html {
    max-width: 100%;
    overflow-x: clip;
}

body {
    width: 100%;
    max-width: 100%;
}

/* Responsive images */
img {
    max-width: 100%;
    height: auto;
}

/* Make common content containers fit the viewport */
.container,
.container-fluid,
.page-container {
    max-width: 100%;
}

/* Service page layout */
.page-container {
    box-sizing: border-box;
}

/* Tablet screens */
@media (max-width: 991.98px) {
    .page-container {
        width: 95%;
        gap: 20px;
    }

    .sidebar {
        flex: 0 0 200px;
    }

    .main-content {
        min-width: 0;
        overflow-wrap: anywhere;
    }
}

/* Mobile screens */
@media (max-width: 767.98px) {
    .page-container {
        display: flex;
        flex-direction: column;
        width: 100%;
        margin: 15px auto 30px;
        padding: 0 15px;
        gap: 20px;
    }

    .sidebar {
        position: static;
        width: 100%;
        max-width: 100%;
        flex: 0 0 auto;
        box-sizing: border-box;
    }

    .main-content {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    .main-content img,
    .sidebar img {
        max-width: 100%;
        height: auto;
    }

    h1 {
        font-size: clamp(1.6rem, 6vw, 2.2rem);
        overflow-wrap: anywhere;
    }

    h2 {
        font-size: clamp(1.3rem, 5vw, 1.8rem);
    }

    p,
    li {
        overflow-wrap: anywhere;
    }

    input,
    select,
    textarea {
        max-width: 100%;
        box-sizing: border-box;
    }

    iframe,
    video {
        max-width: 100%;
    }
}
