/*
 * DocFX GitBook Template
 * A refined, editorial documentation theme inspired by GitBook
 *
 * Design Philosophy: "Scholarly Warmth"
 * - Warm paper-like backgrounds that feel inviting
 * - Teal accents that guide without overwhelming
 * - Typography that prioritizes extended reading comfort
 * - Subtle depth through layered shadows and borders
 */

/* ═══════════════════════════════════════════════════════════════════════════
   CUSTOM FONTS
   Matching Hymma.net typography (Tailwind system font stack)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════════════
   CSS CUSTOM PROPERTIES - LIGHT THEME
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
    /* Brand Colors */
    --gitbook-accent: #0D9488;
    --gitbook-accent-hover: #0F766E;
    --gitbook-accent-light: #CCFBF1;
    --gitbook-accent-subtle: #F0FDFA;

    /* Background Hierarchy */
    --gitbook-bg: #FDFCFA;
    --gitbook-bg-elevated: #FFFFFF;
    --gitbook-bg-sunken: #F8F6F3;
    --gitbook-bg-sidebar: #FAF9F7;
    --gitbook-bg-code: #F5F3F0;

    /* Text Hierarchy */
    --gitbook-text: #1F2937;
    --gitbook-text-secondary: #4B5563;
    --gitbook-text-muted: #6B7280;
    --gitbook-text-dim: #9CA3AF;

    /* Borders & Dividers */
    --gitbook-border: #E8E5E1;
    --gitbook-border-light: #F0EDE9;
    --gitbook-border-focus: #0D9488;

    /* Shadows */
    --gitbook-shadow-sm: 0 1px 2px rgba(31, 41, 55, 0.04);
    --gitbook-shadow-md: 0 4px 12px rgba(31, 41, 55, 0.08);
    --gitbook-shadow-lg: 0 12px 32px rgba(31, 41, 55, 0.12);
    --gitbook-shadow-glow: 0 0 0 3px rgba(13, 148, 136, 0.15);

    /* Typography - Matching Hymma.net (Tailwind system font stack) */
    --font-serif: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans', Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    --font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans', Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;

    /* Spacing */
    --header-height: 64px;
    --sidebar-width: 280px;
    --toc-width: 220px;
    --content-max-width: 800px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   DARK THEME
   ═══════════════════════════════════════════════════════════════════════════ */

[data-bs-theme="dark"] {
    --gitbook-accent: #2DD4BF;
    --gitbook-accent-hover: #5EEAD4;
    --gitbook-accent-light: #134E4A;
    --gitbook-accent-subtle: #0F2D2A;

    --gitbook-bg: #0F0F10;
    --gitbook-bg-elevated: #18181B;
    --gitbook-bg-sunken: #09090B;
    --gitbook-bg-sidebar: #131316;
    --gitbook-bg-code: #1E1E22;

    --gitbook-text: #FAFAFA;
    --gitbook-text-secondary: #D4D4D8;
    --gitbook-text-muted: #A1A1AA;
    --gitbook-text-dim: #71717A;

    --gitbook-border: #27272A;
    --gitbook-border-light: #1F1F23;
    --gitbook-border-focus: #2DD4BF;

    --gitbook-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --gitbook-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --gitbook-shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
    --gitbook-shadow-glow: 0 0 0 3px rgba(45, 212, 191, 0.2);
}

/* ═══════════════════════════════════════════════════════════════════════════
   BASE STYLES
   ═══════════════════════════════════════════════════════════════════════════ */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--gitbook-text);
    background-color: var(--gitbook-bg);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Subtle paper texture overlay */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.015;
    pointer-events: none;
    z-index: 9999;
}

[data-bs-theme="dark"] body::before {
    opacity: 0.03;
}

/* ═══════════════════════════════════════════════════════════════════════════
   HEADER / NAVBAR
   ═══════════════════════════════════════════════════════════════════════════ */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--gitbook-bg-elevated);
    border-bottom: 1px solid var(--gitbook-border);
    box-shadow: var(--gitbook-shadow-sm);
    z-index: 1000;
    backdrop-filter: blur(12px);
    background: rgba(253, 252, 250, 0.92);
}

[data-bs-theme="dark"] .navbar {
    background: rgba(15, 15, 16, 0.92);
}

.navbar .container-xxl {
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    max-width: 100%;
}

/* Logo */
.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-sans);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gitbook-text);
    text-decoration: none;
    transition: opacity var(--transition-fast);
}

.navbar-brand:hover {
    opacity: 0.8;
    color: var(--gitbook-text);
}

.navbar-brand img {
    height: 32px;
    width: auto;
}

/* Search */
#search {
    flex: 1;
    max-width: 400px;
    margin: 0 2rem;
}

#search input {
    width: 100%;
    height: 40px;
    padding: 0 1rem 0 2.75rem;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    color: var(--gitbook-text);
    background: var(--gitbook-bg-sunken);
    border: 1px solid var(--gitbook-border);
    border-radius: var(--radius-lg);
    outline: none;
    transition: all var(--transition-fast);
}

#search input::placeholder {
    color: var(--gitbook-text-dim);
}

#search input:focus {
    background: var(--gitbook-bg-elevated);
    border-color: var(--gitbook-border-focus);
    box-shadow: var(--gitbook-shadow-glow);
}

#search::before {
    content: '';
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239CA3AF' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'/%3E%3C/svg%3E");
    background-size: contain;
}

/* Nav Links */
.navbar-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
    list-style: none;
    padding: 0;
    margin-bottom: 0;
}

.navbar-nav .nav-link {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gitbook-text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.navbar-nav .nav-link:hover {
    color: var(--gitbook-text);
    background: var(--gitbook-bg-sunken);
}

/* Theme Toggle */
#theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--gitbook-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--gitbook-text-muted);
    transition: all var(--transition-fast);
}

#theme-toggle:hover {
    color: var(--gitbook-text);
    background: var(--gitbook-bg-sunken);
    border-color: var(--gitbook-border);
}

/* ═══════════════════════════════════════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════════════════════════════════════ */

.body-content {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr var(--toc-width);
    min-height: calc(100vh - var(--header-height));
    margin-top: var(--header-height);
}

@media (max-width: 1280px) {
    .body-content {
        grid-template-columns: var(--sidebar-width) 1fr;
    }
}

@media (max-width: 1024px) {
    .body-content {
        grid-template-columns: 1fr;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════════════════════════════════════ */

.sidebar {
    position: sticky;
    top: var(--header-height);
    height: calc(100vh - var(--header-height));
    overflow-y: auto;
    padding: 1.5rem 0;
    background: var(--gitbook-bg-sidebar);
    border-right: 1px solid var(--gitbook-border);
}

/* Custom scrollbar for sidebar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--gitbook-border);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--gitbook-text-dim);
}

/* TOC Navigation */
.toc {
    padding: 0 1rem;
}

.toc .nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.toc .nav > li > .nav-link,
.toc .nav > li > .expand-stub + a {
    display: flex;
    align-items: center;
    padding: 0.625rem 1rem;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gitbook-text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    position: relative;
}

.toc .nav > li > .nav-link:hover,
.toc .nav > li > .expand-stub + a:hover {
    color: var(--gitbook-text);
    background: var(--gitbook-bg);
}

.toc .nav > li > .nav-link.active,
.toc .nav > li.active > .expand-stub + a {
    color: var(--gitbook-accent);
    background: var(--gitbook-accent-subtle);
    font-weight: 600;
}

.toc .nav > li > .nav-link.active::before,
.toc .nav > li.active > .expand-stub + a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--gitbook-accent);
    border-radius: 0 2px 2px 0;
}

/* Nested Navigation */
.toc .nav .nav {
    margin-left: 1rem;
    padding-left: 0.75rem;
    border-left: 1px solid var(--gitbook-border-light);
}

.toc .nav .nav .nav-link {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    font-weight: 400;
    color: var(--gitbook-text-muted);
}

.toc .nav .nav .nav-link:hover {
    color: var(--gitbook-text-secondary);
}

.toc .nav .nav .nav-link.active {
    color: var(--gitbook-accent);
    background: transparent;
    font-weight: 500;
}

/* Section Headers */
.toc .nav-section-header {
    padding: 1.5rem 1rem 0.5rem;
    font-family: var(--font-sans);
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gitbook-text-dim);
}

/* Expand/Collapse */
.expand-stub {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--gitbook-text-dim);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.expand-stub:hover {
    background: var(--gitbook-bg);
    color: var(--gitbook-text-secondary);
}

.expand-stub::before {
    content: '';
    width: 12px;
    height: 12px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M9 5l7 7-7 7'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    transition: transform var(--transition-fast);
}

.expanded > .expand-stub::before {
    transform: rotate(90deg);
}

@media (max-width: 1024px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: var(--header-height);
        width: var(--sidebar-width);
        transform: translateX(-100%);
        z-index: 900;
        box-shadow: var(--gitbook-shadow-lg);
        transition: transform var(--transition-base);
    }

    .sidebar.show {
        transform: translateX(0);
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════════════════════════════════════════ */

main,
article {
    padding: 2.5rem 3rem 4rem;
    max-width: var(--content-max-width);
    margin: 0 auto;
}

@media (max-width: 768px) {
    main,
    article {
        padding: 1.5rem 1rem 3rem;
    }
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    padding: 0;
    list-style: none;
    font-family: var(--font-sans);
    font-size: 0.8125rem;
}

.breadcrumb-item a {
    color: var(--gitbook-text-muted);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.breadcrumb-item a:hover {
    color: var(--gitbook-accent);
}

.breadcrumb-item + .breadcrumb-item::before {
    content: '/';
    padding-right: 0.5rem;
    color: var(--gitbook-border);
}

.breadcrumb-item.active {
    color: var(--gitbook-text-secondary);
}

/* ═══════════════════════════════════════════════════════════════════════════
   TYPOGRAPHY
   ═══════════════════════════════════════════════════════════════════════════ */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    font-weight: 600;
    color: var(--gitbook-text);
    line-height: 1.3;
    margin-top: 2em;
    margin-bottom: 0.75em;
    scroll-margin-top: calc(var(--header-height) + 2rem);
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

h1::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--gitbook-accent), var(--gitbook-accent-light));
    border-radius: 2px;
    margin-top: 1rem;
}

h2 {
    font-size: 1.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--gitbook-border-light);
}

h3 {
    font-size: 1.375rem;
}

h4 {
    font-size: 1.125rem;
}

h5, h6 {
    font-size: 1rem;
    font-family: var(--font-sans);
    font-weight: 600;
}

p {
    margin-bottom: 1.25em;
    color: var(--gitbook-text-secondary);
}

/* Lead paragraph */
.lead,
article > p:first-of-type {
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--gitbook-text-secondary);
}

/* Links */
a {
    color: var(--gitbook-accent);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--gitbook-accent-hover);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Lists */
ul, ol {
    margin-bottom: 1.25em;
    padding-left: 1.5em;
    color: var(--gitbook-text-secondary);
}

li {
    margin-bottom: 0.5em;
}

li::marker {
    color: var(--gitbook-accent);
}

/* ═══════════════════════════════════════════════════════════════════════════
   CODE
   ═══════════════════════════════════════════════════════════════════════════ */

code {
    font-family: var(--font-mono);
    font-size: 0.875em;
    padding: 0.2em 0.4em;
    background: var(--gitbook-bg-code);
    border: 1px solid var(--gitbook-border-light);
    border-radius: var(--radius-sm);
    color: var(--gitbook-text);
}

pre {
    margin: 1.5em 0;
    padding: 1.25rem 1.5rem;
    background: var(--gitbook-bg-code);
    border: 1px solid var(--gitbook-border);
    border-radius: var(--radius-lg);
    overflow-x: auto;
    position: relative;
}

pre code {
    padding: 0;
    background: transparent;
    border: none;
    font-size: 0.875rem;
    line-height: 1.7;
}

/* Code block header */
pre[class*="language-"]::before {
    content: attr(data-lang);
    position: absolute;
    top: 0;
    right: 1rem;
    padding: 0.25rem 0.75rem;
    font-family: var(--font-sans);
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gitbook-text-dim);
    background: var(--gitbook-bg-elevated);
    border: 1px solid var(--gitbook-border);
    border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

/* Syntax highlighting - Custom theme */
.hljs-keyword,
.hljs-selector-tag,
.hljs-built_in {
    color: #D946EF;
}

.hljs-string,
.hljs-attr {
    color: #059669;
}

.hljs-number,
.hljs-literal {
    color: #EA580C;
}

.hljs-comment {
    color: var(--gitbook-text-dim);
    font-style: italic;
}

.hljs-function,
.hljs-title {
    color: #2563EB;
}

.hljs-class .hljs-title {
    color: #0D9488;
}

.hljs-variable,
.hljs-params {
    color: var(--gitbook-text);
}

[data-bs-theme="dark"] .hljs-keyword,
[data-bs-theme="dark"] .hljs-selector-tag,
[data-bs-theme="dark"] .hljs-built_in {
    color: #F0ABFC;
}

[data-bs-theme="dark"] .hljs-string,
[data-bs-theme="dark"] .hljs-attr {
    color: #6EE7B7;
}

[data-bs-theme="dark"] .hljs-number,
[data-bs-theme="dark"] .hljs-literal {
    color: #FB923C;
}

[data-bs-theme="dark"] .hljs-function,
[data-bs-theme="dark"] .hljs-title {
    color: #93C5FD;
}

[data-bs-theme="dark"] .hljs-class .hljs-title {
    color: #5EEAD4;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════════════════════════════════════ */

table {
    width: 100%;
    margin: 1.5em 0;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

thead {
    background: var(--gitbook-bg-sunken);
    border-bottom: 2px solid var(--gitbook-border);
}

th {
    padding: 0.875rem 1rem;
    font-family: var(--font-sans);
    font-weight: 600;
    text-align: left;
    color: var(--gitbook-text);
}

td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--gitbook-border-light);
    color: var(--gitbook-text-secondary);
}

tbody tr:hover {
    background: var(--gitbook-bg-sunken);
}

/* ═══════════════════════════════════════════════════════════════════════════
   BLOCKQUOTES & CALLOUTS
   ═══════════════════════════════════════════════════════════════════════════ */

blockquote {
    margin: 1.5em 0;
    padding: 1rem 1.25rem;
    background: var(--gitbook-accent-subtle);
    border-left: 4px solid var(--gitbook-accent);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    color: var(--gitbook-text-secondary);
}

blockquote p:last-child {
    margin-bottom: 0;
}

/* Alert/Note boxes */
.NOTE, .TIP, .WARNING, .IMPORTANT, .CAUTION,
[class*="alert-"] {
    margin: 1.5em 0;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    border-left: 4px solid;
}

.NOTE, .alert-info {
    background: #EFF6FF;
    border-left-color: #3B82F6;
}

.TIP, .alert-success {
    background: #F0FDF4;
    border-left-color: #22C55E;
}

.WARNING, .alert-warning {
    background: #FFFBEB;
    border-left-color: #F59E0B;
}

.IMPORTANT, .CAUTION, .alert-danger {
    background: #FEF2F2;
    border-left-color: #EF4444;
}

[data-bs-theme="dark"] .NOTE,
[data-bs-theme="dark"] .alert-info {
    background: rgba(59, 130, 246, 0.1);
}

[data-bs-theme="dark"] .TIP,
[data-bs-theme="dark"] .alert-success {
    background: rgba(34, 197, 94, 0.1);
}

[data-bs-theme="dark"] .WARNING,
[data-bs-theme="dark"] .alert-warning {
    background: rgba(245, 158, 11, 0.1);
}

[data-bs-theme="dark"] .IMPORTANT,
[data-bs-theme="dark"] .CAUTION,
[data-bs-theme="dark"] .alert-danger {
    background: rgba(239, 68, 68, 0.1);
}

/* ═══════════════════════════════════════════════════════════════════════════
   RIGHT SIDEBAR (TOC / AFFIX)
   ═══════════════════════════════════════════════════════════════════════════ */

aside.affix,
.affix {
    position: sticky;
    top: calc(var(--header-height) + 2rem);
    height: fit-content;
    max-height: calc(100vh - var(--header-height) - 4rem);
    overflow-y: auto;
    padding: 1.5rem 1rem 1.5rem 0;
}

.affix > h5,
.affix-title {
    font-family: var(--font-sans);
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gitbook-text-dim);
    margin-bottom: 1rem;
    padding-left: 1rem;
}

.affix ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.affix li {
    margin-bottom: 0;
}

.affix a {
    display: block;
    padding: 0.375rem 1rem;
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    color: var(--gitbook-text-muted);
    text-decoration: none;
    border-left: 2px solid transparent;
    transition: all var(--transition-fast);
}

.affix a:hover {
    color: var(--gitbook-text-secondary);
    border-left-color: var(--gitbook-border);
}

.affix a.active {
    color: var(--gitbook-accent);
    border-left-color: var(--gitbook-accent);
    font-weight: 500;
}

/* Nested TOC levels */
.affix ul ul {
    margin-left: 0.75rem;
}

.affix ul ul a {
    font-size: 0.75rem;
    padding: 0.25rem 1rem;
}

@media (max-width: 1280px) {
    aside.affix,
    .affix {
        display: none;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════════════════ */

footer {
    margin-top: 4rem;
    padding: 2rem 0;
    border-top: 1px solid var(--gitbook-border);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: var(--content-max-width);
    margin: 0 auto;
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    color: var(--gitbook-text-dim);
}

/* Page Navigation */
.pagination {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--gitbook-border);
}

.pagination-nav {
    display: flex;
    flex-direction: column;
    padding: 1rem 1.25rem;
    background: var(--gitbook-bg-elevated);
    border: 1px solid var(--gitbook-border);
    border-radius: var(--radius-lg);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.pagination-nav:hover {
    border-color: var(--gitbook-accent);
    box-shadow: var(--gitbook-shadow-md);
    text-decoration: none;
}

.pagination-nav--next {
    text-align: right;
}

.pagination-label {
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gitbook-text-dim);
    margin-bottom: 0.25rem;
}

.pagination-title {
    font-family: var(--font-serif);
    font-size: 1rem;
    font-weight: 600;
    color: var(--gitbook-text);
}

/* ═══════════════════════════════════════════════════════════════════════════
   API REFERENCE SPECIFIC STYLES
   ═══════════════════════════════════════════════════════════════════════════ */

/* Type badges */
.badge,
.type-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2em 0.6em;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--gitbook-bg-code);
    border: 1px solid var(--gitbook-border);
    border-radius: var(--radius-sm);
    color: var(--gitbook-text-secondary);
}

/* Method signatures */
.method-signature {
    padding: 1rem 1.25rem;
    background: var(--gitbook-bg-code);
    border: 1px solid var(--gitbook-border);
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    overflow-x: auto;
}

/* Parameter tables */
.parameters-table th {
    width: 30%;
    min-width: 150px;
}

/* Returns/Exceptions */
.returns,
.exceptions {
    margin: 1.5em 0;
    padding: 1rem 1.25rem;
    background: var(--gitbook-bg-sunken);
    border-radius: var(--radius-md);
}

.returns h4,
.exceptions h4 {
    margin-top: 0;
    font-size: 0.875rem;
    font-family: var(--font-sans);
}

/* Inheritance tree */
.inheritance {
    padding: 1rem;
    background: var(--gitbook-bg-sunken);
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 0.8125rem;
}

.inheritance-item {
    padding-left: 1.5rem;
    border-left: 2px solid var(--gitbook-border);
    margin-left: 0.5rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════════════════════ */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

article {
    animation: fadeIn 0.4s ease-out;
}

/* Smooth hover transitions for interactive elements */
a, button, .nav-link, .pagination-nav {
    transition: all var(--transition-fast);
}

/* ═══════════════════════════════════════════════════════════════════════════
   SEARCH RESULTS OVERLAY
   ═══════════════════════════════════════════════════════════════════════════ */

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 0.5rem;
    background: var(--gitbook-bg-elevated);
    border: 1px solid var(--gitbook-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--gitbook-shadow-lg);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1001;
}

.search-result-item {
    display: block;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--gitbook-border-light);
    text-decoration: none;
    transition: background var(--transition-fast);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover,
.search-result-item.active {
    background: var(--gitbook-bg-sunken);
}

.search-result-title {
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--gitbook-text);
    margin-bottom: 0.25rem;
}

.search-result-path {
    font-family: var(--font-sans);
    font-size: 0.75rem;
    color: var(--gitbook-text-dim);
}

/* ═══════════════════════════════════════════════════════════════════════════
   MOBILE MENU BUTTON
   ═══════════════════════════════════════════════════════════════════════════ */

.mobile-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--gitbook-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--gitbook-text-muted);
}

@media (max-width: 1024px) {
    .mobile-menu-toggle {
        display: flex;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   UTILITY CLASSES
   ═══════════════════════════════════════════════════════════════════════════ */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.text-muted {
    color: var(--gitbook-text-muted) !important;
}

.text-accent {
    color: var(--gitbook-accent) !important;
}

.bg-accent-subtle {
    background: var(--gitbook-accent-subtle) !important;
}
