/* Board Unity SDK Documentation Styles */

/* Font Imports */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&display=swap');

@font-face {
  font-family: 'ITC Kabel';
  src: url('../fonts/itc-kabel_ultra.woff2') format('woff2'),
       url('../fonts/itc-kabel_ultra.woff') format('woff');
  font-weight: 900;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: 'Neue Haas Grotesk Text';
  src: url('../fonts/NeueHaasGroteskText-55Roman-Web.woff2') format('woff2'),
       url('../fonts/NeueHaasGroteskText-55Roman-Web.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: 'Neue Haas Grotesk Text';
  src: url('../fonts/NeueHaasGroteskText-65Medium-Web.woff2') format('woff2'),
       url('../fonts/NeueHaasGroteskText-65Medium-Web.woff') format('woff');
  font-weight: 500;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: 'Neue Haas Grotesk Text';
  src: url('../fonts/NeueHaasGroteskText-75Bold-Web.woff2') format('woff2'),
       url('../fonts/NeueHaasGroteskText-75Bold-Web.woff') format('woff');
  font-weight: 700;
  font-style: normal;
  font-display: block;
}

/* Design Tokens */
:root {
  /* Colors */
  --bg-color: #fffef1;
  --text-color: #000000;
  --accent-color: #32c992;
  --purple: #6d13ec;
  --border-color: rgba(0, 0, 0, 0.15);
  --code-bg: rgba(0, 0, 0, 0.05);
  --secondary-text: rgba(0, 0, 0, 0.5);

  /* Layout */
  --sidebar-width: 329px;

  /* Typography */
  --font-heading: 'ITC Kabel', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Neue Haas Grotesk Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-code: 'IBM Plex Mono', 'SFMono-Regular', Consolas, monospace;
}

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

/* Base */
html {
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  color: var(--text-color);
  background-color: var(--bg-color);
  line-height: 1.5;
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-color);
  border-right: 1px solid var(--border-color);
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  flex-shrink: 0;
  z-index: 100;
}

.sidebar-header {
  padding: 20px 22px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-header a {
  display: block;
  text-decoration: none;
}

.sidebar-header .logo {
  height: 35px;
  width: auto;
}

.sidebar-header .docs-label {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 16px;
  color: var(--secondary-text);
  letter-spacing: 0.32px;
  text-transform: uppercase;
}


/* Navigation */
.sidebar nav {
  padding: 73px 22px 22px;
}

/* Nav Section */
.nav-section {
  margin-bottom: 0;
}

.nav-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0;
  margin-bottom: 8px;
}

.nav-section-link {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 32px;
  line-height: 38px;
  letter-spacing: -1.28px;
  color: var(--text-color);
  text-decoration: none;
  display: block;
  flex: 1;
  cursor: pointer;
}

.nav-section-link:hover {
  opacity: 0.7;
  text-decoration: none;
}

.nav-section-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  margin: 0;
  margin-left: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-section-toggle:hover {
  opacity: 0.7;
}

.nav-section-header .chevron {
  width: 17px;
  height: 16px;
  flex-shrink: 0;
}

.nav-section .arrow-up {
  display: none;
}

.nav-section .arrow-down {
  display: block;
}

.nav-section.open .arrow-up {
  display: block;
}

.nav-section.open .arrow-down {
  display: none;
}

/* Nav Children */
.nav-children {
  display: flex;
  flex-direction: column;
  padding-left: 16px;
  margin-left: 22px;
  margin-bottom: 40px;
  position: relative;
}

.nav-children::before {
  content: '';
  position: absolute;
  left: 0;
  top: 5px;
  bottom: 5px;
  width: 1px;
  background: var(--border-color);
}

/* Animated expand/collapse - Stripe-style timing */
.nav-children {
  overflow: hidden;
  max-height: 500px;
  opacity: 1;
  transition:
    max-height 200ms cubic-bezier(0, .09, .4, 1),
    opacity 150ms cubic-bezier(0, .09, .4, 1),
    margin-bottom 200ms cubic-bezier(0, .09, .4, 1);
}

.nav-section.collapsed .nav-children {
  max-height: 0;
  opacity: 0;
  margin-bottom: 0;
}

.nav-children a {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  line-height: 24px;
  color: var(--text-color);
  text-decoration: none;
  padding: 4px 0;
  position: relative;
  margin-left: 0;
}

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

.nav-children a.active {
  font-weight: 700;
}

/* Green indicator bar for active nav item */
.nav-children a.active::before {
  content: '';
  position: absolute;
  left: -15px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 26px;
  background-color: #32c992;
  border-radius: 0;
}

/* Top-level nav items */
.sidebar nav > a.nav-item {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 32px;
  line-height: 38px;
  letter-spacing: -1.28px;
  color: var(--text-color);
  text-decoration: none;
  display: block;
  margin-bottom: 40px;
}

.sidebar nav > a.nav-item:hover {
  color: var(--text-color);
}

.sidebar nav > a.nav-item.active {
  color: var(--accent-color);
}

/* Main Wrapper */
.main-wrapper {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
  overflow-x: hidden;
}

/* Main Content */
main {
  flex: 1;
  padding: 0;
}

.container {
  width: 100%;
  max-width: 1050px;
  margin: 0;
  padding: 67px 40px 80px 78px;
}

/* Typography */
h1 {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 54px;
  line-height: 41px;
  letter-spacing: -2.16px;
  color: var(--text-color);
  margin: 0 0 26px 0;
}

h2 {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 36px;
  line-height: 41px;
  letter-spacing: -1.44px;
  color: var(--text-color);
  margin: 40px 0 24px 0;
  padding: 0;
  border: none;
}

h3 {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 28px;
  line-height: 34px;
  letter-spacing: -1.12px;
  color: var(--text-color);
  margin: 32px 0 16px 0;
}

h4 {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 22px;
  line-height: 28px;
  letter-spacing: -0.88px;
  color: var(--text-color);
  margin: 24px 0 12px 0;
}

p {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  line-height: 24px;
  color: var(--text-color);
  margin: 0 0 16px 0;
}

a {
  color: var(--purple);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

strong, b {
  font-weight: 700;
}

/* Lists */
ul, ol {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 24px;
  margin: 0 0 16px 24px;
  padding: 0;
}

li {
  margin: 0 0 0 0;
}

li::marker {
  color: var(--text-color);
}

/* Code */
code {
  font-family: var(--font-code);
  font-size: 14px;
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 4px;
}

pre {
  font-family: var(--font-code);
  font-size: 16px;
  line-height: 24px;
  background: var(--code-bg);
  padding: 26px 29px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 0 0 24px 0;
}

pre code {
  font-size: 16px;
  padding: 0;
  background: none;
  border-radius: 0;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 24px 0;
  font-family: var(--font-body);
  font-size: 16px;
}

th, td {
  text-align: left;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
}

th {
  font-weight: 700;
  background: var(--code-bg);
}

/* Blockquote */
blockquote {
  margin: 0 0 24px 0;
  padding: 16px 24px;
  border-left: 4px solid var(--accent-color);
  background: var(--code-bg);
  border-radius: 0 8px 8px 0;
}

blockquote p:last-child {
  margin-bottom: 0;
}

/* Horizontal Rule */
hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 40px 0;
}

/* Footer */
footer {
  background: var(--purple);
  margin: 0 20px;
  border-radius: 12px 12px 0 0;
  padding: 50px 40px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

footer .footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

footer .social-links {
  display: flex;
  gap: 30px;
  align-items: center;
}

footer .social-links a {
  color: #fffef1;
  display: block;
  width: 24px;
  height: 24px;
  transition: opacity 0.15s ease;
}

footer .social-links a:hover {
  opacity: 0.8;
  text-decoration: none;
}

footer .social-links svg {
  width: 24px;
  height: 24px;
  fill: #fffef1;
}

footer .copyright {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 16px;
  line-height: 19px;
  color: #fffef1;
  margin: 0;
}

footer .footer-logo {
  margin-top: 40px;
  width: 100%;
  max-width: 1360px;
}

footer .footer-logo svg {
  width: 100%;
  height: auto;
}

/* First h1 after main starts - no top margin needed */
main > .container > h1:first-child,
.container > h1:first-child {
  margin-top: 0;
}

/* First h2 after h1 */
h1 + h2 {
  margin-top: 24px;
}

/* Syntax highlighting - Rouge */
.highlight {
  background: var(--code-bg);
  border-radius: 8px;
  margin: 0 0 24px 0;
}

.highlight pre {
  margin: 0;
}

/* API Reference specific styles */
.api-member {
  margin-bottom: 32px;
}

.api-member h3 {
  font-family: var(--font-code);
  font-weight: 500;
  font-size: 18px;
  letter-spacing: 0;
  background: var(--code-bg);
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 12px;
}

.api-member p {
  margin-left: 0;
}

/* Mobile Header */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--bg-color);
  border-bottom: 1px solid var(--border-color);
  z-index: 200;
  align-items: center;
  padding: 0 20px;
}

.hamburger {
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: var(--text-color);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hamburger .close-icon {
  display: none;
}

.menu-open .hamburger .hamburger-icon {
  display: none;
}

.menu-open .hamburger .close-icon {
  display: block;
}

.mobile-logo {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.mobile-logo svg {
  height: 28px;
  width: auto;
}

/* Menu Overlay - hidden */
.menu-overlay {
  display: none;
}

/* Responsive */
@media (max-width: 1100px) {
  .container {
    padding-left: 40px;
    padding-right: 40px;
  }
}

@media (max-width: 1000px) {
  :root {
    --sidebar-width: 280px;
  }
}

@media (max-width: 900px) {
  :root {
    --sidebar-width: 240px;
  }

  .container {
    padding-left: 32px;
    padding-right: 32px;
  }
}

@media (max-width: 850px) {
  :root {
    --sidebar-width: 220px;
  }

  .container {
    padding-left: 24px;
    padding-right: 24px;
  }
}

@media (max-width: 768px) {
  /* Show mobile header */
  .mobile-header {
    display: flex;
  }

  /* Sidebar becomes full-screen overlay */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    transform: translateX(-100%);
    z-index: 150;
    border-right: none;
  }

  /* Transition enabled via JS class to prevent flash on resize */
  .menu-ready .sidebar {
    transition: transform 0.3s ease;
  }

  .menu-open .sidebar {
    transform: translateX(0);
  }

  .sidebar nav {
    padding: 20px 22px;
  }

  .main-wrapper {
    margin-left: 0;
    padding-top: 60px;
  }

  body {
    flex-direction: column;
  }

  .container {
    padding: 40px 24px 60px;
  }

  h1 {
    font-size: 36px;
    line-height: 40px;
  }

  h2 {
    font-size: 28px;
    line-height: 34px;
  }

  footer {
    margin: 0 12px;
  }
}
