/* ============================================
   DOCS SITE STYLES
   ============================================ */

/* Import Fonts from local */
@font-face {
    font-family: 'Bricolage Grotesque';
    src: url('/assets/fonts/bricolage-grotesque-variable.ttf') format('truetype');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Schibsted Grotesk';
    src: url('/assets/fonts/schibsted-grotesk-variable.ttf') format('truetype');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

/* CSS Variables - same as main site */
:root {
    --background: hsl(27, 60%, 97%);
    --foreground: hsl(242, 70%, 19%);
    --primary: hsl(253, 100%, 74%);
    --action: hsl(44, 100%, 70%);
    --secondary: hsl(214, 57%, 93%);
    --border: hsl(242, 70%, 19%);
    --muted-default: hsl(242, 20%, 90%);
    --muted-foreground: hsl(242, 30%, 40%);
    --card: #FFFFFF;
    --card-foreground: hsl(242, 70%, 19%);
}

[data-theme="dark"] {
    --background: #000000;
    --foreground: hsl(27, 60%, 95%);
    --primary: hsl(253, 100%, 74%);
    --action: #FCD666;
    --secondary: hsl(214, 57%, 15%);
    --border: #A16207;
    --muted-default: hsl(242, 20%, 18%);
    --muted-foreground: hsl(242, 30%, 70%);
    --card: transparent;
    --card-foreground: hsl(27, 60%, 95%);
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Utility classes from main site */
.bg-background {
    background-color: var(--background);
}

.text-foreground {
    color: var(--foreground);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Schibsted Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--background);
    color: var(--foreground);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: var(--background);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    width: 100%;
}

.navbar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.5rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    padding: 0;
}

.logo {
    display: flex;
    align-items: center;
    font-family: 'Schibsted Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--foreground);
    text-decoration: none;
    justify-self: center;
}

.hamburger {
    display: none;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--foreground);
    font-size: 1.5rem;
}

.nav-actions {
    display: flex;
    align-items: center;
}

.btn-icon {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--foreground);
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-theme-toggle {
    display: none;
}

.icon-sm {
    font-size: 1.25rem;
}

.nav-menu {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-link {
    color: var(--foreground);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
}

.nav-link:hover {
    color: var(--primary);
}

.nav-overlay {
    display: none;
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    isolation: isolate;
}

.nav-overlay.active {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

/* Main content area with header offset */
body {
    padding-top: 70px;
}

/* Custom Scrollbar - Neutral (like shadcn) */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #64748b;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #475569;
}
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* Desktop: docs sidebar */
.docs-sidebar {
    width: 280px;
    padding: 1rem;
    position: fixed;
    top: 80px;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 1001;
    border-right: 1px solid var(--border);
}

/* Desktop content needs margin for sidebar */
.docs-content {
    margin-left: 280px;
    padding: 1rem 2rem;
    width: calc(100% - 280px);
    max-width: 100%;
}

/* Desktop: nav-menu */
.nav-menu {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    justify-self: center;
    padding: 0 1rem;
}

.desktop-nav {
    display: flex;
    gap: 1.5rem;
}

.mobile-sidebar {
    display: none;
}

/* Hide mobile theme toggle on desktop */
#theme-toggle-mobile {
    display: none;
}

@media (min-width: 1025px) {
    #theme-toggle-mobile {
        display: block;
    }
}

/* Docs nav links */
.docs-nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    color: var(--foreground);
    text-decoration: none;
    border-radius: 0.5rem;
    margin-bottom: 0.25rem;
    width: 100%;
    box-sizing: border-box;
}
.docs-nav-link:hover {
    background: var(--secondary);
}
.docs-nav-link.active {
    width: 100%;
    display: block;
    background: var(--action);
    color: #1a1a1a;
    border: 1px solid var(--border);
    box-shadow: 2px 2px 0px 0px var(--border);
    font-weight: 600;
    box-sizing: border-box;
}

/* Yellow hover for nav links */
.docs-nav-link:hover {
    background: var(--action);
    border: 1px solid var(--border);
    box-shadow: 2px 2px 0px 0px var(--border);
    color: #1a1a1a;
}

/* Header nav links */
.nav-menu .nav-link.active {
    color: var(--primary);
    font-weight: 600;
}

.nav-menu .nav-link:hover {
    color: var(--primary);
}

/* Docs sections */
.docs-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    box-shadow: 4px 4px 0px 0px var(--border);
}

.docs-code {
    background: #1e293b;
    color: #ffffff;
    padding: 1rem;
    border-radius: 0.5rem;
    font-family: monospace;
    overflow-x: auto;
    margin: 1rem 0;
    position: relative;
    white-space: pre;
    font-size: 0.875rem;
    line-height: 1.5;
}

.docs-code code {
    display: block;
    margin: 0;
    padding: 0;
    line-height: inherit;
}

/* Copy button for code blocks */
.docs-code .copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: background 0.2s;
}

.docs-code .copy-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.docs-code .copy-btn.copied {
    background: #22c55e;
    border-color: #22c55e;
}

/* Subtitle text */
.subtitle {
    color: var(--foreground);
    opacity: 0.9;
    line-height: 1.7;
}

/* On This Page */
.on-this-page {
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    box-shadow: 4px 4px 0px 0px var(--border);
    margin-bottom: 2rem;
}
.on-this-page h4 {
    font-family: 'Schibsted Grotesk', sans-serif;
    font-weight: 600;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.on-this-page ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.on-this-page li {
    margin-bottom: 0.5rem;
}
.on-this-page a {
    color: var(--foreground);
    text-decoration: none;
    font-size: 0.875rem;
    display: block;
    padding: 0.25rem 0;
}
.on-this-page a:hover {
    color: var(--primary);
}

/* ============================================
   DOCS MOBILE STYLES (max-width: 1024px)
   ============================================ */
@media (max-width: 1024px) {
    /* Hide docs sidebar completely */
    .docs-sidebar {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        width: 0 !important;
        overflow: hidden !important;
    }
    
    /* Docs content - no margin for sidebar */
    .docs-content {
        margin-left: 0 !important;
        padding: 10px !important;
        max-width: 100% !important;
        width: 100% !important;
    }
    
    /* Hide on-this-page on mobile */
    .on-this-page {
        display: none !important;
    }
    
    /* Mobile header layout */
    /* Force remove ALL blur and transitions on everything */
    * {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        transform: none !important;
    }
    
    .header {
        padding: 10px !important;
        background-color: var(--background) !important;
    }
    .navbar {
        padding: 0 !important;
        display: grid !important;
        grid-template-columns: auto 1fr auto !important;
        gap: 10px !important;
        position: relative !important;
    }
    
    /* Hamburger - left padding for spacing from edge */
    .hamburger {
        display: flex !important;
        padding: 8px 10px 8px 10px !important;
        margin: 0 !important;
        align-items: center !important;
        justify-content: center !important;
        outline: none !important;
        border: none !important;
        background: transparent !important;
    }
    .hamburger:focus {
        outline: none !important;
        box-shadow: none !important;
    }
    
    /* Logo - tight spacing */
    .logo {
        display: flex !important;
        align-items: center !important;
        padding: 4px !important;
        margin-left: 10px !important;
        justify-content: flex-start !important;
    }
    
    /* Theme toggle - align with logo in navbar grid */
    .nav-actions {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
        padding-right: 10px !important;
        height: 44px !important;
    }
    
    #theme-toggle-mobile {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 40px !important;
        height: 40px !important;
        padding: 0.5rem !important;
        background: transparent !important;
        border: none !important;
        cursor: pointer !important;
    }
    
    /* Hide desktop nav, show mobile sidebar */
    .desktop-nav {
        display: none !important;
    }
    
    .mobile-sidebar {
        display: block !important;
        width: 100% !important;
    }
    
    /* Mobile nav-menu (sidebar drawer) */
    .nav-menu {
        width: 85% !important;
        max-width: 300px !important;
        position: fixed !important;
        top: 70px !important;
        left: 0 !important;
        bottom: 0 !important;
        transform: translateX(-100%) !important;
        z-index: 1001 !important;
        padding: 1rem !important;
        flex-direction: column !important;
        align-items: stretch !important;
gap: 10px !important;
                background-color: var(--background) !important;
                border-right: none !important;
                overflow-y: auto !important;
            }
    
    .nav-menu.active {
        transform: translateX(0) !important;
    }
    
    /* Docs container - prevent shift */
    .container {
        margin-left: 0 !important;
        padding: 0 10px !important;
        max-width: 100% !important;
        width: 100% !important;
        position: relative !important;
        transform: none !important;
    }
    
    .container[style*="margin-top"] {
        margin-left: 0 !important;
        transform: none !important;
    }
    
    /* Flex container for docs */
    [style*="display: flex"][style*="gap: 2rem"] {
        gap: 1rem !important;
        max-width: 100% !important;
        flex-direction: column !important;
    }
    
    /* Mobile sidebar active state */
    .mobile-sidebar .docs-nav-link {
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .mobile-sidebar .docs-nav-link.active {
        width: 100% !important;
        display: flex !important;
    }
    
    /* Prevent content shift - aggressive */
    html, body {
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100vw !important;
    }
    
    body.menu-open {
        overflow: hidden !important;
        position: relative !important;
    }
    
    body.menu-open .container,
    body.menu-open .docs-content,
    body.menu-open .docs-section {
        margin-left: 0 !important;
        transform: none !important;
        filter: none !important;
        -webkit-filter: none !important;
        opacity: 1 !important;
        isolation: isolate;
    }
    
    /* Ensure overlay doesn't affect content positioning */
    .nav-overlay {
        pointer-events: auto;
    }
    
    /* Nav overlay */
    .nav-overlay {
        display: block !important;
    }
}