/* =========================================================
   CMS / INFORMATION PAGE
========================================================= */

.cms-page {
    --cms-navy: #102a43;
    --cms-blue: #2563eb;
    --cms-blue-light: #eff6ff;
    --cms-muted: #64748b;
    --cms-border: #e5edf5;
    --cms-bg: #f7fbff;
    --cms-green: #059669;
    background: var(--cms-bg);
    min-height: 100vh;
}


/* =========================================================
   READING PROGRESS
========================================================= */

.cms-reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 3000;
    width: 100%;
    height: 3px;
    background: transparent;
}

.cms-reading-progress span {
    display: block;
    width: 0;
    height: 100%;
    background: linear-gradient(
        90deg,
        #2563eb,
        #06b6d4,
        #10b981
    );
    transition: width .08s linear;
}


/* =========================================================
   HERO
========================================================= */

.cms-page-hero {
    position: relative;
    overflow: hidden;
    padding: 64px 0 52px;
    border-bottom: 1px solid var(--cms-border);
    background:
        radial-gradient(
            circle at 10% 10%,
            rgba(37,99,235,.09),
            transparent 32%
        ),
        radial-gradient(
            circle at 90% 30%,
            rgba(6,182,212,.08),
            transparent 30%
        ),
        #fff;
}

.cms-page-hero-inner {
    max-width: 920px;
    margin: 0 auto;
}

.cms-page-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 22px;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 700;
}

.cms-page-breadcrumb a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--cms-muted);
    text-decoration: none;
}

.cms-page-breadcrumb a:hover {
    color: var(--cms-blue);
}

.cms-page-eyebrow {
    margin-bottom: 9px;
    color: var(--cms-blue);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.cms-page-hero h1 {
    max-width: 820px;
    margin: 0;
    color: var(--cms-navy);
    font-size: clamp(32px, 5vw, 54px);
    font-weight: 900;
    letter-spacing: -.045em;
    line-height: 1.05;
}

.cms-page-description {
    max-width: 720px;
    margin: 18px 0 0;
    color: var(--cms-muted);
    font-size: 14px;
    line-height: 1.8;
}

.cms-page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 25px;
}

.cms-page-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 38px;
    padding: 8px 13px;
    border: 1px solid var(--cms-border);
    border-radius: 10px;
    color: #475569;
    background: #fff;
    font-size: 10px;
    font-weight: 800;
    cursor: pointer;
    transition: .2s ease;
}

.cms-page-action:hover {
    border-color: #bfdbfe;
    color: var(--cms-blue);
    background: var(--cms-blue-light);
    transform: translateY(-1px);
}


/* =========================================================
   SEARCH
========================================================= */

.cms-search-panel {
    display: none;
    border-bottom: 1px solid var(--cms-border);
    background: #fff;
}

.cms-search-panel.is-open {
    display: block;
}

.cms-search-inner {
    max-width: 920px;
    margin: 0 auto;
    padding: 14px 0;
}

.cms-search-input {
    position: relative;
}

.cms-search-input > i {
    position: absolute;
    top: 50%;
    left: 14px;
    color: #94a3b8;
    transform: translateY(-50%);
}

.cms-search-input input {
    width: 100%;
    height: 46px;
    padding: 0 44px 0 40px;
    border: 1px solid var(--cms-border);
    border-radius: 12px;
    outline: none;
    color: var(--cms-navy);
    background: #f8fafc;
    font-size: 12px;
    transition: .2s ease;
}

.cms-search-input input:focus {
    border-color: #93c5fd;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(37,99,235,.08);
}

.cms-search-input button {
    position: absolute;
    top: 50%;
    right: 9px;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: #64748b;
    background: #eaf0f6;
    transform: translateY(-50%);
    cursor: pointer;
}

.cms-search-inner > span {
    display: block;
    margin-top: 7px;
    color: #94a3b8;
    font-size: 9px;
}


/* =========================================================
   MAIN LAYOUT
========================================================= */

.cms-page-main {
    padding: 45px 0 80px;
}

.cms-page-layout {
    display: grid;
    grid-template-columns: 235px minmax(0, 1fr);
    gap: 28px;
    align-items: start;
}


/* =========================================================
   TOC
========================================================= */

.cms-page-sidebar {
    position: sticky;
    top: 25px;
}

.cms-toc-card {
    overflow: hidden;
    border: 1px solid var(--cms-border);
    border-radius: 17px;
    background: #fff;
    box-shadow: 0 12px 35px rgba(16,42,67,.055);
}

.cms-toc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 17px;
    border-bottom: 1px solid var(--cms-border);
}

.cms-toc-header > div {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.cms-toc-header span {
    color: #94a3b8;
    font-size: 8px;
    font-weight: 900;
    letter-spacing: .13em;
}

.cms-toc-header strong {
    color: var(--cms-navy);
    font-size: 13px;
}

.cms-toc-header > i {
    color: var(--cms-blue);
}

.cms-toc {
    max-height: calc(100vh - 160px);
    overflow-y: auto;
    padding: 8px;
}

.cms-toc::-webkit-scrollbar {
    width: 3px;
}

.cms-toc::-webkit-scrollbar-thumb {
    border-radius: 10px;
    background: #cbd5e1;
}

.cms-toc a {
    position: relative;
    display: block;
    padding: 8px 9px 8px 13px;
    border-radius: 8px;
    color: #64748b;
    font-size: 9px;
    font-weight: 700;
    line-height: 1.45;
    text-decoration: none;
    transition: .2s ease;
}

.cms-toc a:hover {
    color: var(--cms-blue);
    background: #f8fafc;
}

.cms-toc a.active {
    color: var(--cms-blue);
    background: var(--cms-blue-light);
}

.cms-toc a.active::before {
    position: absolute;
    top: 7px;
    bottom: 7px;
    left: 0;
    width: 3px;
    border-radius: 5px;
    background: var(--cms-blue);
    content: "";
}

.cms-toc a.level-3 {
    padding-left: 23px;
    font-size: 8px;
}


/* =========================================================
   ARTICLE
========================================================= */

.cms-article {
    min-width: 0;
}

.cms-article-card {
    overflow: hidden;
    border: 1px solid var(--cms-border);
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 15px 45px rgba(16,42,67,.06);
}

.cms-content {
    padding: 42px 48px;
    color: #334155;
    font-size: 14px;
    line-height: 1.85;
}

.cms-content > *:first-child {
    margin-top: 0;
}

.cms-content > *:last-child {
    margin-bottom: 0;
}


/* Headings */

.cms-content h2 {
    position: relative;
    scroll-margin-top: 35px;
    margin: 42px 0 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #edf2f7;
    color: var(--cms-navy);
    font-size: 24px;
    font-weight: 900;
    letter-spacing: -.025em;
    line-height: 1.25;
}

.cms-content h3 {
    scroll-margin-top: 35px;
    margin: 30px 0 11px;
    color: var(--cms-navy);
    font-size: 18px;
    font-weight: 850;
    line-height: 1.3;
}

.cms-content h4 {
    margin: 24px 0 9px;
    color: #1e3a5f;
    font-size: 15px;
    font-weight: 850;
}


/* Text */

.cms-content p {
    margin: 0 0 17px;
}

.cms-content strong {
    color: #1e293b;
}

.cms-content ul,
.cms-content ol {
    margin: 0 0 20px;
    padding-left: 23px;
}

.cms-content li {
    margin: 6px 0;
}

.cms-content li::marker {
    color: var(--cms-blue);
    font-weight: 800;
}


/* Links */

.cms-content a {
    color: var(--cms-blue);
    font-weight: 700;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.cms-content a:hover {
    color: #1d4ed8;
}


/* Blockquotes */

.cms-content blockquote {
    margin: 25px 0;
    padding: 18px 20px;
    border-left: 4px solid var(--cms-blue);
    border-radius: 0 12px 12px 0;
    color: #475569;
    background: #f8fbff;
}


/* Tables */

.cms-content .table-responsive {
    overflow-x: auto;
}

.cms-content table {
    width: 100%;
    margin: 25px 0;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border: 1px solid var(--cms-border);
    border-radius: 12px;
}

.cms-content th,
.cms-content td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--cms-border);
    text-align: left;
}

.cms-content th {
    color: var(--cms-navy);
    background: #f7faff;
    font-size: 11px;
    font-weight: 850;
}

.cms-content td {
    color: #475569;
    font-size: 11px;
}

.cms-content tr:last-child td {
    border-bottom: 0;
}


/* Images */

.cms-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 25px auto;
    border-radius: 14px;
    box-shadow: 0 15px 35px rgba(15,23,42,.08);
}


/* Code */

.cms-content pre {
    position: relative;
    overflow-x: auto;
    margin: 22px 0;
    padding: 20px;
    border-radius: 13px;
    color: #e2e8f0;
    background: #0f172a;
    font-size: 12px;
    line-height: 1.7;
}

.cms-content code {
    padding: 2px 5px;
    border-radius: 5px;
    color: #1e40af;
    background: #eff6ff;
    font-size: .9em;
}

.cms-content pre code {
    padding: 0;
    color: inherit;
    background: transparent;
}


/* Horizontal line */

.cms-content hr {
    margin: 35px 0;
    border: 0;
    border-top: 1px solid var(--cms-border);
}


/* Highlighted search result */

.cms-content mark {
    padding: 1px 3px;
    border-radius: 4px;
    color: #854d0e;
    background: #fef08a;
}


/* =========================================================
   ARTICLE FOOTER
========================================================= */

.cms-article-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 20px 30px;
    border-top: 1px solid var(--cms-border);
    background: #fbfdff;
}

.cms-footer-message {
    display: flex;
    align-items: center;
    gap: 11px;
}

.cms-footer-icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: var(--cms-green);
    background: #ecfdf5;
}

.cms-footer-message strong,
.cms-footer-message span {
    display: block;
}

.cms-footer-message strong {
    color: var(--cms-navy);
    font-size: 10px;
}

.cms-footer-message span {
    margin-top: 2px;
    color: #94a3b8;
    font-size: 8px;
}

.cms-top-button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 11px;
    border: 1px solid var(--cms-border);
    border-radius: 9px;
    color: #64748b;
    background: #fff;
    font-size: 9px;
    font-weight: 800;
    cursor: pointer;
}

.cms-top-button:hover {
    color: var(--cms-blue);
    border-color: #bfdbfe;
}


/* =========================================================
   FLOATING BUTTON
========================================================= */

.cms-floating-top {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 1000;
    width: 43px;
    height: 43px;
    display: grid;
    place-items: center;
    border: 1px solid #dbeafe;
    border-radius: 13px;
    color: #fff;
    background: var(--cms-blue);
    box-shadow: 0 12px 28px rgba(37,99,235,.25);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: .25s ease;
}

.cms-floating-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.cms-floating-top:hover {
    transform: translateY(-3px);
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 991.98px) {

    .cms-page-layout {
        grid-template-columns: 1fr;
    }

    .cms-page-sidebar {
        position: fixed;
        top: 0;
        left: -310px;
        z-index: 2500;
        width: min(310px, 88vw);
        height: 100vh;
        padding: 20px;
        background: #fff;
        box-shadow: 20px 0 50px rgba(15,23,42,.15);
        transition: left .25s ease;
    }

    .cms-page-sidebar.is-open {
        left: 0;
    }

    .cms-toc-card {
        height: 100%;
    }

    .cms-toc {
        max-height: calc(100vh - 80px);
    }

    .cms-toc-overlay {
        position: fixed;
        inset: 0;
        z-index: 2400;
        display: none;
        background: rgba(15,23,42,.45);
    }

    .cms-toc-overlay.is-open {
        display: block;
    }

    .cms-content {
        padding: 35px;
    }
}

@media (max-width: 767.98px) {

    .cms-page-hero {
        padding: 42px 0 35px;
    }

    .cms-page-hero h1 {
        font-size: 32px;
    }

    .cms-page-description {
        font-size: 12px;
    }

    .cms-page-actions {
        width: 100%;
    }

    .cms-page-action {
        flex: 1;
    }

    .cms-page-main {
        padding: 25px 0 55px;
    }

    .cms-article-card {
        border-radius: 16px;
    }

    .cms-content {
        padding: 25px 20px;
        font-size: 13px;
        line-height: 1.75;
    }

    .cms-content h2 {
        margin-top: 32px;
        font-size: 21px;
    }

    .cms-content h3 {
        font-size: 17px;
    }

    .cms-article-footer {
        align-items: flex-start;
        flex-direction: column;
        padding: 17px 20px;
    }

    .cms-top-button {
        width: 100%;
        justify-content: center;
    }

    .cms-floating-top {
        right: 14px;
        bottom: 14px;
    }
}

@media print {

    .cms-page-hero {
        padding: 20px 0;
    }

    .cms-page-actions,
    .cms-search-panel,
    .cms-page-sidebar,
    .cms-floating-top,
    .cms-reading-progress,
    .cms-article-footer {
        display: none !important;
    }

    .cms-page-layout {
        display: block;
    }

    .cms-article-card {
        border: 0;
        box-shadow: none;
    }

    .cms-content {
        padding: 0;
    }
}