/* ==========================================================
   CommunityHub Documentation
   Navy / corporate blue visual system
   Material for MkDocs behavior is preserved.
   ========================================================== */

:root {
    --ch-navy-950: #102b50;
    --ch-navy-900: #15365f;
    --ch-navy-800: #1d4778;
    --ch-blue-700: #2866ad;
    --ch-blue-600: #347bc4;
    --ch-blue-100: #eaf2fb;
    --ch-blue-050: #f5f8fc;
    --ch-text: #26364a;
    --ch-muted: #66768a;
    --ch-border: #d9e2ec;
    --ch-surface: #f5f7fa;
    --ch-content-width: 1500px;
}

[data-md-color-scheme="default"] {
    --md-primary-fg-color: var(--ch-navy-900);
    --md-primary-fg-color--dark: var(--ch-navy-950);
    --md-primary-fg-color--light: var(--ch-navy-800);
    --md-accent-fg-color: var(--ch-blue-600);
    --md-typeset-a-color: var(--ch-blue-700);
    --md-default-fg-color: var(--ch-text);
    --md-default-fg-color--light: #52647a;
    --md-default-fg-color--lighter: #8492a3;
    --md-default-fg-color--lightest: var(--ch-border);
    --md-default-bg-color: #ffffff;
    --md-code-bg-color: #f3f6fa;
    --md-footer-bg-color: var(--ch-navy-950);
    --md-footer-fg-color: #f5f8fc;
}

/* Overall layout */
.md-grid {
    max-width: var(--ch-content-width);
}

.md-main__inner {
    margin-top: 1.35rem;
}

.md-content {
    max-width: none;
    min-width: 0;
}

.md-content__inner {
    margin: 0 1.15rem 2.25rem;
}

.md-sidebar {
    padding-top: 0.65rem;
}

@media screen and (min-width: 76.25em) {
    .md-sidebar--primary {
        width: 13.5rem;
    }

    .md-sidebar--secondary {
        width: 12.25rem;
    }

    .md-main__inner {
        grid-template-columns: 13.5rem minmax(0, 1fr) 12.25rem;
    }
}

/* Header and search */
.md-header {
    background: var(--ch-navy-900);
    box-shadow: 0 2px 5px rgba(16, 43, 80, 0.16);
}

.md-tabs {
    background: var(--ch-navy-950);
}

.md-search__form {
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 0.25rem;
}

.md-search__input {
    color: #ffffff;
    caret-color: #ffffff;
}

.md-search__input::placeholder {
    color: rgba(255, 255, 255, 0.78);
}

/* Expanded search panel uses a light background */
[data-md-toggle="search"]:checked ~ .md-header .md-search__input {
    color: var(--md-default-fg-color);
    caret-color: var(--md-default-fg-color);
}

/* Left navigation and right table of contents */
.md-nav {
    font-size: 0.76rem;
}

.md-nav__title {
    color: var(--ch-navy-900);
    font-weight: 700;
}

.md-nav__link {
    border-radius: 0.18rem;
    font-size: 0.76rem;
    transition: background-color 120ms ease, color 120ms ease;
}

.md-nav__link:hover,
.md-nav__link:focus {
    color: var(--ch-blue-700);
    background: var(--ch-blue-050);
}

.md-nav__link--active {
    color: var(--ch-navy-900) !important;
    font-weight: 700;
}

.md-nav--primary .md-nav__link--active {
    background: var(--ch-blue-100);
    border-left: 2px solid var(--ch-blue-700);
    padding-left: 0.55rem;
}

.md-nav--secondary .md-nav__link--active {
    border-left: 2px solid var(--ch-blue-700);
    padding-left: 0.55rem;
}

/* Main content typography */
.md-typeset {
    color: var(--ch-text);
    font-size: 0.82rem;
    line-height: 1.75;
}

.md-typeset h1 {
    margin: 0 0 1.35rem;
    color: var(--ch-navy-950);
    font-size: 1.9rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.3;
}

.md-typeset h2 {
    margin: 2.3rem 0 0.9rem;
    padding-bottom: 0.45rem;
    border-bottom: 1px solid var(--ch-border);
    color: var(--ch-navy-900);
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.4;
}

.md-typeset h3 {
    margin: 1.8rem 0 0.65rem;
    color: var(--ch-navy-800);
    font-size: 1.08rem;
    font-weight: 700;
}

.md-typeset h4 {
    color: #355575;
    font-size: 0.92rem;
    font-weight: 700;
}

.md-typeset p,
.md-typeset ul,
.md-typeset ol {
    margin-bottom: 0.95rem;
}

.md-typeset a {
    color: var(--ch-blue-700);
    text-decoration: none;
}

.md-typeset a:hover {
    color: var(--ch-navy-900);
    text-decoration: underline;
}

.md-typeset hr {
    border-bottom-color: var(--ch-border);
}

/* Tables */
.md-typeset table:not([class]) {
    display: table;
    width: 100%;
    border: 1px solid var(--ch-border);
    border-collapse: collapse;
    font-size: 0.78rem;
}

.md-typeset table:not([class]) th {
    background: #eaf1f8;
    color: var(--ch-navy-900);
    font-weight: 700;
    text-align: left;
}

.md-typeset table:not([class]) th,
.md-typeset table:not([class]) td {
    padding: 0.68rem 0.82rem;
    border: 1px solid var(--ch-border);
    vertical-align: top;
}

.md-typeset table:not([class]) tbody tr:nth-child(even) td {
    background: #f8fafd;
}

/* Code */
.md-typeset code {
    border-radius: 0.2rem;
    font-size: 0.84em;
}

.md-typeset pre {
    border: 1px solid #dce5ef;
    border-radius: 0.25rem;
}

.md-typeset pre > code {
    font-size: 0.78rem;
    line-height: 1.65;
}

/* Admonitions and quotations */
.md-typeset .admonition,
.md-typeset details {
    border-radius: 0.22rem;
    box-shadow: none;
}

.md-typeset .admonition-title,
.md-typeset summary {
    color: var(--ch-navy-900);
}

.md-typeset blockquote {
    border-left-color: var(--ch-blue-600);
    color: var(--ch-muted);
}

/* Footer */
.md-footer,
.md-footer-meta {
    background: var(--ch-navy-950);
}

.communityhub-footer {
    width: 100%;
    min-width: 0;
    padding: 1.1rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.communityhub-footer__title {
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 700;
}

.communityhub-footer__links {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
}

.communityhub-footer__links a {
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.76rem;
    text-decoration: none;
}

.communityhub-footer__links a:hover {
    color: #ffffff;
    text-decoration: underline;
}

.communityhub-footer__copyright {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.72rem;
    white-space: nowrap;
}

/* Wide table utilities */
.doc-table-scroll {
    width: 100%;
    height: 16px;
    overflow-x: auto;
    overflow-y: hidden;
}

.doc-table-scroll::after {
    content: "";
    display: block;
    width: 1800px;
    height: 1px;
}

.doc-table-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.5rem;
}

.doc-table-view-full {
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--ch-navy-900);
    border-radius: 0.2rem;
    background: var(--ch-navy-900);
    color: #ffffff;
    font-size: 0.76rem;
    cursor: pointer;
}

.doc-table-view-full:hover {
    background: var(--ch-navy-950);
}

.doc-table-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: rgba(10, 25, 44, 0.58);
}

.doc-table-modal__dialog {
    width: 95vw;
    max-width: 1600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    box-shadow: 0 0.5rem 2rem rgba(16, 43, 80, 0.28);
}

.doc-table-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--ch-navy-900);
    color: #ffffff;
}

.doc-table-modal__title {
    font-size: 0.95rem;
    font-weight: 700;
}

.doc-table-modal__close {
    border: 0;
    background: transparent;
    color: #ffffff;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.doc-table-modal__body {
    overflow: auto;
    padding: 1rem;
}

.doc-table-modal__body table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
}

.doc-table-modal__body th,
.doc-table-modal__body td {
    padding: 0.4rem 0.6rem;
    border-bottom: 1px solid var(--ch-border);
    white-space: nowrap;
}

.doc-table-modal__body thead th {
    border-bottom: 2px solid #9fb4ca;
    color: var(--ch-navy-900);
}

body.doc-table-modal-open {
    overflow: hidden;
}

@media screen and (max-width: 76.24em) {
    .md-content__inner {
        margin-right: 0.8rem;
        margin-left: 0.8rem;
    }
}

@media screen and (max-width: 700px) {
    .communityhub-footer {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.75rem;
    }

    .communityhub-footer__copyright {
        white-space: normal;
    }

    .md-typeset h1 {
        font-size: 1.6rem;
    }
}
