/* ============================================================================ */
/* Yupiik Minisite default theme                                               */
/* Documentation layout using the yupiik.com brand palette. Light and dark    */
/* themes driven by the `data-theme` attribute on <html> and the               */
/* `yupiik-theme` localStorage key. */
/* ============================================================================ */

:root {
    /* brand */
    --brand-green: #46F72F;
    --brand-green-dark: #2ecf1c;
    --brand-purple: #D858FF;
    --brand-blue: #02ABEA;
    --brand-blue-dark: #056EBB;

    /* neutrals */
    --white: #ffffff;
    --gray-50: #f6f7f9;
    --gray-100: #eef0f3;
    --gray-200: #e2e5ea;
    --gray-300: #cfd4db;
    --gray-400: #9aa4b2;
    --gray-500: #6b7686;
    --gray-600: #4b5563;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-850: #161e2c;
    --gray-900: #0b0c0f;

    /* fonts */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    /* layout */
    --header-height: 76px;
    --content-max-width: 1680px;
    --radius: 14px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.18);

    /* semantic (light theme default) */
    --bg: var(--gray-50);
    --surface: var(--white);
    --surface-2: var(--gray-100);
    --border: var(--gray-200);
    --text: #24262b;
    --muted: #626873;
    --heading: #24262b;
    --link: var(--brand-blue-dark);
    --link-hover: #04558f;
    --brand: var(--brand-blue-dark);
    --ring: var(--brand-blue);
    --code-bg: #eaf5fc;
    --code-text: #04558f;
    --pre-bg: #20242c;
    --pre-text: #e2e8f0;
    --admonition-bg: var(--gray-50);
    --scrollbar: var(--gray-300);
}

/* System preference fallback when no explicit theme is selected. */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme='light']) {
        --bg: var(--gray-900);
        --surface: #12141a;
        --surface-2: #1c202b;
        --border: #262b36;
        --text: var(--gray-100);
        --muted: var(--gray-400);
        --heading: #f2f5f9;
        --link: var(--brand-blue);
        --link-hover: var(--brand-purple);
        --brand: var(--brand-blue);
        --ring: #7ad2f7;
        --code-bg: #1c2028;
        --code-text: var(--brand-purple);
        --pre-bg: #0d1117;
        --pre-text: #c9d1d9;
        --admonition-bg: #161b22;
        --scrollbar: #333a47;
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
        --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
        --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.6);
    }
}

/* explicit light: always apply light no matter the system preference */
:root[data-theme='light'] {
    --bg: var(--gray-50);
    --surface: var(--white);
    --surface-2: var(--gray-100);
    --border: var(--gray-200);
    --text: #24262b;
    --muted: #626873;
    --heading: #24262b;
    --link: var(--brand-blue-dark);
    --link-hover: #04558f;
    --brand: var(--brand-blue-dark);
    --ring: var(--brand-blue);
    --code-bg: #eaf5fc;
    --code-text: #04558f;
    --pre-bg: #20242c;
    --pre-text: #e2e8f0;
    --admonition-bg: var(--gray-50);
    --scrollbar: var(--gray-300);
}

/* explicit dark: always apply dark */
:root[data-theme='dark'] {
    --bg: var(--gray-900);
    --surface: #12141a;
    --surface-2: #1c202b;
    --border: #262b36;
    --text: var(--gray-100);
    --muted: var(--gray-400);
    --heading: #f2f5f9;
    --link: var(--brand-blue);
    --link-hover: var(--brand-purple);
    --brand: var(--brand-blue);
    --ring: #7ad2f7;
    --code-bg: #1c2028;
    --code-text: var(--brand-purple);
    --pre-bg: #0d1117;
    --pre-text: #c9d1d9;
    --admonition-bg: #161b22;
    --scrollbar: #333a47;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.6);
}

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-height) + 20px);
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.75;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.2s ease, color 0.2s ease;
}

a {
    color: var(--link);
    text-decoration: none;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}

a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--heading);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.25;
    margin: 0 0 0.5em;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.65rem; }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.1rem; }
h5 { font-size: 1rem; }

img { max-width: 100%; height: auto; }

::selection {
    background: color-mix(in srgb, var(--brand) 20%, var(--surface));
    color: var(--heading);
}

/* Scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }
::-webkit-scrollbar-track { background: transparent; }

/* ============================================================================ */
/* Header                                                                       */
/* ============================================================================ */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-height);
    background: #191b20;
    color: #f6f7f9;
    border-bottom: 3px solid var(--brand-blue);
    box-shadow: var(--shadow-md);
}

.header-inner {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 0 28px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand {
    min-width: 0;
    display: flex;
    align-items: center;
}

.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--heading);
    font-weight: 600;
    font-size: 1.1rem;
    text-decoration: none;
}

.brand-link:hover {
    color: var(--heading);
    text-decoration: none;
}

.brand-logo {
    height: 40px;
    width: auto;
}

.brand-text {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.4;
    letter-spacing: -0.01em;
}

.brand-side {
    font-weight: 400;
    font-size: 0.85rem;
    color: #c2c5cd;
    letter-spacing: 0.02em;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.icon-btn:hover {
    background: var(--surface-2);
    color: var(--text);
    border-color: var(--border);
}

/* The icon indicates the theme the button will switch to. */
.icon-sun { display: none; }
.icon-moon { display: block; }

:root[data-theme='dark'] .icon-sun { display: block; }
:root[data-theme='dark'] .icon-moon { display: none; }

:root[data-theme='light'] .icon-sun { display: none; }
:root[data-theme='light'] .icon-moon { display: block; }

/* No explicit attribute: follow the operating system preference (default). */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme='light']) .icon-sun { display: block; }
    :root:not([data-theme='light']) .icon-moon { display: none; }
}

/* social links rendered from generated extension points (ul.social-list / anchors) */
.social-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.social-list li {
    display: inline-flex;
}

.social-list a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-size: 1rem;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.social-list a:hover {
    color: var(--text);
    background: var(--surface-2);
    text-decoration: none;
}

/* ============================================================================ */
/* Page layout                                                                  */
/* ============================================================================ */

.page {
    flex: 1 0 auto;
    max-width: var(--content-max-width);
    width: 100%;
    margin: 0 auto 48px;
    padding: 0;
    display: flex;
    align-items: flex-start;
    gap: 0;
}

/* Optional left menu (for minisite-index style/sites with a left nav) */
.page-navigation-left {
    flex: 0 0 240px;
    padding: 28px 18px;
    position: -webkit-sticky;
    position: sticky;
    top: calc(var(--header-height) + 20px);
    max-height: calc(100vh - var(--header-height) - 36px);
    overflow-y: auto;
    scrollbar-width: thin;
    align-self: flex-start;
}

.page-navigation-left h3 {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin: 0 0 8px;
}

.page-navigation-left ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.page-navigation-left > ul > li > a {
    display: block;
    padding: 11px 12px;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.92rem;
    border-left: 2px solid transparent;
}

.page-navigation-left > ul > li > a:hover {
    background: var(--surface-2);
    text-decoration: none;
    border-left-color: var(--brand);
}

.page-navigation-left li > ul > li > a {
    display: block;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-size: 0.85rem;
    border-left: 2px solid transparent;
}

.page-navigation-left li > ul > li > a:hover {
    color: var(--text);
    background: var(--surface-2);
    text-decoration: none;
    border-left-color: var(--brand);
}

.page-navigation-left li > ul > li > a i {
    width: 18px;
    text-align: center;
    margin-right: 6px;
    color: var(--muted);
}

.page-navigation-left li > ul > li > a i[class=""] {
    display: none;
}

.page-navigation-left > ul > li > a i {
    width: 18px;
    text-align: center;
    margin-right: 6px;
    color: var(--muted);
}

/* right-hand generated navigation (toc) - populated by minisite.js */
.page-navigation-right {
    flex: 0 0 clamp(240px, 24vw, 360px);
    padding: 28px 18px;
    position: -webkit-sticky;
    position: sticky;
    top: calc(var(--header-height) + 20px);
    max-height: calc(100vh - var(--header-height) - 36px);
    overflow-y: auto;
    scrollbar-width: thin;
}

.page-navigation-right h3 {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin: 0 0 8px;
}

.generated-nav-menu {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.generated-nav-menu ul,
.page-navigation-left ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.generated-nav-menu li,
.page-navigation-left li {
    list-style: none;
    margin: 0;
}

.generated-nav-menu a {
    display: block;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--muted);
    border-left: 2px solid transparent;
    overflow-wrap: break-word;
}

.generated-nav-menu a:hover {
    color: var(--text);
    background: var(--surface-2);
    text-decoration: none;
    border-left-color: var(--brand);
}

.generated-nav-menu .active > a {
    color: var(--brand);
    border-left-color: var(--brand);
}

/* Indented branches connect each child to its parent heading. */
.generated-nav-menu li > ul,
.page-navigation-left li > ul {
    margin-left: 12px;
}

.generated-nav-menu li > ul > li,
.page-navigation-left li > ul > li {
    position: relative;
    padding-left: 12px;
    border-left: 1px solid var(--border);
}

.generated-nav-menu li > ul > li::before,
.page-navigation-left li > ul > li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 15px;
    width: 12px;
    border-top: 1px solid var(--border);
}

.generated-nav-menu li > ul > li:last-child,
.page-navigation-left li > ul > li:last-child {
    border-left-color: transparent;
}

.generated-nav-menu li > ul > li:last-child::after,
.page-navigation-left li > ul > li:last-child::after {
    content: "";
    position: absolute;
    left: -1px;
    top: 0;
    height: 15px;
    border-left: 1px solid var(--border);
}

/* main content column */
.container {
    max-width: 100%;
    margin: 0 auto;
}

.page-content {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    padding: 36px clamp(24px, 3vw, 56px) 48px;
    background: var(--surface);
    min-height: calc(100vh - 200px);
    overflow-wrap: anywhere;
}

.page-header {
    padding-bottom: 24px;
    margin-bottom: 28px;
    border-bottom: 1px solid var(--border);
}

.page-header::after {
    content: "";
    display: block;
    width: 48px;
    height: 4px;
    margin-top: 24px;
    border-radius: 4px;
    background: var(--brand-blue);
}

.page-content > .page-header,
.page-content > nav,
.page-content-body {
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
}

.page-header h1 {
    font-size: clamp(1.9rem, 3vw, 2.8rem);
    margin: 0;
    letter-spacing: -0.02em;
}

.page-content-body {
    font-size: 1rem;
}

/* ============================================================================ */
/* Breadcrumb                                                                    */
/* ============================================================================ */

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
    font-size: 0.85rem;
    color: var(--muted);
}

.breadcrumb-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "/";
    color: var(--gray-400);
}

.breadcrumb-item a { color: var(--muted); }
.breadcrumb-item a:hover { color: var(--link); text-decoration: none; }

.breadcrumb-icon {
    display: inline-flex;
    align-items: center;
    color: var(--brand);
}

/* ============================================================================ */
/* Footer                                                                       */
/* ============================================================================ */

.site-footer {
    flex-shrink: 0;
    margin-top: auto;
    border-top: 3px solid var(--brand-blue);
    background: #191b20;
    padding: 28px 24px;
}

.footer-inner {
    max-width: var(--content-max-width);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
}

.footer-social .social-list { gap: 8px; }

.footer-social .social-list a {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
}

.copyright {
    color: var(--muted);
    font-size: 0.88rem;
}

.copyright a { color: var(--muted); }
.copyright a:hover { color: var(--link); }

.footer-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    column-gap: 0;
    row-gap: 6px;
    font-size: 0.88rem;
}

.footer-bar .legal-link + .legal-link {
    margin-left: 1rem;
    padding-left: 1rem;
    border-left: 1px solid var(--border);
}

.footer-bar .legal-link {
    color: var(--muted);
    text-decoration: none;
}

.footer-bar .legal-link:hover {
    color: var(--link);
    text-decoration: underline;
}

/* ============================================================================ */
/* Search modal                                                                 */
/* ============================================================================ */

.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
}

.modal.open { display: block; }

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

.modal-dialog {
    position: relative;
    max-width: 620px;
    margin: 12vh auto 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: modal-in 0.16s ease-out;
}

@keyframes modal-in {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
}

.modal-title {
    margin: 0;
    font-size: 1.05rem;
}

.modal-close {
    border: none;
    background: transparent;
    font-size: 1.4rem;
    line-height: 1;
    color: var(--muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

.modal-close:hover {
    color: var(--text);
    background: var(--surface-2);
}

.modal-body {
    padding: 16px 18px 20px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    font-size: 1rem;
    font-family: var(--font-sans);
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus {
    border-color: var(--ring);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 25%, transparent);
}

.search-hits {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 50vh;
    overflow-y: auto;
}

.search-result-container {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.search-result-container:hover {
    border-color: var(--ring);
    transform: translateY(-1px);
}

.search-result-container a {
    font-weight: 600;
    color: var(--heading);
}

.search-result-container a:hover { color: var(--link); text-decoration: none; }

.search-result-container p {
    margin: 4px 0 0;
    font-size: 0.9rem;
    color: var(--muted);
}

.search-result-container mark {
    background: color-mix(in srgb, var(--brand-purple) 30%, transparent);
    color: var(--heading);
    border-radius: 3px;
    padding: 0 2px;
}

.text-center { text-align: center; }

/* ============================================================================ */
/* Index pages (cards + docs overview)                                           */
/* ============================================================================ */

.page-heading {
    max-width: 640px;
    margin: 24px auto;
    text-align: center;
    font-size: 2.4rem;
    letter-spacing: -0.02em;
}

.page-intro {
    max-width: 720px;
    margin: 0 auto 8px;
    text-align: center;
    color: var(--muted);
    font-size: 1.1rem;
}

.docs-overview {
    margin-top: 28px;
}

.row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: 1fr;
    gap: 18px;
}

.row > .col-12,
.row > .col-lg-4 {
    padding: 0;
    display: flex;
}

/* Center the last, partial row of the index card grid (3-column layout). */
@media (min-width: 993px) {
    .row > .col-12:nth-last-child(1):nth-child(3n + 1),
    .row > .col-lg-4:nth-last-child(1):nth-child(3n + 1),
    .row > .col-12:nth-last-child(2):nth-child(3n + 1),
    .row > .col-lg-4:nth-last-child(2):nth-child(3n + 1) {
        grid-column: 2;
    }

    .row > .col-12:nth-last-child(1):nth-child(3n + 2),
    .row > .col-lg-4:nth-last-child(1):nth-child(3n + 2) {
        grid-column: 3;
    }
}

.py-3 { padding-top: 12px; padding-bottom: 12px; }
.py-5 { padding-top: 36px; padding-bottom: 36px; }

@media (max-width: 992px) {
    .row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .row { grid-template-columns: minmax(0, 1fr); }
}

.card {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.card:hover, .card:focus-within {
    border-color: color-mix(in srgb, var(--ring) 60%, var(--border));
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-sm:hover { box-shadow: var(--shadow-md); }

.card-body {
    padding: 26px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 12px;
    font-size: 1.1rem;
}

.theme-icon-holder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    flex: none;
    border-radius: var(--radius-sm);
    font-size: 1.15rem;
    background: color-mix(in srgb, var(--brand) 10%, var(--surface));
    color: var(--brand);
}

/* category badge colors emitted by categoryClass */
.category-cream { background: #f7f3e0; color: #8a6d1a; }
.category-green { background: #d8f7cf; color: #2c7a1c; }
:root[data-theme='dark'] .category-green { background: #1f3d17; color: #7ce86a; }
.category-purple { background: #f0dcfb; color: #7a2c9e; }
:root[data-theme='dark'] .category-purple { background: #3a2153; color: #dd9bf7; }
.category-blue { background: #d9effa; color: #0b5b86; }
:root[data-theme='dark'] .category-blue { background: #12354a; color: #5cc9f5; }
.category-red { background: #f9dcdc; color: #9e2c2c; }
:root[data-theme='dark'] .category-red { background: #4a1f1f; color: #f18080; }
.category-orange { background: #fce8d5; color: #9e5a0b; }
:root[data-theme='dark'] .category-orange { background: #4a3212; color: #f5a951; }
.category-cyan { background: #d9f5f5; color: #0b6f6f; }
:root[data-theme='dark'] .category-cyan { background: #123a3a; color: #5ce4e4; }
.category-pink { background: #fbdcf0; color: #9e3a6f; }
:root[data-theme='dark'] .category-pink { background: #4a1f38; color: #f59cd0; }
.category-light { background: var(--surface-2); color: var(--muted); }

.card-title-text {
    color: var(--heading);
    line-height: 1.3;
}

.card-subtitle-text {
    display: block;
    font-size: 0.82rem;
    color: var(--muted);
    font-weight: 400;
    margin-top: 2px;
}

.card-text {
    color: var(--muted);
    font-size: 0.92rem;
    flex: 1;
}

/* invisible full-card link (the whole card is clickable) */
.card-link-mask {
    position: absolute;
    inset: 0;
    z-index: 1;
    text-indent: -9999px;
    overflow: hidden;
    border-radius: var(--radius);
}

/* ============================================================================ */
/* Page footer navigation (prev/next)                                            */
/* ============================================================================ */

.page-footer-nav {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.page-footer-nav a {
    flex: 0 1 48%;
    padding: 14px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.page-footer-nav a:hover {
    border-color: var(--ring);
    background: var(--surface-2);
    text-decoration: none;
}

.page-footer-nav a div:first-child {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin-bottom: 2px;
}

.page-footer-nav a div:last-child {
    font-weight: 600;
    color: var(--heading);
}

/* ============================================================================ */
/* Asciidoctor content                                                          */
/* ============================================================================ */

.page-content-body p {
    margin: 0 0 16px;
}

.page-content-body ul,
.page-content-body ol {
    padding-left: 24px;
    margin: 0 0 16px;
}

.page-content-body li { margin: 4px 0; }

.page-content-body dt.hdlist1,
.page-content-body td.hdlist1 {
    font-weight: bold;
}

.page-content-body blockquote {
    margin: 0 0 16px;
    padding: 8px 20px;
    border-left: 3px solid var(--brand);
    color: var(--muted);
    background: var(--admonition-bg);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.page-content-body code {
    font-family: var(--font-mono);
    font-size: 0.88em;
    background: var(--code-bg);
    color: var(--code-text);
    padding: 0.15em 0.4em;
    border: 1px solid color-mix(in srgb, var(--brand) 15%, var(--border));
    border-radius: 6px;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

.page-content-body pre {
    position: relative;
    margin: 0 0 16px;
    padding: 28px 24px 24px;
    background: var(--pre-bg);
    color: var(--pre-text);
    border: 1px solid color-mix(in srgb, var(--brand) 12%, var(--border));
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.88rem;
    line-height: 1.6;
}

.page-content-body pre code {
    background: transparent;
    color: inherit;
    border: 0;
    padding: 0;
    font-size: inherit;
}

/* Copy code button injected inside `pre`, anchored top-right, hover-revealed. */
.copy-code-button {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: color-mix(in srgb, var(--pre-text) 14%, transparent);
    color: var(--pre-text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: background-color 0.2s ease, opacity 0.2s ease;
}

.page-content-body pre:hover .copy-code-button,
.copy-code-button:focus-visible {
    opacity: 0.6;
}

.copy-code-button:hover {
    opacity: 1;
    background: color-mix(in srgb, var(--pre-text) 26%, transparent);
}

.copy-code-button.is-copied {
    opacity: 1;
}

.copy-code-button svg {
    width: 14px;
    height: 14px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.copy-code-button .copy-check {
    display: none;
    stroke: var(--brand-green-dark);
}

.copy-code-button.is-copied .copy-glyph {
    display: none;
}

.copy-code-button.is-copied .copy-check {
    display: block;
}

/* admonitions (Docusaurus-style: tinted card, accent left border, top header strip) */
.admonitionblock {
    display: block;
    margin: 0 0 24px;
    border: 1px solid var(--border);
    border-left-width: 4px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--admonition-bg);
}

.admonitionblock > table,
.admonitionblock > table > tbody,
.admonitionblock > table > tbody > tr,
.admonitionblock > table > tbody > tr > td {
    display: block;
    width: 100%;
}

.admonitionblock td.icon {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    border-bottom: 1px solid var(--border);
}

.admonitionblock td.icon .title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    line-height: 1;
}

.admonitionblock td.icon .title::before {
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    font-style: normal;
    font-size: 1.1rem;
    line-height: 1;
    margin-right: 10px;
}

.admonitionblock td.content {
    width: 100%;
    padding: 14px 18px;
    background: transparent;
    border: 0;
    overflow-wrap: anywhere;
}

.admonitionblock td.content > :last-child {
    margin-bottom: 0;
}

.admonitionblock.note {
    border-left-color: #448aff;
}

.admonitionblock.note td.icon {
    background: rgba(68, 138, 255, 0.14);
}

.admonitionblock.note td.icon .title {
    color: #448aff;
}

.admonitionblock.note td.icon .title::before {
    content: '\f05a';
}

.admonitionblock.tip {
    border-left-color: #00a400;
}

.admonitionblock.tip td.icon {
    background: rgba(0, 164, 0, 0.12);
}

.admonitionblock.tip td.icon .title {
    color: #00a400;
}

.admonitionblock.tip td.icon .title::before {
    content: '\f0eb';
}

.admonitionblock.important {
    border-left-color: #448aff;
}

.admonitionblock.important td.icon {
    background: rgba(68, 138, 255, 0.14);
}

.admonitionblock.important td.icon .title {
    color: #448aff;
}

.admonitionblock.important td.icon .title::before {
    content: '\f06a';
}

.admonitionblock.warning {
    border-left-color: #e6a700;
}

.admonitionblock.warning td.icon {
    background: rgba(230, 167, 0, 0.14);
}

.admonitionblock.warning td.icon .title {
    color: #e6a700;
}

.admonitionblock.warning td.icon .title::before {
    content: '\f071';
}

.admonitionblock.caution {
    border-left-color: #e13238;
}

.admonitionblock.caution td.icon {
    background: rgba(225, 50, 56, 0.12);
}

.admonitionblock.caution td.icon .title {
    color: #e13238;
}

.admonitionblock.caution td.icon .title::before {
    content: '\f06d';
}

/* tables */
.tableblock-wrapper {
    overflow-x: auto;
    margin: 0 0 16px;
}

table.tableblock {
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    width: 100%;
    margin: 0 0 16px;
    font-size: 0.92rem;
}

table.tableblock.fit-content {
    width: auto;
}

p.tableblock {
    margin: 0;
}

.tableblock thead th {
    text-align: left;
    background: var(--surface-2);
    font-weight: 600;
}

.tableblock th,
.tableblock td {
    border: 1px solid var(--border);
    padding: 14px 16px;
    overflow-wrap: anywhere;
}

.tableblock tr:nth-child(even) td {
    background: color-mix(in srgb, var(--surface-2) 45%, var(--surface));
}

/* inline title / labels */
.title {
    color: var(--muted);
    font-style: italic;
    font-size: 0.9rem;
}

/* section anchor hover */
.anchor { color: var(--muted); }
.anchor:hover { color: var(--link); text-decoration: none; }

/* tabs (asciidoctor-tabs) */
.tabs {
    margin: 0 0 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.tablist {
    display: flex;
    gap: 0;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
}

.tablist li {
    list-style: none;
}

.tablist a {
    display: inline-block;
    padding: 8px 16px;
    color: var(--muted);
    border-bottom: 2px solid transparent;
}

.tablist a:hover { color: var(--text); text-decoration: none; }

.tablist li.is-active a {
    color: var(--brand);
    border-bottom-color: var(--brand);
}

.tabcontent { padding: 16px; }

/* llm-chat floating */
#llm-chat-root { z-index: 150; }

/* ============================================================================ */
/* Blog listing links                                                           */
/* ============================================================================ */

[role="blog-links"] {
    display: flex;
    gap: 16px;
    justify-content: center;
    padding: 0;
    list-style: none;
    margin: 32px 0 0;
}

[role="blog-links"] li { margin: 0; }

[role="blog-links"] a {
    display: inline-block;
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.9rem;
}

[role="blog-links"] a:hover {
    border-color: var(--ring);
    text-decoration: none;
}

/* ============================================================================ */
/* Responsive                                                                   */
/* ============================================================================ */

/* The dark framing stays consistent across light and dark content themes. */
.site-header .brand-link, .site-header .brand-link:hover {
    color: #f6f7f9;
}
.site-header .icon-btn, .site-header .social-list a,
.site-header .header-actions > a, .site-header .header-actions > li > a,
.site-footer .social-list a, .site-footer .copyright,
.site-footer .copyright a, .site-footer .legal-link {
    color: #c2c5cd;
}
.site-header .icon-btn:hover, .site-header .social-list a:hover {
    color: #ffffff;
    background: #363940;
    border-color: #494c54;
}
.site-footer a:hover { color: #ffffff; }
.header-actions > li { list-style: none; }

.page-content-body .sect1 + .sect1 {
    margin-top: 40px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}
.page-content-body .sect2 > h3 { margin: 28px 0 16px; }
.page-content-body p { line-height: 1.8; }
.page-content-body .sidebarblock,
.page-content-body .exampleblock > .content {
    margin-bottom: 24px;
    padding: 24px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 12px;
}
.page-navigation-left a[aria-current='page'],
.page-navigation-left a[aria-current='page']:hover {
    color: var(--brand);
    background: color-mix(in srgb, var(--brand) 10%, var(--surface));
    border-left-color: var(--brand);
    font-weight: 600;
}
/* the parent entries of the current page */
.page-navigation-left li:has(> ul a[aria-current='page']) > a {
    color: var(--brand);
}

a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible {
    outline: 3px solid var(--ring);
    outline-offset: 4px;
}

@media (max-width: 1199px) {
    .page-navigation-right { display: none; }
}

@media (max-width: 799px) {
    .page { flex-direction: column; margin-bottom: 24px; }
    .page-navigation-left {
        flex: 0 0 auto;
        width: 100%;
        position: static;
        max-height: initial;
        padding: 12px 16px;
        border-bottom: 1px solid var(--border);
    }
    .page-navigation-left h3 { display: none; }
    .page-navigation-left > ul {
        flex-direction: row;
        gap: 6px;
        overflow-x: auto;
        padding: 3px 0;
    }
    .page-navigation-left li { flex-shrink: 0; }
    /* the strip lists the child pages after their parent, in the same row */
    .page-navigation-left li:has(> ul),
    .page-navigation-left li > ul { display: flex; flex-direction: row; gap: 6px; margin-left: 0; }
    .page-navigation-left li > ul > li { flex-shrink: 0; padding-left: 0; border-left: 0; }
    .page-navigation-left li > ul > li::before,
    .page-navigation-left li > ul > li::after { display: none; }
    .page-navigation-left li > ul > li > a { padding: 8px 12px; font-size: 0.8rem; }
    .page-navigation-left > ul > li > a { padding: 8px 12px; font-size: 0.8rem; }
    .page-content { padding: 24px 18px 32px; }
    .header-inner { padding: 0 16px; gap: 8px; }
    .brand-link { font-size: 0.9rem; }
    .brand-side { font-size: 0.7rem; }
    .header-actions { gap: 2px; flex-wrap: wrap; justify-content: flex-end; }
    .icon-btn, .social-list a { width: 32px; height: 32px; }
    .page-heading { font-size: 1.9rem; }
    .modal-dialog { width: calc(100% - 24px); margin: 12px auto; }
    table.tableblock th, table.tableblock td { padding: 10px 8px; }
    .page-footer-nav { flex-wrap: wrap; }
    .page-footer-nav a { flex: 1 1 180px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .card:hover, .card:focus-within { transform: none; }
}