/* =========================================================
   SOF FORUM - MOBILE RESPONSIVE CSS
   Targeted specifically for questionDetails.jsp
   ========================================================= */


/* =========================================================
   1. GLOBAL BOX SIZING
   ========================================================= */

html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}


/* Prevent Bootstrap rows from creating horizontal overflow */

#page-wrapper .row {
    margin-left: 0;
    margin-right: 0;
}


/* Images/media must never exceed their parent */

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


/* =========================================================
   2. MAIN PAGE CONTAINER
   ========================================================= */

#page-wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 15px;
    padding-right: 15px;
}


/* =========================================================
   3. CONTENT WRAPPER
   ========================================================= */

#content-wrapper {
    width: 100%;
    max-width: 100%;
    margin-left: 0 !important;
    padding-left: 0;
    padding-right: 0;
}


/* =========================================================
   4. FORUM HEADER
   User Forum + Ask Your Question
   ========================================================= */

#page-wrapper > .row > #content-wrapper > .row > .col-lg-12 {
    width: 100%;
}


/* User Forum row */

#page-wrapper .container {
    width: 100%;
    max-width: 100%;
}


/* User Forum heading */

#page-wrapper .container h1 {
    margin-top: 10px;
    margin-bottom: 15px;
    font-size: 28px;
    line-height: 1.25;
}


/* Ask Question button */

#page-wrapper .btn-lg.btn-success {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 18px;
    white-space: normal;
    text-align: center;
}


/* =========================================================
   5. BREADCRUMB
   ========================================================= */

.breadcrumb {
    margin-bottom: 15px;
    padding-left: 0;
    padding-right: 0;
    background: transparent;
    white-space: normal;
}

.breadcrumb li {
    white-space: normal;
}


/* =========================================================
   6. USER PROFILE / MAIN FORUM WIDTH
   ========================================================= */

#user-profile {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
}


/*
   Your actual content is inside col-lg-10.
   On mobile it should become full width.
*/

#user-profile > .col-lg-10 {
    width: 100%;
    padding-left: 0;
    padding-right: 0;
}


/* Remove unused desktop side spacing */

#user-profile > .col-lg-10 > .row {
    margin-left: 0;
    margin-right: 0;
}


/* =========================================================
   7. MAIN BOX
   ========================================================= */

#user-profile .main-box {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}


/* =========================================================
   8. SEARCH AREA
   ========================================================= */

#searchNCO {
    position: relative;
    width: 300px;
    max-width: 100%;
}

#searchNCO .form-control {
    width: 100%;
    height: 42px;
    padding-right: 40px;
    border-radius: 6px;
}

#searchNCO .search-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
}


/* =========================================================
   9. STORY
   ========================================================= */

.story {
    width: 100%;
    max-width: 100%;
    overflow: visible;
}


/* =========================================================
   10. USER AVATAR + CONTENT
   ========================================================= */

.story-user {
    float: left;
    width: 55px;
    margin-right: 15px;
}

.story-user img {
    width: 45px;
    height: 45px;
    max-width: 45px;
    border-radius: 50%;
}


/*
   Important:
   Prevent story content from becoming wider than viewport.
*/

.story-content {
    width: auto;
    max-width: calc(100% - 70px);
    overflow-wrap: anywhere;
    word-break: normal;
}


/* =========================================================
   11. STORY HEADER
   ========================================================= */

.story-header {
    width: 100%;
    max-width: 100%;
    overflow-wrap: anywhere;
}


/* Author/school/city */

.story-author {
    max-width: 100%;
    line-height: 1.5;
    overflow-wrap: anywhere;
    word-break: break-word;
}


/* Subject/Class */

.story-header .small {
    max-width: 100%;
    line-height: 1.6;
    overflow-wrap: anywhere;
}


/* Date/time */

.story-time {
    max-width: 100%;
    white-space: normal;
}


/* =========================================================
   12. QUESTION CONTENT
   #forum_ans
   ========================================================= */

#forum_ans {
    width: 100%;
    max-width: 100%;
    padding: 15px 0;

    color: #222;

    font-size: 18px;
    line-height: 1.65;

    overflow-wrap: anywhere;
    word-break: normal;
}


/*
   IMPORTANT:
   Your current code has:

   p img {
       width: fit-content;
   }

   This can cause mobile overflow.

   Override it here.
*/

#forum_ans img,
#forum_ans p img {
    width: auto !important;
    max-width: 100% !important;
    height: auto !important;
    display: block;
    margin-left: 0;
    margin-right: 0;
}


/* Images inside links */

#forum_ans a img {
    max-width: 100% !important;
    height: auto !important;
}


/* Tables inside questions */

#forum_ans table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
}


/* Long preformatted content */

#forum_ans pre {
    max-width: 100%;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
}


/* Iframes */

#forum_ans iframe {
    width: 100% !important;
    max-width: 100% !important;
}


/* Videos */

#forum_ans video {
    width: 100% !important;
    height: auto !important;
}


/* =========================================================
   13. QUESTION TEXT ELEMENTS
   ========================================================= */

#forum_ans p,
#forum_ans div,
#forum_ans span,
#forum_ans li {
    max-width: 100%;
    overflow-wrap: anywhere;
}


/* Don't force every paragraph to become tiny */

.story-inner-content-forum p {
    line-height: 1.65;
}


/* =========================================================
   14. ANSWERS PANEL
   ========================================================= */

#accordion {
    width: 100%;
    max-width: 100%;
}

#accordion .panel {
    width: 100%;
    max-width: 100%;
}

#accordion .panel-heading {
    width: 100%;
    max-width: 100%;
}

#accordion .panel-title {
    max-width: 100%;
}


/* View all answers */

#accordion .panel-title a {
    display: inline-block;
    max-width: 100%;
    line-height: 1.5;
    white-space: normal;
}


/* Answer panel body */

#accordion .panel-body {
    width: 100%;
    max-width: 100%;
    padding-left: 0;
    padding-right: 0;
}


/* =========================================================
   15. ANSWER STORY
   ========================================================= */

#accordion .story {
    width: 100%;
    max-width: 100%;
}


/* Answer heading */

.storyheading,
.storyheadingM {
    width: 100%;
    max-width: 100%;
    margin-top: 15px;

    font-size: 22px;
    line-height: 1.4;

    overflow-wrap: anywhere;
}


/* Edit Post button */

.storyheading .pull-right,
.storyheadingM .pull-right {
    float: right;
}


/* =========================================================
   16. ANSWER CONTENT
   ========================================================= */

.story-inner-content-forum {
    width: 100%;
    max-width: 100%;

    font-size: 18px;
    line-height: 1.65;

    overflow-wrap: anywhere;
    word-break: normal;
}


/* Images inside answers */

.story-inner-content-forum img {
    width: auto !important;
    max-width: 100% !important;
    height: auto !important;
}


/* Tables inside answers */

.story-inner-content-forum table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
}


/* Pre/code */

.story-inner-content-forum pre {
    max-width: 100%;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
}


/* =========================================================
   17. LIKE / DISLIKE
   ========================================================= */

.story-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;

    margin-top: 10px;
}

.story-footer a {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    white-space: normal;
}


/* =========================================================
   18. EDIT POST MODAL
   ========================================================= */

.modal-dialog {
    width: 600px;
    max-width: calc(100% - 30px);
    margin: 30px auto;
}

.modal-content {
    max-width: 100%;
    overflow: hidden;
}

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

#editAnsPostMessage {
    width: 100%;
    max-width: 100%;
    min-height: 180px;
    resize: vertical;
}


/* =========================================================
   19. POST YOUR ANSWER
   ========================================================= */

#threadDetailsNco,
[id^="threadDetails"] {
    width: 100%;
    max-width: 100%;
}


.main-box-body {
    width: 100%;
    max-width: 100%;
}


/* Answer textarea */

textarea#ansPostMessage {
    display: block;
    width: 100% !important;
    max-width: 100% !important;

    min-height: 180px;

    resize: vertical;

    overflow-y: auto;
}


/* =========================================================
   20. CAPTCHA
   ========================================================= */

.g-recaptcha {
    max-width: 100%;
}


/* Prevent captcha wrapper from creating horizontal overflow */

.g-recaptcha > div {
    max-width: 100%;
}


/* =========================================================
   21. FORM ELEMENTS
   ========================================================= */

.form-control,
input,
textarea,
select {
    max-width: 100%;
}


/* =========================================================
   22. SUBMIT BUTTON
   ========================================================= */

input[type="submit"].btn-primary {
    min-height: 44px;
    padding: 10px 25px;
    border-radius: 6px;
}


/* =========================================================
   23. MOBILE - 767px
   ========================================================= */

@media (max-width: 767px) {


    /* -----------------------------------------
       PAGE
       ----------------------------------------- */

    #page-wrapper {
        width: 100%;
        padding-left: 10px;
        padding-right: 10px;
    }


    /* -----------------------------------------
       BREADCRUMB
       ----------------------------------------- */

    .breadcrumb {
        font-size: 13px;
        margin-bottom: 10px;
    }


    /* -----------------------------------------
       HEADER
       ----------------------------------------- */

    #page-wrapper .container {
        padding-left: 0;
        padding-right: 0;
    }


    #page-wrapper .container .row {
        display: flex;
        flex-direction: column;
    }


    #page-wrapper .container .col-lg-2,
    #page-wrapper .container .col-lg-10 {
        width: 100%;
        padding-left: 0;
        padding-right: 0;
    }


    #page-wrapper .container h1 {
        font-size: 25px;
        margin: 5px 0 12px;
    }


    #page-wrapper .container .pull-right {
        float: none !important;
        width: 100%;
    }


    #page-wrapper .container .btn-lg.btn-success {
        width: 100%;
        display: flex;
    }


    /* -----------------------------------------
       USER PROFILE
       ----------------------------------------- */

    #user-profile {
        width: 100%;
    }


    #user-profile > .col-lg-10 {
        width: 100%;
    }


    /* -----------------------------------------
       MAIN BOX
       ----------------------------------------- */

    #user-profile .main-box {
        border-radius: 6px;
    }


    /* -----------------------------------------
       SEARCH
       ----------------------------------------- */

    .filter-block {
        width: 100%;
        padding: 0 !important;
    }


    .filter-block .form-group {
        width: 100%;
        float: none !important;
        margin-bottom: 15px;
    }


    #searchNCO {
        width: 100%;
    }


    #searchNCO .form-control {
        width: 100%;
        height: 44px;
        font-size: 15px;
    }


    /* -----------------------------------------
       STORY
       ----------------------------------------- */

    .story {
        padding-top: 10px !important;
    }


    .story-user {
        float: none;
        width: 100%;
        margin: 0 0 10px;
    }


    .story-user img {
        width: 42px;
        height: 42px;
        max-width: 42px;
    }


    .story-content {
        width: 100%;
        max-width: 100%;
    }


    /* -----------------------------------------
       STORY HEADER
       ----------------------------------------- */

    .story-header {
        display: block;
    }


    .story-author {
        font-size: 14px;
        line-height: 1.6;
    }


    .story-header .small {
        margin-top: 5px;
        font-size: 13px;
        line-height: 1.5;
    }


    .story-time {
        margin-top: 6px;
        font-size: 12px;
    }


    /* -----------------------------------------
       QUESTION
       ----------------------------------------- */

    #forum_ans {
        padding: 12px 0;

        font-size: 15px;

        line-height: 1.65;
    }


    #forum_ans p {
        font-size: inherit !important;
        line-height: 1.65;
        margin-bottom: 10px;
    }


    /* -----------------------------------------
       QUESTION IMAGES
       ----------------------------------------- */

    #forum_ans img,
    #forum_ans p img {
        width: auto !important;
        max-width: 100% !important;
        height: auto !important;

        display: block;

        margin: 8px auto;
    }


    /* -----------------------------------------
       ANSWERS
       ----------------------------------------- */

    .storyheading,
    .storyheadingM {
        font-size: 18px;
        line-height: 1.45;
        padding-right: 0;
    }


    .story-inner-content-forum {
        font-size: 15px;
        line-height: 1.65;
    }


    .story-inner-content-forum p {
        font-size: 15px !important;
        line-height: 1.65;
    }


    /* Answer images */

    .story-inner-content-forum img {
        width: auto !important;
        max-width: 100% !important;
        height: auto !important;
        display: block;
        margin: 8px auto;
    }


    /* -----------------------------------------
       EDIT POST
       ----------------------------------------- */

    .storyheading .label,
    .storyheadingM .label {
        float: none !important;

        display: inline-flex;

        margin-top: 8px !important;

        min-height: 36px;

        align-items: center;
    }


    /* -----------------------------------------
       LIKES
       ----------------------------------------- */

    .story-footer {
        gap: 8px 15px;
    }


    .story-footer a {
        font-size: 13px;
        min-height: 40px;
    }


    /* -----------------------------------------
       SUBMIT YOUR ANSWER
       ----------------------------------------- */

    #accordion .panel-heading {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }


    #accordion .panel-title small {
        font-size: 14px;
        line-height: 1.5;
    }


    /* -----------------------------------------
       ANSWER FORM
       ----------------------------------------- */

    .main-box-header h2 {
        font-size: 21px;
        margin-top: 10px;
    }


    textarea#ansPostMessage {
        width: 100% !important;
        min-height: 150px;
        font-size: 15px;
    }


    /* -----------------------------------------
       CAPTCHA
       ----------------------------------------- */

    .g-recaptcha {
        transform: scale(.85) !important;
        -webkit-transform: scale(.85) !important;

        transform-origin: left top !important;
        -webkit-transform-origin: left top !important;

        margin-bottom: 5px;
    }


    /* -----------------------------------------
       SUBMIT
       ----------------------------------------- */

    input[type="submit"].btn-primary {
        width: 100%;
        min-height: 46px;
        font-size: 16px;
    }


    /* -----------------------------------------
       MODAL
       ----------------------------------------- */

    .modal-dialog {
        width: auto;
        max-width: calc(100% - 20px);
        margin: 10px auto;
    }


    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 15px;
    }


    #editAnsPostMessage {
        min-height: 150px;
        font-size: 15px;
    }

}


/* =========================================================
   24. VERY SMALL MOBILE - 375px
   ========================================================= */

@media (max-width: 375px) {


    #page-wrapper {
        padding-left: 8px;
        padding-right: 8px;
    }


    #page-wrapper .container h1 {
        font-size: 22px;
    }


    #forum_ans {
        font-size: 14px;
    }


    .story-author {
        font-size: 13px;
    }


    .story-header .small {
        font-size: 12px;
    }


    .story-inner-content-forum {
        font-size: 14px;
    }


    .storyheading,
    .storyheadingM {
        font-size: 17px;
    }


    textarea#ansPostMessage {
        min-height: 130px;
    }


    .g-recaptcha {
        transform: scale(.75) !important;
        -webkit-transform: scale(.75) !important;
    }

}