/* CSS Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  font-weight: 400;
  color: #1c1c1c;
  background-color: #ffffff;
}

[data-theme="dark"] {
  body {
    color: #e5e5e5;
    background-color: #0a0a0a;
  }
}

#root {
  height: 100vh;
  display: flex;
  flex-direction: column;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

input, button, textarea, select {
  font: inherit;
}

button {
  background: none;
  border: none;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: inherit;
}

ul, ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-size: inherit;
  font-weight: inherit;
}

p {
  margin: 0;
}

/* Scrollbar Styling - Cross-browser support */
* {
  scrollbar-width: thin;
  scrollbar-color: #999999 transparent;
}

[data-theme="dark"] {
  * {
    scrollbar-color: #515151 transparent;
  }
}

*::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background-color: #525252;
  border-radius: 6px;
  border: 3px solid #ffffff;
}

[data-theme="dark"] {
  *::-webkit-scrollbar-thumb {
    background-color: #6B7280;
    border-color: #0a0a0a;
  }
}

*::-webkit-scrollbar-thumb:hover {
  background-color: #1c1c1c;
}

[data-theme="dark"] {
  *::-webkit-scrollbar-thumb:hover {
    background-color: #9CA3AF;
  }
}

/* Font Declarations */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/assets/fonts/inter/Inter-VariableFont_opsz,wght.ttf') format('truetype-variations');
  font-named-instance: 'Regular';
}

@font-face {
  font-family: 'Inter';
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url('/assets/fonts/inter/Inter-Italic-VariableFont_opsz,wght.ttf') format('truetype-variations');
  font-named-instance: 'Italic';
}

/* Layout */
.layout {
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.layout-container {
  display: flex;
  flex: 1;
  width: 100%;
  overflow: hidden;
  height: calc(100vh - 4rem);
}

.layout-sidebar {
  width: 300px;
  flex-shrink: 0;
  height: 100%;
  overflow: hidden;
}

.layout-main {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  height: 100%;
  display: flex;
  justify-content: center;
}

.layout-main-inner {
  width: 100%;
  max-width: 1400px;
  padding: 3rem 1.5rem;
}

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

@media (max-width: 1024px) {
  .layout-sidebar {
    width: 220px;
  }
}

@media (max-width: 768px) {
  .layout-sidebar {
    width: 200px;
  }

  .layout-main-inner {
    padding: 1rem;
  }
}

@media (max-width: 640px) {
  .layout-sidebar {
    display: none;
  }

  .layout-main-inner {
    padding: 1rem 0.5rem;
  }
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #1c1c1c;
}

h1 {
  font-size: 1.875rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
  font-weight: 600;
  margin-top: 0;
  margin-bottom: 1rem;
}

h2 {
  font-size: 1.5rem;
  line-height: 1.4;
  letter-spacing: -0.01em;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

h3 {
  font-size: 1.25rem;
  line-height: 1.5;
  letter-spacing: -0.01em;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

h4 {
  font-size: 1.125rem;
  line-height: 1.5;
  letter-spacing: 0.01em;
  font-weight: 600;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

h5 {
  font-size: 1rem;
  line-height: 1.5;
  letter-spacing: 0.01em;
  font-weight: 600;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

h6 {
  font-size: 0.875rem;
  line-height: 1.5;
  letter-spacing: 0.01em;
  font-weight: 600;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

p {
  font-size: 1rem;
  line-height: 1.7;
  font-weight: 400;
  margin-top: 0;
  margin-bottom: 1rem;
}

a {
  color: #0665c4;
  font-weight: 500;
  text-decoration: underline;
  transition: all 0.2s ease;
}

a:hover {
  color: #0a0b66;
  font-weight: 500;
}

[data-theme="dark"] {
  h1, h2, h3, h4, h5, h6 {
    color: #e5e5e5;
  }

  a {
    color: #0665c4;
  }

  a:hover {
    color: #61b1f2;
  }
}

code, pre {
  font-family: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, "Courier New", monospace;
  font-size: 0.875rem;
}

code {
  background-color: #f8f8f8;
  padding: 0.125rem 0.375rem;
  border-radius: 0.125rem;
}

[data-theme="dark"] {
  code {
    background-color: #1a1a1a;
  }
}

pre {
  background-color: #f8f8f8;
  padding: 1rem;
  border-radius: 0.25rem;
  overflow-x: auto;
  margin-bottom: 1rem;
}

[data-theme="dark"] {
  pre {
    background-color: #1a1a1a;
  }
}


pre code {
  background-color: transparent;
  padding: 0;
}

ul, ol {
  padding-left: 2rem;
  margin-bottom: 1.5rem;
  line-height: 1.7;
}

ul {
  list-style: disc;
  list-style-position: outside;
}

ol {
  list-style: decimal;
  list-style-position: outside;
}

ul ul {
  list-style-type: circle;
}

ul ul ul {
  list-style-type: square;
}

ol ol {
  list-style-type: lower-alpha;
}

ol ol ol {
  list-style-type: lower-roman;
}

li {
  margin-bottom: 0.5rem;
  line-height: 1.7;
}

li p {
  margin-bottom: 0.5rem;
}

blockquote {
  margin: 1rem 0;
  padding-left: 1rem;
  border-left: 4px solid #e5e5e5;
  color: #525252;
}

[data-theme="dark"] {
  blockquote {
    border-left-color: #262626;
    color: #c9c9c9;
  }
}

hr {
  border: none;
  border-top: 1px solid #e5e5e5;
  margin: 1.5rem 0;
}

[data-theme="dark"] {
  hr {
    border-top-color: #262626;
  }
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}

th, td {
  text-align: left;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid #e5e5e5;
}

[data-theme="dark"] {
  th, td {
    border-bottom-color: #262626;
  }
}

th {
  font-weight: 600;
  background-color: #f8f8f8;
}

[data-theme="dark"] {
  th {
    background-color: #1a1a1a;
  }
}


img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1rem 0;
  border-radius: 0.25rem;
  cursor: pointer;
  transition: transform 0.2s ease;
}

/* Header */
.site-header {
  background-color: #ffffff;
  border-bottom: 1px solid #e5e5e5;
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
}

[data-theme="dark"] {
  .site-header {
    background-color: #0a0a0a;
    border-bottom-color: #262626;
  }
}

.site-header.has-nav {
  height: 144px;
}

.site-header.no-nav {
  height: 80px;
}

.header-top {
  height: 80px;
}

.site-header.has-nav .header-top {
  border-bottom: 1px solid #e5e5e5;
}

.header-bottom {
  height: 64px;
}

.header-container {
  max-width: 100%;
  margin: 0 auto;
  height: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 2rem 0 1rem;
}

.mobile-menu-button {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: transparent;
  border: none;
  color: #1c1c1c;
  cursor: pointer;
  border-radius: 0.25rem;
  transition: background-color 0.2s ease;
  flex-shrink: 0;
}

[data-theme="dark"] {
  .mobile-menu-button {
    color: #e5e5e5;
  }
}

.mobile-menu-button:hover {
  background: #f8f8f8;
}

[data-theme="dark"] {
  .mobile-menu-button:hover {
    background: #1a1a1a;
  }
}

.header-brand {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.header-logo-link {
  text-decoration: none;
  color: #1c1c1c;
  font-weight: 600;
  font-size: 1.25rem;
}

.header-logo {
  height: 2.5rem;
  max-width: 250px;
  object-fit: contain;
}

.header-logo-light {
  display: block;
}

.header-logo-dark {
  display: none;
}

[data-theme="dark"] {
  .header-logo-light {
    display: none;
  }
  
  .header-logo-dark {
    display: block;
  }
}

.header-search {
  display: flex;
  justify-content: center;
  height: 2.2rem;
  padding: 0 1.5rem;
}

.header-search-button {
  display: flex;
  align-items: center;      
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: #f8f8f8;
  border: 1px solid #e5e5e5;
  border-radius: 0.5rem;
  color: #525252;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 300px;
}

[data-theme="dark"] {
  .header-search-button {
    background: #1a1a1a;
    border-color: #262626;
    color: #c9c9c9;
  }
}

.header-search-button:hover {
  border-color: #171717;
  background: #ffffff;
}

[data-theme="dark"] {
  .header-search-button:hover {
    border-color: #fafafa;
    background: #0a0a0a;
  }
}

.search-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: #525252;
}

[data-theme="dark"] {
  .search-icon {
    color: #c9c9c9;
  }
}

.search-text {
  flex: 1;
  text-align: left;
}

.search-shortcut {
  padding-left: 6px;
  padding-right: 6px;
  padding-bottom: 1px;
  background: #f8f8f8;
  font-size: 0.875rem;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #525252;
  font-weight: 500;
}

[data-theme="dark"] {
  .search-shortcut {
    background: #1a1a1a;
    color: #c9c9c9;
  }
}


.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: flex-end;
}

.header-nav {
  width: 100%;
}

.header-nav-list {
  display: flex;
  list-style: none;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
}

.header-nav-item {
  margin: 0;
}

.header-nav-link {
  text-decoration: none;
  color: #666666;
  padding: 0.5rem 0;
  transition: color 0.2s ease;
  font-size: 0.875rem;
  font-weight: 500;
}

.header-nav-link:hover {
  color: #171717;
}

.header-nav-link.active {
  color: #171717;
  border-bottom: 2px solid #171717;
}

[data-theme="dark"] {
  .header-nav-link {
    color: #b3b3b3;
  }

  .header-nav-link:hover {
    color: #fafafa;
  }

  .header-nav-link.active {
    color: #fafafa;
  }
}

@media (max-width: 768px) {
  .header-search {
    padding: 0 0.5rem;
  }

  .header-search-button {
    min-width: 200px;
  }

  .header-container {
    padding: 0 1rem;
  }

  .search-text {
    display: none;
  }

  .search-shortcut {
    display: none;
  }
}

@media (max-width: 640px) {
  .mobile-menu-button {
    display: flex;
  }

  .header-container {
    padding: 0 0.5rem;
  }

  .header-brand {
    flex: 1;
    justify-content: center;
  }

  .header-search {
    display: none;
  }

  .header-actions {
    min-width: auto;
  }
}

/* SideNav */
.sidenav {
  background-color: #FAFAFA;
  border-right: 1px solid #E8E8E8;
  padding: 1rem 0.75rem 1rem 0.5rem;
  height: 100%;
  min-height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}

[data-theme="dark"] .sidenav {
  background-color: #0F0F0F;
  border-right-color: #1F1F1F;
}

.sidenav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidenav-group {
  padding: 0.5rem;
  margin-bottom: 0.25rem;
}

.sidenav-item {
  margin-bottom: 0.25rem;
}

.sidenav-item-wrapper {
  position: relative;
}

.sidenav-toggle-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1;
  opacity: 0;
}

.sidenav-chevron {
  width: 0.75rem;
  height: 0.75rem;
  flex-shrink: 0;
  opacity: 0.7;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.15s ease;
  margin-left: auto;
}

.sidenav-link:hover .sidenav-chevron {
  opacity: 1;
}

.sidenav-chevron.collapsed {
  transform: rotate(-90deg);
}

.sidenav-chevron.expanded {
  transform: rotate(0deg);
}

.sidenav-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.5rem;
  border-radius: 6px;
  color: #1C1C1C;
  text-decoration: none;
  font-size: 0.875rem;
  line-height: 1.25;
  transition: all 0.15s ease;
  background-color: transparent;
  width: 100%;
  min-height: 2rem;
  border: none;
  text-align: left;
  cursor: pointer;
  position: relative;
}

[data-theme="dark"] .sidenav-link {
  color: #F2F2F2;
}

.sidenav-link:hover {
  color: #1C1C1C;
  background-color: #E5E5E5;
}

[data-theme="dark"] .sidenav-link:hover {
  color: #F2F2F2;
  background-color: #1F1F1F;
}

.sidenav-link:focus-visible {
  outline: 2px solid #171717;
  outline-offset: 2px;
}

[data-theme="dark"] .sidenav-link:focus-visible {
  outline-color: #FAFAFA;
}

.sidenav-link.active {
  color: #171717;
  background-color: #E5E5E5;
  font-weight: 500;
}

[data-theme="dark"] .sidenav-link.active {
  color: #FAFAFA;
  background-color: #1F1F1F;
}


.sidenav-link.sidenav-group-label {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(28, 28, 28, 0.7);
  padding: 0.375rem 0.5rem;
  min-height: 2rem;
}

[data-theme="dark"] .sidenav-link.sidenav-group-label {
  color: rgba(242, 242, 242, 0.7);
}

.sidenav-link.sidenav-group-label:hover {
  background-color: transparent;
  opacity: 1;
}

.sidenav-link.disabled {
  opacity: 0.5;
  pointer-events: none;
}

.sidenav-sublist-wrapper {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidenav-sublist-wrapper.collapsed {
  grid-template-rows: 0fr;
}

.sidenav-sublist-wrapper.expanded {
  grid-template-rows: 1fr;
}

.sidenav-sublist {
  list-style: none;
  margin: 0;
  padding-left: 1.5rem;
  overflow: hidden;
  min-height: 0;
}

.sidenav-sublist-wrapper.expanded .sidenav-sublist {
  padding-top: 0.25rem;
}

.sidenav-sublist .sidenav-item {
  margin-bottom: 0.25rem;
}

.sidenav-sublist .sidenav-link {
  min-height: 1.75rem;
  padding: 0.25rem 0.5rem;
}

/* Mobile Menu */
.mobile-menu-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 90;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.mobile-menu-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 280px;
  max-width: 85vw;
  background: #ffffff;
  z-index: 95;
  display: flex;
  flex-direction: column;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
  animation: slideIn 0.3s ease;
}

[data-theme="dark"] {
  .mobile-menu-drawer {
    background: #0a0a0a;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.3);
  }
}

@keyframes slideIn {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}

.mobile-menu-header {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid #e5e5e5;
  flex-shrink: 0;
}

[data-theme="dark"] {
  .mobile-menu-header {
    border-bottom-color: #262626;
  }
}

.mobile-menu-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: transparent;
  border: none;
  color: #1c1c1c;
  cursor: pointer;
  border-radius: 0.25rem;
  transition: background-color 0.2s ease;
}

[data-theme="dark"] {
  .mobile-menu-close {
    color: #e5e5e5;
  }
}

.mobile-menu-close:hover {
  background: #f8f8f8;
}

[data-theme="dark"] {
  .mobile-menu-close:hover {
    background: #1a1a1a;
  }
}

.mobile-menu-content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

/* Content Page */
.content-page {
  width: 100%;
}

.content-wrapper {
  display: flex;
  gap: 4rem;
  width: 100%;
}

.content-article {
  flex: 1;
  min-width: 0;
  max-width: 60rem;
}

.content-header {
  margin-bottom: 2rem;
  border-bottom: 1px solid #e5e5e5;
}

[data-theme="dark"] {
  .content-header {
    border-bottom-color: #262626;
  }
}

.content-title {
  margin-top: 0;
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  color: #171717;
}

[data-theme="dark"] {
  .content-title {
    color: #fafafa;
  }
}

.content-description {
  font-size: 1rem;
  line-height: 1.7;
  font-weight: 400;
  color: #1c1c1c;
  margin-bottom: 1rem;
  max-width: 42rem;
}

[data-theme="dark"] {
  .content-description {
    color: #e5e5e5;
  }
}

.content-meta {
  display: flex;
  font-size: 0.875rem;
  color: #525252;
  margin-bottom: 1rem;
}

[data-theme="dark"] {
  .content-meta {
    color: #c9c9c9;
  }
}

.content-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.content-tag {
  padding: 0.25rem 0.5rem;
  background: #f8f8f8;
  color: #1c1c1c;
  border-radius: 0.125rem;
  font-size: 0.875rem;
}

[data-theme="dark"] {
  .content-tag {
    background: #1a1a1a;
    color: #e5e5e5;
  }
}


.content-body {
  margin-bottom: 3rem;
}

.content-toc {
  width: 280px;
  flex-shrink: 0;
}

.content-footer {
  margin-top: 4rem;
  margin-bottom: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #e5e5e5;
}

[data-theme="dark"] {
  .content-footer {
    border-top-color: #262626;
  }
}

.content-footer-info p {
  text-align: center;
  color: #525252;
  font-size: 0.875rem;
}

[data-theme="dark"] {
  .content-footer-info p {
    color: #c9c9c9;
  }
}

.content-footer-text {
  margin: 0 0 0.5rem 0;
}

.content-footer-powered {
  margin: 0;
}

.content-footer-powered a {
  color: #171717;
  text-decoration: none;
}

[data-theme="dark"] {
  .content-footer-powered a {
    color: #fafafa;
  }
}

.content-footer-powered a:hover {
  text-decoration: underline;
}

@media (max-width: 1280px) {
  .content-toc {
    width: 240px;
  }
}

@media (max-width: 1024px) {
  .content-toc {
    width: 220px;
  }

  .content-article {
    max-width: 720px;
  }
}

@media (max-width: 1024px) {
  .content-wrapper {
    gap: 3rem;
  }
}

@media (max-width: 768px) {
  .content-wrapper {
    flex-direction: column;
    gap: 2rem;
  }

  .content-article {
    max-width: 100%;
  }

  .content-toc {
    width: 100%;
    order: -1;
  }

  .content-title {
    font-size: 2.25rem;
  }
}

@media (max-width: 640px) {
  .content-toc {
    display: none;
  }

  .content-title {
    font-size: 2rem;
  }

  .content-meta {
    flex-direction: column;
    gap: 0.5rem;
  }
}

/* Heading with Anchor Link */
.heading-with-anchor {
  position: relative;
  scroll-margin-top: calc(4rem + 1rem);
}

.heading-anchor-link {
  position: absolute;
  left: -1.5rem;
  opacity: 0;
  padding: 0.25rem;
  background: transparent;
  border: none;
  color: #525252;
  cursor: pointer;
  transition: opacity 0.2s ease, background-color 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.125rem;
}

[data-theme="dark"] {
  .heading-anchor-link {
    color: #c9c9c9;
  }
}

.heading-anchor-link:hover {
  opacity: 1;
  background-color: #f8f8f8;
}

[data-theme="dark"] {
  .heading-anchor-link:hover {
    background-color: #1a1a1a;
  }
}

.heading-with-anchor:hover .heading-anchor-link {
  opacity: 0.7;
}

.heading-with-anchor:hover .heading-anchor-link:hover {
  opacity: 1;
}

.heading-anchor-link:focus-visible {
  opacity: 1;
  outline: 2px solid #525252;
  outline-offset: 2px;
}

[data-theme="dark"] {
  .heading-anchor-link:focus-visible {
    outline-color: #c9c9c9;
  }
}

.heading-copied-tooltip {
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  margin-top: 0.5rem;
  padding: 0.25rem 0.5rem;
  background-color: #525252;
  color: #ffffff;
  font-size: 0.875rem;
  border-radius: 0.25rem;
  white-space: nowrap;
  pointer-events: none;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-weight: 400;
}

[data-theme="dark"] {
  .heading-copied-tooltip {
    background-color: #c9c9c9;
    color: #0a0a0a;
  }
}


@media (hover: none) and (pointer: coarse) {
  .heading-anchor-link {
    opacity: 0.6;
  }
  
  .heading-with-anchor:active .heading-anchor-link {
    opacity: 1;
  }
}

@media (max-width: 768px) {
  .heading-anchor-link {
    position: relative;
    left: auto;
    margin-left: 0.5rem;
    display: inline-flex;
    vertical-align: middle;
  }
}

/* Code Block with Syntax Highlighting */
.code-block-wrapper {
  position: relative;
  margin-bottom: 1rem;
}

.code-block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
  background-color: #f8f8f8;
  border: 1px solid #e5e5e5;
  border-bottom: none;
  border-radius: 0.25rem 0.25rem 0 0;
}

[data-theme="dark"] {
  .code-block-header {
    background-color: #1a1a1a;
    border-color: #262626;
  }
}

.code-block-language {
  font-size: 0.875rem;
  font-weight: 600;
  color: #525252;
  text-transform: capitalize;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

[data-theme="dark"] {
  .code-block-language {
    color: #c9c9c9;
  }
}

.code-block-copy {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem;
  background: transparent;
  border: none;
  color: #525252;
  cursor: pointer;
  border-radius: 0.125rem;
  transition: all 0.2s ease;
}

[data-theme="dark"] {
  .code-block-copy {
    color: #c9c9c9;
  }
}

.code-block-copy:hover {
  background-color: #ffffff;
  color: #1c1c1c;
}

[data-theme="dark"] {
  .code-block-copy:hover {
    background-color: #0a0a0a;
    color: #e5e5e5;
  }
}


.code-block-copy:active {
  transform: scale(0.95);
}

.code-block-copy svg {
  width: 16px;
  height: 16px;
}

.code-block-wrapper pre {
  margin-top: 0;
  margin-bottom: 0;
  border: 1px solid #e5e5e5;
  border-radius: 0 0 0.25rem 0.25rem;
}

[data-theme="dark"] {
  .code-block-wrapper pre {
    border-color: #262626;
  }
}

/* Prism Token Colors */
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
  color: #6a737d;
}

[data-theme="dark"] {
  .token.comment,
  .token.prolog,
  .token.doctype,
  .token.cdata {
    color: #8b949e;
  }
}

.token.punctuation {
  color: #1c1c1c;
}

[data-theme="dark"] {
  .token.punctuation {
    color: #e5e5e5;
  }
}


.token.namespace {
  opacity: 0.7;
}

.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
  color: #0184bc;
}

[data-theme="dark"] {
  .token.property,
  .token.tag,
  .token.boolean,
  .token.number,
  .token.constant,
  .token.symbol,
  .token.deleted {
    color: #79c0ff;
  }
}

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
  color: #50a14f;
}

[data-theme="dark"] {
  .token.selector,
  .token.attr-name,
  .token.string,
  .token.char,
  .token.builtin,
  .token.inserted {
    color: #7ee787;
  }
}

.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
  color: #a626a4;
}

[data-theme="dark"] {
  .token.operator,
  .token.entity,
  .token.url,
  .language-css .token.string,
  .style .token.string {
    color: #d2a8ff;
  }
}

.token.atrule,
.token.attr-value,
.token.keyword {
  color: #a626a4;
}

[data-theme="dark"] {
  .token.atrule,
  .token.attr-value,
  .token.keyword {
    color: #ff7b72;
  }
}

.token.function,
.token.class-name {
  color: #c18401;
}

[data-theme="dark"] {
  .token.function,
  .token.class-name {
    color: #d29922;
  }
}

.token.regex,
.token.important,
.token.variable {
  color: #e45649;
}

[data-theme="dark"] {
  .token.regex,
  .token.important,
  .token.variable {
    color: #ffa657;
  }
}


.token.bold {
  font-weight: bold;
}

.token.italic {
  font-style: italic;
}

.token.entity {
  cursor: help;
}

pre[class*="language-"] {
  position: relative;
  line-height: 1.5;
}

code[class*="language-"],
pre[class*="language-"] {
  color: #1c1c1c;
  text-align: left;
  white-space: pre;
  word-spacing: normal;
  word-break: normal;
  word-wrap: normal;
  tab-size: 2;
  hyphens: none;
}

[data-theme="dark"] {
  code[class*="language-"],
  pre[class*="language-"] {
    color: #e5e5e5;
  }
}

/* Card Component */
.card-grid {
  display: grid;
  gap: 1.5rem;
  margin: 2rem 0;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}

.card-grid[data-cols="2"] {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
}

.card-grid[data-cols="3"] {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}

.card-grid[data-cols="4"] {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}

.card {
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  border: 1px solid #E6E6E6;
  border-radius: 8px;
  background-color: #FFFFFF;
  transition: all 300ms ease;
  position: relative;
}

.card-link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  display: block;
  height: 100%;
}

.card-link:hover {
  box-shadow: 4px 10px 15px -3px rgba(23, 23, 23, 0.06);
  transform: translateY(-4px);
}

.card-link:hover .card-arrow {
  transform: translateX(4px);
  color: #171717;
}

.card-link:active {
  transform: translateY(-2px);
}

.card-icon {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.card-icon-img {
  width: 2.5rem;
  height: 2.5rem;
  object-fit: contain;
  flex-shrink: 0;
  margin: 0 0 1rem 0;
}

.card-content {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-title {
  margin: 0 0 0.25rem 0;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.5;
  color: #171717;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  transition: color 300ms ease;
}

.card-arrow {
  flex-shrink: 0;
  margin-top: 0.25rem;
  color: #525252;
  transition: all 300ms ease;
  width: 1.25rem;
  height: 1.25rem;
}

.card-description {
  margin: 0;
  color: #1C1C1C;
  font-size: 0.875rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-description p {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: inherit;
}

.card-description p:not(:last-child) {
  margin-bottom: 0.5rem;
}

[data-theme="dark"] {
  .card {
    background-color: #171717;
    border-color: #262626;
  }
  
  .card-title {
    color: #FAFAFA;
  }
  
  .card-description {
    color: #D9D9D9;
  }
  
  .card-description p {
    color: inherit;
  }
  
  .card-arrow {
    color: #B3B3B3;
  }
  
  .card-link:hover .card {
    box-shadow: 0 10px 15px -3px rgba(250, 250, 250, 0.05);
    border-color: rgba(179, 179, 179, 0.5);
  }
  
  .card-link:hover .card-title {
    color: #FFFFFF;
  }
  
  .card-link:hover .card-arrow {
    color: #FAFAFA;
  }
}

/* Callout Component */
/* Base Callout Container */
.callout {
  background-color: #F5F5F5;
  padding: 16px;
  border-radius: 8px;
  margin: 16px 0;
  border-left-style: solid;
  border-left-width: 4px;
}

/* Note Callout (Blue/Cyan) */
.callout-note {
  border-left-color: #47A3D1;
}

/* Warning Callout (Amber/Yellow) */
.callout-warning {
  border-left-color: #E6911A;
}

/* Danger Callout (Red) */
.callout-danger {
  border-left-color: #D22D2D;
}

/* Callout Title */
.callout-title {
  font-weight: 600;
  font-size: 16px;
  line-height: 1.4;
  margin-bottom: 4px;
  color: #0f172a;
}

/* Callout Body Text */
.callout-body {
  font-size: 16px;
  line-height: 1.625;
  color: #576375;
}

/* Icon Styling */
.callout-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 2px;
  color: #576375;
}

[data-theme="dark"] {
  .callout {
    background-color: #1D212B;
  }
  
  .callout-title {
    color: #F3F5F7;
  }
  
  .callout-body {
    color: #8A99A8;
  }
  
  .callout-icon {
    color: #8A99A8;
  }
}

/* Table of Contents */
.toc {
  position: sticky;
  top: 5rem;
  width: 14rem;
  display: none;
}

@media (min-width: 1280px) {
  .toc {
    display: block;
  }
}

.toc-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1c1c1c;
  margin: 0 0 1rem 0;
}

[data-theme="dark"] {
  .toc-title {
    color: #e5e5e5;
  }
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-list li + li {
  margin-top: 0.5rem;
}

.toc-link {
  display: block;
  width: 100%;
  text-align: left;
  font-size: 0.875rem;
  line-height: 1.25rem;
  padding: 0;
  padding-left: 0.75rem;
  border: none;
  border-left: 2px solid transparent;
  background: transparent;
  color: #525252;
  font-weight: 400;
  cursor: pointer;
  transition: color 200ms ease;
}

[data-theme="dark"] {
  .toc-link {
    color: #c9c9c9;
  }
}

.toc-link:hover {
  color: #171717;
}

[data-theme="dark"] {
  .toc-link:hover {
    color: #fafafa;
  }
}

.toc-link.active {
  color: #171717;
  font-weight: 500;
  border-left-color: #171717;
}

[data-theme="dark"] {
  .toc-link.active {
    color: #fafafa;
    border-left-color: #fafafa;
  }
}

.toc-link[data-level="3"] {
  padding-left: 1rem;
}

.toc-link[data-level="4"] {
  padding-left: 1.5rem;
}

.toc-link[data-level="5"] {
  padding-left: 2rem;
}

.toc-link[data-level="6"] {
  padding-left: 2.5rem;
}

/* Search Modal */
.search-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
  padding-left: 2rem;
  padding-right: 2rem;
  padding-bottom: 2rem;
  animation: fadeIn 0.15s ease-out;
}

[data-theme="dark"] {
  .search-modal-backdrop {
    background: rgba(0, 0, 0, 0.8);
  }
}


@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.search-modal {
  background: #ffffff;
  border-radius: 0.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  width: 90%;
  max-width: 42rem;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideDown 0.2s ease-out;
  border: 1px solid #e5e5e5;
}

[data-theme="dark"] {
  .search-modal {
    background: #0a0a0a;
    border-color: #262626;
  }
}

.search-input-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  border-bottom: 1px solid #e5e5e5;
  flex-shrink: 0;
}

[data-theme="dark"] {
  .search-input-container {
    border-bottom-color: #262626;
  }
}

.search-input-icon {
  width: 20px;
  height: 20px;
  color: #525252;
  flex-shrink: 0;
}

[data-theme="dark"] {
  .search-input-icon {
    color: #c9c9c9;
  }
}

.search-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 1rem;
  color: #1c1c1c;
  outline: none;
}

[data-theme="dark"] {
  .search-input {
    color: #e5e5e5;
  }
}

.search-input::placeholder {
  color: #525252;
  opacity: 0.6;
}

[data-theme="dark"] {
  .search-input::placeholder {
    color: #c9c9c9;
  }
}

.search-close-button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: #525252;
  border-radius: 0.125rem;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

[data-theme="dark"] {
  .search-close-button {
    color: #c9c9c9;
  }
}

.search-close-button:hover {
  background: #f8f8f8;
  color: #1c1c1c;
}

[data-theme="dark"] {
  .search-close-button:hover {
    background: #1a1a1a;
    color: #e5e5e5;
  }
}


.search-close-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.search-results {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  min-height: 0;
}

.search-results-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.search-result-item {
  margin-bottom: 0.5rem;
}

.search-result-link {
  display: block;
  padding: 1rem;
  background: #f8f8f8;
  border-radius: 0.25rem;
  text-decoration: none;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

[data-theme="dark"] {
  .search-result-link {
    background: #1a1a1a;
  }
}

.search-result-link.selected {
  border-color: #171717;
  background: #ffffff;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
  .search-result-link.selected {
    border-color: #fafafa;
    background: #0a0a0a;
  }
}

.search-result-link:hover,
.search-result-link:focus {
  border-color: #171717;
  background: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
  .search-result-link:hover,
  .search-result-link:focus {
    border-color: #fafafa;
    background: #0a0a0a;
  }
}

.search-result-title {
  font-weight: 500;
  color: #1c1c1c;
  margin-bottom: 0.25rem;
  font-size: 1rem;
}

[data-theme="dark"] {
  .search-result-title {
    color: #e5e5e5;
  }
}

.search-result-excerpt {
  font-size: 0.875rem;
  color: #525252;
  line-height: 1.5;
  margin-bottom: 0.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

[data-theme="dark"] {
  .search-result-excerpt {
    color: #c9c9c9;
  }
}

.search-result-url {
  font-size: 0.875rem;
  color: #525252;
  opacity: 0.7;
}

[data-theme="dark"] {
  .search-result-url {
    color: #c9c9c9;
  }
}

.search-loading,
.search-empty,
.search-no-results,
.search-notice {
  text-align: center;
  padding: 1rem;
  color: #525252;
}

[data-theme="dark"] {
  .search-loading,
  .search-empty,
  .search-no-results,
  .search-notice {
    color: #c9c9c9;
  }
}


.search-empty-text,
.search-help-text,
.search-notice-text {
  margin: 0;
}

.search-shortcuts {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.875rem;
  color: #525252;
}

[data-theme="dark"] {
  .search-shortcuts {
    color: #c9c9c9;
  }
}

.search-shortcuts kbd {
  padding: 0.25rem 0.5rem;
  background: #f8f8f8;
  border: 1px solid #e5e5e5;
  border-radius: 0.125rem;
  font-family: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, "Courier New", monospace;
  font-size: 0.75rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] {
  .search-shortcuts kbd {
    background: #1a1a1a;
    border-color: #262626;
  }
}

.search-separator {
  color: #525252;
  opacity: 0.5;
}

[data-theme="dark"] {
  .search-separator {
    color: #c9c9c9;
  }
}


@media (max-width: 768px) {
  .search-modal-backdrop {
    padding-top: 5vh;
  }

  .search-modal {
    width: 95%;
    max-height: 90vh;
  }

  .search-input-container {
    padding: 1rem;
  }

  .search-input {
    font-size: 1rem;
  }
}

/* Utility Classes */
.loading {
  text-align: center;
  padding: 3rem;
  color: #525252;
}

[data-theme="dark"] {
  .loading {
    color: #c9c9c9;
  }
}

.error {
  color: #1a1a1a;
  padding: 1rem;
  background: #f8f8f8;
  border-radius: 0.25rem;
  border-left: 4px solid #1a1a1a;
}

[data-theme="dark"] {
  .error {
    color: #ffffff;
    background: #1a1a1a;
    border-left-color: #ffffff;
  }
}


.table-wrapper {
  overflow-x: auto;
  margin-bottom: 1rem;
}

/* Image Modal/Lightbox */
.image-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  cursor: zoom-out;
}

.image-modal img {
  max-width: 90vw;
  max-height: 90vh;
  width: auto;
  height: auto;
  cursor: default;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.image-modal-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  font-size: 32px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
}

.image-modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Theme Toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f8f8;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  padding: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 40px;
  height: 40px;
}

[data-theme="dark"] {
  .theme-toggle {
    background: #1a1a1a;
    border-color: #262626;
  }
}

.theme-toggle:hover {
  background: #ffffff;
  border-color: #171717;
}

[data-theme="dark"] {
  .theme-toggle:hover {
    background: #0a0a0a;
    border-color: #fafafa;
  }
}

.theme-toggle .theme-icon {
  color: #525252;
  transition: color 0.2s ease;
  display: block;
  flex-shrink: 0;
}

[data-theme="dark"] {
  .theme-toggle .theme-icon {
    color: #c9c9c9;
  }
}

.theme-toggle:hover .theme-icon {
  color: #1c1c1c;
}

[data-theme="dark"] {
  .theme-toggle:hover .theme-icon {
    color: #e5e5e5;
  }
}

@media (max-width: 480px) {
  .theme-toggle {
    width: 36px;
    height: 36px;
    padding: 6px;
  }

  .theme-toggle .theme-icon {
    width: 18px;
    height: 18px;
  }
}

/* Page Navigation (Prev/Next) */
.page-navigation {
  margin-top: 3rem;
  padding-top: 3rem;
  border-top: 1px solid #e5e5e5;
}

[data-theme="dark"] {
  .page-navigation {
    border-top-color: #262626;
  }
}

.page-nav-container {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.page-nav-link {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem;
  border: 1px solid #e5e5e5;
  border-radius: 0.25rem;
  text-decoration: none;
  transition: all 0.2s ease;
  flex: 1;
  max-width: 45%;
}

[data-theme="dark"] {
  .page-nav-link {
    border-color: #262626;
  }
}

.page-nav-link:hover {
  background: #f8f8f8;
  border-color: #171717;
}

[data-theme="dark"] {
  .page-nav-link:hover {
    background: #1a1a1a;
    border-color: #fafafa;
  }
}

.page-nav-prev {
  text-align: left;
}

.page-nav-next {
  text-align: right;
}

.page-nav-direction {
  font-size: 0.875rem;
  color: #525252;
}

[data-theme="dark"] {
  .page-nav-direction {
    color: #c9c9c9;
  }
}

.page-nav-label {
  font-weight: 500;
  color: #1c1c1c;
}

[data-theme="dark"] {
  .page-nav-label {
    color: #e5e5e5;
  }
}


.page-nav-spacer {
  flex: 1;
}