/* =====================================================
REMOVE THEME WIDTH LIMITS
===================================================== */

.single-doc_page article,
.single-doc_page #primary,
.single-doc_page main:not(.doc-main),
.single-doc_page .content-area {
    max-width: none !important;
    width: 100% !important;
    padding: 0 !important;
}

body.single-doc_page h1.entry-title {
    font-size: 36px !important;
}


/* =====================================================
PAGE BACKGROUND
===================================================== */

body.single-doc_page {
    background: #f6f8fb;
    margin-top: 140px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}


/* =====================================================
DOC WRAPPER
===================================================== */

.doc-wrapper {
    width: 100%;
}


/* =====================================================
MAIN FLEX LAYOUT  ⭐ CORE FIX
===================================================== */

.doc-layout {
    display: flex;
    flex-direction: row;
    align-items: flex-start;

    width: 100%;
    max-width: 1400px;
    box-sizing: border-box;
    margin: 40px auto;
    padding: 0 40px;
    gap: 40px;
}

/* =====================================================
LARGE SCREENS (e.g., iMacs, Ultrawides)
===================================================== */
@media(min-width: 1440px) {
    .doc-layout {
        max-width: 1600px;
        padding: 0 60px;
    }
}

/* =====================================================
SIDEBAR NAVIGATION
===================================================== */
.doc-sidebar {
    width: 300px;
    min-width: 300px;
    background: transparent;
    padding: 0;
    box-sizing: border-box;
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

/* scrollbar styling for sidebar */
.doc-sidebar::-webkit-scrollbar {
    width: 6px;
}

.doc-sidebar::-webkit-scrollbar-thumb {
    background-color: #dfe1e6;
    border-radius: 4px;
}

/* Sidebar Accordion Styles */
.ior-tree-level {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    text-align: left !important;
}

.doc-children .ior-tree-level {
    padding-left: 20px !important;
}

.doc-page-item {
    margin: 2px 0;
    text-align: left !important;
}

.doc-item-wrapper {
    display: flex;
    align-items: center;
    justify-content: flex-start !important;
    text-align: left !important;
    padding: 6px 10px;
    border-radius: 4px;
    transition: background 0.1s;
    position: relative;
}

.doc-item-wrapper:hover {
    background: #ebecf0;
}

.doc-item-wrapper.active {
    background: #e6effc;
}

.doc-item-wrapper.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 5px;
    bottom: 5px;
    width: 3px;
    background-color: #0c66e4;
    border-radius: 0 3px 3px 0;
}

.doc-item-wrapper.active a {
    color: #0c66e4 !important;
}

.doc-item-wrapper a {
    display: flex;
    align-items: center;
    justify-content: flex-start !important;
    text-align: left !important;
    color: #344563 !important;
    /* Confluence text color */
    text-decoration: none !important;
    font-size: 14.5px;
    font-weight: 500;
    line-height: 1.4;
    flex-grow: 1;
    border: none !important;
    box-shadow: none !important;
}

.doc-item-wrapper a:hover {
    color: #172b4d !important;
    text-decoration: none !important;
}

.doc-toggle {
    cursor: pointer;
    font-size: 16px;
    width: 20px;
    height: 20px;
    line-height: 20px;
    color: #5e6c84;
    transition: transform 0.2s;
    margin-right: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.doc-toggle:hover {
    background: rgba(9, 32, 66, 0.08);
    border-radius: 3px;
}

.doc-toggle.expanded {
    transform: rotate(90deg);
}

.doc-toggle-placeholder {
    width: 20px;
    height: 20px;
    margin-right: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #42526E;
    line-height: 1;
}

.doc-icon {
    font-size: 16px;
    line-height: 1.2;
    width: 20px;
    height: 16px;
    margin-right: 8px;
    color: #5e6c84;
}

.doc-item-wrapper.active .doc-icon {
    color: #0c66e4;
}

.doc-toc {
    width: 100%;
    box-sizing: border-box;
    background: #fafbfc;
    /* Confluence light gray */
    padding: 20px 25px;
    margin-bottom: 40px;
    border: 1px solid #dfe1e6;
    border-radius: 3px;
}

.doc-toc h3 {
    margin-top: 0;
    font-size: 18px;
    font-weight: 600;
    color: #172b4d;
    /* Confluence text color */
}

.doc-toc li {
    font-weight: 400;
    color: #172b4d;
}

.doc-toc ul {
    margin: 10px 0 0 0 !important;
    padding-left: 20px !important;
}

.doc-toc a {
    color: #0052cc;
    font-weight: 400;
    /* Confluence link color */
    text-decoration: none;
}

.doc-toc a:hover {
    text-decoration: underline;
}

/* =====================================================
CONTENT AREA
===================================================== */

.doc-main {
    flex-grow: 1;
    width: 100%;
    min-width: 0;
    max-width: 1320px;
    box-sizing: border-box;

    background: #fff;
    padding: 0 30px 40px 30px !important;

    border-radius: 0;
    box-shadow: none;
}




/* =====================================================
TYPOGRAPHY
===================================================== */

.doc-main h1,
.doc-main h2,
.doc-main h3,
.doc-main h4,
.doc-main h5,
.doc-main h6 {
    color: #172b4d;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Oxygen, Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif !important;
}

.doc-main h1 {
    font-size: 32px !important;
    margin-bottom: 20px;
}

.doc-main h2 {
    margin-top: 28px !important;
    font-size: 24px !important;
    padding-bottom: 0;
    border-bottom: none;
    margin-bottom: 14px !important;
}

.doc-main h3 {
    margin-top: 24px !important;
    font-size: 20px !important;
    margin-bottom: 12px !important;
}

.doc-main h4 {
    margin-top: 20px !important;
    font-size: 18px !important;
    margin-bottom: 10px !important;
}

.doc-main p,
.doc-main li {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Oxygen, Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif !important;
    font-size: 16px !important;
    line-height: 1.6 !important;
    color: #172b4d;
    margin-top: 10px !important;
    margin-bottom: 12px !important;
}


/* =====================================================
LIST FIX
===================================================== */

.doc-main ul {
    list-style-type: none !important;
    padding-left: 0 !important;
    margin: 15px 0;
}

.doc-main ul>li {
    position: relative;
    padding-left: 30px !important;
    margin-bottom: 10px;
}

.doc-main ul>li::before {
    content: "•";
    position: absolute;
    left: 8px;
    top: -2px;
    font-size: 24px;
    color: #0c66e4;
    line-height: 1.2;
}

.doc-main ol {
    list-style: decimal !important;
    padding-left: 25px !important;
    margin: 15px 0;
}

.doc-main ol>li {
    padding-left: 5px !important;
    margin-bottom: 10px;
}


/* =====================================================
IMAGES
===================================================== */

.doc-main img {
    width: 100%;
    max-width: 900px;
    /* Increased from 700px for larger screens, but kept reasonable */
    display: block;
    margin: 50px auto;
    /* Slightly more spacing */
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    /* Added soft shadow to make it eye-catchy */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.doc-main img:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

@media(min-width: 1600px) {
    .doc-main img {
        max-width: 1100px;
        /* Scale up slightly more on very large screens */
        margin: 60px auto;
    }
}


/* =====================================================
INLINE COMMENT HIGHLIGHT
===================================================== */

.doc-highlight {
    background: #fff1a8;
    padding: 2px 4px;
    border-radius: 4px;
    cursor: pointer;
}

.doc-highlight:hover {
    background: #ffe066;
}


/* =====================================================
COMMENT INPUT POPUP
===================================================== */

.doc-comment-popup {

    position: absolute;
    min-width: 280px;

    background: #fff;
    padding: 15px;

    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .15);
    z-index: 9999;
    display: block !important;
}

.doc-comment-popup input,
.doc-comment-popup textarea {

    width: 100%;
    padding: 8px;
    margin-bottom: 10px;

    border: 1px solid #ddd;
    border-radius: 6px;
}

.doc-comment-popup textarea {
    height: 80px;
    resize: vertical;
    min-height: 50px;
    max-height: 300px;
}


/* =====================================================
POPUP BUTTONS
===================================================== */

.doc-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.doc-actions button {
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
}

.doc-actions .save {
    background: #0c66e4;
    color: #fff;
}

.doc-actions .cancel {
    background: #eee;
}

.doc-actions .resolve {
    background: #22c55e;
    color: #fff;
}


/* =====================================================
VIEW COMMENT POPUP
===================================================== */

.doc-view-popup {

    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    background: #fff;
    padding: 25px;

    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .2);

    width: 90%;
    max-width: 420px;
    z-index: 9999;
    display: block !important;
}


/* =====================================================
FRONTEND LOGIN SECTION (MODAL)
===================================================== */

.doc-login-modal-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100vw;
    height: 100vh;
    background: rgba(9, 30, 66, 0.54);
    z-index: 9998;
    display: flex;
    justify-content: center;
    align-items: center;
}

.doc-login-section {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .2);
    width: 90%;
    max-width: 400px;
    position: relative;
    z-index: 9999;
}

.doc-login-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #5e6c84;
    padding: 0;
    line-height: 1;
}

.doc-login-close:hover {
    color: #172b4d;
}

.doc-login-section h4 {
    margin-top: 0;
    color: #172b4d;
    font-size: 20px;
    margin-bottom: 5px;
}

.doc-login-section p {
    color: #5e6c84;
    font-size: 14px;
    margin-bottom: 20px;
    margin-top: 0;
}

.doc-login-section form {
    display: flex;
    flex-direction: column;
}

.doc-login-section .login-username,
.doc-login-section .login-password {
    margin-bottom: 15px;
}

.doc-login-section label {
    display: block;
    font-weight: 500;
    color: #172b4d;
    margin-bottom: 8px;
    font-size: 14px;
}

.doc-login-section input[type="text"],
.doc-login-section input[type="password"] {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #dfe1e6;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.doc-login-section input[type="text"]:focus,
.doc-login-section input[type="password"]:focus {
    border-color: #0052cc;
    outline: none;
}

.doc-login-section .login-remember {
    margin-bottom: 20px;
    font-size: 14px;
    color: #5e6c84;
    display: flex;
    align-items: center;
}

.doc-login-section .login-remember input {
    margin-right: 8px;
}

.doc-login-section .login-submit input {
    background: #0c66e4;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: 500;
    font-size: 16px;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s;
}

.doc-login-section .login-submit input:hover {
    background: #0052cc;
}


/* =====================================================
BOTTOM COMMENTS SECTION (OVERRIDE THEME STYLES)
===================================================== */

/* Forcefully hide Elementor's duplicate default comments section */
.single-doc_page main#content>#comments,
.single-doc_page main#content>.comments-area {
    display: none !important;
}

.doc-bottom-comments {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid #dfe1e6;
}

.doc-bottom-comments #reply-title,
.doc-bottom-comments .comments-title {
    font-size: 24px;
    color: #172b4d;
    font-weight: 500;
    margin-bottom: 20px;
}

.doc-bottom-comments .comment-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 0 40px 0 !important;
}

.doc-bottom-comments .comment-body {
    background: #fafbfc;
    border: 1px solid #dfe1e6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.doc-bottom-comments .comment-meta {
    margin-bottom: 10px;
    font-size: 14px;
    color: #5e6c84;
}

.doc-bottom-comments .comment-meta b {
    color: #172b4d;
    font-size: 16px;
}

.doc-bottom-comments .comment-content p {
    font-size: 15px;
    color: #172b4d;
    margin: 0;
}

/* Comment Form Styling */
.doc-bottom-comments .comment-form {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(9, 30, 66, 0.08);
    border: 1px solid #dfe1e6;
}

.doc-bottom-comments .comment-form-comment label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #172b4d;
}

.doc-bottom-comments .comment-form textarea {
    width: 100%;
    border: 2px solid #dfe1e6;
    border-radius: 6px;
    padding: 12px;
    font-size: 15px;
    color: #172b4d;
    transition: border-color 0.2s;
    box-sizing: border-box;
    resize: vertical;
    min-height: 100px;
}

.doc-bottom-comments .comment-form textarea:focus {
    border-color: #0052cc;
    outline: none;
}

.doc-bottom-comments .form-submit .submit {
    background: #0c66e4;
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 4px;
    font-weight: 500;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 15px;
}

.doc-bottom-comments .form-submit .submit:hover {
    background: #0052cc;
}

.doc-bottom-comments .logged-in-as {
    font-size: 14px;
    color: #5e6c84;
    margin-bottom: 20px;
}

.doc-bottom-comments .logged-in-as a {
    color: #0052cc;
    text-decoration: none;
}

.doc-bottom-comments .logged-in-as a:hover {
    text-decoration: underline;
}


/* =====================================================
TABLET
===================================================== */

@media(max-width:1024px) {

    body.single-doc_page {
        margin-top: 110px;
    }

    .doc-layout {
        flex-direction: column;
        padding: 0 40px;
        gap: 20px;
    }

    .doc-sidebar {
        width: 100%;
        min-width: 0;
        position: static;
        max-height: none;
        margin-bottom: 20px;
        border-bottom: 1px solid #dfe1e6;
        padding-bottom: 20px;
    }

    .doc-toc,
    .doc-main {
        min-width: 0;
        width: 100%;
    }

    .doc-toc {
        margin-bottom: 25px;
    }

}


/* =====================================================
MOBILE
===================================================== */

@media(max-width:600px) {

    body.single-doc_page {
        margin-top: 40px;
    }

    .doc-layout {
        padding: 0 10px;
    }

    .doc-main {
        padding: 30px 20px !important;
    }

    .doc-main h1 {
        font-size: 28px;
    }

    .doc-main h2 {
        font-size: 22px;
    }

    .doc-comment-popup {
        width: 90%;
        min-width: 0;
        left: 5% !important;
    }

}


/* =====================================================
SHORTCODE GRID CARD STYLES
===================================================== */
.ior-docs-grid-container {
    width: 100%;
    margin: 40px auto;
    padding: 0 20px;
    box-sizing: border-box;
    max-width: 1280px;
    /* Aligns with main layout max-width */
}

.ior-docs-grid {
    display: grid;
    /* 3 cards per row matching screenshot */
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}

.ior-doc-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #eaeaea;
    border-radius: 4px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    height: 100%;
    box-sizing: border-box;
    cursor: pointer;
    overflow: hidden;
}

.ior-doc-card-header {
    width: 100%;
    height: 200px;
    background: #0f2142;
    /* Deep Navy Blue */
    border-bottom: 1px solid #eaeaea;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
}

/* Optional subtle background pattern or gradient for depth */
.ior-doc-card-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
}

.ior-doc-card .ior-doc-title-overlay {
    font-size: 22px !important;
    color: #ffffff !important;
    text-align: center;
    margin: 0 !important;
    font-weight: 700 !important;
    line-height: 1.4 !important;
    border-bottom: none !important;
    padding-bottom: 0 !important;
    z-index: 1;
    /* ensures it sits above the subtle gradient */
}

.ior-doc-card-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.ior-doc-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
    border-color: #d0d0d0;
    text-decoration: none !important;
}



.ior-doc-card .ior-doc-excerpt {
    font-size: 14.5px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 24px;
    flex-grow: 1;
}

/* Ensure no formatting from doc-main overrides card P inside excerpt */
.ior-doc-card .ior-doc-excerpt p {
    font-size: 14.5px !important;
    line-height: 1.6 !important;
    color: #666 !important;
    margin: 0 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 3 !important;
    line-clamp: 3 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
}

.ior-doc-card .ior-read-more {
    font-size: 14px;
    font-weight: 700;
    color: #2b4b8a;
    display: flex;
    align-items: center;
    transition: color 0.2s;
    margin-top: auto;
}

.ior-doc-card:hover .ior-read-more {
    color: #0c66e4;
    text-decoration: none !important;
}

@media(max-width: 600px) {
    .ior-docs-grid {
        grid-template-columns: 1fr;
    }
}