/* =========================================================
   HELP CENTER
   Page-scoped styles for /kien-thuc/. Shared policy styles are
   intentionally overridden here to keep this documentation page
   readable without leaking presentation rules into the template.
   ========================================================= */

html,
body {
    overflow-x: clip !important;
}

html {
    scroll-padding-top: 104px;
    scroll-behavior: smooth;
}

.help-center-page {
    width: 100%;
    max-width: 1280px;
    min-height: 100vh;
    margin: 0 auto;
    padding: 112px 32px 96px;
}

.help-center-page .dispositio {
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    gap: clamp(36px, 5vw, 72px);
    width: 100%;
    max-width: none;
    align-items: start;
}

/* Sidebar / table of contents */
.help-center-page .margo {
    position: sticky;
    top: 92px;
    width: 100%;
    max-height: calc(100vh - 116px);
    padding: 20px 16px;
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.38);
    box-shadow: 0 18px 48px rgba(2, 6, 23, 0.16);
    backdrop-filter: blur(12px);
}

.help-center-page .margo::-webkit-scrollbar {
    width: 4px;
}

.help-center-page .margo::-webkit-scrollbar-track {
    background: transparent;
}

.help-center-page .margo::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.45);
}

.help-center-page .margo > .index {
    margin: 0 10px 12px;
    color: var(--J-gray-4, #94a3b8);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.help-center-page .nav-menu {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.help-center-page .nexus {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0;
    padding: 9px 10px;
    border-radius: 9px;
    color: #cbd5e1;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    text-decoration: none;
    transition: color 160ms ease, background-color 160ms ease;
}

.help-center-page .nexus:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.055);
}

.help-center-page .category-toggle.is-active {
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.09);
}

.help-center-page .chevron {
    display: inline-flex;
    flex: 0 0 14px;
    width: 14px;
    height: 14px;
    margin: 0;
    float: none;
    color: #64748b;
    transition: transform 180ms ease, color 180ms ease;
}

.help-center-page .category-toggle.is-active .chevron {
    color: #f59e0b;
}

.help-center-page .chevron.is-open {
    transform: rotate(90deg);
}

.help-center-page .nav-sections-group {
    display: none;
    flex-direction: column;
    gap: 2px;
    margin: 2px 0 8px 15px;
    padding-left: 10px;
    border-left: 1px solid rgba(148, 163, 184, 0.18);
}

.help-center-page .nav-sections-group.is-open {
    display: flex;
}

.help-center-page .nav-article {
    margin: 0;
    padding: 7px 9px;
    color: #94a3b8;
    font-size: 13px;
    font-weight: 500;
    opacity: 1;
}

.help-center-page .nav-article.is-active {
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.07);
}

/* Main documentation column */
.help-center-page .materies-container,
.help-center-page .materies {
    min-width: 0;
    width: 100%;
}

.help-center-page .materies {
    max-width: 860px;
}

.help-center-page .materies > h1.index {
    max-width: 760px;
    margin: 0 0 52px;
    color: #f8fafc;
    font-family: "Source Serif 4", Georgia, serif;
    font-size: clamp(42px, 5vw, 58px);
    font-weight: 700;
    line-height: 1.04;
    letter-spacing: -0.035em;
    text-transform: none;
}

.help-center-page .materies > h1.index::after {
    content: "";
    display: block;
    width: 64px;
    height: 3px;
    margin-top: 24px;
    border-radius: 999px;
    background: var(--J-accent, #f59e0b);
}

.help-center-page .fasciculus {
    margin: 0 0 68px;
}

.help-center-page .inscriptio {
    margin: 0 0 10px;
    padding: 0 0 14px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    color: #fbbf24;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 12px;
    font-weight: 750;
    line-height: 1.4;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.help-center-page .help-articles {
    margin: 0;
    padding: 0;
    border-left: 0;
}

.help-center-page .versus {
    display: block;
    padding: 0;
}

.help-center-page .help-article {
    counter-reset: help-step;
    padding: 30px 0 34px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.help-center-page .help-article:last-child {
    border-bottom: 0;
}

.help-center-page .titulus {
    display: block;
    margin: 0 0 18px;
    color: #f8fafc;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: clamp(22px, 2.6vw, 28px);
    font-weight: 700;
    line-height: 1.28;
    letter-spacing: -0.018em;
}

.help-center-page .sententia {
    margin: 0;
    color: #cbd5e1;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16.5px;
    line-height: 1.75;
}

.help-center-page .sententia p {
    margin: 0 0 18px;
    line-height: inherit;
    text-align: left;
}

.help-center-page .sententia p:last-child {
    margin-bottom: 0;
}

.help-center-page .sententia strong {
    color: #f8fafc;
    font-weight: 650;
}

.help-center-page .sententia a {
    color: #fbbf24;
    text-underline-offset: 3px;
}

.help-center-page .sententia a:hover {
    color: #fde68a;
}

/* Restore native, readable list formatting on this page. The shared policy
   stylesheet uses legal-document counters that do not suit help articles. */
.help-center-page .sententia ol,
.help-center-page .sententia ul {
    display: block;
    margin: 16px 0 22px;
    padding-left: 26px;
    list-style-position: outside !important;
    counter-reset: none;
}

.help-center-page .sententia ol {
    list-style-type: decimal !important;
}

.help-center-page .sententia ul {
    list-style-type: disc !important;
}

.help-center-page .sententia ol li,
.help-center-page .sententia ul li {
    display: list-item;
    position: static;
    margin: 0 0 9px;
    padding: 0 0 0 4px;
    line-height: 1.65;
    text-align: left;
}

.help-center-page .sententia ol li::before,
.help-center-page .sententia ul li::before {
    content: none !important;
}

/* Markdown can split consecutive tutorial steps into separate <ol> blocks
   when explanatory paragraphs sit between them. Keep one counter per article
   so those blocks continue as 1, 2, 3... instead of restarting at 1. */
.help-center-page .sententia > ol {
    padding-left: 0;
    list-style: none !important;
}

.help-center-page .sententia > ol > li {
    position: relative;
    padding-left: 24px;
    counter-increment: help-step;
}

.help-center-page .sententia > ol > li::before {
    content: counter(help-step) "." !important;
    position: absolute;
    top: 0;
    left: 0;
    color: #f59e0b;
    font-weight: 700;
}

.help-center-page .sententia li::marker {
    color: #f59e0b;
    font-weight: 700;
}

.help-center-page .sententia li > p {
    display: inline;
    margin: 0;
}

.help-center-page .sententia ol ol,
.help-center-page .sententia ul ul,
.help-center-page .sententia ol ul,
.help-center-page .sententia ul ol {
    margin: 8px 0 6px;
    padding-left: 24px;
}

.help-center-page .sententia blockquote {
    margin: 24px 0;
    padding: 16px 20px;
    border-left: 3px solid #f59e0b;
    border-radius: 0 10px 10px 0;
    color: #e2e8f0;
    background: rgba(245, 158, 11, 0.07);
}

.help-center-page .sententia code {
    padding: 0.15em 0.42em;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 5px;
    color: #fde68a;
    background: rgba(15, 23, 42, 0.7);
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 0.88em;
    overflow-wrap: anywhere;
}

.help-center-page .sententia pre {
    max-width: 100%;
    margin: 20px 0 24px;
    padding: 18px 20px;
    overflow-x: auto;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.78);
    box-shadow: inset 3px 0 0 rgba(245, 158, 11, 0.65);
    white-space: pre-wrap;
}

.help-center-page .sententia pre code {
    padding: 0;
    border: 0;
    color: #e2e8f0;
    background: transparent;
    font-size: 13.5px;
    line-height: 1.7;
    white-space: inherit;
}

.help-center-page .sententia hr {
    margin: 30px 0;
    border: 0;
    border-top: 1px solid rgba(148, 163, 184, 0.16);
}

.help-center-page .sententia img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    margin: 24px auto;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    box-shadow: 0 16px 36px rgba(2, 6, 23, 0.28);
    cursor: zoom-in;
}

.help-center-page .sententia table {
    width: 100%;
    margin: 22px 0;
    border-collapse: collapse;
    font-size: 15px;
}

.help-center-page .sententia th,
.help-center-page .sententia td {
    padding: 11px 12px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    text-align: left;
    vertical-align: top;
}

.help-center-page .sententia th {
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.04);
}

/* Image lightbox */
.custom-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    visibility: hidden;
    opacity: 0;
    background: rgba(2, 6, 23, 0.9);
    backdrop-filter: blur(10px);
    cursor: zoom-out;
    transition: opacity 220ms ease, visibility 220ms ease;
}

.custom-lightbox.active {
    visibility: visible;
    opacity: 1;
}

.custom-lightbox img {
    max-width: min(1100px, 94vw);
    max-height: 90vh;
    border-radius: 12px;
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.55);
    transform: scale(0.98);
    transition: transform 220ms ease;
}

.custom-lightbox.active img {
    transform: scale(1);
}

@media (max-width: 960px) {
    .help-center-page {
        padding-inline: 24px;
    }

    .help-center-page .dispositio {
        grid-template-columns: 220px minmax(0, 1fr);
        gap: 32px;
    }
}

@media (max-width: 760px) {
    html {
        scroll-padding-top: 88px;
    }

    .help-center-page {
        padding: 92px 18px 68px;
    }

    .help-center-page .dispositio {
        display: flex;
        flex-direction: column;
        gap: 42px;
    }

    .help-center-page .margo {
        position: static;
        max-height: none;
        padding: 16px 14px;
        overflow: visible;
    }

    .help-center-page .materies > h1.index {
        margin-bottom: 42px;
        font-size: clamp(36px, 11vw, 48px);
    }

    .help-center-page .fasciculus {
        margin-bottom: 54px;
    }

    .help-center-page .help-article {
        padding: 26px 0 30px;
    }

    .help-center-page .sententia {
        font-size: 16px;
        line-height: 1.7;
    }

    .help-center-page .sententia ol,
    .help-center-page .sententia ul {
        margin-left: 0;
        padding-left: 22px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .help-center-page *,
    .custom-lightbox,
    .custom-lightbox img {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
