/* Layout for Water Resource Tutorial
   Provides a sticky sidebar (fixed pane) and scrollable content area.
*/

html,
body {
    height: 100%;
    margin: 0;
    overflow: hidden !important;
    /* Prevent global scroll */
}

body {
    display: flex;
    flex-direction: column;
    padding-top: 80px;
    /* Offset for fixed navbar */
}

.tutorial-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Ensure the row takes full remaining height */
.tutorial-container>.row {
    flex: 1;
    height: 100%;
    margin: 0;
}

/* Sidebar Column - Scrollable independently */
.tutorial-container .col-lg-3 {
    height: 100%;
    overflow-y: auto;
    border-right: 1px solid #eee;
    padding: 2rem 15px 2rem 0;
}

/* Sidebar Content - Reset sticky behavior */
.tutorial-sidebar {
    position: static !important;
    height: auto !important;
    width: 100%;
}

/* Content Column - Scrollable independently */
.tutorial-container .col-lg-9 {
    height: 100%;
    overflow-y: auto;
    padding: 2rem 0 2rem 2rem;
    overflow-x: auto;
}

/* Ensure content doesn't break alignment */
.tutorial-content {
    width: 100%;
    max-width: 100%;
}

/* Images and Pre blocks should stay within bounds */
.tutorial-content img,
.tutorial-content pre {
    max-width: 100%;
    height: auto;
}

/* Footer outside scrollable area */
.footer {
    flex-shrink: 0;
    width: 100%;
}

/* Mobile Responsiveness */
@media (max-width: 991px) {

    html,
    body {
        height: auto;
        overflow-y: auto !important;
        overflow-x: hidden;
    }

    .tutorial-container {
        height: auto;
        overflow: visible;
        display: block;
    }

    .tutorial-container>.row {
        height: auto;
        display: block;
        margin-right: -15px;
        margin-left: -15px;
    }

    .tutorial-container .col-lg-3,
    .tutorial-container .col-lg-9 {
        height: auto;
        overflow: visible;
        padding: 1rem;
        border: none;
    }

    .tutorial-sidebar {
        border-bottom: 1px solid #eee;
        margin-bottom: 2rem;
        padding-bottom: 1rem;
    }

    .tutorial-container .col-lg-9 {
        padding-left: 15px;
    }
}